SRV-43 — Loyalty contract extension
Extend the V2 contract with every loyalty operation of change request 04, so mobile and design start in parallel.
| Field | Details |
|---|---|
| Task code | SRV-43 |
| Phase | P4 — V2 evolutions |
| Product scope | V2 |
| Status | Planned |
| Start | Sun 24 Jan 2027 |
| Due | Mon 25 Jan 2027 |
| Responsible | Anis — Full-stack developer |
| Co-responsible | Imad |
| Effort | 1 person-day(s) planned · 3 from scratch · size S |
| Area · app | Server · server |
| Depends on | SRV-29 |
| Unblocks | SRV-44, MRA-21, DES-31 |
| Milestones | — |
Summary
Extend the V2 contract with every loyalty operation of change request 04, so mobile and design start in parallel.
Description
Change request 04 (client loyalty document and letter of 6 Nov 2026), not yet accepted or priced by HOCO. Adds to packages/contracts the 18 reseller and 25 back-office operations of the full programme, the new enums, and the additive voucherCode and cashbackAmount of cart.checkout, and publishes them on the mock server. LoyaltySummary moves to qualified purchases and configured levels. Out of scope: implementation (SRV-44 to SRV-50).
Subtasks
| # | Subtask | Owner |
|---|---|---|
| 1 | Reseller operations: objective, levels, history, cashback, campaigns, missions, challenges, badges, referral, occasion, chests, wheel, reviews | Anis |
| 2 | Back-office operations: dashboard, accounts, rules, simulate, recalculations, levels, campaigns, missions, challenges, badges, referrals, prize tables, reviews, occasions | Anis |
| 3 | Level references as ids in place of the enum LoyaltyLevel in V2 schemas; note the V1 fields to migrate | Anis |
| 4 | Additive voucherCode, cashbackAmount and optional referralCode at sign-up | Anis |
| 5 | OpenAPI regeneration, oasdiff check, mock examples | Anis |
| 6 | Contract review and Dart client regeneration | Imad |
Deliverables
- packages/contracts/src/{loyalty.ts,admin/loyalty.ts} extended
- openapi.json minor version with CHANGELOG
- Updated mock-api-staging
Acceptance criteria
- Every new loyalty operation of endpoints.json exists with its method and path
- No reseller response carries a reward stock, prize stock, budget or places-left number (STK-07, BR-99)
- oasdiff reports no breaking change for V1 clients
- Imad signs off the review
Requirements covered
| Requirement | Title | Release |
|---|---|---|
| LOY-03 | Configurable levels: Standard at sign-up, then levels from qualified purchases over a configurable period | V2 |
| LOY-06 | Missions and challenges: daily, weekly, monthly, seasonal; commercial, interaction, surprise and personalised | V2 |
| LOY-07 | Monthly ranking: configurable criterion and Top N, reviewed results, prizes and home highlight | V2 |
| LOY-08 | Earning rules: barème by product, category, brand, quantity or amount, set in the back-office | V2 |
| LOY-14 | Cashback balance, earning and use at checkout | V2 |
| LOY-15 | Referral of new resellers with fraud controls | V2 |
| LOY-18 | Gift chest with configured prizes, odds and budget | V2 |
| LOY-19 | Wheel of fortune, optional, one spin per entitlement | V2 |
| LOY-21 | Personal objective: progress to the next level on the home | V2 |
| LOY-22 | Full history: separate ledgers, one combined view | V2 |
| LOY-23 | Back-office administration: every rule without a developer, reseller view, manual adjustments | V2 |
| LOY-24 | Programme dashboard | V2 |
| LOY-25 | Rule versioning: new operations only, or recalculation | V2 |
API surface
| Endpoint group | Operations |
|---|---|
| Loyalty (V2) | 23 |
| Promotions & loyalty | 41 |
| Cart & checkout | 8 |
Test measures
- Contract diff test against endpoints.json
- Spectral lint and oasdiff in CI
Risks
- Decisions D-45 to D-63 are open: fields stay generic where the policy is not settled
KPI
- Delivered by Mon 25 Jan 2027 within 1 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.
SRV-29 — V2 API contract — loyalty, packs, credit, returns
Extend packages/contracts with the V2 endpoints first so the mobile V2 work starts against the mock server in parallel.
SRV-30 — V2 — Loyalty engine (points ledger, rewards, vouchers)
Points ledger, base earning on delivery/payment, expiry job, reversals, rewards catalogue, redemptions and vouchers usable at checkout.