Empire Teas CRM — Prototype Inventory
⚠️ STALE — do not read this as the prototype’s current state. Captured 2026-07-06 against a much smaller build. The prototype has since grown substantially, and this inventory lists as absent several things that now exist (login, role switcher, Products catalog, Inbox, sequences, pipeline configuration, attachments, migration wizard, a working global search). For what the prototype does today, read
feature-detail.md, which was verified against the bundle. This file is kept as the 2026-07-06 capture it is — a dated record that fed the PRD’s functional surface — and needs re-capturing before it is cited again.Bulk pricing has since moved (2026-09-11). §1’s nav list predates a Pricing entry (Tea Room / Administrator only), §2.4’s Accounts entry predates its Buying standards & prices section, and the Products catalog this capture already lists as absent came and went — it gained a price board, lost it to the account and the Pricing screen (2026-09-11), and was removed outright on 2026-09-15 (PRD Rev 27: the Buying Standard is the sellable record, so there is no catalog screen). Those sections are deliberately not rewritten: editing a dated capture to match today would destroy the record it exists to be.
design/prototypes/README.mdand.forge/design/prototypes/feature-detail.mdcarry the current state.
Exhaustive feature/functionality inventory of the client-approved prototype (
.forge/design/prototypes/crm/crm-prototype.dc.html, 2026-07-03) — the authoritative statement of what the CRM will look like and do for the tea-domain modules. Captured 2026-07-06 (feedsproject-prd.md§Functional Surface F1–F19 and §Domain Model). Preserved here so it survives independent of the prototype file.
0. Technical context (not a feature)
- Single-file prototype. Entire app is one file (~1,830 lines).
support.jsis only the generic dc-runtime (React-based template renderer:<x-dc>,sc-if,sc-for,{{ }},class Component extends DCLogic) — contains no Empire-specific logic; ignore as a feature source. - All app logic lives in one
Componentclass:state,renderVals(), event handlers,seed*()mock data. State is in-memory (no backend/persistence). - Assets:
assets/empire-logo.webp— the only one the canvas html references. - Baked persona: Priya Fernando, “Sales Lead” (avatar “PF”). Fixed date: “Tuesday, 17 June 2026 · Good morning, Priya.”
- Design system: warm tea palette (
#F4EEE2bg,#C8923Agold,#2C5F2D/#2E5103greens,#B23A2Ealert red); fonts Fraunces (serif headings) + Inter (body). AI features always tagged with a green “sparkle” pill.
1. Navigation / top-level modules
Left sidebar (collapsible 248px ↔ 76px). Nav items + route keys + badges:
| Nav label | screen key | badge |
|---|---|---|
| Dashboard | dashboard |
— |
| Lead Triage | leads |
214 |
| Pipeline | pipeline |
— |
| Accounts | accounts |
— |
| Samples | samples |
6 |
| Quotes | quotes |
— |
| Activities | activities |
5 (gold/alert) |
- Sidebar header: Empire logo + “Empire Teas” / “SALES CRM”. Footer: user card (PF, Priya Fernando, Sales Lead). Collapse chevron.
- Top bar: global search input (placeholder “Search accounts, leads, quotes…”, not wired), “New” button (gold, → Lead Triage), notifications bell w/ unread dot (visual).
- Overlays: Deal Detail Modal (right slide-over), Toast (bottom-center, auto-dismiss 2,800 ms).
2. Per-module features
2.1 Dashboard (isDashboard)
- Header: date line + “Dashboard” + “Last synced with ERP · 6 min ago”.
- 5 KPI cards: Avg inquiry response
9.4h(“▼1.8h vs last week · target <12h”) · Follow-ups due today14(“5 overdue”) · Samples overdue for feedback6(“oldest 18 days”) · Quotes aging >7 days4(“$182k at risk”) · Dormant high-value accounts3(“silent >90 days”). - AI Morning Briefing (tagged) — narrative “drafted from 214 leads, 23 open opps, ERP sync”; names Hamburg Tea Trading (P1 $74k), Gulf Beverage quote (5 days on margin approval, $46k), 6 overdue samples (Kyoto Leaf 18 days). CTAs: “Review Hamburg lead →”, “Open Gulf Beverage quote”.
- “What’s stuck — and why” (AI SUGGESTED) — 5 plain-language blockers, each click-through, colored severity dot.
- “Pipeline by stage” — horizontal bar funnel + Private Label/Bulk toggle; footer: open value, won this quarter, in final negotiation.
- “High-priority leads to triage” (AI RANKED) — 4 lead cards w/ priority badge + confidence %.
2.2 Lead Triage (isLeads) — master/detail
- Left queue: header “{n} shown · 214 in backlog”; AI banner “AI has summarised, scored & drafted replies. You approve every action.”; filters (priority pills All/P1/P2/P3/P4, country dropdown, buyer-type dropdown); queue cards (priority badge, company, SPAM/DUPLICATE tag, country·buyer·received, product, confidence bar %); “+188 more in backlog” footer; empty state “Queue clear for these filters.”
- Right detail: priority badge, “Lead {id} · received {date}”, company; meta grid (Country, Buyer type, Est. value, Channel); AI Summary card (summary, confidence bar %, “Why this priority”); Recommended next action; Draft follow-up editable
<textarea>(tagged “AI DRAFTED · EDITABLE”, “· edited by you” when modified; footnote “pricing intentionally omitted (human-set)”); actions Approve & send / Convert to opportunity / Archive / nurture.
2.3 Pipeline (isPipeline) — Kanban
- Header: “{n} {Private Label|Bulk} opportunities · drag a card between stages”; stats Open value + Won this quarter.
- Pipeline toggle tabs: Private Label / Bulk (two distinct stage sets).
- Columns per stage: label + count + open-value subtotal + scrollable cards.
- Opp cards: company, country·product, value (green) + volume, cert chips, owner avatar + “{age}d in stage” + age dot (red >14d / gold >7d / green ≤7d).
- Drag-and-drop between stages (sets stage, resets age:0, toast); column highlights on drag-enter. Click card → Deal Detail Modal.
2.4 Accounts (isAccounts) — master/detail
- Left list: “8 active customers · 3 need attention”; cards (company, “Dormant” badge, type·country, LTV, “{n}d ago”).
- Right detail: header (type·region, company, LTV, “last contact {n} days ago”); AI Briefing (“BEFORE YOU MEET THIS CUSTOMER” — narrative, Open items, Suggested next move, Reorder/upsell trigger); Profile grid (Customer type, Region, Certifications chips, Preferred packaging chips, Incoterms chips); Private-label deals — product briefs (rows w/ brief-status badge); Contacts (avatar+name+role·email); Communication timeline (color-dotted by kind); Open opportunities; Past orders (“— via ERP”, order ref monospace).
2.5 Samples (isSamples) — board / table toggle
- Header: “{inFlight} in flight · {overdue} overdue for feedback · {awaitingPrep} awaiting R&D prep”; AI nudge banner (red) naming overdue samples.
- Board view: column per lifecycle state; sample cards (account, Round N, country·product, owner avatar+name, due chip red if overdue, courier+tracking monospace, outcome note, buttons “Draft feedback chase” [red, on overdue ≥10d] and “{advance} →”).
- Management table: columns Sample/account · State · Owner · Due · Status — computes “where it’s stuck” reason (“Buyer feedback overdue 18d”, “In transit 10d — check courier”, “Awaiting R&D prep”, etc.); stuck rows pink.
- Advance logic: sets days:0; entering Dispatched auto-generates courier “DHL” + random tracking; entering Feedback received sets outcome note.
2.6 Quotes (isQuotes) — master/detail
- Left list: “6 active · 4 aging >7 days · 1 awaiting approval”; cards (quote id monospace, aging chip colored by age ≥14 red/≥7 gold, account, product, value, “checklist {done}/8”).
- Right detail: header (“{id} · {status}”, account, product·country, value, “margin {m}”); AI Quote Assistant (tagged, shown when checklist incomplete — warnings per unmet item, lock footnote “Pricing is calculated and approved by a human”); Readiness checklist (8 items): Product spec, Quantity, Packaging, Incoterm, Currency, Destination, Certifications, Margin & approval; Quote details; Similar past quotes (AI MATCHED — ref, margin·outcome Won/Lost); Revision history (v1/v2/v3); Approve button (disabled “Complete checklist to submit” until 8/8 → “Approve pricing & submit” → status Submitted); footnote “Submission to ERP happens only after a human approves pricing.”
2.7 Activities (isActivities) — grouped list
- Header + filter pills (All / Overdue / Today / Upcoming); grouped sections Overdue (red) / Today (gold) / Upcoming (green) / Completed (under All); rows (type dot, title strikethrough when done, type·account·owner, due chip, “Mark done” button); overdue rows pink.
2.8 Deal Detail Modal (selOpp) — cross-cutting slide-over
Sections (conditional): header (“{id} · {Private Label|Bulk} · {stage}”, company, product); metrics grid (Value, Volume, Owner); “This deal’s product holds” cert chips; Sample round history (per-round dot); Certification mismatch check (buyer-required vs product-held → “Missing: …” or green all-present); Export documentation checklist (AI GENERATED — base + country + per-cert docs, toggleable checkboxes, “Based on destination ({country}) and certifications · {done}/{total} assembled”; earlier stages show simplified no-commercial-value note); Product brief (field rows, missing = red “Needs confirmation”, certs chips, “Open questions — blocking handoff”, or green complete); ERP handoff (only when Won — readiness checklist [quote approved / certs verified / brief complete] + “Generate handoff document” → toast; note “Automatic ERP sync is pending confirmation of ERP API availability — showing the manual handoff document path”).
3. AI features (15, each UI-tagged)
- AI Morning Briefing (Dashboard) · 2. “What’s stuck — and why” (Dashboard) · 3. High-priority leads AI RANKED (Dashboard) · 4. Lead inquiry extraction & summary (Lead detail) · 5. Lead triage scoring P1–P4 + confidence + reason (queue) · 6. Spam/duplicate detection (queue) · 7. AI-drafted follow-up (Lead detail, editable, pricing omitted) · 8. Recommended next action (Lead detail) · 9. Account brief (Account detail) · 10. AI sample nudge / “Draft feedback chase” (Samples) · 11. AI Quote Assistant (Quote detail, never sets price) · 12. Similar past quotes AI MATCHED (Quote detail) · 13. Certification mismatch check (Deal Modal) · 14. Export documentation checklist AI GENERATED (Deal Modal) · 15. Product brief open-questions (Deal Modal).
Consistent principle: human-in-the-loop — AI summarises/scores/drafts/flags; the human approves every action and sets/approves all pricing.
4. Entities & complete field lists (from seed data)
- Lead (22 records
L-2041…L-2062):id, company, country, buyer, value, channel, source, received, priority(P1–P4), confidence(0–100), tag(null|SPAM|DUPLICATE), status(new|approved|converted|archived), product, summary, reason, action, draft; runtimedraftText, edited. - Opportunity/Deal (17 records
O-501…O-518):id, company, country, product, volume, value, owner, pipelineType(bulk|privateLabel), stage, age, certs[]. - Account (8 records
A-01…A-08):id, company, country, region, type, certs[], packaging[], incoterms[], lastContactDays, value(LTV), dormant(bool), contacts[], timeline[], openOpps[], samples[], quotes[], orders[], briefing{}. Sub-entities — Contact:name, role, email; Timeline event:when, what, kind(lead|order|sample|call|quote|note); Order:ref(PO-xxxx), what, value, when; Briefing:last, openItems[], nextMove, trigger. - Product Brief (5 records, keyed by opp id):
teaType, blendProfile, originReq, certsRequired[], packaging, packSize, outerPackaging, volume, targetMarket, openQuestions[]. - Sample (13 records
S-01…S-11+ round-2S-03a, S-07a):id, account, country, product, owner, state, due, days, courier, tracking, outcome, opp, round. - Quote (6 records
Q-1185…Q-1192):id, account, country, product, qty, packaging, incoterm, currency, destination, certs, value, margin, status, age, checklist{8 booleans}, revisions[]. Revision:v, when, note. PlussimilarMapof past quotes. - Activity (12 records
AC-1…AC-12):id, type, title, account, owner, due, status(overdue|today|upcoming|done). - Doc Rules (
seedDocRules):baseDocs[], countryDocs{country→doc[]}, certDocs{cert→doc}— the export-doc rules engine (config/reference data). - User (implicit): current = Priya Fernando (Sales Lead). Owners: Priya Fernando, Dilan Perera, Anushka Wickrama, Roshan De Silva (sales); Tharindu Jay, Menaka Silva (R&D tasters/samples).
- Transient UI:
docChecks{}, erpHandoffs{}, draftEdits{}, filters, view toggles, selection ids,toast.
5. Pipelines & stages (exact names)
- Private Label (10 stages): New inquiry → Qualified buyer → Brief captured → Sample requested → Sample dispatched → Sample feedback → Artwork approval → Quote submitted → Negotiation → Won (“Won → ERP handoff”).
- Bulk (4 stages): New inquiry → Quote submitted → Negotiation → Won.
- Sample lifecycle (7 states,
sStates): Requested → Blended/Prepared → Dispatched → Delivered → Feedback due → Feedback received → Outcome. Advance labels: Mark prepared / Mark dispatched / Mark delivered / Mark feedback due / Log feedback / Set outcome / Closed. - Quote statuses (free-text observed): Draft — inputs incomplete · Draft — awaiting sample outcome · Awaiting margin approval · Submitted · Submitted — in negotiation. Gate: all 8 checklist items pass → Submitted.
- Lead: new → approved | converted | archived. Activity buckets: overdue → today → upcoming → done.
6. Roles / permissions
- No login/role-switching/permission enforcement in prototype (single fixed user). Implicit roles via
owner: Sales owners vs R&D tasters (samples). Governance = human-in-the-loop (pricing approval, AI-action approval), not RBAC.
7. Dashboards / metrics
5 KPI cards (see 2.1); pipeline funnel (PL/Bulk toggle) w/ open value, won this quarter, in-final-negotiation; sample summary counts; quote summary line. Dashboard KPIs are hardcoded; funnel + sample/quote counts computed from state.
8. Settings / config
No dedicated settings screen. Configuration is implicit in seedDocRules (export-doc rules for 11 countries + 8 certs) — the most PRD-relevant admin-managed reference-data surface.
9. Tea-domain enumerated values (verbatim from code)
- Customer/buyer types: Importer, Distributor, Supermarket, Foodservice, Wellness, Supplier (spam), Private-label, Wellness / Private-label.
- Certifications: EU Organic, USDA Organic, JAS Organic, Halal, Kosher, Fair Trade, BRCGS, FDA.
- Packaging: Loose-leaf, Double-chamber teabag, Single-chamber sachet, Pyramid sachet, Gift tin / Tin gift pack, Carton (retail-ready), Jute sack (bulk), Foil-lined, 25kg sacks, retail caddy.
- Incoterms + ports: FOB Colombo, CIF Hamburg, CIF Jebel Ali, CIF Yokohama, CIF Los Angeles, CIF Marseille, CIF Gothenburg. Destinations: Hamburg, Jebel Ali, Yokohama, Dubai, Gothenburg. Currencies: USD, EUR, JPY.
- Tea grades/product types: OP1, BOP, BOPF, FBOP, sencha, genmaicha, matcha, hojicha, organic black/green, herbal (sleep/immunity/detox), flavored fruit, English Breakfast, single-estate (Uva).
- Countries/markets: Germany, Japan, UAE, Sweden, France, Russia, USA, Canada, Australia, South Korea, Saudi Arabia, Netherlands, India, Sri Lanka (origin).
- Regions: EU — Northern Europe, EU — Western Europe, Middle East, East Asia, North America, Eastern Europe.
- Export documents (doc rules): Commercial Invoice, Packing List, Bill of Lading / Airway Bill, Certificate of Origin (Chamber of Commerce), SLTB Export Authorisation, CUSDEC via ASYCUDA, Phytosanitary Certificate, Pesticide residue test report (EU MRL), GCC Conformity Certificate, SASO Conformity Certificate, JAS Import Notification, Food Sanitation Law Import Notification, FDA Prior Notice, EAEU Conformity Declaration, CFIA Import Declaration, Biosecurity Import Declaration, + per-cert certificates (organics matched to batch/lot).
- Couriers: DHL, FedEx, Aramex.
10. Seed-data shape (reveals intended model)
22 leads (2 P1, 7 P2, 8 P3, 5 P4; 2 DUPLICATE, 2 SPAM) · 17 opps across PL(6)/Bulk(11), 2 Won · 8 accounts (1 dormant: Volga Tea Imports 96 days; LTVs $60k–$420k) · 5 product briefs (4 w/ open questions, 1 complete) · 13 samples (multi-round: Kyoto Leaf R1 rejected → R2 overdue 18d) · 6 quotes (varying checklist completeness; revision history v1–v3; similar-quote map) · 12 activities (5 overdue, 2 today, 3 upcoming, 2 done) · past orders PO-8302…PO-8841 (implies ERP order-history integration).
11. Notable interactions
Right slide-over modal (backdrop closes); bottom-center toast (2,800 ms); Kanban drag-drop (stage change + age reset + toast); master/detail auto-select-first; view toggles (PL/Bulk, board/table, filter pills, dropdowns); inline textarea editing (per-lead, “edited by you”); toggleable export-doc checkboxes; conditional UI (doc checklist past sample stage; ERP handoff only when Won; cert-mismatch only when account match; “Draft feedback chase” only overdue ≥10d; quote approve only 8/8); collapsible sidebar. No keyboard shortcuts, saved views, bulk actions, true export, real search wiring, or pagination (backlog counts static). ERP framed as future integration (manual handoff fallback).
Gap flags for the PRD
- Sub-brands absent — Thurson/Hyson/Akina/Ceylon Wild Harvest do not appear in prototype code; only “Empire Teas” + origins/estates. Brand tracking is unconfirmed scope (→ PRD OQ-20).
- ERP integration is stubbed as a manual handoff-document path pending ERP API confirmation (→ PRD OQ-2 / R-01).
- Pipedrive-parity features (email-in-CRM, calendar/contact sync, sequences, products catalog, configurable pipelines, global search, list views, attachments, custom fields) are not in the prototype — added to the PRD from Pipedrive doc research (see
../research/pipedrive-features.md).