01 · Executive verdict
Four layers, four states
Platform · M1–M4
Ready
Schema, RBAC, queues, lead & fleet desks, estimates, SLA and handover APIs/UI implemented.
Operations · M6
Partial
All 5 roles seeded; pipeline reached BOOKED / DELIVERED / AFTER_SALES; fleet prep barely exercised.
Security · Supabase
High risk
RLS off on many public tables; sensitive columns exposed via the Data API.
Phase 2 product
Deferred
PDF receipts, email/SMS automation, warranty, margin KPIs — mostly out of scope or stubbed.
02 · Live customer pipeline
The lead journey, end to end
BRD §16 claimed "no lead past LEAD." Obsolete — Finance confirm and SC handover have both run in production.
Inquiry
CRE registry
Lead
Sales desk
Booked
Finance confirm
Delivered
SC handover
After-sales
Post-delivery
22 active leads · every stage of the state machine now exercised
Bottleneck: 13 sitting in INQUIRY vs 1 LEAD
CRE staffing or auto-claim SLAs needed; promote or merge stale inquiries (O-03).
Booking queue: 0 pending
Requests already confirmed or cleared — Finance confirm path is live.
03 · Live dataset snapshot
What the database says vs. the BRD
Table growth since BRD §22
2026-06-17 snapshot vs. live 2026-07-21 — the audit trail is finally being written.
Estimates by status (38 total)
32 stuck in DRAFT and zero ACCEPTED — quote-send hygiene is issue O-02 / U-01.
Fleet prep backlog
~161 of 175 cars in showroom not yet prepared — the largest ops gap (O-01 / G-07).
Staffing: one person per lane
BRD G-03 resolved for MVP — but capacity is thin; no backup coverage (O-04).
CRE
Sales
Finance
Mktg
S.Chain
+1 user with no CRM role. Action: seed backup users and document vacation coverage.
04 · Security advisors · P0
Security must precede scale
CRM tables were designed with RLS — legacy catalog and auth tables are the primary exposure surface.
S-01 · RLS disabled
users, cars, estimates, inquiries, notifications and more sit open on the public schema.
S-02 · Secrets exposed
users.password, password_resets.token, device_otps.otp reachable via the Data API.
S-03 · Permissive policies
USING (true) / WITH CHECK (true) on contact and vehicle reference tables; mutable search_path on trigger functions.
S-04 · Open buckets
Public listing on car-images and profile-pictures; narrow storage SELECT so objects stay URL-accessible without directory listing.
Sprint A: S-01 → S-02 → S-03 → advisor re-check
05 · Improvement backlog
Prioritized by impact × effort
Backlog composition
20 tracked items: 4 security (P0), 6 ops (P1), 6 product (P1), 4 UX (P2) — security first, then the ops pilot.
P0 — Security & trust
Blocks everything else. Must precede any production scale-up.
| S-01 | RLS off on users, cars, estimates, auth helpers | Enable RLS + least-privilege policies; never expose password hashes via PostgREST |
| S-02 | Sensitive columns on password_resets, device_otps | RLS + revoke anon/authenticated grants where the app uses server-only Prisma |
| S-03 | Permissive WITH CHECK (true) policies | Tighten insert/update policies on contact & reference tables |
| S-04 | Public bucket listing | Narrow storage SELECT so objects stay URL-accessible without directory listing |
P1 — Ops & data quality
The system works; the team hasn't run it at scale yet.
| O-01 | ~161 cars prep-pending, SLA red fleet → Supply Chain prep pilot (10–20 units), then Marketing display batch |
| O-02 | 32/38 estimates stuck DRAFT → CRE/Sales SOP: require phone + send; orphan sync cadence |
| O-03 | 13 INQUIRY backlog vs 1 LEAD → CRE staffing / auto-claim SLAs; promote or merge stale inquiries |
| O-04 | Single staff per role → seed backup users; document vacation coverage |
| O-05 | Phone dedupe fragile → keep normalize-phones maintenance job; UAT merge on known duplicates |
| O-06 | Finance app still unlinked (1 row) → manual link from finance desk, then build auto-ingest (F-01) |
P1 — Product gaps (code)
Missing or stubbed features that need dev time.
| F-01 | No auto-ingest from finance_applications → add createLeadFromFinanceApplication + hook on the create API |
| F-02 | default_sales_assignee_id missing from settings UI → expose on /admin/crm/settings |
| F-03 | SMS falls back to a stub without Twilio → configure Twilio or hide SMS CTAs until configured |
| F-04 | Handover UI still says "Print stub" → rename + polish the receipt PDF UX |
| F-05 | Lost deals not a first-class status → decide: add LOST enum or document the win/loss side-door in SOPs |
| F-06 | BRD stale (§13–25) → refresh BRD live tables from this snapshot on next release |
P2 — UX & quality
Polish and coverage — do after P0/P1.
| U-01 | Estimate conversion low (no ACCEPTED live) → Sales coaching KPIs; nudge on VIEWED quotes |
| U-02 | Marketing lacks a dedicated /admin/crm/marketing home → optional home desk (queue-only OK if documented) |
| U-03 | Heavy admin API surfaces for CRM staff → continue path-gated menus; audit leftover admin-only links |
| U-04 | Activity feeds historically sparse for Marketing/SC → ensure every fleet mutation logs crm_vehicle_activities; raise coverage |
06 · BRD gap register
6 of 10 gaps closed since June
| ID | Original gap | Status · 2026-07-21 |
|---|---|---|
| G-09 | No lead past LEAD | ✅ Fixed — BOOKED 4 · DELIVERED 1 · AFTER_SALES 1 |
| G-03 | Only 1/5 roles seeded | ✅ Fixed — 1 user per role |
| G-08 | Zero vehicle activities | ✅ Fixed — 19 rows live |
| G-01/02 | CRE unassigned filter · auto-claim | ✅ Fixed in queue service / claim lib |
| G-05 | Contact not ingested | ✅ Code wired — verify backlog |
| G-07 | Prep workflow never run | ⚠️ ~161 pending — ops pilot |
| G-06 | Finance app not linked | ⚠️ 0 linked rows — needs F-01 + ops |
| G-04 | Phone normalization | ⚠️ Tools exist; hygiene ongoing |
| G-10 | default_sales null / no UI | ⚠️ Product gap (F-02) |
07 · 90-day roadmap
Four sprints to Phase 2 kickoff
Sprint A — Security
S-01 RLS enablement → S-02 secret columns → S-03 policy tightening → advisor re-check.
Sprint B — Ops pilot
Backup users → prep pilot (20 cars) → Marketing display batch → quote-send hygiene → CRE inquiry burn-down.
Sprint C — Product closure
Finance-app ingest → default-sales settings UI → SMS/handover polish → full UAT: Inquiry → Lead → Book → Prep → Display → Handover → After-sales.
Sprint D — Phase 2 kickoff
Settlement hard-gate → document upload (receipts / invoices) → email quote & booking templates.
08 · Future developments
Phase 2 & Phase 3 — full scope
Phase 2 · Commitment & documents
Next major · BRD §1 / §14.3
| Theme | Scope |
|---|---|
| Documents | Payment receipt / invoice PDF upload on lead; store URLs; activity PAYMENT_NOTED with attachment metadata |
| Settlement gate | Hard-block SC handover until SETTLEMENT_NOTED — soft signal exists today; enforce in the API |
| Booking rollback | Controlled Finance/Admin unbook with audit trail + car restored to AVAILABLE (API stubs exist — productize) |
| Email / SMS automation | Quote sent, booking confirmed, follow-up reminders; Twilio + transactional email |
| Warranty registration | Post-DELIVERED capture; optional SMS confirmation |
| Margin KPIs | Cost vs quote vs booked price on the Finance/Sales performance desks |
Phase 3 · Growth CRM
After Phase 2 · management call
| Theme | Scope |
|---|---|
| Lead scoring & cadences | Auto-prioritize the Sales agenda by score and follow-up cadence |
| Campaign attribution | Facebook / campaign attribution deeper than the lead_source enum |
| Customer portal | Customers view their quote, booking status, and handover appointment |
| Multi-showroom | Per-location prep and SLA dashboards for multi-showroom capacity |
| Mobile PWA | Sales/SC field visits + handover checklist, offline-friendly |
| Zoho-parity extras | Per crm_vs_zoho_comparison.md §8 — only if management prioritizes |