2.1 KiB
2.1 KiB
API Phase 7 Move Log
Date: 2026-03-17
Scope: Move dashboard read endpoints out of api/src/server.ts into a dedicated route module.
Route Registration Changes
- Added dashboard route import in server.ts
- Registered dashboard routes in server.ts
- New canonical route module: dashboard.ts
- Removed inline dashboard route blocks from
server.tsto avoid duplicate registration:GET /dashboardGET /crisis-status
Endpoint Movements
GET /dashboard
- Original:
server.tsline 1081 - Moved to dashboard.ts
- References:
GET /crisis-status
- Original:
server.tsline 1330 - Moved to dashboard.ts
- References:
- No direct web/api wrapper references currently found via repo search.
- Endpoint remains available for API consumers and future UI wiring.
Helper Ownership in Phase 7
- Route-local helpers in
dashboard.ts:monthKeymonthLabelbuildMonthBucketsDAY_MS
- Reused allocator date helpers:
- static
getUserMidnightFromDateOnly - dynamic import of
getUserMidnightandcalculateNextPaydayfor parity with pre-move logic
- static
Verification
- Build
cd api && npm run build✅
- Focused tests
cd api && npm run test -- tests/auth.routes.test.ts- Result: blocked by local DB connectivity (
127.0.0.1:5432unavailable), suite skipped/failed before endpoint assertions.