Loyalty programme
Requirements LOY-01 to LOY-07 (V2): points earning, expiry and reversal, Bronze to VIP levels, rewards and redemption, the traceable points history, missions and challenges, and the Top 3 resellers of the month.
This area covers the V2 loyalty programme (cahier §4.4 « Les points de fidélité sont crédités après livraison ou paiement selon le paramétrage », §4.6, §5.5, §12 scenario Fidélité, §14.2). It is not part of V1; its design is prepared in DES-30 and built after generalisation. Apps: reseller app and web, back-office, API. Server module: loyalty (V2). Policy values are open in D-05 and the V1/V2 split in D-16; settings loyalty.* are in the settings catalogue.
| ID | Requirement | Release | Priority | Source | Apps |
|---|---|---|---|---|---|
LOY-01 | Points earned per order, credited after delivery or payment (setting), bonuses | V2 | SHOULD | §4.4, §4.6, §14.2 | API |
LOY-02 | Points expiry, adjustments and reversal on cancellation or refund | V2 | SHOULD | §4.6 | API · BO |
LOY-03 | Levels Bronze, Silver, Gold, VIP over a period with client-validated thresholds | V2 | SHOULD | §4.6 | API · BO · RA · RW |
LOY-04 | Rewards catalogue (voucher, free delivery, discount, gift, early access) and redemption | V2 | SHOULD | §4.6, §5.5 | API · BO · RA · RW |
LOY-05 | Traceable points history for the reseller and the back-office | V2 | SHOULD | §5.5, §12 | API · BO · RA · RW |
LOY-06 | Missions and challenges: commercial, interaction, weekly and monthly challenges, surprise and personalised missions | V2 | SHOULD | Client doc 03 (18 Oct 2026) | API · BO · RA · RW |
LOY-07 | Top 3 resellers of the month: ranking, vouchers, badges and home highlight | V2 | COULD | Client doc 03 (18 Oct 2026) | API · BO · RA · RW |
LOY-01 — Points earned per order
Statement — The system should credit loyalty points per order once the order is delivered or paid (setting), plus configured bonuses.
Rules
- Points = floor(eligible amount ÷
loyalty.pointsPerAmount) — default 1 point per 10 000 centimes (100 DA); eligible amount = order total TTC after discounts, excluding delivery fees and excluded brands or categories. - Trigger
loyalty.earnOn:DELIVERED(default) orPAID(invoice fully paid). Until then the points show as en attente. - Bonuses (
BONUS): first order, campaigns (e.g. ×2 on a brand for a period), configured in BO-53; never on replacement orders created by after-sales. - One
EARNtransaction per order, idempotent on the order id.
Acceptance criteria
- A delivered order of 125 000,00 DA (delivery fee excluded) credits 1 250 points; replaying the event credits nothing more.
Data — LoyaltyAccount, LoyaltyTransaction, Order, Setting.
Interfaces
- Screens: RA-38 Loyalty · BO-53 Loyalty settings & levels
- Endpoints:
admin.loyalty.settings
LOY-02 — Expiry, adjustments and reversals
| Release | Priority | Source | Apps | Owner tasks |
|---|---|---|---|---|
| V2 | SHOULD | cahier §4.6 | API · BO | SRV-30 |
Statement — Points should expire after a configured period, be adjustable with a reason, and be reversed when the order is cancelled, returned or credited.
Rules
- Expiry: points expire
loyalty.pointsValidityMonths(12) after the end of the month they were earned; a monthly job (1st, 03:00) writesEXPIREtransactions; redemptions consume the oldest points first; a notification 30 days before expiry of 500 points or more. - Adjustments (
ADJUST) byloyalty.updateholders with a mandatory reason, audited. - Reversal (
REVERSAL): cancellation after credit, return reception or credit note removes the points earned on the affected amount (pro rata). If points were already spent the balance may go negative; redemptions are then blocked until it is positive again (§4.6 « Les points annulés ou remboursés doivent être régularisés »).
Acceptance criteria
- Returning half of an order that earned 1 250 points writes a reversal of 625 points.
- An adjustment without reason →
400 VALIDATION_FAILED.
Data — LoyaltyTransaction, LoyaltyAccount, ReturnRequest, CreditNote, AuditLog.
Interfaces
- Screens: BO-53 Loyalty settings & levels
- Endpoints:
admin.loyalty.adjust
LOY-03 — Levels Bronze, Silver, Gold, VIP
| Release | Priority | Source | Apps | Owner tasks |
|---|---|---|---|---|
| V2 | SHOULD | cahier §4.6 | API · BO · RA · RW | SRV-30, DSH-21, WEB-20, MRA-20, DES-30 |
Statement — The system should compute each reseller's level (LoyaltyLevel) from points earned over a rolling period with thresholds validated by HOCO.
Rules
- Level = highest level whose threshold ≤ points earned (
EARN+BONUS−REVERSAL) over the lastloyalty.levelPeriodMonths(12). Placeholder thresholds for the design only: Silver 5 000, Gold 15 000, VIP 40 000 (loyalty.levelThresholds, to validate). - Upgrades apply at once; downgrades are evaluated on the 1st of each month, one level at a time.
- The reseller sees level, progress and points missing (« Plus que 2 550 pts pour atteindre le niveau Gold », reference screen 6); levels can target promotions (PRM-02).
Acceptance criteria
- A reseller at 12 450 points with Gold at 15 000 sees Silver and 2 550 points missing; earning 2 550 points upgrades them at once.
Data — LoyaltyAccount, LoyaltyTransaction, Setting.
Interfaces
- Screens: RA-38 Loyalty · BO-53 Loyalty settings & levels · RW-15 Loyalty, rewards & packs
- Endpoints:
loyalty.summary·admin.loyalty.settings
LOY-04 — Rewards catalogue and redemption
| Release | Priority | Source | Apps | Owner tasks |
|---|---|---|---|---|
| V2 | SHOULD | cahier §4.6, §5.5 | API · BO · RA · RW | SRV-30, DSH-21, WEB-20, MRA-20, DES-30, SRV-29 |
Statement — Resellers should exchange points for rewards: voucher, free delivery, discount, gift or early access.
Rules
- A
Rewardhas aRewardType, points cost, quantity available, minimum level, validity window and active flag. - Redemption checks, in order: account active; reward active, in its window and in stock (
409 REWARD_UNAVAILABLE— §5.5 « Les récompenses indisponibles ne doivent pas pouvoir être réclamées »); level (409 REWARD_LEVEL_REQUIRED); balance ≥ cost (409 LOYALTY_INSUFFICIENT_POINTS). It then writes aREDEEMtransaction and aRewardRedemptionatomically (idempotent). VOUCHER,FREE_DELIVERY,DISCOUNTcreate a single-useVoucher(valid 90 days) applied at checkout;GIFTis fulfilled by the back-office with the next order;EARLY_ACCESSgrants visibility of new products.- A redemption cancelled before use restores the points (
REVERSAL).
Acceptance criteria
- Redeeming a 6 000-point reward with 12 450 points leaves 6 450 and a voucher; redeeming an out-of-stock reward →
409 REWARD_UNAVAILABLE.
Data — Reward, RewardRedemption, Voucher, LoyaltyTransaction.
Interfaces
- Screens: RA-39 Rewards & redemption · BO-54 Rewards & redemptions · RW-15 Loyalty, rewards & packs
- Endpoints:
loyalty.rewards·loyalty.redeem·loyalty.redemptions·admin.rewards.crud·admin.redemptions.list
LOY-05 — Traceable points history
Statement — Every points movement should be visible, with its reason, to the reseller and the back-office.
Rules
- The ledger is append-only: type (
LoyaltyTransactionType), points (signed), balance after, label, related order, reward or user, time. Balance = sum of the ledger; a nightly check compares it with the stored balance. - The reseller sees their own history with filters; the back-office sees any reseller's with the actor of manual entries, and can export it.
Acceptance criteria
- For a reseller, the sum of the history equals the displayed balance; an adjustment shows its author and reason in the back-office only.
Data — LoyaltyTransaction, LoyaltyAccount.
Interfaces
- Screens: RA-38 Loyalty · BO-54 Rewards & redemptions
- Endpoints:
loyalty.transactions
LOY-06 — Missions and challenges
| Release | Priority | Source | Apps | Owner tasks |
|---|---|---|---|---|
| V2 | SHOULD | Client doc 03 (18 Oct 2026) | API · BO · RA · RW | SRV-30, MRA-20, DES-30 |
Statement — The loyalty programme should offer missions and challenges that earn bonus points (HOCO's document 03, SN-07, SN-08, SN-22, SN-24; smart notifications).
Rules
- Mission kinds: commerciales (first order of the month +200 points, 5 orders in the month +500, purchases above 5 000 000 DA in the month +700, a product bought for the first time, purchases from 3 different categories), interaction (rate the last order +50, enable notifications), challenges (3 orders in 7 days, the monthly objective, Flash Challenge: buy the chosen product today), surprise (one random mission a week, unknown in advance) and personnalisées (built from the reseller's category history).
- Each mission has a condition evaluated by the server on orders and events, a period, a reward in points (
BONUStransaction) and a status (assigned, completed, expired); completing it notifies SN-08. - Academy missions (videos, quiz), product reviews and the Daily / Weekly / Monthly cadence are later (D-40, D-42).
Acceptance criteria
- A reseller with the mission « 5 commandes ce mois-ci » who has their fifth order delivered in the month gets 500 points once.
Data — V2 mission model (to design with SRV-29), LoyaltyTransaction.
LOY-07 — Top 3 resellers of the month
| Release | Priority | Source | Apps | Owner tasks |
|---|---|---|---|---|
| V2 | COULD | Client doc 03 (18 Oct 2026) | API · BO · RA · RW | SRV-30, MRA-20, DES-30 |
Statement — The system could rank resellers each month and reward the top three (SN-27).
Rules
- Score over the calendar month from purchase volume (delivered orders TTC), number of orders and activity in the app; weights, eligibility and ties are D-42.
- Prizes proposed by HOCO: 1st — voucher 20 000 DA, badge « Meilleur Revendeur », shown on the home page for a month; 2nd — 10 000 DA, « Top Revendeur »; 3rd — 5 000 DA, « Top 3 Revendeur ». Vouchers are
Voucherrewards. - The back-office reviews the ranking before publication (fraud, returns, unpaid invoices).
Acceptance criteria
- On the 1st of the month the reviewed ranking is published, the three winners receive their voucher and badge, and the first appears on every reseller's home for the month.
Data — V2 Voucher, Reward, RewardRedemption, ranking snapshot.
Promotions & packs
Daily offers, scheduled promotions and temporary discounts on products, categories or brands, targeting, stacking rules, dates and caps applied by the cart, banners with countdown, flash sales and the promotion tabs, and the V2 profitable packs and exclusive offers.
Field operations (delegates, tours, visits)
Requirements FLD-01 to FLD-19: delegates, objectives, tour planning and lifecycle, GPS check-in, visits, reports, field sign-up, tour closing and the location policy.