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)} /> + + I Said Yes Book Sent + + {card.iSaidYesBookSent ? "Yes" : "No"} + + + + FT Guest Letter Sent + + {card.ftGuestLetterSent ? "Yes" : "No"} + + + + {getValue("notes") && ( + <> + + + Notes + setField("notes", e.target.value)} + rows={3} + /> + + > + )} + + + {card.rawOcrResponse && ( diff --git a/src/app/settings/page.tsx b/src/app/settings/page.tsx index 4b55cff..bf5c89e 100644 --- a/src/app/settings/page.tsx +++ b/src/app/settings/page.tsx @@ -58,6 +58,41 @@ import { Checkbox } from "@/components/ui/checkbox"; type MondayColumn = { id: string; title: string; type: string }; +const MONDAY_MAPPABLE_FIELDS = [ + { field: "name", label: "Name" }, + { field: "gender", label: "Gender" }, + { field: "dateOfBirth", label: "Date of Birth" }, + { field: "maritalStatus", label: "Marital Status" }, + { field: "visitType", label: "Visit Type" }, + { field: "followUp", label: "Follow-Up" }, + { field: "cellPhone", label: "Cell Phone" }, + { field: "homePhone", label: "Home Phone" }, + { field: "email", label: "Email" }, + { field: "address", label: "Address" }, + { field: "aptNumber", label: "Apt #" }, + { field: "city", label: "City" }, + { field: "state", label: "State" }, + { field: "zip", label: "Zip" }, + { field: "prayerRequests", label: "Prayer Requests" }, + { field: "prayerForTeam", label: "For Prayer Team" }, + { field: "prayerConfidential", label: "Confidential" }, + { field: "messageTopics", label: "Message Topics" }, + { field: "messageTopicsOther", label: "Other - Topics" }, + { field: "nextStep", label: "Next Step" }, + { field: "attendanceDuration", label: "Attendance Duration" }, + { field: "campusPreference", label: "Campus Preference" }, + { field: "campusPreferenceOther", label: "Other Location" }, + { field: "howHeard", label: "How Did You Hear" }, + { field: "howHeardOther", label: "Other - How Heard" }, + { field: "serviceAttended", label: "A B C D" }, + { field: "serviceTime", label: "Service Time" }, + { field: "notes", label: "Notes" }, + { field: "planningCenter", label: "Planning Center" }, + { field: "iSaidYesBookSent", label: "I Said Yes Book Sent" }, + { field: "ftGuestLetterSent", label: "FT Guest Letter Sent" }, + { field: "reviewStatus", label: "Review Status" }, +] as const; + type SettingsData = { ollamaUrl: string; model: string; @@ -878,10 +913,10 @@ export default function SettingsPage() { {mondayColumns.length > 0 && ( Column Mapping - - {["name", "email", "cellPhone", "gender", "visitType", "city", "state", "reviewStatus"].map((field) => ( + + {MONDAY_MAPPABLE_FIELDS.map(({ field, label }) => ( - {field} + {label} setColumnMapping(field, !v || v === "__none__" ? "" : v)} @@ -899,7 +934,7 @@ export default function SettingsPage() { ))} - Files (images) + Files (images) setColumnMapping("_files", !v || v === "__none__" ? "" : v)}
Column Mapping