// Example data for a fictional outdoor-living builder in the Fort Worth area. // Every person, message and setting below is invented for the demonstration. // Shapes follow the HighLevel API responses; the settings in `exampleConfig` are defined for the demonstration. import type { CheckConfig, Contact, Message, Snapshot } from "./types"; export const EXAMPLE_NOW = "2026-09-22T16:00:00-05:00"; // Tuesday 4:00 pm, Central time export const exampleConfig: CheckConfig = { timezone: "America/Chicago", inquiryFormIds: ["form_project_inquiry"], // the warranty request form is not a sales inquiry firstReplyWithinMinutes: 60, holdUntilFieldId: "cf_follow_up_hold_until", expectedAutoReplyMarkers: ["Thanks for reaching out about your project"], personalizedTemplates: [ { id: "tpl_consult_confirm", name: "Home consultation confirmation (SMS)", marker: "your home consultation is set for", greetingPrefix: "Hi ", requiredContactField: "firstName", atRiskStageIds: ["stg_new"], }, ], bookingAsk: { marker: "Book your free home consultation", calendarId: "cal_home_consult" }, stageLimitsDays: { stg_design_sent: { label: "Design proposal sent", days: 10 }, stg_estimate_sent: { label: "Estimate sent", days: 14 }, }, reminderMatchToleranceMinutes: 30, maxAutomatedPer24h: 3, expectedActiveWorkflows: [ { name: "Speed to lead", expectedStatus: "published" }, { name: "Home consultation confirmation", expectedStatus: "published" }, { name: "Review request after completion", expectedStatus: "published" }, ], staleRunAfterHours: 26, }; const c = (id: string, first: string | undefined, last: string, dateAdded: string, extra: Partial = {}): Contact => ({ id, firstName: first, lastName: last, name: [first, last].filter(Boolean).join(" "), dateAdded, tags: [], source: "form", ...extra, }); export const exampleContacts: Contact[] = [ c("c_dana", "Dana", "Whitfield", "2026-09-22T09:12:31-05:00"), c("c_marcus", undefined, "Marcus Reyes", "2026-09-21T14:20:05-05:00"), c("c_ortiz", undefined, "Ortiz", "2026-09-22T13:40:12-05:00"), c("c_priya", "Priya", "Natarajan", "2026-09-21T11:30:44-05:00"), c("c_renee", "Renee", "Castillo", "2026-09-01T09:40:02-05:00", { customFields: [{ id: "cf_follow_up_hold_until", value: "2026-10-06T09:00:00-05:00" }], }), c("c_frank", "Frank", "Delgado", "2026-09-20T17:05:40-05:00"), c("c_hannah", "Hannah", "Cole", "2026-09-22T14:30:10-05:00"), c("c_sam", "Sam", "Ortega", "2026-09-18T10:00:00-05:00"), c("c_ruth", "Ruth", "Ambrose", "2026-09-21T15:58:00-05:00"), c("c_keene", "Bill", "Keene", "2024-04-10T10:12:00-05:00"), c("c_glen", "Glen", "Harber", "2026-09-22T08:00:00-05:00", { source: "import" }), c("c_tyler", "Tyler", "Moss", "2023-05-12T10:15:00-05:00"), c("c_alicia", "Alicia", "Brandt", "2026-09-22T13:05:00-05:00"), c("c_wes", "Wes", "Pruitt", "2025-05-02T12:00:00-05:00", { dnd: true }), c("c_kevin", "Kevin", "Lott", "2026-08-25T08:30:00-05:00"), ]; const sub = (id: string, contactId: string, createdAt: string, formId = "form_project_inquiry") => ({ id, contactId, formId, createdAt }); let n = 0; const msg = (contactId: string, dateAdded: string, m: Partial): Message => ({ id: `msg_${++n}`, messageType: "TYPE_SMS", contactId, conversationId: `conv_${contactId}`, dateAdded, direction: "outbound", status: "delivered", ...m, }); const SPEED = "Thanks for reaching out about your project. When is a good time for a quick call?"; export const exampleMessages: Message[] = [ // Marcus: answered, booked, then the confirmation goes out with a blank greeting msg("c_marcus", "2026-09-21T14:21:02-05:00", { source: "workflow", body: SPEED }), msg("c_marcus", "2026-09-21T15:06:10-05:00", { source: "workflow", body: "Hi , your home consultation is set for Thursday at 10:00 am. Reply C to confirm.", }), // Ortiz: answered; no first name on file, and will get the confirmation template when booked msg("c_ortiz", "2026-09-22T13:41:00-05:00", { source: "workflow", body: SPEED }), // Priya: answered by a person, books, and the nurture still asks her to book msg("c_priya", "2026-09-21T11:48:20-05:00", { source: "app", userId: "u_coordinator", body: "Hi Priya, thanks for the photos of the back yard. I'll call you this afternoon." }), msg("c_priya", "2026-09-21T15:41:00-05:00", { source: "workflow", body: "Hi Priya, your home consultation is set for Thursday at 1:00 pm. Reply C to confirm." }), msg("c_priya", "2026-09-22T10:00:00-05:00", { source: "workflow", body: "Still planning your outdoor kitchen? Book your free home consultation: example.com/consult", }), // Renee: answered by a person, later asks to wait msg("c_renee", "2026-09-01T09:54:00-05:00", { source: "app", userId: "u_coordinator", body: "Hi Renee, happy to help with the pool. Does Thursday work for a visit?" }), msg("c_renee", "2026-09-02T10:01:00-05:00", { body: "Reminder: your home consultation is tomorrow at 10:00 am." }), msg("c_renee", "2026-09-08T18:22:00-05:00", { direction: "inbound", status: "delivered", body: "We're traveling until Oct 6. Can we pick the design back up when we're home?", }), msg("c_renee", "2026-09-08T18:40:00-05:00", { source: "app", userId: "u_coordinator", body: "Of course. Safe travels, I'll reach out on the 6th." }), // Frank: answered, booked Monday for Wednesday; no reminder found on Tuesday afternoon msg("c_frank", "2026-09-20T17:06:00-05:00", { source: "workflow", body: SPEED }), // Hannah: booked late, reminder window already passed at booking time msg("c_hannah", "2026-09-22T14:31:00-05:00", { source: "workflow", body: SPEED }), // Sam: cancelled; being asked to book again is right msg("c_sam", "2026-09-18T10:01:00-05:00", { source: "workflow", body: SPEED }), msg("c_sam", "2026-09-21T10:00:00-05:00", { source: "workflow", body: "No problem about Monday. Book your free home consultation when it suits you: example.com/consult", }), // Ruth: five automated messages in under a day msg("c_ruth", "2026-09-21T15:59:00-05:00", { source: "workflow", body: SPEED }), msg("c_ruth", "2026-09-21T16:00:00-05:00", { source: "workflow", messageType: "TYPE_EMAIL", body: "Your outdoor living idea book" }), msg("c_ruth", "2026-09-22T08:00:00-05:00", { source: "workflow", body: "Did you get a chance to look at the idea book?" }), msg("c_ruth", "2026-09-22T09:00:00-05:00", { source: "workflow", messageType: "TYPE_EMAIL", body: "Three patio layouts for sloped yards" }), msg("c_ruth", "2026-09-22T12:00:00-05:00", { source: "workflow", body: "Want to see a project near you?" }), // Returning client: old contact, new project, answered by the workflow msg("c_keene", "2026-09-22T11:31:00-05:00", { source: "workflow", body: SPEED }), // Alicia: a person called her msg("c_alicia", "2026-09-22T13:20:00-05:00", { messageType: "TYPE_CALL", source: "app", status: "connected", userId: "u_owner", meta: { callStatus: "completed" } }), // A newsletter to Dana does not count as a reply to her inquiry msg("c_dana", "2026-09-22T11:00:00-05:00", { source: "bulk_actions", messageType: "TYPE_EMAIL", body: "Fall project calendar is filling up" }), ]; export const exampleSnapshot: Snapshot = { locationId: "loc_example", collectedAt: "2026-09-22T15:55:00-05:00", sources: [ { source: "contacts", status: "complete" }, { source: "forms.submissions", status: "complete" }, { source: "messages.nonEmail", status: "complete" }, { source: "messages.email", status: "complete" }, { source: "calendars.events", status: "complete" }, { source: "calendars.notifications", status: "complete" }, { source: "opportunities", status: "complete" }, { source: "workflows", status: "complete" }, ], contacts: exampleContacts, submissions: [ sub("sub_dana", "c_dana", "2026-09-22T09:12:31-05:00"), sub("sub_marcus", "c_marcus", "2026-09-21T14:20:05-05:00"), sub("sub_ortiz", "c_ortiz", "2026-09-22T13:40:12-05:00"), sub("sub_priya", "c_priya", "2026-09-21T11:30:44-05:00"), sub("sub_frank", "c_frank", "2026-09-20T17:05:40-05:00"), sub("sub_hannah", "c_hannah", "2026-09-22T14:30:10-05:00"), sub("sub_sam", "c_sam", "2026-09-18T10:00:00-05:00"), sub("sub_ruth", "c_ruth", "2026-09-21T15:58:00-05:00"), sub("sub_keene", "c_keene", "2026-09-22T11:30:00-05:00"), sub("sub_tyler", "c_tyler", "2026-09-22T10:15:00-05:00", "form_warranty_request"), sub("sub_alicia", "c_alicia", "2026-09-22T13:05:00-05:00"), sub("sub_wes", "c_wes", "2026-09-22T11:00:00-05:00"), ], messages: exampleMessages, events: [ { id: "ev_marcus", calendarId: "cal_home_consult", contactId: "c_marcus", title: "Home consultation", appointmentStatus: "confirmed", startTime: "2026-09-24T10:00:00-05:00", endTime: "2026-09-24T11:00:00-05:00", dateAdded: "2026-09-21T15:05:30-05:00", dateUpdated: "2026-09-21T15:05:30-05:00" }, { id: "ev_priya", calendarId: "cal_home_consult", contactId: "c_priya", title: "Home consultation", appointmentStatus: "confirmed", startTime: "2026-09-24T13:00:00-05:00", endTime: "2026-09-24T14:00:00-05:00", dateAdded: "2026-09-21T15:40:12-05:00", dateUpdated: "2026-09-21T15:40:12-05:00" }, { id: "ev_renee", calendarId: "cal_home_consult", contactId: "c_renee", title: "Home consultation", appointmentStatus: "showed", startTime: "2026-09-03T10:00:00-05:00", endTime: "2026-09-03T11:00:00-05:00", dateAdded: "2026-09-01T10:02:00-05:00", dateUpdated: "2026-09-03T11:05:00-05:00" }, { id: "ev_frank", calendarId: "cal_home_consult", contactId: "c_frank", title: "Home consultation", appointmentStatus: "confirmed", startTime: "2026-09-23T14:00:00-05:00", endTime: "2026-09-23T15:00:00-05:00", dateAdded: "2026-09-21T09:10:00-05:00", dateUpdated: "2026-09-21T09:10:00-05:00" }, { id: "ev_hannah", calendarId: "cal_home_consult", contactId: "c_hannah", title: "Home consultation", appointmentStatus: "confirmed", startTime: "2026-09-23T09:00:00-05:00", endTime: "2026-09-23T10:00:00-05:00", dateAdded: "2026-09-22T15:00:00-05:00", dateUpdated: "2026-09-22T15:00:00-05:00" }, { id: "ev_sam", calendarId: "cal_home_consult", contactId: "c_sam", title: "Home consultation", appointmentStatus: "cancelled", startTime: "2026-09-21T10:00:00-05:00", endTime: "2026-09-21T11:00:00-05:00", dateAdded: "2026-09-18T10:30:00-05:00", dateUpdated: "2026-09-19T12:00:00-05:00" }, { id: "ev_alicia", calendarId: "cal_site_measure", contactId: "c_alicia", title: "Site measurement", appointmentStatus: "confirmed", startTime: "2026-09-23T11:00:00-05:00", endTime: "2026-09-23T11:45:00-05:00", dateAdded: "2026-09-22T13:25:00-05:00", dateUpdated: "2026-09-22T13:25:00-05:00" }, ], notifications: { cal_home_consult: [ { _id: "n1", receiverType: "contact", channel: "sms", notificationType: "booked", isActive: true }, { _id: "n2", receiverType: "contact", channel: "sms", notificationType: "reminder", isActive: true, beforeTime: [{ timeOffset: 24, unit: "hours" }] }, ], cal_site_measure: [ { _id: "n3", receiverType: "assignedUser", channel: "email", notificationType: "booked", isActive: true }, ], }, opportunities: [ { id: "o_dana", name: "Patio and shade", contactId: "c_dana", pipelineId: "p_sales", pipelineStageId: "stg_new", status: "open", createdAt: "2026-09-22T09:12:40-05:00", lastStageChangeAt: "2026-09-22T09:12:40-05:00" }, { id: "o_ortiz", name: "Covered patio", contactId: "c_ortiz", pipelineId: "p_sales", pipelineStageId: "stg_new", status: "open", createdAt: "2026-09-22T13:40:20-05:00", lastStageChangeAt: "2026-09-22T13:40:20-05:00" }, { id: "o_marcus", name: "Pergola", contactId: "c_marcus", pipelineId: "p_sales", pipelineStageId: "stg_consult_booked", status: "open", createdAt: "2026-09-21T14:20:10-05:00", lastStageChangeAt: "2026-09-21T15:05:30-05:00" }, { id: "o_priya", name: "Outdoor kitchen", contactId: "c_priya", pipelineId: "p_sales", pipelineStageId: "stg_consult_booked", status: "open", createdAt: "2026-09-21T11:30:50-05:00", lastStageChangeAt: "2026-09-21T15:40:12-05:00" }, { id: "o_renee", name: "Pool and deck", contactId: "c_renee", pipelineId: "p_sales", pipelineStageId: "stg_design_sent", status: "open", createdAt: "2026-09-01T09:40:10-05:00", lastStageChangeAt: "2026-09-06T14:00:00-05:00" }, { id: "o_kevin", name: "Fire pit and seating wall", contactId: "c_kevin", pipelineId: "p_sales", pipelineStageId: "stg_estimate_sent", status: "open", createdAt: "2026-08-25T08:30:00-05:00", lastStageChangeAt: "2026-09-03T16:10:00-05:00" }, ], workflows: [ { id: "wf_speed", name: "Speed to lead", status: "published", version: 7, createdAt: "2025-11-02T10:00:00-05:00", updatedAt: "2026-09-10T15:20:00-05:00" }, { id: "wf_confirm", name: "Home consultation confirmation", status: "published", version: 3, createdAt: "2025-11-02T10:00:00-05:00", updatedAt: "2026-06-01T09:00:00-05:00" }, { id: "wf_nurture", name: "Nurture: book a consultation", status: "published", version: 5, createdAt: "2025-12-01T10:00:00-05:00", updatedAt: "2026-08-14T11:00:00-05:00" }, { id: "wf_review", name: "Review request after completion", status: "draft", version: 4, createdAt: "2026-01-12T10:00:00-05:00", updatedAt: "2026-09-15T17:45:00-05:00" }, ], }; export function contactName(id: string | undefined): string { const x = exampleContacts.find((k) => k.id === id); if (!x) return ""; return [x.firstName, x.lastName].filter(Boolean).join(" "); }