HOCO B2B
Team tasksImad

MDA-10 — Delegate app — tour closing, reports & performance

Closing preview with blocking items, end-of-day comment, final report, performance widgets, reports history.

FieldDetails
Task codeMDA-10
PhaseP1 — V1 build & integration
Product scopeV1
StatusPlanned
StartSun 13 Dec 2026
DueMon 14 Dec 2026
ResponsibleImad — Mobile developer (Flutter)
Co-responsible—
Effort1.25 person-day(s) planned · 4 from scratch · size S
Area · appDelegate app · mobile
Depends onDES-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

#SubtaskOwner
1TourClosingScreen DA-20 on GET /delegate/tours/{id}/closing-preview: day summary (visits done, not done, remaining; sign-ups, installs, first orders), objectives and conversionImad
2Blocking 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
3End-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 tourImad
4TOUR_CLOSING_BLOCKED handling with details.blockingItems mapped to the same listImad
5Final report view from the close response (« Tournée clôturée à 17:42 »), read-only afterwards; sampling stopped and home updatedImad
6ReportsScreen DA-21: GET /delegate/reports history of visit reports and tour reports with filters by periodImad
7Performance widgets on GET /delegate/performance?period=: visits, sign-ups, installs, first orders, revenue, km, conversion, with simple charts (fl_chart) and comparison to objectivesImad

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

RequirementTitleRelease
FLD-12Tour closing: day summary, comment, objectives and conversion, final report; requires reasons and synced data; definitive unless reopenedV1
FLD-19Delegate reports history and own performance over periodsV1
SYN-06Visible sync state: synced, pending, errorV1

Screens

ScreenNameApp
DA-20Tour closing & resultsDA
DA-21Reports & performanceDA

API surface

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.

On this page