diff --git a/app/applications/application-form.tsx b/app/applications/application-form.tsx
index 6b26f8e..886e0e8 100644
--- a/app/applications/application-form.tsx
+++ b/app/applications/application-form.tsx
@@ -75,6 +75,10 @@ const applicationSchema = z
campaignBlurb: z
.string()
.min(50, 'Please provide a detailed response (at least 50 characters)'),
+ bostonCampus: z.boolean({
+ error: 'Please indicate if you will be on the Boston campus',
+ }),
+ bostonCampusExplanation: z.string().optional(),
})
.refine(
(data) => {
@@ -85,6 +89,19 @@ const applicationSchema = z
message: 'Constituency must be one of the selected colleges',
path: ['constituency'],
},
+ )
+ .refine(
+ (data) => {
+ // If not on Boston campus, explanation is required
+ if (data.bostonCampus === false) {
+ return data.bostonCampusExplanation && data.bostonCampusExplanation.trim().length > 0;
+ }
+ return true;
+ },
+ {
+ message: 'Please explain your situation if you will not be on the Boston campus for the entirety of your term',
+ path: ['bostonCampusExplanation'],
+ },
);
type ApplicationFormData = z.infer;
@@ -133,11 +150,13 @@ export default function ApplicationForm({
diversityEquityInclusionLongAnswer: '',
conflictSituationLongAnswer: '',
campaignBlurb: '',
+ bostonCampusExplanation: '',
},
});
const colleges = watch('college');
const constituency = watch('constituency');
+ const bostonCampus = watch('bostonCampus');
// Auto-select constituency if only one college is selected, clear if invalid
useEffect(() => {
@@ -795,6 +814,65 @@ export default function ApplicationForm({
)}
+
+
+
+ Do you plan to be on the Boston campus for the
+ entirety of your potential term?
+
+
+
+
+ setValue('bostonCampus', true, {
+ shouldValidate: true,
+ })
+ }
+ />
+ Yes
+
+
+
+ setValue('bostonCampus', false, {
+ shouldValidate: true,
+ })
+ }
+ />
+ No
+
+
+ {errors.bostonCampus && (
+
+ {errors.bostonCampus.message}
+
+ )}
+
+
+ {bostonCampus === false && (
+
+
+ Please explain your situation.
+
+
+ {errors.bostonCampusExplanation && (
+
+ {errors.bostonCampusExplanation.message}
+
+ )}
+
+ )}
diff --git a/lib/actions/applications.ts b/lib/actions/applications.ts
index ef6f287..5c3f5f3 100644
--- a/lib/actions/applications.ts
+++ b/lib/actions/applications.ts
@@ -30,6 +30,8 @@ type ApplicationData = {
diversityEquityInclusionLongAnswer: string;
conflictSituationLongAnswer: string;
campaignBlurb: string;
+ bostonCampus: boolean;
+ bostonCampusExplanation?: string;
};
export async function submitApplication(formData: ApplicationData) {
@@ -70,6 +72,8 @@ export async function submitApplication(formData: ApplicationData) {
diversityEquityInclusionLongAnswer: formData.diversityEquityInclusionLongAnswer,
conflictSituationLongAnswer: formData.conflictSituationLongAnswer,
campaignBlurb: formData.campaignBlurb,
+ bostonCampus: formData.bostonCampus,
+ bostonCampusExplanation: formData.bostonCampusExplanation || null,
};
await createOrUpdateApplication(data);
diff --git a/package-lock.json b/package-lock.json
index 5360b1e..3c970b7 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "@nomination-system/source",
- "version": "1.5.0",
+ "version": "1.5.1",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@nomination-system/source",
- "version": "1.5.0",
+ "version": "1.5.1",
"hasInstallScript": true,
"license": "MIT",
"dependencies": {
@@ -92,7 +92,6 @@
"integrity": "sha512-CGOfOJqWjg2qW/Mb6zNsDm+u5vFQ8DxXfbM09z69p5Z6+mE1ikP2jUXw+j42Pf1XTYED2Rni5f95npYeuwMDQA==",
"dev": true,
"license": "MIT",
- "peer": true,
"dependencies": {
"@babel/code-frame": "^7.29.0",
"@babel/generator": "^7.29.0",
@@ -2290,7 +2289,6 @@
"resolved": "https://registry.npmjs.org/@supabase/supabase-js/-/supabase-js-2.97.0.tgz",
"integrity": "sha512-kTD91rZNO4LvRUHv4x3/4hNmsEd2ofkYhuba2VMUPRVef1RCmnHtm7rIws38Fg0yQnOSZOplQzafn0GSiy6GVg==",
"license": "MIT",
- "peer": true,
"dependencies": {
"@supabase/auth-js": "2.97.0",
"@supabase/functions-js": "2.97.0",
@@ -2695,7 +2693,6 @@
"integrity": "sha512-ilcTH/UniCkMdtexkoCN0bI7pMcJDvmQFPvuPvmEaYA/NSfFTAgdUSLAoVjaRJm7+6PvcM+q1zYOwS4wTYMF9w==",
"devOptional": true,
"license": "MIT",
- "peer": true,
"dependencies": {
"csstype": "^3.2.2"
}
@@ -2706,7 +2703,6 @@
"integrity": "sha512-jp2L/eY6fn+KgVVQAOqYItbF0VY/YApe5Mz2F0aykSO8gx31bYCZyvSeYxCHKvzHG5eZjc+zyaS5BrBWya2+kQ==",
"devOptional": true,
"license": "MIT",
- "peer": true,
"peerDependencies": {
"@types/react": "^19.2.0"
}
@@ -2777,7 +2773,6 @@
"integrity": "sha512-IgSWvLobTDOjnaxAfDTIHaECbkNlAlKv2j5SjpB2v7QHKv1FIfjwMy8FsDbVfDX/KjmCmYICcw7uGaXLhtsLNg==",
"dev": true,
"license": "MIT",
- "peer": true,
"dependencies": {
"@typescript-eslint/scope-manager": "8.56.0",
"@typescript-eslint/types": "8.56.0",
@@ -3271,7 +3266,6 @@
"integrity": "sha512-UVJyE9MttOsBQIDKw1skb9nAwQuR5wuGD3+82K6JgJlm/Y+KI92oNsMNGZCYdDsVtRHSak0pcV5Dno5+4jh9sw==",
"dev": true,
"license": "MIT",
- "peer": true,
"bin": {
"acorn": "bin/acorn"
},
@@ -3609,7 +3603,6 @@
}
],
"license": "MIT",
- "peer": true,
"dependencies": {
"baseline-browser-mapping": "^2.9.0",
"caniuse-lite": "^1.0.30001759",
@@ -4324,7 +4317,6 @@
"integrity": "sha512-20MV9SUdeN6Jd84xESsKhRly+/vxI+hwvpBMA93s+9dAcjdCuCojn4IqUGS3lvVaqjVYGYHSRMCpeFtF2rQYxQ==",
"dev": true,
"license": "MIT",
- "peer": true,
"dependencies": {
"@eslint-community/eslint-utils": "^4.8.0",
"@eslint-community/regexpp": "^4.12.2",
@@ -4461,7 +4453,6 @@
"integrity": "sha512-whOE1HFo/qJDyX4SnXzP4N6zOWn79WhnCUY/iDR0mPfQZO8wcYE4JClzI2oZrhBnnMUCBCHZhO6VQyoBU95mZA==",
"dev": true,
"license": "MIT",
- "peer": true,
"dependencies": {
"@rtsao/scc": "^1.1.0",
"array-includes": "^3.1.9",
@@ -6740,7 +6731,6 @@
"integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==",
"dev": true,
"license": "MIT",
- "peer": true,
"engines": {
"node": ">=12"
},
@@ -6818,7 +6808,6 @@
"integrity": "sha512-bXWy3vTk8mnRmT+SLyZBQoC2vtV9Z8u7OHvEu+aULYxwiop/CPiFZ+F56KsNRNf35jw+8wcu8pmLsjxpBxAO9g==",
"hasInstallScript": true,
"license": "Apache-2.0",
- "peer": true,
"dependencies": {
"@prisma/config": "6.18.0",
"@prisma/engines": "6.18.0"
@@ -6912,7 +6901,6 @@
"resolved": "https://registry.npmjs.org/react/-/react-19.2.4.tgz",
"integrity": "sha512-9nfp2hYpCwOjAN+8TZFGhtWEwgvWHXqESH8qT89AT/lWklpLON22Lc8pEtnpsZz7VmawabSU0gCjnj8aC0euHQ==",
"license": "MIT",
- "peer": true,
"engines": {
"node": ">=0.10.0"
}
@@ -6922,7 +6910,6 @@
"resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.2.4.tgz",
"integrity": "sha512-AXJdLo8kgMbimY95O2aKQqsz2iWi9jMgKJhRBAxECE4IFxfcazB2LmzloIoibJI3C12IlY20+KFaLv+71bUJeQ==",
"license": "MIT",
- "peer": true,
"dependencies": {
"scheduler": "^0.27.0"
},
@@ -6935,7 +6922,6 @@
"resolved": "https://registry.npmjs.org/react-hook-form/-/react-hook-form-7.71.2.tgz",
"integrity": "sha512-1CHvcDYzuRUNOflt4MOq3ZM46AronNJtQ1S7tnX6YN4y72qhgiUItpacZUAQ0TyWYci3yz1X+rXaSxiuEm86PA==",
"license": "MIT",
- "peer": true,
"engines": {
"node": ">=18.0.0"
},
@@ -7606,8 +7592,7 @@
"version": "4.2.0",
"resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-4.2.0.tgz",
"integrity": "sha512-yYzTZ4++b7fNYxFfpnberEEKu43w44aqDMNM9MHMmcKuCH7lL8jJ4yJ7LGHv7rSwiqM0nkiobF9I6cLlpS2P7Q==",
- "license": "MIT",
- "peer": true
+ "license": "MIT"
},
"node_modules/tailwindcss-animate": {
"version": "1.0.7",
@@ -7796,7 +7781,6 @@
"integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==",
"devOptional": true,
"license": "Apache-2.0",
- "peer": true,
"bin": {
"tsc": "bin/tsc",
"tsserver": "bin/tsserver"
@@ -8134,7 +8118,6 @@
"resolved": "https://registry.npmjs.org/zod/-/zod-4.3.6.tgz",
"integrity": "sha512-rftlrkhHZOcjDwkGlnUtZZkvaPHCsDATp4pGpuOOMDaTdDDXF91wuVDJoWoPsKX/3YPQ5fHuF3STjcYyKr+Qhg==",
"license": "MIT",
- "peer": true,
"funding": {
"url": "https://github.com/sponsors/colinhacks"
}
diff --git a/prisma/migrations/20260324000000_add_boston_campus_question/migration.sql b/prisma/migrations/20260324000000_add_boston_campus_question/migration.sql
new file mode 100644
index 0000000..f72152b
--- /dev/null
+++ b/prisma/migrations/20260324000000_add_boston_campus_question/migration.sql
@@ -0,0 +1,3 @@
+-- AlterTable
+ALTER TABLE "applications" ADD COLUMN "bostonCampus" BOOLEAN NOT NULL DEFAULT true;
+ALTER TABLE "applications" ADD COLUMN "bostonCampusExplanation" TEXT;
diff --git a/prisma/schema.prisma b/prisma/schema.prisma
index 6e40322..2cb8ff5 100644
--- a/prisma/schema.prisma
+++ b/prisma/schema.prisma
@@ -54,6 +54,8 @@ model Application {
diversityEquityInclusionLongAnswer String
conflictSituationLongAnswer String
campaignBlurb String @default("")
+ bostonCampus Boolean @default(true)
+ bostonCampusExplanation String?
nominationFormPdfUrl String?
createdAt DateTime @default(now())