Skip to content

Category analysis: recursive tree + monthly average column#55

Merged
tschaefermedia merged 2 commits into
mainfrom
fix/category-analysis-recursive-tree
Jul 3, 2026
Merged

Category analysis: recursive tree + monthly average column#55
tschaefermedia merged 2 commits into
mainfrom
fix/category-analysis-recursive-tree

Conversation

@tschaefermedia

@tschaefermedia tschaefermedia commented Jul 3, 2026

Copy link
Copy Markdown
Owner

Changes

1. Full recursive tree (any depth)

Categories wrapped under Einnahmen/Ausgaben umbrellas make the tree 3+ levels deep. Previously the detail view showed only 2 levels and the donut/treemap collapsed to a single box.

  • Controller emits a full recursive node tree (own + all descendants' totals, empty branches pruned).
  • Detail view uses a PrimeVue TreeTable — every level expands.
  • Donut/treemap descend past single wrapper roots to the first real breakdown, so they work however categories are grouped.

2. 'Mtl. Durchschnitt' (monthly average) column

  • Kategorien page — new column next to Buchungen: each category's own total ÷ months since the first transaction (up to the current month).
  • Analysis page — new column per active view (Ausgaben/Einnahmen), counting only the months up to the currently selected month, subtree-rolled to match the Betrag column.

Tests

  • test_aggregates_across_arbitrary_nesting_depth asserts the 3rd level reaches the payload.
  • test_monthly_average_counts_only_months_up_to_selected_month (analysis) and test_index_exposes_monthly_average (Kategorien).
  • All CategoryAnalysis + CategoryController tests pass; frontend builds.

Users can wrap categories under Einnahmen/Ausgaben umbrellas, making the tree
3+ levels deep. The detail view only rendered two levels, and the donut/treemap
charted top-level categories only — so with a single umbrella root they
collapsed to one meaningless box.

- Controller now emits a full recursive node tree (own + descendant totals,
  empty subtrees pruned) instead of a flattened two-level structure.
- Detail view uses a PrimeVue TreeTable so every level expands.
- Charts descend past single wrapper roots to the first level with a real
  breakdown, so they work regardless of how the tree is grouped.
- Kategorien page: new 'Mtl. Durchschnitt' column next to Buchungen — each
  category's own total over the months since the first transaction.
- Analysis: 'Mtl. Durchschnitt' column per active view, counting only the
  months up to the currently selected month (subtree-rolled, matching Betrag).
@tschaefermedia tschaefermedia changed the title Render category analysis as a full recursive tree at any depth Category analysis: recursive tree + monthly average column Jul 3, 2026
@tschaefermedia
tschaefermedia merged commit 48235a2 into main Jul 3, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant