MRA-04 — Reseller app — cart, checkout & confirmation
Cart with live re-validation messages, address book, payment method with credit availability, order note, idempotent checkout, confirmation.
| Field | Details |
|---|---|
| Task code | MRA-04 |
| Phase | P1 — V1 build & integration |
| Product scope | V1 |
| Status | Planned |
| Start | Thu 12 Nov 2026 |
| Due | Sun 15 Nov 2026 |
| Responsible | Imad — Mobile developer (Flutter) |
| Co-responsible | — |
| Effort | 1.5 person-day(s) planned · 5 from scratch · size S |
| Area · app | Reseller app · mobile |
| Depends on | DES-08 |
| Unblocks | MDA-09 |
| Milestones | — |
Summary
Cart with live re-validation messages, address book, payment method with credit availability, order note, idempotent checkout, confirmation.
Description
Checkout turns the server-side cart (shared with the reseller web, ORD-01) into an order, and every rule — minimum amount, quantities, stock, credit, promotions — is re-validated by the server, so the app's job is to show issues clearly and submit exactly once (ORD-02, ORD-03, FIN-05). Scope: cart RA-17 with live re-validation messages, checkout RA-18 (address, payment method with credit availability, delivery fee, note, summary), address book RA-19 and confirmation RA-20. Per the 17 Oct decision no order is confirmed automatically: the confirmation screen says the order is « Envoyée » and waits for HOCO's confirmation (ORD-14). It needs cart.*, cart.checkoutOptions, cart.checkout (Idempotency-Key required) and addresses.* (SRV-15, SRV-18) and Akram's DES-08 validation messages. The cart widgets live in hoco_catalog because MDA-09 builds the assisted order with them; MRA-05 shows the resulting order.
Subtasks
| # | Subtask | Owner |
|---|---|---|
| 1 | CartScreen RA-17 on GET /cart: lines with price, promotion, line total, quantity stepper (PATCH /cart/items/{id}, debounced), swipe-to-remove with undo, « Vider le panier »; refreshed on resume because the cart is shared with the web | Imad |
| 2 | IssueBanner list from cart issues: BLOCKING vs WARNING for PRICE_CHANGED, STOCK_INSUFFICIENT, PRODUCT_UNAVAILABLE, QUANTITY_NOT_ALLOWED and ORDER_MIN_AMOUNT_NOT_MET with the amount still missing (« Encore 3 500,00 DA pour commander ») | Imad |
| 3 | Totals block: subtotal, promotions, delivery fee (free-delivery threshold progress, DLV-06), VAT, total in DZD from server values only | Imad |
| 4 | CheckoutScreen RA-18 on GET /cart/checkout-options: address selector, payment methods (« Paiement à la livraison », « Virement bancaire », « CCP », « BaridiMob », « Crédit (paiement différé) » with available credit and disabled state when insufficient), order note, final summary | Imad |
| 5 | Submit with POST /cart/checkout: Idempotency-Key created when the checkout screen opens and reused on every retry; expected totals sent; button locked while in flight | Imad |
| 6 | Checkout error handling: 409 CART_CHANGED → show the re-validated cart diff and ask to confirm again; 422 CREDIT_LIMIT_EXCEEDED, STOCK_INSUFFICIENT, ORDER_MIN_AMOUNT_NOT_MET; 403 ACCOUNT_PENDING_VALIDATION with « Compte en attente de validation » | Imad |
| 7 | AddressBookScreen RA-19: addresses.list/create/update/remove/setDefault, wilaya/commune pickers, last address not deletable | Imad |
| 8 | OrderConfirmationScreen RA-20: number CMD-2026-000158, status « Envoyée », text explaining HOCO confirms the order before preparation, buttons « Suivre ma commande » and « Continuer mes achats » | Imad |
| 9 | Extract CartLineTile, IssueBanner and TotalsBlock into hoco_catalog for MDA-09 | Imad |
Deliverables
- apps/reseller/lib/src/features/cart/ and features/checkout/ (cart, checkout, addresses, confirmation)
- packages/hoco_catalog/lib/src/cart/ (line tile, issue banner, totals block)
- integration_test/checkout_test.dart
- Firebase App Distribution build 0.3.0 (staging) with the ordering flow
Acceptance criteria
- A lost connection during « Valider la commande » followed by a retry creates exactly one order; the retry returns the same order with Idempotent-Replayed: true (ORD-03)
- A price change between cart and checkout returns CART_CHANGED and the reseller sees and confirms the new totals before the order is created (PRC-05)
- Credit is offered only up to the available amount; above it the method is disabled or CREDIT_LIMIT_EXCEEDED is explained (FIN-05)
- The minimum-amount banner shows the exact amount missing and blocks submission (ORD-02)
- The confirmation shows the order as « Envoyée » awaiting HOCO's confirmation — never as « Validée » (ORD-14)
- A cart changed on the reseller web is reflected after returning to the app
Requirements covered
| Requirement | Title | Release |
|---|---|---|
| ORD-01 | Server-side cart shared across the reseller's devices (mobile and web) | V1 |
| ORD-02 | Cart rules: minimum amount, minimum quantities and steps, maximum per order, stock and credit checks | V1 |
| ORD-03 | Checkout: address, note, payment method; a unique order number; immediately visible in the back-office | V1 |
| FIN-02 | Payment methods: cash on delivery, bank transfer, CCP, BaridiMob, credit | V1 |
| FIN-05 | Basic credit control: ceiling, used and available credit checked at checkout | V1 |
| DLV-06 | Delivery-fee policy (free threshold, per wilaya) | V1 |
Screens
API surface
| Endpoint group | Operations |
|---|---|
| Cart & checkout | 8 |
| Reseller profile, addresses & documents | 9 |
Test measures
- integration_test of cart → checkout → confirmation, including a simulated network drop and retry with the same key
- Widget tests of each issue code banner and of the CART_CHANGED diff dialog
- Unit test that the checkout Idempotency-Key is stable for one checkout session and renewed for the next
Risks
- Users double-submit on slow networks — single in-flight guard plus the idempotent key; tested on a throttled 3G profile
KPI
- Delivered by Sun 15 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.
MRA-03 — Reseller app — product detail & favorites
Gallery, variants, prices, availability, quantity stepper with limits, add to cart / order now, specs sheet, similar products, favorites, share.
MRA-05 — Reseller app — orders, tracking & assisted-order confirmation
Status counters, list with live progress tracker (SSE while open, push otherwise), order detail with timeline, documents, cancel, reorder, contact support; confirm or reject assisted orders.