whisper-money/app/Enums
Víctor Falcón 7cc49a5368
feat(analysis): project-aware transaction analysis (#513)
## What

Reworks the filtered **transaction analysis drawer** to behave like a
*project view* — a coherent set of related transactions (a trip, a
rental, a renovation, a side hustle) — and surfaces data that was
already computable but never shown.

### Two shapes, auto-detected
The drawer adapts to whether the set is **expense-only** or **income +
expense**, detected from the income share (`income >= 15% of expense`).
A stray refund won't flip a trip into a P&L view; a rental's rent will.

- **Expense mode:** total spent, daily average, cumulative spend line.
- **Income mode:** net result + margin %, income vs expense bars,
cumulative **net** line.

The mode can be overridden per filter (Auto / Expenses only / Income &
expenses), mirroring the existing daily-average override exactly:
remembered in the browser per filter fingerprint and synced to a
matching saved filter via a new `analysis_mode` column + PATCH endpoint.

### New panels (all from existing data)
- **Largest expenses** — top 5, expandable to 10, biggest spends first.
- **Spending by payee** — horizontal bars, gated to ≥2 named payees.
- **Spending by account** — list, gated to ≥2 accounts.

### Smarter table
The largest-expenses table hides any column the filter or the rows have
pinned to a single value (e.g. filtering by one label drops the Labels
column; a one-category result drops the Category column).

## Tests
- **Backend:** new Pest coverage for `largest_expenses`, payee/account
breakdowns, `cumulative_net`, and the `analysis_mode` endpoint
(`TransactionAnalysisTest`, `SavedFilterTest`) — all green.
- **Frontend:** 9 vitest cases covering mode detection/override, the day
override, and column hiding.
- New `__()` keys added to `lang/es.json`.

## Notes
- Adds migration `add_analysis_mode_to_saved_filters_table`.
2026-06-09 15:32:07 +02:00
..
AccountType.php feat(accounts): add real estate asset tracking (#241) 2026-03-24 10:21:32 +00:00
AnalysisMode.php feat(analysis): project-aware transaction analysis (#513) 2026-06-09 15:32:07 +02:00
BankingConnectionStatus.php feat: Integrate EnableBanking as open banking provider (#106) 2026-02-12 09:09:28 +01:00
BankingSyncLogStatus.php fix(banking): retry failed sync connections and log every sync attempt (#251) 2026-03-31 11:34:35 +01:00
BudgetPeriodType.php Add yearly budget period (#384) 2026-05-12 13:35:25 +02:00
CategoryCashflowDirection.php feat(cashflow): track transfer categories in trends (#236) 2026-03-18 14:02:47 +00:00
CategoryColor.php Add category type field support (#2) 2025-12-01 20:19:47 +01:00
CategoryDeletionStrategy.php feat: parent/child category tree (#474) 2026-06-03 19:30:12 +02:00
CategoryType.php feat(cashflow): add savings and period views (#424) 2026-05-25 16:41:00 +02:00
ChartColorScheme.php Add chart color scheme setting (#101) 2026-02-28 12:58:21 +01:00
DripEmailType.php fix: limit bank sync emails to one per day (#290) 2026-04-15 16:39:28 +02:00
LabelColor.php feat: add transaction labels feature (#24) 2025-12-13 13:02:19 +01:00
LeadCohort.php feat(leads): cohort-based launch invitations with per-user Stripe coupons (#333) 2026-04-30 15:10:28 +01:00
PropertyType.php feat(accounts): add real estate asset tracking (#241) 2026-03-24 10:21:32 +00:00
RolloverType.php Add Budgeting Feature to Track and Manage Spending (#36) 2026-01-21 15:25:50 +01:00
TransactionSource.php feat: Integrate EnableBanking as open banking provider (#106) 2026-02-12 09:09:28 +01:00