Add Analyse page: expenses over all years with drill-down #4
Loading…
Reference in a new issue
No description provided.
Delete branch "analytics"
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?
Summary
A new Analyse page (Charts → Analyse,
/analytics) shows the current mandator's expenses over all years, with drill-down all expenses → subclass → account → booking text (first word, like the existing charts). This covers steps 1 and 2 of the analytics plan; more views (composition, year comparison, heatmap, table) follow in later PRs.The page replaces the old "Ausgaben" and "Zeitverlauf" charts, which are removed (see below). "Vermögen" stays until the Analyse page covers assets.
Page
?from=&to=&period=&sub=&acc=&text=): back/forward and bookmarks work. Data is loaded once per visit; every change is an in-memory query.Data
MultiYearRepository(IMultiYearRepository) reads Accounts / SubClasses / Transactions of any mandator and year. It is read-only (never creates folders or copies files) and shares the per-session cache with the other repositories, so a save in the current year is reflected immediately.ExpenseAnalysisflattens all years into one row per month / account / booking-text group:TransactionDataset.GetTextGroupgets a static overload so the grouping can be used without a transaction view.BaseRepositorycan load a cached list from any directory.Chart.js
wwwroot/lib/chartjswith its licence, checked against the npm registry checksum. There is no CDN dependency, so the app works offline.wwwroot/js/charts.jsloads it only when the page opens and styles it likeChartTheme(palette, font, de-CH numbers with').StackedBarChart.razorcreates the chart once and then updates it in place.Removed
/spendings, donut) and Zeitverlauf (/SpendingsOverTime, stacked bars) and their menu entries. Bookmarks to them now show "not found".ChartService.GetExpensesPerMonthAsyncwith its two helpers and its 6 tests; nothing else used them.ChartServicenow only serves the booking-text charts.Test plan
dotnet build --no-incremental: no warningsdotnet test: 75/75 pass (6 tests removed withGetExpensesPerMonthAsync), including 15 newExpenseAnalysisTestShouldtests (subclass totals, refunds, non-expense bookings, transfers, account renames across years, booking-text level, breadcrumb, book-year attribution, running year, quarters/years, year range, year-over-year comparison, no previous year, no data) and 4MultiYearRepositoryTestShouldtestsKnown limitations
🤖 Generated with Claude Code