Team tasksAnis
SRV-46 — Cashback wallet and checkout use
Separate cashback ledger, earning, checks at checkout, hold and release, expiry.
| Field | Details |
|---|---|
| Task code | SRV-46 |
| Phase | P4 — V2 evolutions |
| Product scope | V2 |
| Status | Planned |
| Start | Mon 1 Mar 2027 |
| Due | Wed 3 Mar 2027 |
| Responsible | Anis — Full-stack developer |
| Co-responsible | — |
| Effort | 2.5 person-day(s) planned · 6 from scratch · size M |
| Area · app | Server · server |
| Depends on | SRV-45 |
| Unblocks | SRV-50 |
| Milestones | — |
Summary
Separate cashback ledger, earning, checks at checkout, hold and release, expiry.
Description
Change request 04 (client loyalty document and letter of 6 Nov 2026), not yet accepted or priced by HOCO. Builds CashbackTransaction, earning on the eligible amount, the checks of cart.checkout, the hold at SUBMITTED and release on refusal or cancellation (ORD-14), reversal on returns, expiry and manual adjustment. Stays behind loyalty.cashback.enabled until the accountant review D-60 is closed.
Subtasks
| # | Subtask | Owner |
|---|---|---|
| 1 | Cashback ledger, balance cache and rule of kind CASHBACK | Anis |
| 2 | Earning and reversal on order events | Anis |
| 3 | cart.get and cart.checkout: cashbackAmount, voucher and cashback stacking | Anis |
| 4 | Hold and release around confirmation | Anis |
| 5 | Expiry job and admin.loyalty.cashback.adjust | Anis |
Deliverables
- apps/server/src/modules/loyalty/cashback.service.ts
- Cart engine changes behind a flag
Acceptance criteria
- 2 % of 100 000 DA adds 2 000 DA (LOY-14)
- The cap of 20 % is enforced at checkout (LOY-14)
- A refused order releases the amount (LOY-14)
- With the switch off, V1 checkout is unchanged
Requirements covered
| Requirement | Title | Release |
|---|---|---|
| LOY-14 | Cashback balance, earning and use at checkout | V2 |
| LOY-04 | Rewards catalogue (voucher, free delivery, discount, gift, early access, commercial advantage) and redemption | V2 |
API surface
| Endpoint group | Operations |
|---|---|
| Loyalty (V2) | 23 |
| Cart & checkout | 8 |
| Promotions & loyalty | 41 |
Test measures
- DB tests under concurrent checkouts
- Regression of V1 cart totals
Risks
- Invoice and VAT treatment unknown (D-60): keep the working assumption in one place
KPI
- Delivered by Wed 3 Mar 2027 within 2.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.