MDA-04 — Delegate app — point-of-sale sheet & prospects list
POS sheet (contact actions, history, tasks, photos) and the prospects/resellers list with search, status filters and distance sort, list/map toggle.
| Field | Details |
|---|---|
| Task code | MDA-04 |
| Phase | P1 — V1 build & integration |
| Product scope | V1 |
| Status | Planned |
| Start | Tue 1 Dec 2026 |
| Due | Wed 2 Dec 2026 |
| Responsible | Imad — Mobile developer (Flutter) |
| Co-responsible | — |
| Effort | 1.25 person-day(s) planned · 4 from scratch · size S |
| Area · app | Delegate app · mobile |
| Depends on | DES-13 |
| Unblocks | — |
| Milestones | — |
Summary
POS sheet (contact actions, history, tasks, photos) and the prospects/resellers list with search, status filters and distance sort, list/map toggle.
Description
Before and during a visit the delegate needs everything about a point of sale on one screen, and between visits a list of prospects and resellers in their zone they can search, filter and sort by distance (CRM-01, CRM-04, CRM-07). Scope: point-of-sale sheet DA-09 (details, status, contact actions, interaction history, open tasks, photos, recent visits and orders summary, notes and call logs) and prospects & resellers list DA-13 with search, status filters, distance sort and a list/map toggle. Data is scoped to the delegate's zones and assigned resellers (ACL-03) and cached in hoco_offline so the sheet opens offline; notes and call logs are client-id outbox mutations. It needs delegate.resellers.list|get|addNote (SRV-14) and Akram's DES-12/DES-13 frames. The sheet is the hub that opens MDA-07 (edit), MDA-08 (invite), MDA-09 (first order) and MDA-06 (follow-ups).
Subtasks
| # | Subtask | Owner |
|---|---|---|
| 1 | PointOfSaleSheet DA-09 on GET /delegate/resellers/{id} with drift fallback: store, owner, REV number, ResellerStatus pill, address, GPS, potential, assigned delegate | Imad |
| 2 | Contact actions: « Appeler » (tel:), « WhatsApp » (wa.me), « SMS », « Itinéraire » (ExternalNavigation) | Imad |
| 3 | InteractionTimeline (CRM-07): visits, calls, notes, orders, payments, claims and status changes with InteractionType icons; orders summary without purchase prices | Imad |
| 4 | Quick note and call log → delegate.resellers.addNote (types NOTE / CALL) with client UUIDv7 and occurredAt through the outbox | Imad |
| 5 | Open tasks and photos sections (PrivateImage gallery) linking to DA-19 and MDA-07 | Imad |
| 6 | Action bar: « Modifier », « Inviter », « Aide à la 1ère commande », « Ajouter à la tournée » (unplanned visit) | Imad |
| 7 | ProspectsScreen DA-13: GET /delegate/resellers online (search, status filter, cursor) and local drift search offline; status chips for the 10 ResellerStatus values (« Nouveau prospect », « À contacter », « Intéressé »…) | Imad |
| 8 | Distance sort from the current fix (local haversine) and list/map toggle with clustered markers coloured by status | Imad |
| 9 | Out-of-scope handling: 404 / OUT_OF_SCOPE records removed from the local cache with « Ce point de vente n'est plus dans votre zone » | Imad |
Deliverables
- apps/delegate/lib/src/features/resellers/ (POS sheet, prospects list, map view)
- Outbox mutation type delegate.resellers.addNote
- Drift DAO queries for local search and distance sort
Acceptance criteria
- The sheet opens offline for any reseller in the delegate's cached scope with its last known history (SYN-04)
- Only resellers of the delegate's zones and assignments are listed; nothing else is reachable by search (ACL-03)
- Status filters and distance sort combine and return within 1 s on 2 000 local records
- A note added offline appears at the top of the timeline at once and on the back-office after sync (CRM-07)
- List and map toggle show the same filtered set
Requirements covered
| Requirement | Title | Release |
|---|---|---|
| CRM-01 | Reseller/prospect record with the minimum data set (store, owner, phone, WhatsApp, email, wilaya, commune, address, GPS, type, potential, delegate, photos, documents, status) | V1 |
| CRM-04 | Reseller lifecycle (10 statuses) with automatic and manual transitions and full history | V1 |
| CRM-07 | Unified interaction history: calls, visits, notes, orders, payments, claims | V1 |
| ACL-03 | Data scope: delegates see only their zones, tours, assigned resellers and own performance; resellers only their own data | V1 |
Screens
API surface
| Endpoint group | Operations |
|---|---|
| Prospects, points of sale, follow-ups & invitations | 13 |
Test measures
- Unit tests of local search and distance sort on a seeded drift database of 2 000 resellers
- Widget tests of the timeline per InteractionType and of status chips
- Integration test: offline note → reconnect → server timeline contains it once
Risks
- Large zones make the cached scope heavy — sync only assigned resellers plus prospects of the delegate's communes, with paging in sync.delta
KPI
- Delivered by Wed 2 Dec 2026 within 1.25 person-day(s).
- Every acceptance criterion above demonstrated before hand-off; linked requirements' acceptance criteria pass.
- Zero open critical defects, permission gaps or data-integrity regressions at sign-off.
Generated from content/plan/tasks.json by scripts/generate-team-tasks.mjs. Dates are computed by the scheduler (Sunday–Thursday weeks, holidays excluded) — change the plan, not this page.
MDA-03 — Delegate app — map, navigation & arrival check-in
Full map with route and next destination, ETA/distance, external GPS launch, 'Arrived' check-in with tolerance feedback.
MDA-05 — Delegate app — visit flow
Visit detail with GPS validation, start/end, live duration, checklist, quick note, photos, call; not-done reason sheet. Works offline.