[BTAPI-65] Add GET /one-time/transactions #82
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feature/BTAPI-65"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Ticket
BTAPI-65 Add GET /one-time/transactions — one-time transactions for a calendar year
Summary
GET /one-time/transactions?year=YYYY, returning every one-time-tagged transaction for a calendar year (defaulting to the current year inAmerica/Edmonton), newest first. Backs the upcoming One-Time screen (BTAPP-50), which is blocked on this ticket.oneTimeTransactionsQuerySchema(four-digit integer, optional); malformed years return 400, an empty year returns200 [].currentYear()/yearWindow(year)pair into@lib/budget(alongside the existingstartOfBudgetWeek/countsTowardBudget) so the calendar-year-window computation isn't duplicated across the new route, the one-time data layer, and the pre-existing tag-summary window —getSummariesin@lib/tagsnow uses the same helper.ignoredflag.Deferred
A performance review found
getTransactionsForYear/spentFromPoolwalk every one-time-tagged transaction ever recorded rather than just the requested year, since no index currently coverstags.name+datetogether. Measured impact is ~1ms at household data volumes — confirmed low severity and deliberately not addressed here. A compound index{ 'tags.name': 1, date: -1 }inensureIndexes()(server/lib/data/transaction/index.ts) would close this if it's ever worth doing.