Skip to main content

Leads

Data

  • Table: leads in Supabase
  • Types: Lead, LeadActivity in lib/supabase.ts
  • Actions: app/actions/leads.ts — CRUD + activity log

Activity log

Every status change and notable action is appended to lead_activities. Displayed chronologically on the lead detail page.

Creating a lead

Leads are created when:

  1. A contact form is submitted at /contact (submitContactForm)
  2. A service order is placed at /services/[slug] (submitServiceOrder)
  3. Admin creates one manually at /admin/leads

QuickActions

From the lead detail page, admin can:

  • Send a questionnaire (emails token link)
  • Create a proposal
  • Create a case study (maps lead → draft project)