4.0 KiB
4.0 KiB
Unit of Work Story Map — CMS Frontend
Story-to-Unit Mapping
All 20 user stories from stories.md are assigned to units. Every story is covered.
| Story | Title | Unit | Rationale |
|---|---|---|---|
| US-06 | Initialize system as first Owner | Unit 0 + Unit 2 | Backend endpoint already exists; frontend SetupPage in Unit 2 |
| US-07 | Redirect to setup when not initialized | Unit 0 + Unit 2 | Backend returns initialized: false; InitGuard in Unit 2 |
| US-01 | Login with email and password | Unit 2 | LoginPage + AuthContext.login() |
| US-02 | Session persistence via refresh token | Unit 2 | AuthContext restore-on-mount + httpOnly cookie (Unit 0 backend) |
| US-03 | Logout | Unit 2 | AuthContext.logout() + AuthController.Revoke() |
| US-04 | Redirect to login when not authenticated | Unit 2 | ProtectedRoute |
| US-05 | Auto token refresh on expiry | Unit 2 | ApiClient 401 interceptor → AuthContext.refresh() |
| US-13 | Complete account setup via invitation link | Unit 2 | InviteCompletePage (stubs for invitation hooks; full hooks in Unit 5) |
| US-14 | Handle expired/invalid invitation token | Unit 2 | InviteCompletePage error states |
| US-18 | Role-appropriate sidebar navigation | Unit 3 | Sidebar with role-filtered nav items |
| US-19 | Toggle dark/light theme | Unit 3 | ThemeProvider + theme toggle in Sidebar |
| US-08 | View dashboard after login | Unit 4 | DashboardPage |
| US-09 | View availability status on dashboard | Unit 4 | AvailabilityStatusBadge + useAvailabilityStatus |
| US-10 | View list of users | Unit 5 | UsersPage + useUsers |
| US-11 | Invite a new user | Unit 5 | InviteUserDialog + useInviteUser |
| US-12 | Share invite link | Unit 5 | InviteUserDialog (step 2 — share link) |
| US-15 | View own profile | Unit 6 | ProfilePage |
| US-16 | View availability status in settings | Unit 6 | SettingsPage + useAvailabilityStatus (reused from Unit 4) |
| US-17 | Access denied to System Settings for non-Owners | Unit 6 | RoleGuard on /settings |
| US-20 | View CMS management placeholder | Unit 6 | CmsPage (Owner only) |
Coverage Verification
| Unit | Stories | Count |
|---|---|---|
| Unit 0 (Backend) | US-02 (partial), US-06 (partial), US-07 (partial) | 3 |
| Unit 2 (Auth Pages) | US-01, US-02, US-03, US-04, US-05, US-06, US-07, US-13, US-14 | 9 |
| Unit 3 (Layout) | US-18, US-19 | 2 |
| Unit 4 (Dashboard) | US-08, US-09 | 2 |
| Unit 5 (User Management) | US-10, US-11, US-12 | 3 |
| Unit 6 (Remaining Pages) | US-15, US-16, US-17, US-20 | 4 |
Total: 20/20 stories assigned ✅
Story Map Visualization
graph TD
subgraph U0["Unit 0 — Backend"]
s06b["US-06 partial\nsetup endpoint"]
s07b["US-07 partial\nstatus endpoint"]
s02b["US-02 partial\ncookie support"]
end
subgraph U2["Unit 2 — Auth Pages"]
s01["US-01 Login"]
s02["US-02 Session restore"]
s03["US-03 Logout"]
s04["US-04 Auth redirect"]
s05["US-05 Token refresh"]
s06["US-06 Setup page"]
s07["US-07 Init redirect"]
s13["US-13 Invite complete"]
s14["US-14 Invalid token"]
end
subgraph U3["Unit 3 — Layout"]
s18["US-18 Sidebar nav"]
s19["US-19 Theme toggle"]
end
subgraph U4["Unit 4 — Dashboard"]
s08["US-08 Dashboard"]
s09["US-09 Availability"]
end
subgraph U5["Unit 5 — User Mgmt"]
s10["US-10 User list"]
s11["US-11 Invite user"]
s12["US-12 Share link"]
end
subgraph U6["Unit 6 — Remaining"]
s15["US-15 Profile"]
s16["US-16 Settings"]
s17["US-17 Access denied"]
s20["US-20 CMS placeholder"]
end
U0 --> U2 --> U3 --> U4 --> U5 --> U6
style U0 fill:#4CAF50,stroke:#2E7D32,color:#fff
style U2 fill:#FF5722,stroke:#BF360C,color:#fff
style U3 fill:#9C27B0,stroke:#4A148C,color:#fff
style U4 fill:#2196F3,stroke:#0D47A1,color:#fff
style U5 fill:#009688,stroke:#004D40,color:#fff
style U6 fill:#607D8B,stroke:#263238,color:#fff