WEB-04 — Reseller web — orders & finance
Orders list and detail with live tracking (SSE), assisted-order confirmation, returns, documents; invoices, payments, declarations and credit.
| Field | Details |
|---|---|
| Task code | WEB-04 |
| Phase | P1 — V1 build & integration |
| Product scope | V1 |
| Status | Planned |
| Start | Tue 1 Dec 2026 |
| Due | Wed 2 Dec 2026 |
| Responsible | Anis — Full-stack developer |
| Co-responsible | — |
| Effort | 0.75 person-day(s) planned · 4 from scratch · size S |
| Area · app | Reseller web · web |
| Depends on | WEB-03 |
| Unblocks | WEB-05 |
| Milestones | — |
Summary
Orders list and detail with live tracking (SSE), assisted-order confirmation, returns, documents; invoices, payments, declarations and credit.
Description
Resellers follow their orders and finances on the web with the same live status as in the app (cahier §5.4, §4.7; ORD-06…ORD-08, ORD-13, ORD-15, FIN-01, FIN-03, FIN-10). This task delivers the orders list with counters and filters (RW-08), the order detail with a live status timeline over SSE (events.stream), cancellation while allowed, reorder, invoice and delivery-note downloads, assisted-order confirmation or rejection before expiry, and the V1 return flow — request a return on a delivered order (lines, quantities, reason, photos, within the window) and follow its status (RW-09); and the finance pages (RW-13): balance and available credit, invoices with PDFs, payments, and payment declarations with proof upload. Out of scope: after-sales claims and support (WEB-05).
Subtasks
| # | Subtask | Owner |
|---|---|---|
| 1 | RW-08 orders list: counters by status (orders.summary), status filter, search by number, cursor pagination | Anis |
| 2 | SSE client for events.stream (EventSource with credentials, Last-Event-ID, backoff, refetch on reconnect, pause when the tab is hidden) | Anis |
| 3 | RW-09 order detail: lines, totals, status timeline updated live, delivery info and tracking, documents (invoice, BL) | Anis |
| 4 | Actions: « Annuler » while SUBMITTED/PENDING with reason, « Commander à nouveau » (reorder into cart) | Anis |
| 5 | Assisted order panel: delegate, lines, expiry countdown, « Confirmer » / « Refuser » with reason | Anis |
| 6 | Return request form on delivered orders: lines and quantities, reason, photos upload, window check; return status tracking with ReturnStatus pills and credit note link | Anis |
| 7 | RW-13 finance: summary (balance, available credit), invoices list/detail with PDF, payments list | Anis |
| 8 | Payment declaration form: method, amount, reference, date, proof upload (PAYMENT_PROOF), status À vérifier | Anis |
| 9 | Design QA of RW-08, RW-09 and RW-13 | Akram |
Deliverables
- apps/web/src/app/[locale]/(account)/orders/{page.tsx,[orderId]/page.tsx,[orderId]/return/page.tsx}
- apps/web/src/app/[locale]/(account)/finance/{page.tsx,invoices/…,payments/…}
- apps/web/src/lib/events.ts (SSE client hook)
Acceptance criteria
- When the back-office confirms an order, the open order page shows Validée within 2 seconds without reload (ORD-15)
- Cancel is offered only while the order is SUBMITTED or PENDING (ORD-10)
- An assisted order can be confirmed or refused until it expires; after expiry the panel shows Expirée (ORD-08)
- A return can be requested only on delivered orders within the window and for remaining quantities; its status updates live (ORD-13)
- A payment declaration with proof appears as À vérifier and later as Confirmé or Rejeté (FIN-03)
- Invoice PDFs download through signed links (FIN-01)
Requirements covered
| Requirement | Title | Release |
|---|---|---|
| ORD-06 | Every modification and status change is historised, dated and notified | V1 |
| ORD-07 | Reseller order tracking: counters by status, filters, progress, details, invoice download, support, reorder | V1 |
| ORD-08 | Assisted orders prepared by a delegate, confirmed by the reseller or validated by the administration | V1 |
| FIN-01 | Invoices generated from orders with legal mentions and PDF; statuses unpaid, partially paid, paid, overdue, cancelled | V1 |
| FIN-03 | Payment recording in the back-office and payment declaration with proof by the reseller | V1 |
| FIN-10 | Reseller finance view: balance, available credit, invoices, payments | V1 |
| ORD-13 | Returns: request on a delivered order, back-office approval, reception; returned quantities re-enter stock automatically | V1 |
| ORD-15 | Order status changes reach the reseller in real time (live update in the app and web) and as a notification | V1 |
Screens
| Screen | Name | App |
|---|---|---|
| RW-08 | Orders list | RW |
| RW-09 | Order detail, tracking & assisted-order confirmation | RW |
| RW-13 | Invoices, payments & credit | RW |
API surface
| Endpoint group | Operations |
|---|---|
| Reseller orders | 11 |
| Reseller finance | 6 |
Test measures
- Playwright e2e: order → back-office confirm → live update in the web page
- Playwright e2e: delivered order → return request with photo → back-office reception → credit note visible
- Network-drop test of the SSE client (offline 1 min, then resume)
Risks
- Corporate proxies or browser extensions break SSE — fall back to polling the order every 30 s when the stream fails repeatedly
KPI
- Delivered by Wed 2 Dec 2026 within 0.75 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.
WEB-03 — Reseller web — cart & checkout
Cart shared with the mobile app, checkout with address/payment/note and confirmation.
WEB-05 — Reseller web — promotions, notifications, account, support
Promotions, notifications inbox, profile/store/addresses/settings, support tickets and after-sales claims, regional WhatsApp button.