Files
SkyMoney/docs/api-phase6-move-log.md
Ricearoni1245 a8e5443b0d
All checks were successful
Deploy / deploy (push) Successful in 1m31s
Security Tests / security-non-db (push) Successful in 21s
Security Tests / security-db (push) Successful in 26s
phase 7: income, payday. and budget handling routes simplified and compacted
2026-03-17 22:05:17 -05:00

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.ts to avoid duplicate registration:
    • POST /income
    • GET /income/history
    • POST /income/preview
    • GET /payday/status
    • POST /payday/dismiss
    • POST /budget/allocate
    • POST /budget/fund
    • POST /budget/reconcile

Endpoint Movements

  1. POST /income
  1. GET /income/history
  1. POST /income/preview
  1. GET /payday/status
  1. POST /payday/dismiss
  1. POST /budget/allocate
  1. POST /budget/fund
  1. POST /budget/reconcile

Helper Ownership in Phase 6

  • Shared helper injection from server.ts:
    • mutationRateLimit
    • computeDepositShares
    • computeWithdrawShares
    • isProd flag for environment-sensitive logging
  • Route-local schemas/helpers:
    • income.ts: AllocationOverrideSchema
    • budget.ts: BudgetBody, ReconcileBody
    • payday.ts: local debug logger and query schema

Notes

  • Removed legacy unregistered api/src/routes/income-preview.ts to avoid duplicate endpoint logic drift.

Verification

  1. Build
  • cd api && npm run build
  1. 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:5432 unavailable), suites skipped/failed before endpoint assertions.