MDA-10 — Delegate app — tour closing, reports & performance
Closing preview with blocking items, end-of-day comment, final report, performance widgets, reports history.
| Field | Details |
|---|---|
| Task code | MDA-10 |
| Phase | P1 — V1 build & integration |
| Product scope | V1 |
| Status | Planned |
| Start | Sun 13 Dec 2026 |
| Due | Mon 14 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 |
| Unblocks | — |
| Milestones | — |
Summary
Closing preview with blocking items, end-of-day comment, final report, performance widgets, reports history.
Description
Closing the tour produces the delegate's day result and the report managers rely on; it is definitive unless the back-office reopens it, so it requires every stop to be done or justified and every action synced (FLD-12, SYN-06). Scope: tour closing and results DA-20 (closing preview with blocking items resolved inline, end-of-day comment, close, final report) and reports and performance DA-21 (history of visit and tour reports, own performance over periods, FLD-19). The app adds a local UNSYNCED_DATA blocking item while the outbox holds items for this tour and forces a sync before calling delegate.tours.close; a server 409 TOUR_CLOSING_BLOCKED with details.blockingItems is rendered the same way. It needs delegate.tours.closingPreview|close and delegate.reports|performance (SRV-21) and Akram's DES-14 frames. Closing stops MDA-12 sampling.
Subtasks
| # | Subtask | Owner |
|---|---|---|
| 1 | TourClosingScreen DA-20 on GET /delegate/tours/{id}/closing-preview: day summary (visits done, not done, remaining; sign-ups, installs, first orders), objectives and conversion | Imad |
| 2 | Blocking items list: unvisited stops without reason (inline « Marquer non réalisée » opening DA-11) and the local UNSYNCED_DATA item with « Synchroniser maintenant » | Imad |
| 3 | End-of-day comment and « Clôturer la tournée » → POST /delegate/tours/{id}/close with an Idempotency-Key, enabled only when online and the outbox is empty for this tour | Imad |
| 4 | TOUR_CLOSING_BLOCKED handling with details.blockingItems mapped to the same list | Imad |
| 5 | Final report view from the close response (« Tournée clôturée à 17:42 »), read-only afterwards; sampling stopped and home updated | Imad |
| 6 | ReportsScreen DA-21: GET /delegate/reports history of visit reports and tour reports with filters by period | Imad |
| 7 | Performance widgets on GET /delegate/performance?period=: visits, sign-ups, installs, first orders, revenue, km, conversion, with simple charts (fl_chart) and comparison to objectives | Imad |
Deliverables
- apps/delegate/lib/src/features/closing/ (DA-20)
- apps/delegate/lib/src/features/reports/ (DA-21)
- Widget tests of closing with and without blocking items
Acceptance criteria
- « Clôturer la tournée » stays disabled while any stop lacks a status or reason, or while any item of the tour is unsynced (FLD-12, SYN-06)
- Each blocking item can be resolved from the closing screen without navigating away
- After closing, the tour is read-only, location sampling has stopped and the final report is shown and listed in DA-21
- A retried close does not close twice or produce two reports (Idempotency-Key)
- Performance figures for a period match the back-office for the same delegate (FLD-19)
Requirements covered
| Requirement | Title | Release |
|---|---|---|
| FLD-12 | Tour closing: day summary, comment, objectives and conversion, final report; requires reasons and synced data; definitive unless reopened | V1 |
| FLD-19 | Delegate reports history and own performance over periods | V1 |
| SYN-06 | Visible sync state: synced, pending, error | V1 |
Screens
API surface
| Endpoint group | Operations |
|---|---|
| Tours & visits | 19 |
| Delegate home, profile, objectives & reports | 6 |
Test measures
- Widget tests of DA-20 for each blocking-item type and the all-clear state
- Integration test: complete tour with one not-done stop offline → reconnect → close → report
- Unit test of the local UNSYNCED_DATA guard against the outbox
Risks
- Delegates finish in a dead zone and cannot close — closing can wait; home shows « Clôture en attente de connexion » and a reminder push the next morning if still open
KPI
- Delivered by Mon 14 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-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.
MDA-11 — Delegate app — messages, settings & sync centre
Announcements and notifications, settings (language, notifications, location transparency), sync centre with pending/error items and retry.