SRV-01 — Service catalogue — module boundaries, events & ownership (freeze)
Review and freeze the 24 server modules: responsibilities, data each owns, events each emits, jobs, and which apps consume them.
| Field | Details |
|---|---|
| Task code | SRV-01 |
| Phase | P0 — Foundations (cadrage, UX/UI, architecture & contract) |
| Product scope | V1 |
| Status | Done (Sun 18 Oct 2026) |
| Start | Sun 18 Oct 2026 |
| Due | Sun 18 Oct 2026 |
| Responsible | Anis — Full-stack developer |
| Co-responsible | — |
| Effort | 0.5 person-day(s) planned · 2 from scratch · size XS |
| Area · app | Server · server |
| Depends on | PRJ-02 |
| Unblocks | SRV-02 |
| Milestones | — |
Summary
Review and freeze the 24 server modules: responsibilities, data each owns, events each emits, jobs, and which apps consume them.
Description
Step 1 of Anis's sequence (services → database → API contract): before any model or route exists, the 24 modules of the modular monolith (AUTHORING §3) are reviewed and frozen so that ownership of data, events and jobs is unambiguous (NFR-03, NFR-09). For each module the catalogue fixes its responsibility, the Prisma models it owns, the outbox events it emits and consumes, its BullMQ jobs and the apps that call it; cross-module access goes through services, never through another module's tables. The 17 Oct decisions are placed explicitly: AttributeDefinition/VariantAttributeValue in catalog, PriceChange and the three-price resolution in pricing, availability projection in inventory, returns (ReturnRequest, ReturnItem) in orders, CreditNote in billing, AFTER_SALES tickets and SupportRegion in support, the reseller SSE stream in notifications. Out of scope: field-level schema (SRV-02) and request/response shapes (SRV-03). SRV-02 and SRV-03 are derived directly from this freeze.
Note
Subtasks
| # | Subtask | Owner |
|---|---|---|
| 1 | Responsibility statement and owned entities for each of the 24 modules (identity … integrations), using the canonical model names | Anis |
| 2 | Place the new V1 entities: AttributeDefinition/VariantAttributeValue (catalog), SupportRegion/SupportRegionWilaya (support), ReturnRequest/ReturnItem (orders), CreditNote (billing) | Anis |
| 3 | Outbox event catalogue with producer, payload outline and consumers (order.submitted/validated/refused/modified/status_changed/cancelled, return., ticket., stock.alert, visit.checked_in, tour.*) | Anis |
| 4 | Jobs catalogue with schedule and owner (orders.expireAssisted, promotions.applySchedule, support.autoClose, stock alerts, analytics daily aggregates, idempotency and location-ping purges) | Anis |
| 5 | Endpoint group → module mapping for every group in endpoints.json, including events.stream and admin.events.stream | Anis |
| 6 | Inter-module dependency rules (allowed service calls, no cyclic imports) enforced by a lint rule on apps/server/src/modules | Anis |
| 7 | Consumer review of the module → app matrix for the reseller and delegate apps | Imad |
| 8 | Freeze: catalogue page marked v1, change process for later edits (ADR in docs) | Anis |
Deliverables
- apps/docs/content/docs/srs/service-catalogue.mdx frozen as v1
- apps/docs/content/docs/srs/jobs-and-scheduler.mdx with every job, schedule and owner
- Folder skeleton apps/server/src/modules/<module>/ for the 24 modules with an index exporting the service interface
- ADR recording the module boundaries and the outbox pattern
Acceptance criteria
- Every canonical entity of AUTHORING §3 is owned by exactly one module
- Every endpoint group of endpoints.json maps to one owning module
- Every outbox event has a producer, at least one consumer and a payload outline
- Returns, credit notes, after-sales claims, attributes and support regions have an owning module
- Imad has reviewed and accepted the module → app matrix
Requirements covered
| Requirement | Title | Release |
|---|---|---|
| NFR-03 | Scalability for more resellers, products, orders and zones | V1 |
| NFR-09 | Maintainability: automated tests, CI gates, typed contracts, documentation | V1 |
Test measures
- Script check: entity list in the catalogue equals the model list planned for SRV-02
- Dependency lint (no cross-module repository imports) passes on the skeleton
Risks
- Boundaries drift once coding starts — changes go through an ADR and a catalogue update in the same PR
KPI
- Delivered by Sun 18 Oct 2026 within 0.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.
PRJ-03 — Cadrage workshop with HOCO — rules, V1/V2 split, open decisions
Walk HOCO through the PRD and the decision register; close pricing, stock, payment, credit, GPS and language decisions; get the cahier's validation sheet signed.
SRV-02 — Database schema v1 — Prisma models, migrations & reference seeds
Implement the data-model baseline as multi-file Prisma schema; first migration; seeds for wilayas/communes, brands, categories, roles/permissions, settings and reference lists.