MDA-09 — Delegate app — first-order assistance & orders
4-step assisted order reusing the catalog/cart widgets, send for confirmation, status of assisted orders, read-only orders of my resellers.
| Field | Details |
|---|---|
| Task code | MDA-09 |
| Phase | P1 — V1 build & integration |
| Product scope | V1 |
| Status | Planned |
| Start | Wed 9 Dec 2026 |
| Due | Thu 10 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-14, MRA-04 |
| Unblocks | — |
| Milestones | — |
Summary
4-step assisted order reusing the catalog/cart widgets, send for confirmation, status of assisted orders, read-only orders of my resellers.
Description
Delegates help a prospect place their first order on the spot; the order must follow the same pricing and controls as a reseller order and then be confirmed by the reseller in the app or validated by the administration (ORD-02, ORD-08), and first orders are attributed to the delegate (ORD-09). Scope: first-order assistance DA-17 in four steps (reseller, products, delivery and payment, review and send) reusing the hoco_catalog grid, filters, cart lines, issues and totals from MRA-02/MRA-04, plus DA-18 with assisted orders and their confirmation status and the read-only orders of the delegate's resellers. Drafts live on the server (delegate.assisted.create|update|submit|discard), so this flow needs a connection; the selection is kept locally if the network drops. Even after the reseller confirms, the order waits for back-office confirmation (ORD-14). It needs SRV-16 assisted orders, catalog prices for the selected reseller's customer type, and Akram's DES-14 frames.
Subtasks
| # | Subtask | Owner |
|---|---|---|
| 1 | Step 1 — reseller: pick from the delegate's scope (or come from the POS sheet); account status shown (pending accounts produce a PENDING order for RESELLER_NOT_VALIDATED); ASSISTED_ORDER_ALREADY_PENDING handled | Imad |
| 2 | POST /delegate/assisted-orders to open a priced draft for that reseller; draft id kept locally to resume after interruption | Imad |
| 3 | Step 2 — products: hoco_catalog ProductGrid, search, scanner and FilterSheet with the selected reseller's customer-type prices; add/update lines with PATCH /delegate/assisted-orders/{id} returning re-priced totals and issues | Imad |
| 4 | Step 3 — address, payment method and note from the reseller's options; IssueBanner and TotalsBlock reused (ORDER_MIN_AMOUNT_NOT_MET, STOCK_INSUFFICIENT, QUANTITY_NOT_ALLOWED) | Imad |
| 5 | Step 4 — review and send: « Envoyer au revendeur pour confirmation » (confirmation in the reseller app within 72 h) or « Faire valider par l'administration » with a mandatory note on how the reseller agreed → POST /delegate/assisted-orders/{id}/submit with an Idempotency-Key | Imad |
| 6 | Discard draft (DELETE /delegate/assisted-orders/{id}) and resume-draft banner on the POS sheet | Imad |
| 7 | Connectivity guard: steps disabled offline with « Connexion requise pour préparer la commande », local selection preserved | Imad |
| 8 | AssistedOrdersScreen DA-18: AssistedConfirmation pills (« En attente du revendeur », « Confirmée par le revendeur », « Validée par l'administration », « Refusée par le revendeur », « Expirée »), « 1ère commande » badge, then OrderStatus once confirmed | Imad |
| 9 | Orders of my resellers (GET /delegate/orders, GET /delegate/orders/{id}) read-only, no purchase prices, filters by status and reseller | Imad |
Deliverables
- apps/delegate/lib/src/features/assisted_order/ (DA-17 stepper)
- apps/delegate/lib/src/features/orders/ (DA-18)
- hoco_catalog host adapter mapping add-to-cart to assisted-order draft updates
Acceptance criteria
- Prices in the assisted order are the selected reseller's customer-type prices and match what the reseller sees when confirming (PRC-05, ORD-08)
- The same cart rules as the reseller app block submission (minimum amount, quantities, stock) (ORD-02)
- After « Envoyer au revendeur », the reseller receives the confirmation request and the order shows « En attente du revendeur » in DA-18; expiry after 72 h shows « Expirée »
- A confirmed assisted order appears as « Envoyée », awaiting back-office confirmation, never auto-validated (ORD-14)
- The first order of a reseller is flagged « 1ère commande » and counted for the delegate (ORD-09)
- Orders of my resellers never show purchase prices and only include resellers in scope (ACL-03)
Requirements covered
| Requirement | Title | Release |
|---|---|---|
| ORD-02 | Cart rules: minimum amount, minimum quantities and steps, maximum per order, stock and credit checks | V1 |
| ORD-08 | Assisted orders prepared by a delegate, confirmed by the reseller or validated by the administration | V1 |
| ORD-09 | First order flagged and attributed to the reseller and the source delegate in reports | V1 |
Screens
API surface
| Endpoint group | Operations |
|---|---|
| Assisted orders | 6 |
| Catalog & favorites | 12 |
Test measures
- integration_test: POS sheet → assisted order 4 steps → submit → reseller app confirms (two-app flow on staging)
- Widget tests of each step's validation and of the offline guard
- Unit tests of the hoco_catalog host adapter (reseller cart vs assisted draft)
Risks
- Catalog prices for 'another reseller's' customer type need a contract parameter (e.g. resellerId on catalog calls or prices from the draft) — agree it with Anis during SRV-03
- Shared hoco_catalog widgets drift between apps — keep host-specific behaviour behind the adapter and cover both hosts in widget tests
KPI
- Delivered by Thu 10 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-08 — Delegate app — invitation (QR, share, tracking)
QR code, link copy, WhatsApp/SMS share intents, referral code, activation steps refreshed live.
MDA-10 — Delegate app — tour closing, reports & performance
Closing preview with blocking items, end-of-day comment, final report, performance widgets, reports history.