HOCO B2B
Team tasksImad

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.

FieldDetails
Task codeMRA-04
PhaseP1 — V1 build & integration
Product scopeV1
StatusPlanned
StartThu 12 Nov 2026
DueSun 15 Nov 2026
ResponsibleImad — Mobile developer (Flutter)
Co-responsible—
Effort1.5 person-day(s) planned · 5 from scratch · size S
Area · appReseller app · mobile
Depends onDES-08
UnblocksMDA-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

#SubtaskOwner
1CartScreen 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 webImad
2IssueBanner 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
3Totals block: subtotal, promotions, delivery fee (free-delivery threshold progress, DLV-06), VAT, total in DZD from server values onlyImad
4CheckoutScreen 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 summaryImad
5Submit with POST /cart/checkout: Idempotency-Key created when the checkout screen opens and reused on every retry; expected totals sent; button locked while in flightImad
6Checkout 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
7AddressBookScreen RA-19: addresses.list/create/update/remove/setDefault, wilaya/commune pickers, last address not deletableImad
8OrderConfirmationScreen 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
9Extract CartLineTile, IssueBanner and TotalsBlock into hoco_catalog for MDA-09Imad

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

RequirementTitleRelease
ORD-01Server-side cart shared across the reseller's devices (mobile and web)V1
ORD-02Cart rules: minimum amount, minimum quantities and steps, maximum per order, stock and credit checksV1
ORD-03Checkout: address, note, payment method; a unique order number; immediately visible in the back-officeV1
FIN-02Payment methods: cash on delivery, bank transfer, CCP, BaridiMob, creditV1
FIN-05Basic credit control: ceiling, used and available credit checked at checkoutV1
DLV-06Delivery-fee policy (free threshold, per wilaya)V1

Screens

ScreenNameApp
RA-17CartRA
RA-18CheckoutRA
RA-19Address book & address formRA
RA-20Order confirmationRA

API surface

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.

On this page