From f8fc66e3322f18205daa8ed6771d06661e5c342a Mon Sep 17 00:00:00 2001 From: trisha <82386753+tdanielles@users.noreply.github.com> Date: Thu, 13 Nov 2025 22:43:19 -0800 Subject: [PATCH 1/3] Fix isOfLegalAge query issues (#74) --- src/lib/firebase/types.ts | 1 + src/services/query.ts | 12 +++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/lib/firebase/types.ts b/src/lib/firebase/types.ts index b25fc36..1f52a3e 100644 --- a/src/lib/firebase/types.ts +++ b/src/lib/firebase/types.ts @@ -175,6 +175,7 @@ export interface Applicant { gender: string | Record; graduation: number; isOfLegalAge: boolean; + ageByHackathon: string; location: string; // city major: ApplicantMajor | Record; phoneNumber: string; // "+1 XXX-XXX-XXXX" diff --git a/src/services/query.ts b/src/services/query.ts index 6fb2931..854d261 100644 --- a/src/services/query.ts +++ b/src/services/query.ts @@ -34,6 +34,15 @@ export const flattenApplicantData = (applicant: Applicant, hackathon?: string): const hackathonYear = year ? Number.parseInt(year) : 2025; const isLegacyFormat = hackathonYear < 2024 || hackathon === "nwHacks2024"; + const computedIsOfLegalAge = (applicant: Applicant) => { + const rawAge = applicant.basicInfo?.ageByHackathon + if (rawAge == "<=16") return false + if (rawAge == ">24") return true + + const numericAge = typeof rawAge === "number" ? rawAge : Number(rawAge) + return numericAge >= 19 + } + const flattened: FlattenedApplicant = { // Basic Info firstName: applicant.basicInfo?.legalFirstName || applicant.basicInfo?.firstName || "", @@ -55,7 +64,7 @@ export const flattenApplicantData = (applicant: Applicant, hackathon?: string): applicant.basicInfo?.gender as Record | undefined, '' ), - isOfLegalAge: applicant.basicInfo?.isOfLegalAge || false, + isOfLegalAge: computedIsOfLegalAge(applicant), culturalBackground: returnTrueKey(applicant.basicInfo?.ethnicity || applicant.basicInfo?.culturalBackground), dietaryRestriction: createStringFromSelection( applicant.basicInfo?.dietaryRestriction, @@ -148,6 +157,7 @@ export const getAvailableColumns = (): string[] => { gender: "", location: "", isOfLegalAge: true, + ageByHackathon: "0", ethnicity: { asian: false, black: false, From 52e217f6fef920700676b8c45854a88ea8a9863b Mon Sep 17 00:00:00 2001 From: Khaedra <133423015+Khaedra@users.noreply.github.com> Date: Thu, 13 Nov 2025 22:49:28 -0800 Subject: [PATCH 2/3] fix: add hacker role (#71) --- src/components/features/factotum/add-members.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/components/features/factotum/add-members.tsx b/src/components/features/factotum/add-members.tsx index 61562c4..f3ea94c 100644 --- a/src/components/features/factotum/add-members.tsx +++ b/src/components/features/factotum/add-members.tsx @@ -10,9 +10,13 @@ import { toast } from "sonner"; export default function AddMembers() { const [emails, setEmails] = useState(""); const server = useFactotum().server; - const [selectedRoles, setSelectedRoles] = useState(["mentor"]); + const [selectedRoles, setSelectedRoles] = useState(["hacker"]); const availableRoles = [ + { + label: "Hacker", + value: "hacker", + }, { label: "Mentor", value: "mentor", @@ -40,7 +44,7 @@ export default function AddMembers() { .split("\n") .map((e) => e.trim()) .filter((e) => e.length > 0); - + if (emailList.length === 0 || selectedRoles.length === 0) { toast.error("You must select at least one role and provide at least one email"); return; From ee4623e8ccf2f1d8164fd730e7b68878a23ae3fd Mon Sep 17 00:00:00 2001 From: martincai8 Date: Mon, 1 Dec 2025 11:51:16 -0800 Subject: [PATCH 3/3] (small) feat: add travellingToHackathon --- src/components/features/hackerapp/hacker-app-question.tsx | 1 + src/lib/firebase/types.ts | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/features/hackerapp/hacker-app-question.tsx b/src/components/features/hackerapp/hacker-app-question.tsx index e857d05..cfc7614 100644 --- a/src/components/features/hackerapp/hacker-app-question.tsx +++ b/src/components/features/hackerapp/hacker-app-question.tsx @@ -66,6 +66,7 @@ const FORM_INPUT_OPTIONS: HackerApplicationQuestionFormInputField[] = [ "race", "jobPosition", "connectPlus", + "travellingToHackathon", ]; export const SHOW_FORM_INPUT: HackerApplicationQuestionType[] = [ diff --git a/src/lib/firebase/types.ts b/src/lib/firebase/types.ts index 1f52a3e..f0fa08f 100644 --- a/src/lib/firebase/types.ts +++ b/src/lib/firebase/types.ts @@ -319,7 +319,8 @@ export type HackerApplicationQuestionFormInputField = | "pronouns" | "race" | "jobPosition" - | "connectPlus"; + | "connectPlus" + | "travellingToHackathon"; export interface HackerApplicationQuestion { _id?: string; // internal title?: string;