From d58285785ed5e62af85280f1904198f70450559f Mon Sep 17 00:00:00 2001 From: Randall Stillwell Date: Tue, 7 Apr 2026 12:50:03 -0500 Subject: [PATCH] Add Monday.com board fields and expand column mapper - Add followUp, notes, serviceTime, planningCenter, iSaidYesBookSent, ftGuestLetterSent fields to ResponseCard to match Monday.com board - Expand column mapper from 8 fields to all 32 ResponseCard fields with friendly labels matching the Easter Survey spreadsheet columns - Add Workflow & Tracking section on card detail page for the new fields - Fix pre-existing Buffer type error in images API route Made-with: Cursor --- prisma/schema.prisma | 8 +++++ src/app/api/cards/[id]/route.ts | 6 ++++ src/app/api/images/[...path]/route.ts | 2 +- src/app/cards/[id]/page.tsx | 48 +++++++++++++++++++++++++++ src/app/settings/page.tsx | 43 +++++++++++++++++++++--- 5 files changed, 102 insertions(+), 5 deletions(-) diff --git a/prisma/schema.prisma b/prisma/schema.prisma index a483d5f..86ea857 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -42,6 +42,14 @@ model ResponseCard { howHeardOther String? serviceAttended String? + // Monday.com / Workflow fields + followUp String? + notes String? + serviceTime String? + planningCenter String? + iSaidYesBookSent Boolean @default(false) + ftGuestLetterSent Boolean @default(false) + // Meta sourceFile String? frontImagePath String? diff --git a/src/app/api/cards/[id]/route.ts b/src/app/api/cards/[id]/route.ts index c676e1a..39f52fd 100644 --- a/src/app/api/cards/[id]/route.ts +++ b/src/app/api/cards/[id]/route.ts @@ -77,6 +77,10 @@ export async function PUT( "campusPreferenceOther", "howHeardOther", "serviceAttended", + "followUp", + "notes", + "serviceTime", + "planningCenter", "ocrStatus", "reviewStatus", "ocrError", @@ -87,6 +91,8 @@ export async function PUT( if (body.prayerForTeam != null) data.prayerForTeam = Boolean(body.prayerForTeam); if (body.prayerConfidential != null) data.prayerConfidential = Boolean(body.prayerConfidential); + if (body.iSaidYesBookSent != null) data.iSaidYesBookSent = Boolean(body.iSaidYesBookSent); + if (body.ftGuestLetterSent != null) data.ftGuestLetterSent = Boolean(body.ftGuestLetterSent); if (body.ocrConfidence != null) data.ocrConfidence = Number(body.ocrConfidence); if (body.messageTopics != null) data.messageTopics = body.messageTopics; if (body.nextStep != null) data.nextStep = body.nextStep; diff --git a/src/app/api/images/[...path]/route.ts b/src/app/api/images/[...path]/route.ts index eb15ed9..b908dad 100644 --- a/src/app/api/images/[...path]/route.ts +++ b/src/app/api/images/[...path]/route.ts @@ -27,7 +27,7 @@ export async function GET( const buffer = await getBuffer(key); - return new NextResponse(buffer, { + return new NextResponse(new Uint8Array(buffer), { headers: { "Content-Type": contentType, "Cache-Control": "private, max-age=3600", diff --git a/src/app/cards/[id]/page.tsx b/src/app/cards/[id]/page.tsx index e562a60..2fb13ea 100644 --- a/src/app/cards/[id]/page.tsx +++ b/src/app/cards/[id]/page.tsx @@ -15,6 +15,7 @@ import { ScanLine, User, ClipboardList, + ClipboardCheck, Code, RefreshCw, Loader2, @@ -71,6 +72,12 @@ type CardData = { howHeard: string[] | null; howHeardOther: string | null; serviceAttended: string | null; + followUp: string | null; + notes: string | null; + serviceTime: string | null; + planningCenter: string | null; + iSaidYesBookSent: boolean; + ftGuestLetterSent: boolean; ocrStatus: string; reviewStatus: string; ocrConfidence: number | null; @@ -434,6 +441,47 @@ export default function CardDetailPage() { + + + + + Workflow & Tracking + + + +
+ setField("followUp", v)} /> + setField("serviceTime", v)} /> + setField("planningCenter", v)} /> +
+ + + {card.iSaidYesBookSent ? "Yes" : "No"} + +
+
+ + + {card.ftGuestLetterSent ? "Yes" : "No"} + +
+
+ {getValue("notes") && ( + <> + +
+ +