3.9 KiB
3.9 KiB
API Phase 3 Move Log
Date: 2026-03-16
Scope: Move variable-categories endpoints out of api/src/server.ts into a dedicated route module.
Route Registration Changes
- Added variable-categories route import in server.ts
- Registered variable-categories routes in server.ts
- New canonical route module: variable-categories.ts
- Removed inline variable-categories route block from
server.tsto avoid duplicate endpoint registration.
Endpoint Movements
POST /variable-categories
- Moved to variable-categories.ts
- References:
PATCH /variable-categories/:id
- Moved to variable-categories.ts
- References:
DELETE /variable-categories/:id
- Moved to variable-categories.ts
- References:
POST /variable-categories/rebalance
- Moved to variable-categories.ts
- References:
GET /variable-categories/manual-rebalance
- Moved to variable-categories.ts
- References:
POST /variable-categories/manual-rebalance
- Moved to variable-categories.ts
- References:
Helper Ownership in Phase 3
- Kept variable-category-specific helpers local to the route module:
assertPercentTotalgetLatestBudgetSessionensureBudgetSessionensureBudgetSessionAvailableSynced
- Reused shared server helper by injection:
computeDepositSharesinjected fromserver.tsregistration.
- Reused shared mutation throttling by injection:
mutationRateLimitinjected fromserver.tsregistration.
Follow-ups To Revisit
- Consolidate budget-session sync helpers into a shared service (
api/src/services/budget-session.ts) once Phase 4 starts. - Standardize response error envelopes for variable-category routes (
messagevsok/code/message) to reduce client branching. - Recheck
variable-categories.manual-rebalance.test.tsover-80 error-code expectation versus current confirm-style behavior to keep tests aligned with product policy.