HOCO B2B
Team tasksAnis

SRV-45 — Purchase-based levels, Standard, configurable levels, upkeep and drop

Levels as configured data from qualified purchases, with the migration of the V1 enum.

FieldDetails
Task codeSRV-45
PhaseP4 — V2 evolutions
Product scopeV2
StatusPlanned
StartThu 25 Feb 2027
DueSun 28 Feb 2027
ResponsibleAnis — Full-stack developer
Co-responsible—
Effort2 person-day(s) planned · 5 from scratch · size M
Area · appServer · server
Depends onSRV-44
UnblocksSRV-46, SRV-47
Milestones—

Summary

Levels as configured data from qualified purchases, with the migration of the V1 enum.

Description

Change request 04 (client loyalty document and letter of 6 Nov 2026), not yet accepted or priced by HOCO. Builds LoyaltyLevelDefinition, QualifiedPurchaseEntry and LoyaltyLevelChange, the level period, the AND condition, upgrades after each qualified order, upkeep and drop with notice, and loyalty.objective. Takes over level computation from SRV-30. Migrates the V1 enum LoyaltyLevel on PromotionAudience, the segment criteria and PriceList to level ids.

Subtasks

#SubtaskOwner
1LoyaltyLevelDefinition with admin.loyalty.levels.crud, Standard seededAnis
2QualifiedPurchaseEntry ledger fed by orders, returns and cancellationsAnis
3Migration of LoyaltyLevel to level ids (promotions, segments, price lists)Anis
4Upgrade after each qualified order, LoyaltyLevelChangeAnis
5Upkeep, drop, notice job and loyalty.recomputeLevelsAnis
6loyalty.objective and loyalty.levelsAnis

Deliverables

  • apps/server/src/modules/loyalty/levels.service.ts
  • Prisma migration replacing the enum LoyaltyLevel

Acceptance criteria

  • Spending points leaves qualified purchases and level unchanged (LOY-03)
  • A level with an order condition needs both conditions (LOY-03)
  • A new Diamond level needs no release (LOY-03)
  • A drop follows its notice (LOY-20)
  • Objective shows 27 500 DA missing in the document's example (LOY-21)

Requirements covered

RequirementTitleRelease
LOY-03Configurable levels: Standard at sign-up, then levels from qualified purchases over a configurable periodV2
LOY-20Level upkeep and drop with noticeV2
LOY-21Personal objective: progress to the next level on the homeV2

API surface

Endpoint groupOperations
Promotions & loyalty41
Loyalty (V2)23

Test measures

  • Migration test on a V1 database copy
  • Fake-clock tests of upkeep

Risks

  • Thresholds and Diamond vs VIP are open (D-49, D-58)

KPI

  • Delivered by Sun 28 Feb 2027 within 2 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