6.1 KiB
6.1 KiB
API Phase 5 Move Log
Date: 2026-03-17
Scope: Move fixed-plans endpoints out of api/src/server.ts into a dedicated route module.
Route Registration Changes
- Added fixed-plans route import in server.ts
- Registered fixed-plans routes in server.ts
- New canonical route module: fixed-plans.ts
- Removed inline fixed-plans route blocks from
server.tsto avoid duplicate registration:PATCH /fixed-plans/:id/early-fundingPOST /fixed-plans/:id/attempt-final-fundingPATCH /fixed-plans/:id/mark-unpaidPOST /fixed-plans/:id/fund-from-availablePOST /fixed-plans/:id/catch-up-fundingPOST /fixed-plansPATCH /fixed-plans/:idDELETE /fixed-plans/:idPOST /fixed-plans/:id/true-up-actualGET /fixed-plans/duePOST /fixed-plans/:id/pay-now
Endpoint Movements
PATCH /fixed-plans/:id/early-funding
- Original:
server.tsline 1414 - Moved to fixed-plans.ts
- References:
POST /fixed-plans/:id/attempt-final-funding
- Original:
server.tsline 1475 - Moved to fixed-plans.ts
- References:
PATCH /fixed-plans/:id/mark-unpaid
- Original:
server.tsline 1635 - Moved to fixed-plans.ts
- References:
POST /fixed-plans/:id/fund-from-available
- Original:
server.tsline 1674 - Moved to fixed-plans.ts
- References:
POST /fixed-plans/:id/catch-up-funding
- Original:
server.tsline 1828 - Moved to fixed-plans.ts
- References:
POST /fixed-plans
- Original:
server.tsline 2036 - Moved to fixed-plans.ts
- References:
PATCH /fixed-plans/:id
- Original:
server.tsline 2122 - Moved to fixed-plans.ts
- References:
DELETE /fixed-plans/:id
- Original:
server.tsline 2239 - Moved to fixed-plans.ts
- References:
POST /fixed-plans/:id/true-up-actual
- Original:
server.tsline 2285 - Moved to fixed-plans.ts
- References:
GET /fixed-plans/due
- Original:
server.tsline 2429 - Moved to fixed-plans.ts
- References:
POST /fixed-plans/:id/pay-now
- Original:
server.tsline 2495 - Moved to fixed-plans.ts
- References:
Helper Ownership in Phase 5
- Shared helper injection from
server.ts:mutationRateLimitcomputeDepositSharescomputeWithdrawSharescalculateNextDueDatetoBig
- Route-local helper:
DAY_MSconstant for date-window computationsPlanBody/PlanAmountModezod schemas
Verification
- Build
cd api && npm run build✅
- Focused tests
cd api && npm run test -- tests/fixed-plans.estimated-true-up.test.ts tests/payment-rollover.test.ts tests/transactions.test.ts- Result: blocked by local DB connectivity (
127.0.0.1:5432unavailable), suites skipped/failed before endpoint assertions.