# SafeDrive Demo Script (5–7 minutes)

Live demo for **Identity Resolution** and **Customer Unification** on Face360.

## Before you start

1. Platform running: Postgres, RabbitMQ, Redis, Face360-Server API, intelligence worker, Face360-Client.
2. Seed applied: `npm run prisma:seed` in Face360-Server.
3. Login: **demo@safedrive.local** / **Admin@123** (workspace: SafeDrive Auto Insurance).
4. Confirm schema is already **published** with phone + email match rules and **customer display settings** (names in list — seed backfills this).

## Narrative (what to say)

1. **Problem:** "Insurance customers reach us on calls, chat, email, forms, and ad leads — usually as separate records."
2. **Ingest:** "We POST raw conversations to Face360. AI extracts structured fields from our schema."
3. **Identity Resolution:** "Match rules on phone and email decide if this is a new person or an existing customer."
4. **Unification:** "Repeat touchpoints update one profile — timeline, sentiment, and intent grow on a single record."

## Run the demo

### Option A — Channel simulator (recommended for executives)

1. Login: **demo@safedrive.local** / **Admin@123**
2. Open **http://localhost:3001/simulate?story=1** (not in sidebar — share link only)
3. Send Michael Torres payloads one channel at a time (CRM → website → app → call → POS → email → claims)
4. Watch extraction and identity resolution in the right panel after each send
5. Open unified Michael Torres profile after step 7

Add `&present=1` for kiosk mode (hides sidebar).

### Option B — Bulk load (presenter)

On `/demo`, click **Load demo interactions** — or use PowerShell:

```powershell
cd test-data/car-insurance-mix
$env:FACE360_TOKEN = "<paste JWT after login>"
.\ingest-all.ps1
```

Optional delay between payloads for visual timeline spread:

```powershell
$env:INGEST_DELAY_SEC = "2"
```

## What to show (in order)

| Step | Screen | What to highlight |
|------|--------|-------------------|
| 1 | `/simulate?story=1` | Compose raw channel payloads — no Postman |
| 2 | Simulator right panel | AI extraction + CREATED / UPDATED after each send |
| 3 | `/interactions` | Watch interactions move from RECEIVED → COMPLETED |
| 3 | `/customers` | ~10 rows with **real names** (Michael Torres, …) plus email/phone — not 20 numeric IDs |
| 4 | Michael Torres profile | 4 timeline events, unified badges |
| 5 | `/dashboard` | Identity Resolution Outcomes — UPDATED > CREATED |
| 6 | Interaction detail | "Unified existing customer" badge on repeat ingest |

## Expected results

- **20** interactions ingested
- **10** unified customer profiles with human-readable names in the customer list
- **Michael Torres:** 4 touchpoints (CALL, CHAT, EMAIL, CALL)
- Dashboard resolution chart: mostly **UPDATED** for repeat customers, **CREATED** for first-time leads

## Troubleshooting

| Issue | Fix |
|-------|-----|
| Ingest 404 / auth error | Check JWT and `X-Tenant-Id` (script resolves safedrive-demo slug) |
| No customers after 2 min | Intelligence worker not running or missing API keys |
| Duplicate customers | Match rules not published; verify seed or schema publish wizard |
| Customers show long numeric IDs | Run `npm run prisma:seed` or `npm run prisma:backfill-display-config` in Face360-Server |
| `ACTIVE_SCHEMA_NOT_FOUND` | Re-run seed or publish schema manually |

## Credentials reference

| Account | Password | Workspace |
|---------|----------|-----------|
| demo@safedrive.local | Admin@123 | safedrive-demo |
| owner@demo.local | Admin@123 | demo-workspace (onboarding flow, not this demo) |
