SRV-31 — V2 — Profitable packs
Pack definitions, pack pricing and stock, add-pack-to-cart, interaction with promotions.
| Field | Details |
|---|---|
| Task code | SRV-31 |
| Phase | P4 — V2 evolutions |
| Product scope | V2 |
| Status | Planned |
| Start | Wed 27 Jan 2027 |
| Due | Thu 28 Jan 2027 |
| Responsible | Anis — Full-stack developer |
| Co-responsible | — |
| Effort | 1.5 person-day(s) planned · 4 from scratch · size S |
| Area · app | Server · server |
| Depends on | SRV-30 |
| Unblocks | SRV-32, DSH-21 |
| Milestones | — |
Summary
Pack definitions, pack pricing and stock, add-pack-to-cart, interaction with promotions.
Description
Profitable packs are V2 (cahier §4.6, §5.5, §14.2; PRM-06): bundles of references sold at a pack price and added to the cart as one unit. This task implements Pack and PackItem, pack prices per customer type consistent with the three-price model, pack availability derived from its components (availability only for resellers), cart.packs.add adding a pack line that reserves and deducts its component variants, snapshot of pack lines on orders and documents, packs.list/get for resellers and admin.packs.crud, and the interaction rules with promotions. Out of scope: pack pages (DSH-21, WEB-20).
Subtasks
| # | Subtask | Owner |
|---|---|---|
| 1 | Pack and PackItem models and admin.packs.crud (items, quantities, period, images, status) | Anis |
| 2 | Pack prices per customer type and saving shown against the sum of item prices | Anis |
| 3 | Pack availability from component stock (IN_STOCK only if every component is available in the pack quantity) | Anis |
| 4 | cart.packs.add (idempotent) and cart line expansion for stock checks, reservation and deduction of components | Anis |
| 5 | Order and document snapshots of pack lines (pack line with component detail on the delivery note) | Anis |
| 6 | Promotion interaction rule (packs excluded from line promotions by default, setting to allow) | Anis |
| 7 | Reseller packs.list/get guest-safe (no price for guests) | Anis |
Deliverables
- apps/server/src/modules/promotions/packs/{service,router,availability}.ts
- Cart and orders changes for pack lines
- Prisma migration for Pack and PackItem
Acceptance criteria
- Adding a pack to the cart adds one line at the pack price for the reseller's customer type (PRM-06)
- A pack becomes OUT_OF_STOCK as soon as one component lacks the required quantity (STK-07)
- Validating an order with a pack reserves each component variant
- Line promotions do not apply to packs unless the setting allows it
Requirements covered
| Requirement | Title | Release |
|---|---|---|
| PRM-06 | Profitable packs: bundles of references at a pack price, added to cart as a unit | V2 |
API surface
| Endpoint group | Operations |
|---|---|
| Promotions, banners & packs | 5 |
| Cart & checkout | 8 |
| Promotions & loyalty | 10 |
Test measures
- DB tests for component reservation and availability
- Unit tests for pack pricing and saving
KPI
- Delivered by Thu 28 Jan 2027 within 1.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.
SRV-30 — V2 — Loyalty engine (points, levels, rewards, vouchers)
Points ledger, earning on delivery/payment, expiry job, reversals, level computation over a period, rewards catalogue, redemptions and vouchers usable at checkout.
SRV-32 — V2 — Detailed credit, reminders, credit notes, accounting export
Payment terms and due dates, blocking/approval policy, automatic reminders, credit notes and receipts, accounting export formats.