Story Index: Control Plane¶
Module: control-plane Total stories: 31 Decomposed from: docs/architecture/control-plane-arch.md (approved) PRD reference: docs/prd/control-plane-prd.md Design reference: docs/design/control-plane-design.md Brand context: [BOTH] Papillon HR Suite + ALTARYS ENTERPRISE HR Suite Date: 27/02/2026 Last updated: 10/03/2026 (CP-003, CP-004, CP-005, CP-006, CP-007, CP-008, CP-009, CP-010, CP-011, CP-012, CP-013 split)
Dependency Graph¶
CP-001 (TenantContext + Auth Foundation)
├── CP-002 (Tenant CRUD + Lifecycle)
│ ├── CP-005 (Org Structure + Reference Data) ← also depends on CP-004
│ │ └── CP-017 (Employee CRUD + Matricule)
│ │ └── CP-018 (Employee Offline + Manager Hierarchy + PRE_HIRE)
│ ├── CP-006 (Country Config: Tax Brackets + Social Contributions)
│ │ └── CP-019 (Country Config: Holidays + Caching + Validation)
│ ├── CP-007 (Module Gating Backend: Interceptor + BUDMGT Rule)
│ │ └── CP-020 (Module Gating: Suspended Tenant + Module Catalog API)
│ │ └── CP-021 (Module Gating Frontend: Navigation + Upsell Cards)
│ └── CP-008 (Self-Registration Form + Duplicate Detection) ← depends on CP-001 through CP-007
│ ├── CP-022 (Email Verification + Trial/Payment Flow)
│ │ └── CP-024 (Provisioning Pipeline)
│ ├── CP-023 (Module Selection + Pack Detection UI)
│ ├── CP-013 (Channel B: CRM Creates Tenant + Emails + Auth)
│ │ └── CP-030 (Channel B: Opt-Out + Commission + Provisioning)
├── CP-003 (User Entity + Invitation Flow) ← also depends on CP-002
│ ├── CP-014 (Permission Resolution + Module Gating)
│ ├── CP-015 (User Management UI Enhancements)
│ ├── CP-010 (Notification Backend + Templates)
│ │ └── CP-027 (Notification UI)
│ └── CP-011 (Tenant Switch Backend + Switcher UI)
│ └── CP-028 (Tenant Switch UX)
├── CP-004 (Audit Trail Backend Service)
│ ├── CP-016 (Audit Trail UI + Access Control)
│ └── CP-005 (Org Structure + Reference Data)
└── CP-009 (Invoice Generation + Pricing Engine) ← depends on CP-001 through CP-005
├── CP-025 (Subscription Management + Module Add/Remove)
└── CP-026 (Billing Cycle + XOF Compliance)
CP-012 (Admin Console: Tenant List + Payments + Suspension) ← depends on CP-001 through CP-010
└── CP-029 (Admin Console: Module Override + Country Config + Metrics)
Story List¶
| # | Story ID | Title | Depends On | Complexity | Status |
|---|---|---|---|---|---|
| 1 | CP-001 | TenantContext + Auth Foundation | None | L | ✅ Merged |
| 2 | CP-002 | Tenant CRUD + Lifecycle State Machine | CP-001 | L | ✅ Merged |
| 3 | CP-003 | User Entity + Invitation Flow | CP-001, CP-002 | M | 🔲 Not started |
| 4 | CP-004 | Audit Trail Backend Service | CP-001 | M | 🔲 Not started |
| 5 | CP-005 | Organization Structure + Reference Data | CP-001, CP-002, CP-004 | M | 🔲 Not started |
| 6 | CP-006 | Country Config: Tax Brackets + Social Contributions | CP-001, CP-002 | S | 🔲 Not started |
| 7 | CP-007 | Module Gating Backend (Interceptor + BUDMGT Rule) | CP-001, CP-002 | M | 🔲 Not started |
| 8 | CP-008 | Self-Registration Form + Duplicate Detection | CP-001–CP-007 | M | 🔲 Not started |
| 9 | CP-009 | Invoice Generation + Pricing Engine | CP-001–CP-005 | L | 🔲 Not started |
| 10 | CP-010 | Notification Backend Service + Templates | CP-001–CP-003 | M | 🔲 Not started |
| 11 | CP-011 | Tenant Switch Backend + Switcher UI | CP-003 | M | 🔲 Not started |
| 12 | CP-012 | Admin Console: Tenant List + Payments + Suspension | CP-001–CP-010 | L | 🔲 Not started |
| 13 | CP-013 | Channel B: CRM Creates Tenant + Emails + Auth | CP-008 | S | 🔲 Not started |
| 14 | CP-025 | Subscription Management + Module Add/Remove | CP-009 | M | 🔲 Not started |
| 15 | CP-026 | Billing Cycle + XOF Compliance | CP-009 | M | 🔲 Not started |
| 16 | CP-027 | Notification UI (Bell, Unread Count, Offline Queuing) | CP-010 | S | 🔲 Not started |
| 17 | CP-028 | Tenant Switch UX (Performance, Dashboard, Roles) | CP-011 | S | 🔲 Not started |
| 18 | CP-029 | Admin Console: Module Override + Country Config + Metrics | CP-012 | M | 🔲 Not started |
| 19 | CP-030 | Channel B: Opt-Out + Commission + Provisioning | CP-013 | S | 🔲 Not started |
| 20 | CP-014 | Permission Resolution + Module Gating | CP-003 | M | 🔲 Not started |
| 21 | CP-015 | User Management UI Enhancements | CP-003 | S | 🔲 Not started |
| 22 | CP-016 | Audit Trail UI + Access Control | CP-004 | M | 🔲 Not started |
| 23 | CP-017 | Employee CRUD + Matricule | CP-005 | L | 🔲 Not started |
| 24 | CP-018 | Employee Offline + Manager Hierarchy + PRE_HIRE | CP-017 | M | 🔲 Not started |
| 25 | CP-019 | Country Config: Holidays + Caching + Validation | CP-006 | S | 🔲 Not started |
| 26 | CP-020 | Module Gating: Suspended Tenant + Module Catalog API | CP-007 | S | 🔲 Not started |
| 27 | CP-021 | Module Gating Frontend: Navigation + Upsell Cards | CP-020 | M | 🔲 Not started |
| 28 | CP-022 | Email Verification + Trial/Payment Flow | CP-008 | M | 🔲 Not started |
| 29 | CP-023 | Module Selection + Pack Detection UI | CP-008 | M | 🔲 Not started |
| 30 | CP-024 | Provisioning Pipeline | CP-022 | L | 🔲 Not started |
| 31 | CP-031 | Platform Throttling — Rate Limiting + Storage Quota + Subscription Gate | CP-001, CP-002, CP-007 | L | 🔲 Not started |
Implementation Order¶
Recommended sequence for the DEVELOPER personality:
Week 1 — Foundation (can be partially parallelized)¶
- CP-001 — TenantContext + Auth Foundation — Every other slice depends on this. Start here.
- CP-004 — Audit Trail Backend Service — Can start immediately after CP-001. No frontend. Shared infrastructure.
- CP-002 — Tenant CRUD + Lifecycle — Needs CP-001. Core business entity.
- CP-003 — User Entity + Invitation Flow — Needs CP-001 + CP-002. Enables authentication.
- CP-014 — Permission Resolution + Module Gating — Backend-only. Needs CP-003.
- CP-016 — Audit Trail UI + Access Control — Frontend for audit. Needs CP-004.
Week 2 — Master Data + Gating¶
- CP-015 — User Management UI Enhancements — Status badges + multi-tenant detection. Needs CP-003.
- CP-006 — Country Config: Tax Brackets + Social Contributions — Backend-only reference data. Needs CP-001 + CP-002.
- CP-019 — Country Config: Holidays + Caching + Validation — Extends CP-006 with holidays, salary grids, caching.
- CP-007 — Module Gating Backend — Revenue mechanism interceptor + BUDMGT rule. Needs CP-001 + CP-002.
- CP-020 — Module Gating: Suspended Tenant + Catalog API — Extends CP-007 with suspended writes + catalog endpoint.
- CP-005 — Organization Structure + Reference Data — Needs CP-001, CP-002, CP-004.
- CP-017 — Employee CRUD + Matricule — Online employee management. Needs CP-005.
- CP-018 — Employee Offline + Manager Hierarchy + PRE_HIRE — Offline-first completion. Needs CP-017.
Week 2–3 — Integration Slices¶
- CP-008 — Self-Registration Form + Duplicate Detection — Step 1 of onboarding. Needs CP-001–CP-007.
- CP-022 — Email Verification + Trial/Payment Flow — Token verification + status transition. Needs CP-008.
- CP-023 — Module Selection + Pack Detection UI — Step 2 UI. Needs CP-008. Can run parallel with CP-022.
- CP-024 — Provisioning Pipeline — 9-step async pipeline. Needs CP-022.
- CP-021 — Module Gating Frontend — Navigation + upsell cards. Needs CP-020.
- CP-010 — Notification Backend + Templates — Needed by CP-024 for onboarding emails.
- CP-009 — Invoice Generation + Pricing Engine — Revenue. Needs employee count from CP-005.
Week 3 — Complementary + Split Stories¶
- CP-011 — Tenant Switch Backend + Switcher UI — Cabinet comptable feature. Needs CP-003 only.
- CP-025 — Subscription Management + Module Add/Remove — Frontend for billing. Needs CP-009.
- CP-026 — Billing Cycle + XOF Compliance — Billing cycle toggle. Needs CP-009.
- CP-027 — Notification UI — Bell, dropdown, offline queuing. Needs CP-010.
- CP-028 — Tenant Switch UX — Dashboard thumbnails, performance. Needs CP-011.
- CP-013 — Channel B: CRM Creates Tenant + Emails + Auth — Small. Interface contract for CRM module.
- CP-030 — Channel B: Opt-Out + Commission + Provisioning — Completes Channel B. Needs CP-013.
Week 3 to Sprint 2 — Admin Console¶
- CP-012 — Admin Console: Tenant List + Payments + Suspension — Core admin app. Depends on CP-001–CP-010.
- CP-029 — Admin Console: Module Override + Country Config + Metrics — Extends admin app. Needs CP-012.
Parallelization Notes¶
Within dependency constraints, these pairs can be developed in parallel: - CP-004 (Audit) ‖ CP-002 (Tenant) — both only depend on CP-001 - CP-006 (Country Config) ‖ CP-007 (Module Gating) — both depend on CP-001 + CP-002 - CP-014 (Permission Resolution) ‖ CP-015 (User Mgmt UI) ‖ CP-016 (Audit UI) — all independent after CP-003/CP-004 - CP-019 (Holidays+Cache) ‖ CP-020 (Suspended+Catalog) — independent sub-stories of CP-006/CP-007 - CP-022 (Email Verification) ‖ CP-023 (Module Selection UI) — both depend on CP-008 - CP-010 (Notifications Backend) ‖ CP-011 (Tenant Switching) — both depend on CP-003 - CP-009 (Billing) ‖ CP-008 (Registration) — different dependency chains - CP-025 (Subscription UI) ‖ CP-026 (Billing Cycle) — both depend on CP-009 - CP-027 (Notification UI) ‖ CP-028 (Tenant Switch UX) — independent of each other - CP-013 (Channel B API) ‖ CP-012 (Admin Console) — different dependency chains - CP-029 (Admin extras) ‖ CP-030 (Channel B extras) — different dependency chains
Split History¶
Stories split on 10/03/2026 to reduce AC count per story (target: 2–4 ACs each):
| Original | ACs | Split Into | ACs Each |
|---|---|---|---|
| CP-003 (9 ACs) | AC-017–AC-025 | CP-003 (3), CP-014 (3), CP-015 (2) | 3, 3, 2 |
| CP-004 (8 ACs) | AC-026–AC-033 | CP-004 (4), CP-016 (4) | 4, 4 |
| CP-005 (12 ACs) | AC-034–AC-045 | CP-005 (4), CP-017 (4), CP-018 (4) | 4, 4, 4 |
| CP-006 (6 ACs) | AC-046–AC-051 | CP-006 (3), CP-019 (3) | 3, 3 |
| CP-007 (9 ACs) | AC-052–AC-060 | CP-007 (4), CP-020 (2), CP-021 (3) | 4, 2, 3 |
| CP-008 (13 ACs) | AC-061–AC-073 | CP-008 (4), CP-022 (4), CP-023 (3), CP-024 (2) | 4, 4, 3, 2 |
| CP-009 (10 ACs) | AC-074–AC-083 | CP-009 (4), CP-025 (3), CP-026 (3) | 4, 3, 3 |
| CP-010 (7 ACs) | AC-082–AC-088 → renumbered AC-107–AC-113 | CP-010 (4), CP-027 (3) | 4, 3 |
| CP-011 (6 ACs) | AC-089–AC-094 | CP-011 (3), CP-028 (3) | 3, 3 |
| CP-012 (split prior) | — | CP-012, CP-029 | — |
| CP-013 (split prior) | — | CP-013, CP-030 | — |
AC renumbering (CP-010): Original AC-082–AC-088 collided with CP-009's AC-082–AC-083. Renumbered to AC-107–AC-113.
AC renumbering (CP-002): AC-017 (scheduled job for ACTIVE_INCOMPLETE → SUSPENDED) collided with CP-003's AC-017 (list users). Renumbered to AC-114.
Flyway Migration Version Map¶
Assigned by implementation order to avoid conflicts. No gaps allowed within each DB.
Platform DB:
| Version | Story | Migration |
|---|---|---|
| V001 | CP-002 | create_tenant |
| V002 | CP-003 | create_users_roles_permissions |
| V003 | CP-006 | create_country_config_tax_social |
| V004 | CP-019 | create_country_config_holidays_grids |
| V005 | CP-010 | create_notification_templates |
Tenant DB:
| Version | Story | Migration |
|---|---|---|
| V001 | CP-002 | create_tenant_settings |
| V002 | CP-004 | create_audit_entry_partitioned |
| V003 | CP-005 | create_org_unit |
| V004 | CP-005 | create_position_category (+ seed CI data) |
| V005 | CP-017 | create_employee (+ matricule_counters) |
| V006 | CP-018 | create_manager_history |
| V007 | CP-009 | create_invoice_payment |
| V008 | CP-009 | create_counters (invoice_counters) |
| V009 | CP-010 | create_notification |
Decomposition Quality Report¶
- [x] Completeness: All 13 architecture vertical slices covered (8 split into sub-stories = 30 total)
- [x] No orphan acceptance criteria: All 7 PRD user stories (US-CP-001 through US-CP-007) are covered
- [x] No orphan screens: All 22 design screens (16 tenant + 6 admin) are assigned to stories
- [x] Self-containment: Each story file includes all entities, DTOs, endpoints, UI states, French copy, and acceptance criteria needed for implementation
- [x] Dependency correctness: DAG verified — no circular dependencies, no story depends on a later story
- [x] Consistent IDs: CP-001 through CP-030
- [x] French copy included: All UI states have exact French text from the design spec
- [x] OHADA rules specific: Regulatory rules include article references and formulas
- [x] Out-of-scope explicit: Every story lists what it does NOT cover
- [x] Testable criteria: ACs in Given/When/Then format (AC-001–AC-094, AC-107–AC-114)
- [x] Story sizing: All stories have 2–4 acceptance criteria (post-split)