3.8 KiB
3.8 KiB
Unit of Work — Requirement Map — Master CMS Module
No user stories were generated for this feature (skipped — owner-operated, technical feature with clear requirements). This document maps functional requirements and NFRs to units instead.
Functional Requirements → Unit Mapping
| Requirement | Description | Unit |
|---|---|---|
| FR-MASTER-01 | New SlpModularCms.Modules.Master module |
Unit 1 |
| FR-MASTER-02 | CmsInstance entity |
Unit 1 |
| FR-MASTER-03 | Auto-registration: Master registers itself with slave | Unit 1 (client call) + Unit 2 (slave endpoint) |
| FR-MASTER-04 | Integrity Check background service | Unit 1 |
| FR-MASTER-05 | Status push: Master sets slave availability | Unit 1 (client call) + Unit 2 (slave endpoint reused) |
| FR-MASTER-06 | Slave pull model: periodic master check + cache | Unit 2 |
| FR-MASTER-07 | Slave fallback behavior (fail-open) | Unit 2 |
| FR-MASTER-08 | Two-phase availability gate on slave | Unit 2 |
| FR-MASTER-09 | Master CMS exemption from own gate | Unit 2 (natural: no registration record on master) |
| FR-MASTER-10 | Owner role access control | Unit 1 (controller auth) + Unit 2 (API key auth) |
| FR-MASTER-11 | /cms page: slave list |
Unit 3 |
| FR-MASTER-12 | /cms page: add slave CMS |
Unit 1 (API) + Unit 3 (UI) |
| FR-MASTER-13 | /cms page: set slave status |
Unit 1 (API) + Unit 3 (UI) |
| FR-MASTER-14 | Mandatory disable message for NotAvailable | Unit 1 (service validation) + Unit 3 (UI validation) |
| FR-MASTER-15 | Project documentation updates | Unit 4 |
Non-Functional Requirements → Unit Mapping
| Requirement | Description | Unit |
|---|---|---|
| NFR-MASTER-01 | Fail-open safety | Unit 2 (MasterAvailabilityService fallback) |
| NFR-MASTER-02 | Configurable cache interval (MasterModule:CacheMinutes) |
Unit 2 + Unit 4 (documented in README) |
| NFR-MASTER-03 | API key security (never exposed in responses) | Unit 1 (CmsInstanceDto excludes ApiKey) |
| NFR-MASTER-04 | Configurable integrity check interval | Unit 1 (IntegrityCheckBackgroundService) + Unit 4 (documented) |
| NFR-MASTER-05 | ≥ 80% test coverage on new backend code | Unit 1 + Unit 2 (test projects) |
| NFR-MASTER-06 | Per-module database migrations | Unit 1 (MasterDbContext) + Unit 2 (AvailabilityDbContext) |
Unit Coverage Summary
| Unit | FR Coverage | NFR Coverage |
|---|---|---|
| Unit 1 — master-backend | FR-01, FR-02, FR-03 (client), FR-04, FR-05 (client), FR-10 (controller), FR-12 (API), FR-13 (API), FR-14 (validation) | NFR-03, NFR-04, NFR-05 (partial), NFR-06 (partial) |
| Unit 2 — slave-availability-extension | FR-03 (endpoint), FR-05 (endpoint), FR-06, FR-07, FR-08, FR-09, FR-10 (API key) | NFR-01, NFR-02 (partial), NFR-05 (partial), NFR-06 (partial) |
| Unit 3 — frontend-cms-page | FR-11, FR-12 (UI), FR-13 (UI), FR-14 (UI validation) | — |
| Unit 4 — documentation | FR-15 | NFR-02 (partial), NFR-04 (partial) |
Cross-Unit Requirements
Requirements that span multiple units and require coordination:
| Requirement | Units Involved | Coordination Point |
|---|---|---|
| FR-MASTER-03 (auto-registration) | 1 + 2 | ISlaveApiClient.RegisterMasterAsync contract must match POST /api/internal/master/register schema |
| FR-MASTER-05 (status push) | 1 + 2 | ISlaveApiClient.PushStatusAsync reuses existing PUT /api/v1/Availability/admin/status; no schema change needed |
| FR-MASTER-12/13/14 | 1 + 3 | Frontend DTOs must match CmsInstanceDto and UpdateStatusRequest from Unit 1 |
| NFR-MASTER-06 (per-module migrations) | 1 + 2 | Both units introduce a new DbContext; same pattern applied consistently |