feat(reports): plumb accountIds[] account filter into 7 report services #281
Closed
maximus
wants to merge 2 commits from
issue-273-account-filter-services into issue-272-report-filters-hook
pull from: issue-273-account-filter-services
merge into: maximus:issue-272-report-filters-hook
maximus:main
maximus:issue-291-collapse-docs
maximus:issue-290-categories-unify
maximus:issue-289-budget-collapse
maximus:issue-288-collapse-socle
maximus:fix-database-locked-serialization
maximus:issue-228-v16-guard-convertible-scope
maximus:issue-187-balance-cleanup-post-184-185
maximus:issue-188-webkit-date-picker-7-inputs
maximus:issue-180-postcss-audit-fix
maximus:issue-190-restructure-settings-pages
maximus:issue-161-smoke-scaffold
maximus:issue-171-ci-drop-push-trigger
maximus:issue-169-asset-type-balance-categories
maximus:issue-67-feedback-widget
maximus:issue-97-cartes-page
maximus:issue-96-compare-refactor
maximus:issue-51-compte-maximus-oauth
maximus:issue-46-license-commands-entitlements
maximus:issue-48-gate-auto-updates
maximus:issue-47-license-ui-card
maximus:fix/simpl-resultat-54-argon2id-pin
maximus:fix/simpl-resultat-59-bump-vite
maximus:issue-43-update-picomatch
maximus:fix/simpl-resultat-41-category-time-report-filter
maximus:fix/simpl-resultat-31-dashboard-month-dropdown
maximus:fix/simpl-resultat-29-budget-visual-adjustments
maximus:fix/simpl-resultat-23-dashboard-category-ordering
maximus:fix/simpl-resultat-16-prev-year-budget
maximus:fix/simpl-resultat-19-tooltip-transparency
maximus:fix/simpl-resultat-17-remove-piechart-title
maximus:fix/simpl-resultat-16-budget-previous-year
2 commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
b40381fb89 |
docs(reports): fix stale COMPARE_DELTA_SQL comment references
The constant became the compareDeltaSql() function in the previous commit (Issue #273); three comments still named the old constant. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> |
||
|
|
4a93c60ea7 |
feat(reports): plumb accountIds[] account filter into 7 report services
Give every report service an optional accountIds?: number[] filter that narrows results to a subset of import sources (transactions.source_id), matched via a parameterized IN (...) clause — one bound placeholder per id, never a joined string (CWE-89). New shared inPlaceholders() helper (src/utils/sqlFilters.ts) generates the placeholder list so the pattern lives in exactly one place. New accountIds param: getCompareMonthOverMonth, getCompareYearOverYear, getBudgetVsActualData, getCartesSnapshot (forwarded to its getCompareMonthOverMonth + getBudgetVsActualData sub-calls, so the Cartes dashboard's top-movers and budget-adherence cards respect an active filter instead of silently ignoring it). Signature change scalar -> plural: getMonthlyTrends, getCategoryOverTime, getExpensesByCategory (sourceId?: number -> accountIds?: number[]). No scalar production caller of these three passed sourceId today, so only the test call-sites needed updating to the array shape. Omitted/empty accountIds adds no clause at all, so every service stays byte-identical to its pre-#273 SQL/results — pinned by a regression test per service (new budgetService.test.ts / dashboardService.test.ts files, extended reportService.test.ts / reportService.cartes.test.ts). This is backend plumbing only: no report page exposes an account filter control yet (follow-up issues #274-#276 add the shared <FilterPanel> and wire it into Trends/Compare/Budget). Resolves #273 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> |