Files
SkyMoney/docs/api-phase4-move-log.md
Ricearoni1245 181c3bdc9e
All checks were successful
Deploy / deploy (push) Successful in 2m22s
Security Tests / security-non-db (push) Successful in 27s
Security Tests / security-db (push) Successful in 31s
phase 4: simplify all transaction routes
2026-03-17 09:00:48 -05:00

3.0 KiB

API Phase 4 Move Log

Date: 2026-03-17
Scope: Move transactions endpoints out of api/src/server.ts into a dedicated route module.

Route Registration Changes

  • Added transactions route import in server.ts
  • Registered transactions routes in server.ts
  • New canonical route module: transactions.ts
  • Removed inline transactions route blocks from server.ts to avoid duplicate registration:
    • POST /transactions block
    • GET/PATCH/DELETE /transactions block

Endpoint Movements

  1. POST /transactions
  1. GET /transactions
  1. PATCH /transactions/:id
  1. DELETE /transactions/:id

Helper Ownership in Phase 4

  • Shared helper injection from server.ts:
    • mutationRateLimit
    • computeDepositShares
    • computeWithdrawShares
    • computeOverdraftShares
    • calculateNextDueDate
    • toBig
    • parseCurrencyToCents
  • Route-local helper:
    • isDate query validator

Follow-ups To Revisit

  1. Split POST /transactions into smaller internal handlers (variable_spend vs fixed_payment) after endpoint migration phases complete.
  2. Replace broad any shapes in transaction where-clause/order composition with a typed query builder to reduce regression risk.
  3. Reconcile test expectations for plan overdraft behavior (OVERDRAFT_PLAN vs current fixed-payment reconciliation semantics) before behavior changes in later phases.