Internal status report · Snapshot 2026-07-21

Asian Imports CRM

Current features · improvement points · future development. Compiled from the BRD, the app codebase, and a live Supabase snapshot.

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.

Headline: the CRM is no longer "code-only, never past LEAD." Live data shows multi-role usage and full pipeline stages. Remaining work is ops adoption (prep/display at scale), product gaps (finance-app ingest, settings UI, SMS), and security hardening.

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.

13

Inquiry

CRE registry

1

Lead

Sales desk

4

Booked

Finance confirm

1

Delivered

SC handover

1

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).

161 units awaiting prep → then Marketing display batch. Pilot: 10–20 units with Supply Chain.

Staffing: one person per lane

BRD G-03 resolved for MVP — but capacity is thin; no backup coverage (O-04).

1

CRE

1

Sales

1

Finance

1

Mktg

1

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-01RLS off on users, cars, estimates, auth helpersEnable RLS + least-privilege policies; never expose password hashes via PostgREST
S-02Sensitive columns on password_resets, device_otpsRLS + revoke anon/authenticated grants where the app uses server-only Prisma
S-03Permissive WITH CHECK (true) policiesTighten insert/update policies on contact & reference tables
S-04Public bucket listingNarrow 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-0232/38 estimates stuck DRAFT → CRE/Sales SOP: require phone + send; orphan sync cadence
O-0313 INQUIRY backlog vs 1 LEAD → CRE staffing / auto-claim SLAs; promote or merge stale inquiries
O-04Single staff per role → seed backup users; document vacation coverage
O-05Phone dedupe fragile → keep normalize-phones maintenance job; UAT merge on known duplicates
O-06Finance 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-01No auto-ingest from finance_applications → add createLeadFromFinanceApplication + hook on the create API
F-02default_sales_assignee_id missing from settings UI → expose on /admin/crm/settings
F-03SMS falls back to a stub without Twilio → configure Twilio or hide SMS CTAs until configured
F-04Handover UI still says "Print stub" → rename + polish the receipt PDF UX
F-05Lost deals not a first-class status → decide: add LOST enum or document the win/loss side-door in SOPs
F-06BRD stale (§13–25) → refresh BRD live tables from this snapshot on next release

P2 — UX & quality

Polish and coverage — do after P0/P1.

U-01Estimate conversion low (no ACCEPTED live) → Sales coaching KPIs; nudge on VIEWED quotes
U-02Marketing lacks a dedicated /admin/crm/marketing home → optional home desk (queue-only OK if documented)
U-03Heavy admin API surfaces for CRM staff → continue path-gated menus; audit leftover admin-only links
U-04Activity 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

IDOriginal gapStatus · 2026-07-21
G-09No lead past LEAD✅ Fixed — BOOKED 4 · DELIVERED 1 · AFTER_SALES 1
G-03Only 1/5 roles seeded✅ Fixed — 1 user per role
G-08Zero vehicle activities✅ Fixed — 19 rows live
G-01/02CRE unassigned filter · auto-claim✅ Fixed in queue service / claim lib
G-05Contact not ingested✅ Code wired — verify backlog
G-07Prep workflow never run⚠️ ~161 pending — ops pilot
G-06Finance app not linked⚠️ 0 linked rows — needs F-01 + ops
G-04Phone normalization⚠️ Tools exist; hygiene ongoing
G-10default_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

ThemeScope
DocumentsPayment receipt / invoice PDF upload on lead; store URLs; activity PAYMENT_NOTED with attachment metadata
Settlement gateHard-block SC handover until SETTLEMENT_NOTED — soft signal exists today; enforce in the API
Booking rollbackControlled Finance/Admin unbook with audit trail + car restored to AVAILABLE (API stubs exist — productize)
Email / SMS automationQuote sent, booking confirmed, follow-up reminders; Twilio + transactional email
Warranty registrationPost-DELIVERED capture; optional SMS confirmation
Margin KPIsCost vs quote vs booked price on the Finance/Sales performance desks

Phase 3 · Growth CRM

After Phase 2 · management call

ThemeScope
Lead scoring & cadencesAuto-prioritize the Sales agenda by score and follow-up cadence
Campaign attributionFacebook / campaign attribution deeper than the lead_source enum
Customer portalCustomers view their quote, booking status, and handover appointment
Multi-showroomPer-location prep and SLA dashboards for multi-showroom capacity
Mobile PWASales/SC field visits + handover checklist, offline-friendly
Zoho-parity extrasPer crm_vs_zoho_comparison.md §8 — only if management prioritizes