MDA-02 — Delegate app — tour programme & calendar
Tour programme with tabs, mini-map with the same order as the list, start/suspend/resume, reorder when allowed, add an unplanned visit, calendar and history.
| Field | Details |
|---|---|
| Task code | MDA-02 |
| Phase | P1 — V1 build & integration |
| Product scope | V1 |
| Status | Planned |
| Start | Sun 29 Nov 2026 |
| Due | Mon 30 Nov 2026 |
| Responsible | Imad — Mobile developer (Flutter) |
| Co-responsible | — |
| Effort | 1.5 person-day(s) planned · 5 from scratch · size S |
| Area · app | Delegate app · mobile |
| Depends on | DES-12 |
| Unblocks | — |
| Milestones | — |
Summary
Tour programme with tabs, mini-map with the same order as the list, start/suspend/resume, reorder when allowed, add an unplanned visit, calendar and history.
Description
The tour programme is the delegate's working list: list and map must show the same visits in the same order (FLD-06), and the tour lifecycle (start, suspend, resume) must work offline (FLD-04, SYN-04). Scope: tour programme DA-06 with tabs, ordered visit list, mini-map with numbered markers, start/suspend/resume, reorder when the tour's order is « recommandé », adding an unplanned visit, and the tours calendar and history DA-07. All mutations go through the MOB-09 outbox with occurredAt; starting the tour also starts MDA-12 sampling. It needs delegate.tours.* (SRV-21) and the TOUR_SUSPEND_REASON list, plus Akram's DES-12 frames. MDA-03 opens the map from here and MDA-05 opens each visit.
Subtasks
| # | Subtask | Owner |
|---|---|---|
| 1 | TourProgrammeScreen DA-06 reading the drift tours/visits snapshot from GET /delegate/tours/today; tabs « À visiter », « Visités », « Non réalisées »; filters priority (« Prioritaire ») and late (« En retard », derived from the time slot in Africa/Algiers) | Imad |
| 2 | VisitCard rows: order number, store, commune, time slot, VisitStatus pill, distance from the current fix | Imad |
| 3 | Mini-map (hoco_maps) with numbered markers in the list order; tapping a marker scrolls to its row and vice versa (FLD-06) | Imad |
| 4 | Tour actions through the outbox: delegate.tours.start (position + occurredAt; TOUR_NOT_TODAY, TOUR_ALREADY_IN_PROGRESS), suspend with a TOUR_SUSPEND_REASON (blocked by VISIT_IN_PROGRESS), resume | Imad |
| 5 | Drag-and-drop reorder of remaining visits when orderingMode is RECOMMENDED → PUT /delegate/tours/{id}/visit-order; « Ordre imposé » lock when IMPOSED (TOUR_ORDER_IMPOSED) | Imad |
| 6 | Add unplanned visit: pick a point of sale from the local resellers table or a newly created prospect → delegate.tours.addVisit with a client UUIDv7, offline | Imad |
| 7 | ToursCalendarScreen DA-07: GET /delegate/tours for a week or month (calendar view), status pills, past tour detail (delegate.tours.get) read-only with its report | Imad |
| 8 | Hooks to start MDA-12 sampling on IN_PROGRESS and stop it on SUSPENDED or COMPLETED | Imad |
Deliverables
- apps/delegate/lib/src/features/tour/ (programme, calendar, history)
- Outbox mutation types delegate.tours.start, delegate.tours.suspend, delegate.tours.resume, delegate.tours.reorder, delegate.tours.addVisit
- Widget and integration tests of the tour lifecycle offline
Acceptance criteria
- List and mini-map always show the same visits in the same order, including after a reorder (FLD-06)
- Start, suspend and resume work in airplane mode and replay in order with their original times (FLD-04, SYN-04)
- Reorder is impossible on an imposed tour and allowed on a recommended one
- An unplanned visit added offline appears immediately and gets its VIS- number after sync
- Suspension is refused while a visit is checked in or in progress (VISIT_IN_PROGRESS)
- The calendar shows past tours with their statuses and opens their reports (FLD-19)
Requirements covered
| Requirement | Title | Release |
|---|---|---|
| FLD-03 | Tour planning: daily, weekly or monthly; ordered stops (imposed or recommended); priorities and time slots | V1 |
| FLD-04 | Tour lifecycle (planned, to start, in progress, suspended, completed, cancelled); only the assigned delegate starts it | V1 |
| FLD-06 | Tour programme: list and map show the same visits in the same order; filters, delays, priorities | V1 |
| FLD-19 | Delegate reports history and own performance over periods | V1 |
Screens
API surface
| Endpoint group | Operations |
|---|---|
| Tours & visits | 19 |
Test measures
- Widget tests of the tabs, late derivation and reorder lock
- integration_test: start tour offline → add unplanned visit → reconnect → server state matches
- Unit test that list order and marker order come from the same provider
Risks
- Reorder conflicts when the back-office edits stops during the day — server copy wins on delta pull and the delegate is told « La tournée a été modifiée par le bureau »
KPI
- Delivered by Mon 30 Nov 2026 within 1.5 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-01 — Delegate app — home, profile, zone, objectives
Home with today's tour and counters, objectives and conversion widgets, profile hub, my zone, objectives 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.