1. Dashboards
Three role-tuned dashboards on the same source of truth.
Overview
- KPI tiles: leads today/week, appointments today/week, deals in progress, deals closed, monthly revenue, conversion rate, SLA compliance, inventory count and aging.
- Live Showroom Visits widget — real-time floor traffic.
- Active Shoppers widget — customers currently engaged on the website.
- Daily activity charts (responses, appointments, escalations).
My Dashboard
- Personal pipeline: assigned leads, tasks, appointments, and deal probability.
- Daily briefing panel from the AI Copilot.
Team Dashboard
- Per-salesperson performance, leaderboard, round-robin distribution health.
- Manager visibility into SLA, response times, and escalation volumes.
2. Lead Management
The lifecycle, scoring, routing, and ingestion stack.
Lifecycle
Canonical statuses:
newcontactedqualifiedproposalnegotiationwonlostduplicate
- Temperature classification with auto-scoring (0–100).
- Sources: website, walk-in, phone, referral, third-party (ADF), social, email.
- Status changes governed and audited via
lead_status_audit.
Routing
- Round-robin assignment by store and department.
- Configurable in Admin → Lead Routing Settings.
- Honors user availability, role, and store assignment via
user_store_assignments.
Capture & ingestion
- ADF/XML import via
import-lead edge function — parses tags into lead types and notes.
- Website lead form via
submit-website-lead with duplicate rejection on active matches.
- Third-party feeds via API key (
X-API-Key).
AI auto-responder
- Granular triggering rules with exclusions (lead source, hours, status).
- Initial response sent via Madison AI within configured SLA.
- Logged in
ai_interaction_logs.
Filtering & views
All Leads · Hot Leads · New Leads · My Leads. URL-driven filtering for deep-linking.
3. Customer 360
One profile, every channel, every signal.
Profiles
- Identity: name, contacts, address, communication consent (SMS/email).
- Preferred contact channel.
- Tags & segmentation.
- Activity timeline (notes, calls, SMS, email, status changes, assignments).
Customer dashboard
- Profile header with quick actions (call, text, email, schedule).
- Vehicle of Interest panel — links to active lead record.
- Buyer / Co-buyer panel.
- Trade-in panel with VIN decode and comparison tools.
- Sales history, deal probability indicator.
- Online activity feed (page views, vehicle views, scoring).
- Appointments, tasks, and wishlist management.
- Lead Received detail dialog for inbound source review.
- Printable Customer Sheet — internal review document.
Search & tools
- Standard and Advanced Search with multi-field filters.
- Recent · Sold · Recently Contacted · Not Recently Contacted · Lease Prospects.
- Recent Opportunities and Potential Duplicates detection.
- Customer Data Transfer between salespeople / stores.
Add / Edit
- Customer form dialog with ZIP lookup.
- License scan dialog (
scan-license OCR).
- Vehicle lookup dialog tied to inventory.
- Soft-delete with hierarchy preservation.
4. Showroom Visits
Live tracking
- Floor traffic in real time on the Overview Dashboard.
- Sales-process steps: meet & greet, walkaround, demo drive, write-up, etc.
- Visit notes and outcomes.
End Visit / Purchase
- End Visit dialog captures result.
did_buy: true triggers automated cascade — sale record creation, deal initialization, status sync.
- View Visit dialog for historical visit review.
5. Tasks
customer_tasks table with chronological categorization (Today, Overdue, Upcoming, Completed).
- Task types: call, email, sms, follow-up, appointment, other.
- Owner, due date, related entity (lead/customer/deal/vehicle), status.
- Add Task dialog from any customer dashboard.
- Behavioral automation creates tasks from tracking events (e.g., repeat vehicle views).
- AI-generated follow-up tasks suppressed when chat is active (chat-first priority).
6. Calendar / Appointments
- Multi-type appointments: sales, test drive, delivery, service, other.
- Schedule Appointment dialog with 30-minute collision check.
- Edit Appointment dialog and reminders.
- Linked to customers, leads, and deals.
- Statuses: scheduled, confirmed, completed, no-show, cancelled.
7. Activities
- Unified activity stream across customers, leads, and deals.
- Types: note, call, sms, email, status change, assignment.
- Sourced from
customer_activities and demo_messages.
- Inbound communications ingested via
demo_messages (single source of truth) and surfaced as activities.
8. Opportunities
- Recent Opportunities view of active deal-stage customers.
- Tracks deal probability (0–100) with formula-based scoring.
- Surfaces customers ready for desking handoff.
9. Letters
Coming soon — direct mail / printable correspondence module.
10. Links & Resources
- Quick Links — configurable shortcuts.
- Resources — sales collateral, training docs.
- Help Center — in-app support.
11. Communications
Pinned chat widget
- Facebook Messenger-style floating chat (bottom-left).
- Up to 3 simultaneous conversations, minimize/expand.
- 5-second polling, real-time message display.
- Click name to navigate to customer profile.
- Persists to
demo_messages and logs to customer_activities.
- Outbound messages must use
delivered status.
Inbox
- Email, Text, and Calls views with Unread / Sent / Drafts / Missed / Voicemail filters.
- Future-proofed messaging architecture for SMS/email providers.
12. Madison AI Sales Assistant
- Conversational SMS AI with tool calling.
- Tools: inventory search, profile updates, wishlist add, appointment scheduling.
- After-hours behavior modes (
respond, acknowledge_only, silent).
- Auto follow-up engine with configurable intervals and max attempts.
- Re-engagement logic with
escalation_status and auto re-enable.
- Personality configuration (name, persona, tagline, FAQ, promotions, custom phrases).
13. Trade-Ins
- Trade-in dialog with VIN decoder integration.
- API-based vehicle decode and option/trim lookup.
- Comparison vs. inventory and market values.
- Trade specs stored against the customer record.
14. Wishlist / Vehicle of Interest
- Add Wishlist dialog from customer dashboard.
- Vehicle of Interest links the customer dashboard to the active lead vehicle.
- Drives inventory heat-mapping and behavioral triggers.
15. Visitor Intelligence
- Page views, vehicle views, dwell time, scroll depth.
- Visitor scoring and attribution to customer records.
- Cross-join with CRM via tracking integration.
- Performance optimized with
pg_cron refreshed aggregates.
- Powers Active Shoppers widget and behavioral task creation.
16. Deal Probability
- 0–100 scale calculated from lead status, recency of contact, online activity, appointment activity, trade-in presence, and visit progression.
- Surfaced on the customer dashboard and Opportunities view.
17. Handoff to Desking
- Deals require an explicit "Desk Deal" trigger — they are not auto-created.
- Customer → Lead → Deal hierarchy with bidirectional status sync.
- Deals open in
/app/desking with full worksheet.
18. AI Copilot
- Analyst mode and Controlled Autonomy framework.
- Daily briefing with prioritized actions.
- Context-aware chat tied to the current customer / lead / deal.
- Proposes actions (create task, update lead, send message, schedule appointment, assign lead) with confirmation.
- Citations link back to CRM entities.
19. AI Trust Center & Governance
- AI audit log of every AI decision and message.
- Failure mode handling with human escalation rules.
- Configurable autonomy levels per workflow.
- Trust Center settings in Admin.
20. Multi-Tenancy & Access Control
- Hierarchy: Dealer Group → Store (UUID-based, no 5-digit IDs).
- Global store selector (
StoreContext + selectedStoreId).
user_store_assignments controls store access.
- Nine system roles (admin, GM, sales manager, salesperson, BDC, F&I manager, service manager, marketing manager, platform owner).
- Row-Level Security on all CRM tables; Platform Owner bypass policy.
- Tenancy isolation via
store_id or !inner join on customers.
21. Admin Settings (CRM-Relevant)
- Store hours by department (used by Madison after-hours logic).
- Lead routing (round-robin) configuration.
- API key management for inbound lead feeds.
- Department phone numbers (sales, service, parts, finance, main).
- AI Agent settings (Lead Auto-Responder, Appointment Assistant, Madison personality).
- Service Department toggle (hides service features per store).
- Automated user provisioning with context-aware store assignments.
22. Reporting & Audit
- Lead status audit trail.
- Sales Log operational ledger with front/back gross and commission.
- AI Interaction Logs and AI Analytics dashboard.
- Impersonation audit logs for platform admin actions.
Appendix · Data Model
Key tables backing the CRM.
| Table | Purpose |
customers | Master customer records |
leads | Lead lifecycle and assignment |
customer_activities | Activity timeline |
customer_tasks | Tasks and follow-ups |
customer_sales | Sales history |
customer_tradeins | Trade-in records |
customer_wishlist | Vehicles of interest |
appointments | Scheduled events |
showroom_visits | Live floor traffic |
demo_messages | Single source of truth for messaging |
ai_interaction_logs | AI activity analytics |
ai_follow_up_queue | Scheduled AI follow-ups |
lead_status_audit | Lead status change history |
user_store_assignments | User-to-store access mapping |
stores | Store records (UUID, includes department phones) |
store_hours | Per-department hours |