From b8567b0f542d9963ea8b00e40d782232d0ce4c0d Mon Sep 17 00:00:00 2001 From: Jeff Emmett Date: Thu, 12 Mar 2026 13:42:23 -0700 Subject: [PATCH] feat: add food interest tracking to registration flow Add "I would like to include food for the week" checkbox to the payment step with co-producing meals messaging. Track food interest in Google Sheets as column Q ("Want Food"). - Add wantFood field to RegistrationData interface - Add interactive food checkbox replacing static note in payment step - Pass wantFood through register API to Google Sheets - Expand sheet ranges from A:P to A:Q, add "Want Food" header - Preserve food column on payment status updates Co-Authored-By: Claude Opus 4.6 --- app/api/register/route.ts | 3 ++- app/register/page.tsx | 27 +++++++++++++++++++++------ lib/google-sheets.ts | 14 +++++++++----- 3 files changed, 32 insertions(+), 12 deletions(-) diff --git a/app/api/register/route.ts b/app/api/register/route.ts index 244d203..cd3b78d 100644 --- a/app/api/register/route.ts +++ b/app/api/register/route.ts @@ -5,7 +5,7 @@ export async function POST(request: NextRequest) { try { const body = await request.json() - const { name, email, contact, contributions, expectations, howHeard, dietary, crewConsent } = body + const { name, email, contact, contributions, expectations, howHeard, dietary, crewConsent, wantFood } = body // Validate required fields if (!name || !email || !contact || !contributions || !expectations || !crewConsent) { @@ -28,6 +28,7 @@ export async function POST(request: NextRequest) { howHeard: howHeard || "", dietary: Array.isArray(dietary) ? dietary.join(", ") : dietary || "", crewConsent, + wantFood: wantFood || false, }) console.log(`[Register API] Registration added for ${name} at row ${rowNumber}`) diff --git a/app/register/page.tsx b/app/register/page.tsx index 33e0a0e..3dcd2ec 100644 --- a/app/register/page.tsx +++ b/app/register/page.tsx @@ -16,6 +16,7 @@ export default function RegisterPage() { const [step, setStep] = useState<"form" | "payment">("form") const [isSubmitting, setIsSubmitting] = useState(false) const [includeAccommodation, setIncludeAccommodation] = useState(true) + const [wantFood, setWantFood] = useState(false) const [accommodationVenue, setAccommodationVenue] = useState<"commons-hub" | "herrnhof">("commons-hub") const [accommodationType, setAccommodationType] = useState("ch-multi") const [formData, setFormData] = useState({ @@ -85,6 +86,7 @@ export default function RegisterPage() { howHeard: formData.howHeard, dietary: dietaryString, crewConsent: formData.crewConsent, + wantFood, }), }) @@ -283,13 +285,26 @@ export default function RegisterPage() {

)} - {/* Food note */} + {/* Food */}
-

- Food:{" "} - We'll follow up via email with food options and pricing closer to the event. - Your dietary preferences from step 1 have been noted. -

+
+ setWantFood(checked as boolean)} + className="mt-1" + /> +
+ +

+ We are exploring co-producing our own meals as a community. More details and costs + will be shared soon — checking this box registers your interest so we can plan accordingly. + Your dietary preferences from step 1 have been noted. +

+
+
{/* Processing fee */} diff --git a/lib/google-sheets.ts b/lib/google-sheets.ts index 58c0112..5526218 100644 --- a/lib/google-sheets.ts +++ b/lib/google-sheets.ts @@ -24,6 +24,7 @@ export interface RegistrationData { howHeard: string dietary: string crewConsent: string + wantFood: boolean } export interface PaymentUpdateData { @@ -65,12 +66,13 @@ export async function addRegistration(data: RegistrationData): Promise { "", // N: Payment Date "", // O: Accommodation Venue "", // P: Accommodation Type + data.wantFood ? "Yes" : "No", // Q: Want Food ], ] const response = await sheets.spreadsheets.values.append({ spreadsheetId: SPREADSHEET_ID, - range: `${SHEET_NAME}!A:P`, + range: `${SHEET_NAME}!A:Q`, valueInputOption: "USER_ENTERED", insertDataOption: "INSERT_ROWS", requestBody: { values }, @@ -97,7 +99,7 @@ export async function updatePaymentStatus(data: PaymentUpdateData): Promise { // Check if first row has data const response = await sheets.spreadsheets.values.get({ spreadsheetId: SPREADSHEET_ID, - range: `${SHEET_NAME}!A1:P1`, + range: `${SHEET_NAME}!A1:Q1`, }) if (!response.data.values || response.data.values.length === 0) { @@ -192,12 +195,13 @@ export async function initializeSheetHeaders(): Promise { "Payment Date", "Accommodation Venue", "Accommodation Type", + "Want Food", ], ] await sheets.spreadsheets.values.update({ spreadsheetId: SPREADSHEET_ID, - range: `${SHEET_NAME}!A1:P1`, + range: `${SHEET_NAME}!A1:Q1`, valueInputOption: "USER_ENTERED", requestBody: { values: headers }, })