MRA-20 — V2 — Reseller app loyalty, rewards & packs
Points, level progress, history, rewards and redemption, packs list/detail and add-pack-to-cart.
| Field | Details |
|---|---|
| Task code | MRA-20 |
| Phase | P4 — V2 evolutions |
| Product scope | V2 |
| Status | Planned |
| Start | Mon 25 Jan 2027 |
| Due | Wed 27 Jan 2027 |
| Responsible | Imad — Mobile developer (Flutter) |
| Co-responsible | — |
| Effort | 3 person-day(s) planned · 6 from scratch · size M |
| Area · app | Reseller app · mobile |
| Depends on | SRV-29, DES-30 |
| Unblocks | MDA-20 |
| Milestones | — |
Summary
Points, level progress, history, rewards and redemption, packs list/detail and add-pack-to-cart.
Description
V2 adds loyalty and profitable packs to the reseller app (LOY-01, LOY-03, LOY-04, LOY-05, PRM-06). Scope: packs list and detail RA-37 with add-pack-to-cart, loyalty summary with points, level and progress plus history RA-38, and the rewards catalogue with redemption and vouchers RA-39. Returns moved to V1 (MRA-10) and are not part of this task. Work starts against the V2 contract on the mock server (SRV-29) while the engines (SRV-30, SRV-31) are built, and everything ships behind feature flags until V2 go-live. Packs follow the V1 rules: price per customer type, availability only (STK-07), no prices for guests. It needs SRV-29 and Akram's DES-30 designs; MDA-20 follows.
Subtasks
| # | Subtask | Owner |
|---|---|---|
| 1 | Regenerate hoco_api from the V2 contract (loyalty, packs, cart.packs.add) and add V2 feature flags read from appConfig | Imad |
| 2 | PacksScreen RA-37: GET /packs list and GET /packs/{id} detail with items, pack price vs sum of items (« Économisez 1 200,00 DA »), availability pill | Imad |
| 3 | Add pack to cart (POST /cart/packs with an Idempotency-Key) and pack rendering as one unit in the cart lines (hoco_catalog) | Imad |
| 4 | LoyaltyScreen RA-38: GET /loyalty/summary (points, level « Bronze », « Silver », « Gold », « VIP », progress to next level) and history GET /loyalty/transactions (Gain, Bonus, Échange, Expiration, Ajustement, Annulation) | Imad |
| 5 | RewardsScreen RA-39: GET /loyalty/rewards with eligibility, redeem confirmation → POST /loyalty/rewards/{id}/redeem with an Idempotency-Key, my redemptions and vouchers with code/QR (GET /loyalty/redemptions) | Imad |
| 6 | Home and account tiles for points and level, hidden when the flag is off | Imad |
| 7 | Design QA of V2 surfaces against DES-30 (part of DQA-12) | Akram |
Deliverables
- apps/reseller/lib/src/features/loyalty/ and features/packs/
- hoco_catalog pack line support in the cart widgets
- Feature-flagged V2 build on Firebase App Distribution (staging)
Acceptance criteria
- A pack is added to the cart as one unit at the pack price for the reseller's customer type, and checkout applies it (PRM-06)
- Points balance, level and history match the back-office and every movement is traceable (LOY-03, LOY-05)
- Redeeming a reward deducts points once even if the request is retried, and the voucher appears in my redemptions (LOY-04)
- With the V2 flags off nothing of loyalty or packs is visible
- Guests see packs without prices and cannot add them (AUTH-10)
Requirements covered
| Requirement | Title | Release |
|---|---|---|
| LOY-01 | Points earned per order, credited after delivery or payment (setting), bonuses | V2 |
| LOY-03 | Levels Bronze, Silver, Gold, VIP over a period with client-validated thresholds | V2 |
| LOY-04 | Rewards catalogue (voucher, free delivery, discount, gift, early access) and redemption | V2 |
| LOY-05 | Traceable points history for the reseller and the back-office | V2 |
| PRM-06 | Profitable packs: bundles of references at a pack price, added to cart as a unit | V2 |
Screens
| Screen | Name | App |
|---|---|---|
| RA-37 | Packs list & detail | RA |
| RA-38 | Loyalty: points, level, history | RA |
| RA-39 | Rewards & redemption | RA |
API surface
| Endpoint group | Operations |
|---|---|
| Loyalty (V2) | 5 |
| Promotions, banners & packs | 5 |
| Cart & checkout | 8 |
Test measures
- Widget tests of the pack cart line and the redemption confirmation
- Integration test against the V2 mock: pack → cart → checkout; reward → redeem → voucher
- Golden tests of the loyalty level progress at each LoyaltyLevel
Risks
- Level thresholds and earning rules are not validated by HOCO yet — display only server-computed values, never local calculations
KPI
- Delivered by Wed 27 Jan 2027 within 3 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.