whisper-money/resources/js
Víctor Falcón 71dd6e2b7f
feat(budgets): track multiple categories and labels per budget (#466)
## Summary

Budgets previously tracked a single category **or** label (mutually
exclusive). This lets a budget span **multiple** categories and labels
at once, all pooling spend against one allocated amount per period.

Scope decided with the requester:
- **Shared pool** — one allocated amount; any tracked category/label
counts against it.
- **Multi categories + multi labels** on a single budget.
- **Create-only** — tracking is chosen at creation and locked afterward
(edit dialog shows it read-only).

## Changes

**Backend**
- New `budget_category` + `budget_label` pivot tables; data migration
copies existing `category_id`/`label_id` into them, then drops those
columns.
- `Budget` model: `categories()` / `labels()` belongsToMany.
- `BudgetTransactionService` matches transactions across **all** tracked
categories OR labels (live assignment + historical backfill).
- `StoreBudgetRequest` accepts `category_ids` / `label_ids` arrays,
requires ≥1 across both, validates ownership. `update` no longer touches
tracking.

**Frontend**
- Reusable `MultiSelect` (popover + command + badge).
- Create dialog uses multi-selects; cards and show page render tracked
categories/labels as badges; edit dialog shows them read-only.
- Dexie bumped to v10 (drops unused per-category allocations table, adds
`budget_labels`).

## Testing
- Updated all budget/transaction/listener/browser tests for the pivot
model; added cases for multi-category matching, mixed category+label
pooling, and store validation (empty selection + foreign-ownership).
- Added the new `__()` strings to `lang/es.json`.
- Local `pint`, `lint`, `format` pass. Relying on CI for the full suite.
2026-06-01 12:32:23 +02:00
..
components feat(budgets): track multiple categories and labels per budget (#466) 2026-06-01 12:32:23 +02:00
contexts Move transaction filtering from client-side to server-side (#126) 2026-02-16 12:49:04 +01:00
hooks feat(cashflow): add savings and period views (#424) 2026-05-25 16:41:00 +02:00
layouts feat(open-banking): remove feature flag gating (#297) 2026-04-17 10:20:05 +02:00
lib feat(budgets): track multiple categories and labels per budget (#466) 2026-06-01 12:32:23 +02:00
pages feat(budgets): track multiple categories and labels per budget (#466) 2026-06-01 12:32:23 +02:00
providers fix: move community link to user menu (#442) 2026-05-27 17:39:26 +02:00
services feat(transactions): add counterparty fields (#440) 2026-05-27 16:20:55 +02:00
types feat(budgets): track multiple categories and labels per budget (#466) 2026-06-01 12:32:23 +02:00
utils fix(accounts): translate update button in edit account modal (#455) 2026-05-30 16:09:30 +02:00
app.tsx fix: filter Safari cashback extension errors (#447) 2026-05-28 15:10:49 +02:00
ssr.tsx Remove plaintext-transactions feature flag & E2E references (#116) 2026-02-13 11:10:21 +01:00