BillTracker/routes
null 543e94288e refactor(routes): throw-pattern for payments + subscriptions
Standards-unification batch 2. All inline 4xx bodies and try/catch-500
wrappers converted to thrown ApiError factories; validation helpers
(parseYearMonth, getAutopaySuggestionContext, rejectTransactionLinkedPayment)
now throw. Client-visible codes preserved (TRANSACTION_PAYMENT_LOCKED,
NOT_AUTO_MATCH, NO_TRANSACTION, RECLASSIFY_ONLY_SYNC, DUPLICATE_ERROR,
NO_DEBTS). Kills five more err.message-on-500 leaks in subscriptions.cts
(search/decline/catalog/descriptor wrappers).

Two deliberate exceptions, documented inline:
- payments POST / keeps the hand-rolled DUPLICATE_SUSPECTED 409 (carries the
  'existing' payment payload the client's add-anyway flow reads)
- subscriptions /recommendations/create keeps 400-parity pass-through of
  service validation messages via an ApiError wrap

Test harnesses (paymentsRoute, transactionMatchService) mirror the terminal
handler for thrown errors. Server suite 252/252.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-10 16:53:20 -05:00
..
about.cts style: apply Prettier across client + server (no behavior change) 2026-07-06 14:23:53 -05:00
aboutAdmin.cts feat(logging): redacted, level-gated logger; migrate all server console.* (Pillar D) 2026-07-06 16:05:18 -05:00
admin.cts fix(routes): stop leaking raw err.message on 5xx responses 2026-07-10 16:36:27 -05:00
analytics.cts refactor(routes): analytics + tracker → throw pattern (batch 1) 2026-07-06 14:59:29 -05:00
auth.cts refactor(auth): remove dead duplicate admin routes from auth.cts 2026-07-10 16:30:04 -05:00
authOidc.cts feat(logging): redacted, level-gated logger; migrate all server console.* (Pillar D) 2026-07-06 16:05:18 -05:00
bills.cts feat(logging): redacted, level-gated logger; migrate all server console.* (Pillar D) 2026-07-06 16:05:18 -05:00
calendar.cts style: apply Prettier across client + server (no behavior change) 2026-07-06 14:23:53 -05:00
calendarFeed.cts style: apply Prettier across client + server (no behavior change) 2026-07-06 14:23:53 -05:00
categories.cts refactor(categories): adopt Kysely for the /groups query (real production use) 2026-07-06 16:25:30 -05:00
dataSources.cts refactor(routes): throw-pattern for summary, matches, snowball, dataSources 2026-07-10 16:44:19 -05:00
export.cts style: apply Prettier across client + server (no behavior change) 2026-07-06 14:23:53 -05:00
import.cts fix(routes): stop leaking raw err.message on 5xx responses 2026-07-10 16:36:27 -05:00
matches.cts refactor(routes): throw-pattern for summary, matches, snowball, dataSources 2026-07-10 16:44:19 -05:00
monthly-starting-amounts.cts refactor(routes): monthly-starting-amounts → throw pattern; doc exemplar 2026-07-06 15:03:52 -05:00
notifications.cts fix(routes): stop leaking raw err.message on 5xx responses 2026-07-10 16:36:27 -05:00
payments.cts refactor(routes): throw-pattern for payments + subscriptions 2026-07-10 16:53:20 -05:00
privacy.cts style: apply Prettier across client + server (no behavior change) 2026-07-06 14:23:53 -05:00
profile.cts feat(logging): redacted, level-gated logger; migrate all server console.* (Pillar D) 2026-07-06 16:05:18 -05:00
settings.cts style: apply Prettier across client + server (no behavior change) 2026-07-06 14:23:53 -05:00
snowball.cts refactor(routes): throw-pattern for summary, matches, snowball, dataSources 2026-07-10 16:44:19 -05:00
spending.cts fix(routes): stop leaking raw err.message on 5xx responses 2026-07-10 16:36:27 -05:00
status.cts style: apply Prettier across client + server (no behavior change) 2026-07-06 14:23:53 -05:00
subscriptions.cts refactor(routes): throw-pattern for payments + subscriptions 2026-07-10 16:53:20 -05:00
summary.cts refactor(routes): throw-pattern for summary, matches, snowball, dataSources 2026-07-10 16:44:19 -05:00
tracker.cts refactor(routes): analytics + tracker → throw pattern (batch 1) 2026-07-06 14:59:29 -05:00
transactions.cts fix(routes): stop leaking raw err.message on 5xx responses 2026-07-10 16:36:27 -05:00
user.cts style: apply Prettier across client + server (no behavior change) 2026-07-06 14:23:53 -05:00
version.cts refactor(routes): version → throw pattern; keep graceful update-status fallback 2026-07-06 15:01:35 -05:00