# Seed request — demo tenant, for a live driver-app run

> **FOLLOW-UP (2026-08-19, after your seed landed — thank you!):** the seeded jobs come back with
> **empty `customerPhone` and `customerEmail`** (verified on `/jobs.php` for driver1: jobs 26/27/29
> all have `"customerPhone":"", "customerEmail":""`). The driver's **Call customer** / email actions
> need these, so the row just hides right now. `dispJobToWire` already emits both keys — this is a
> **data fill on the seeded rows**, not a code change. Please populate `customer_phone` +
> `customer_email` on `disp_jobs` (and make sure the dispatcher create flow persists what's typed).
> Suggested values for the current seed:
>
> | job | customer | customer_phone | customer_email |
> |---|---|---|---|
> | 26 | Jane Smith | +17705550101 | jane.smith@example.com |
> | 29 | Auburn Ave Supply | +14045550132 | orders@auburnavesupply.com |
> | 27 | Southside Auto | +14045550177 | parts@southsideauto.com |
> | (driver2) | Ana Flores's stop(s) | any valid US number | any address |
>
> Going forward, every job should carry a phone (email optional) — a driver who can't reach the
> customer at the door is stuck.

---


**From:** Delivery_App · **To:** Pranav
**Re:** your doc's two setup gaps ("no depot", "one active driver"). The app is now wired to your
real `dispatch_dea` endpoints and verified reachable (login.php 400/401, jobs.php 401). To do a
real logged-in run we need a little seed data on the demo tenant.

**Tenant:** `tenant_polestardemo_69a8b91ec5d50` · **Date to seed:** **2026-08-19 (today)** so the app's
default `/jobs.php?date=<today>` view returns them (a copy on 2026-08-20 too would be handy).

Please seed via **your own `api/jobs/create.php` + settings**, not raw INSERTs — that way HERE
geocoding fills `lat/lng`, `stop_order` gets computed, and it exercises the real path.

---

## 1. Depot (unblocks stopOrder + suggestions — fixes `NO_DEPOT`)
Set `disp_settings.depot_lat/lng` for the tenant to your demo dealership. If there isn't one, use
Midtown Atlanta so the seeded stops route sensibly:
```
depot_lat = 33.7701
depot_lng = -84.3876   (approx 1000 Peachtree St NE)
```

## 2. Drivers (cipher_central.ps_drivers, active=1, schema_name = the demo tenant)
Two is plenty. Please set a known password so we can log in (bcrypt or cleartext — your login.php
upgrades cleartext on first use):

| driverName | username | password | notes |
|---|---|---|---|
| Mike Ruiz  | `demo.driver1` | `Delivery@123` | give this one the jobs below |
| Ana Flores | `demo.driver2` | `Delivery@123` | second driver, 1 job, to show suggestions later |

Stamp `user_id` / `tenant_id` / `schema_name` as your create-driver path already does (needed for
the WS nudge). Add whatever dispatch profile fields your suggestion engine wants (vehicle,
capacity, shift) so nothing errors.

## 3. Jobs — 4 stops for `demo.driver1`, 1 for `demo.driver2`, dated 2026-08-19
Real Atlanta addresses so geocoding + road distances are real, mixed `service_level`
(regular/expedited/overnight) and units. Assign each to the driver (create the
`disp_job_assignments` row, `is_current=1`), status `assigned`:

| # | assign to | customer_name | address | service_level | units | weight_lb |
|---|---|---|---|---|---|---|
| 1 | demo.driver1 | Jane Smith | 191 Peachtree St NE, Atlanta, GA 30303 | expedited | 2 | — |
| 2 | demo.driver1 | Acme Logistics | 675 Ponce De Leon Ave NE, Atlanta, GA 30308 | regular | 1 | 40 |
| 3 | demo.driver1 | Ricardo Diaz | 30 Ivan Allen Jr Blvd NW, Atlanta, GA 30308 | overnight | 1 | — |
| 4 | demo.driver1 | Southside Auto | 455 Memorial Dr SE, Atlanta, GA 30312 | regular | 3 | 120 |
| 5 | demo.driver2 | Dana Wright | 720 Ralph McGill Blvd NE, Atlanta, GA 30312 | expedited | 1 | — |

A couple with `instructions` (e.g. "Front desk, ask for Jane") and a phone number would make the
detail screen look real. Optionally set a `loadClass` on one (e.g. "Refrigerated") to show the
new field.

---

## What we need back
1. Confirm the two usernames + passwords work (or the ones you actually used).
2. Confirm `stop_order` is populating on `/jobs.php` (depot set).
3. That's it — we flip the app to live (`USE_MOCK_API=false`), log in as `demo.driver1`, and should
   see the 4-stop route from real data with real HERE distances, then walk Accept → Start →
   Navigate → Mark delivered and watch status flow back to your calendar.

Anything simpler on your side, do that instead — this is just enough data for one honest run.
```
Live base the app points at:
https://staging2-dealerpro.matrackinc.com/DealeProDispatchModuleFeature/app/modules/dispatch_dea/api/driver
```

---

## FOLLOW-UP 2 (2026-08-19) — refresh today + add future-dated jobs

Testing has consumed/mutated the original today jobs (some accepted/delivered), and the app now has
an **Upcoming** view (next 7 days) that's empty because nothing is seeded past today. Please add the
following for **`demo.driver1`**, all `status = assigned`, geocoded via your create flow, with phone
(so the Call-customer row + SMS have a target):

### Today — 2026-08-19 (feeds "New jobs" / Today's route)
| customer_name | address | service_level | units | window | phone |
|---|---|---|---|---|---|
| Kayla Moore | 265 Peachtree St NE, Atlanta, GA 30303 | expedited | 1 | 2:00 PM – 4:00 PM | +14045550188 |
| Northside Parts | 1544 Piedmont Ave NE, Atlanta, GA 30324 | regular | 2 | 3:00 PM – 5:00 PM | +14045550190 |

### Tomorrow — 2026-08-20 (feeds "Upcoming")
| customer_name | address | service_level | units | window | phone |
|---|---|---|---|---|---|
| Grant Park Cafe | 550 Cherokee Ave SE, Atlanta, GA 30312 | regular | 1 | 9:00 AM – 11:00 AM | +14045550201 |
| Emory Clinic | 1365 Clifton Rd NE, Atlanta, GA 30322 | overnight | 3 | 1:00 PM – 3:00 PM | +14045550202 |

### Thu — 2026-08-21 (feeds "Upcoming")
| customer_name | address | service_level | units | window | phone |
|---|---|---|---|---|---|
| West End Mall | 850 Oak St SW, Atlanta, GA 30310 | expedited | 1 | 10:00 AM – 12:00 PM | +14045550203 |

All assigned to `demo.driver1` (create the `disp_job_assignments` row, `is_current=1`, status assigned).
That gives us: fresh offers in **New jobs** today, and **Upcoming** showing Tomorrow (2) + Thu (1).

---

## FOLLOW-UP 3 (2026-08-19) — pre-ACCEPTED today jobs (so "Your route" + map + nav demo)

Everything above is `status = assigned` (offers, land in **New jobs**). But **"Your route"**, the
**route map**, and **in-app navigation** only show **accepted** jobs — so with nothing accepted they're
empty until we tap Accept. Please also seed a few **already-accepted** today jobs so the route demos
immediately. Same tenant, **`demo.driver1`**, **date 2026-08-19**, **`status = accepted`**
(set `driver_accept_time`/`assign_state` as your accept.php does; `is_current=1`), geocoded, with phone:

### Today — 2026-08-19, status **accepted** (feeds "Your route" + map + navigation)
| customer_name | address | service_level | units | window | phone |
|---|---|---|---|---|---|
| Piedmont Office Supply | 999 Peachtree St NE, Atlanta, GA 30309 | regular | 1 | 11:00 AM – 1:00 PM | +14045550210 |
| Midtown Deli | 1050 Crescent Ave NE, Atlanta, GA 30309 | expedited | 2 | 12:00 PM – 2:00 PM | +14045550211 |
| Georgia Tech Bookstore | 48 5th St NW, Atlanta, GA 30308 | regular | 1 | 1:00 PM – 3:00 PM | +14045550212 |

With these three accepted, `demo.driver1` on login shows a **3-stop "Your route"** with real
`stop_order`, the **route map** draws them, and **Start navigation** returns HERE turn-by-turn — no
manual accepting needed to demo. (The `assigned` jobs from FOLLOW-UP 2 still show separately under
**New jobs**.)
