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.
| Field | Details |
|---|---|
| Task code | MDA-03 |
| Phase | P1 — V1 build & integration |
| Product scope | V1 |
| Status | Planned |
| Start | Mon 30 Nov 2026 |
| Due | Tue 1 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-12, MOB-10 |
| Unblocks | — |
| Milestones | — |
Summary
Full map with route and next destination, ETA/distance, external GPS launch, 'Arrived' check-in with tolerance feedback.
Description
Delegates navigate to each point of sale and confirm arrival on site; the check-in is what proves a visit happened, so it is checked against GPS tolerance (150 m, accuracy ≤ 100 m) and must still work offline (FLD-07, GEO-03). Scope: full map and navigation DA-08 with current position, ordered markers and route, the next-destination card with distance and ETA, launch of external GPS navigation, and the « Arrivé » check-in with tolerance feedback. It uses MOB-10 (fix, tolerance, external navigation) and posts delegate.visits.arrive through the outbox; Google Maps for maps and, online, the next leg's ETA (INT-01). It needs the field settings and arrive semantics from Anis (SRV-21: GPS_OUT_OF_TOLERANCE, GPS_ACCURACY_TOO_LOW, GPS_MOCK_LOCATION, TOUR_NOT_IN_PROGRESS, VISIT_IN_PROGRESS, justified out-of-tolerance setting) and Akram's DES-12 map frames. After check-in the delegate lands on the visit detail of MDA-05.
Subtasks
| # | Subtask | Owner |
|---|---|---|
| 1 | MapNavigationScreen DA-08: google_maps_flutter with my-location layer, numbered markers by VisitStatus, polyline joining remaining stops in tour order | Imad |
| 2 | NextDestinationCard: store, address, straight-line distance offline; online ETA and road distance for the next leg (Directions/Routes API, cached per leg) | Imad |
| 3 | « Itinéraire » via ExternalNavigation (Google Maps / Waze) and « Appeler » via url_launcher tel: | Imad |
| 4 | ArrivalCheckIn: getFix with live accuracy display → local ToleranceChecker pre-check → outbox delegate.visits.arrive {lat, lng, accuracy, occurredAt, justification?} | Imad |
| 5 | Tolerance feedback: within tolerance → « Arrivée confirmée »; out of tolerance → « Vous êtes à 320 m du point de vente (tolérance 150 m) » with retry, or a justification sheet when out-of-tolerance check-in is allowed | Imad |
| 6 | Server verdict reconciliation: online result (distance, withinTolerance) shown at once; offline check-ins marked « à confirmer » and flagged in the sync centre if the server answers GPS_OUT_OF_TOLERANCE or GPS_MOCK_LOCATION | Imad |
| 7 | Guards: TOUR_NOT_IN_PROGRESS → « Démarrez la tournée » action; VISIT_IN_PROGRESS → link to the open visit; point of sale without coordinates → check-in records a candidate position | Imad |
| 8 | Battery-aware map: lite mode for the mini-map, my-location updates paused when the screen is off | Imad |
Deliverables
- apps/delegate/lib/src/features/map/ (DA-08, next destination, check-in)
- Outbox mutation type delegate.visits.arrive with its local pre-check
- Field-test checklist for check-in accuracy used in MOB-13
Acceptance criteria
- Checking in 140 m from the store with accuracy 30 m succeeds; at 160 m it is refused with the distance shown, using the configured tolerance (FLD-07)
- A fix with accuracy above 100 m is not sent; the user is asked to retry (GPS_ACCURACY_TOO_LOW)
- Offline check-ins are recorded with their occurredAt and position and replayed; a server refusal appears in the sync centre with its code
- « Itinéraire » opens external navigation to the right coordinates (FLD-07)
- Map markers and order match the tour programme list (FLD-06)
Requirements covered
| Requirement | Title | Release |
|---|---|---|
| FLD-07 | Map and navigation: position, next destination with ETA and distance, external GPS navigation, arrival confirmation within tolerance | V1 |
| GEO-03 | GPS capture standard (lat/lng, accuracy, timestamp) and distance computation | V1 |
Screens
| Screen | Name | App |
|---|---|---|
| DA-08 | Map & navigation | DA |
API surface
| Endpoint group | Operations |
|---|---|
| Tours & visits | 19 |
Test measures
- Unit tests of the check-in decision table (tolerance, accuracy, mock, tour state)
- Widget tests of the tolerance feedback states
- Field test at real points of sale (part of MOB-13) recording distance and accuracy per check-in
Risks
- Routing API cost and offline absence — ETA only for the next leg when online, straight-line distance otherwise
- Wrong store coordinates make honest delegates fail check-in — candidate position capture and back-office validation path, plus the justified out-of-tolerance setting
KPI
- Delivered by Tue 1 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-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.
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.