SRV-42 — Store the fields the API defines but the database approximated
Give every V1 field the API reference defines its own column and enforce its rules, instead of approximating it from other data.
| Field | Details |
|---|---|
| Task code | SRV-42 |
| Phase | P1 — V1 build & integration |
| Product scope | V1 |
| Status | Done (Tue 20 Oct 2026) |
| Start | Tue 20 Oct 2026 |
| Due | Tue 20 Oct 2026 |
| Responsible | Anis — Full-stack developer |
| Co-responsible | — |
| Effort | 1.5 person-day(s) planned · 3 from scratch · size 1.5 |
| Area · app | Server · server |
| Depends on | SRV-41 |
| Unblocks | — |
| Milestones | — |
Summary
Give every V1 field the API reference defines its own column and enforce its rules, instead of approximating it from other data.
Description
The audit after SRV-41 found fields the contract accepts but the database never stored. Each is stored with an additive migration, backfilled with the value the API used to derive, and its rules are enforced: promotion internal name, per-reseller cap (cart, checkout, release on refusal) and notify flag; banner draft, mobile image, countdown and audience; variant ARCHIVED vs HIDDEN and weight; announcement SMS/e-mail channels and named users; maintenance end time; delegate supervisor; visit report needs; reseller location source. Category images and versions of objectives/visit types are left as documented.
Subtasks
| # | Subtask | Owner |
|---|---|---|
| 1 | Additive migration with backfills | Anis |
| 2 | Rules enforced and tested | Anis |
| 3 | Database design and API pages updated | Anis |
Deliverables
- Migration 20261026090000_srv42_stored_api_fields
- Server changes and tests
- Docs updates
Acceptance criteria
- No contract change (OpenAPI export identical)
- Existing rows answer as before
- Full test suite passes
Requirements covered
| Requirement | Title | Release |
|---|---|---|
| PRO-03 | ||
| CAT-06 | Product import/export (Excel/CSV) with a validation report | V1 |
API surface
| Endpoint group | Operations |
|---|---|
| Promotions & loyalty | 10 |
| Promotions, banners & packs | 5 |
| Catalog & pricing | 19 |
Test measures
- Integration tests per stored field and rule
Risks
- Behaviour change: new promotions default to notifyResellers false
KPI
- Delivered by Tue 20 Oct 2026 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-28 — Hardening — security, performance, backup restore test
Security headers and rate limits review, permission test sweep, slow-query and index pass, load test of catalog/search and checkout, restore of a backup into a fresh database.
DSH-01 — Back-office foundation — shell, auth, navigation, data patterns
Next.js shell with role-based navigation, sign-in/reset, oRPC + TanStack Query client, HOCO tokens in the UI kit, DataTable/filters/forms/detail patterns, French messages.