4.6 KiB
4.6 KiB
API Phase 6 Move Log
Date: 2026-03-17
Scope: Move income, budget, and payday endpoints out of api/src/server.ts into dedicated route modules.
Route Registration Changes
- Added income route import in server.ts
- Added payday route import in server.ts
- Added budget route import in server.ts
- Registered income routes in server.ts
- Registered payday routes in server.ts
- Registered budget routes in server.ts
- Removed inline route blocks from
server.tsto avoid duplicate registration:POST /incomeGET /income/historyPOST /income/previewGET /payday/statusPOST /payday/dismissPOST /budget/allocatePOST /budget/fundPOST /budget/reconcile
Endpoint Movements
POST /income
- Original:
server.tsline 1382 - Moved to income.ts
- References:
GET /income/history
- Original:
server.tsline 1421 - Moved to income.ts
- References:
POST /income/preview
- Original:
server.tsline 1459 - Moved to income.ts
- References:
GET /payday/status
- Original:
server.tsline 1483 - Moved to payday.ts
- References:
POST /payday/dismiss
- Original:
server.tsline 1586 - Moved to payday.ts
- References:
POST /budget/allocate
- Original:
server.tsline 1597 - Moved to budget.ts
- References:
POST /budget/fund
- Original:
server.tsline 1624 - Moved to budget.ts
- References:
POST /budget/reconcile
- Original:
server.tsline 1657 - Moved to budget.ts
- References:
Helper Ownership in Phase 6
- Shared helper injection from
server.ts:mutationRateLimitcomputeDepositSharescomputeWithdrawSharesisProdflag for environment-sensitive logging
- Route-local schemas/helpers:
income.ts:AllocationOverrideSchemabudget.ts:BudgetBody,ReconcileBodypayday.ts: local debug logger and query schema
Notes
- Removed legacy unregistered
api/src/routes/income-preview.tsto avoid duplicate endpoint logic drift.
Verification
- Build
cd api && npm run build✅
- Focused tests
cd api && npm run test -- tests/income.test.ts tests/income.integration.test.ts- Result: blocked by local DB connectivity (
127.0.0.1:5432unavailable), suites skipped/failed before endpoint assertions.