Files
SkyMoney/docs/api-phase7-move-log.md
Ricearoni1245 952684fc25
All checks were successful
Deploy / deploy (push) Successful in 1m32s
Security Tests / security-non-db (push) Successful in 21s
Security Tests / security-db (push) Successful in 27s
phase 8: site-access and admin simplified and compacted
2026-03-18 06:43:19 -05:00

49 lines
2.1 KiB
Markdown

# 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](/mnt/c/Users/jholt/clone-test/SkyMoney/api/src/server.ts:24)
- Registered dashboard routes in [server.ts](/mnt/c/Users/jholt/clone-test/SkyMoney/api/src/server.ts:944)
- New canonical route module: [dashboard.ts](/mnt/c/Users/jholt/clone-test/SkyMoney/api/src/routes/dashboard.ts:24)
- Removed inline dashboard route blocks from `server.ts` to avoid duplicate registration:
- `GET /dashboard`
- `GET /crisis-status`
## Endpoint Movements
1. `GET /dashboard`
- Original: `server.ts` line 1081
- Moved to [dashboard.ts](/mnt/c/Users/jholt/clone-test/SkyMoney/api/src/routes/dashboard.ts:24)
- References:
- [useDashboard.ts](/mnt/c/Users/jholt/clone-test/SkyMoney/web/src/hooks/useDashboard.ts:85)
- [OnboardingPage.tsx](/mnt/c/Users/jholt/clone-test/SkyMoney/web/src/pages/OnboardingPage.tsx:172)
- [auth.routes.test.ts](/mnt/c/Users/jholt/clone-test/SkyMoney/api/tests/auth.routes.test.ts:37)
- [security-logging-monitoring-failures.test.ts](/mnt/c/Users/jholt/clone-test/SkyMoney/api/tests/security-logging-monitoring-failures.test.ts:48)
2. `GET /crisis-status`
- Original: `server.ts` line 1330
- Moved to [dashboard.ts](/mnt/c/Users/jholt/clone-test/SkyMoney/api/src/routes/dashboard.ts:273)
- 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`:
- `monthKey`
- `monthLabel`
- `buildMonthBuckets`
- `DAY_MS`
- Reused allocator date helpers:
- static `getUserMidnightFromDateOnly`
- dynamic import of `getUserMidnight` and `calculateNextPayday` for parity with pre-move logic
## Verification
1. Build
- `cd api && npm run build`
2. Focused tests
- `cd api && npm run test -- tests/auth.routes.test.ts`
- Result: blocked by local DB connectivity (`127.0.0.1:5432` unavailable), suite skipped/failed before endpoint assertions.