whisper-money/tests/Browser
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
..
assets Improve automation rules and sync error handling 2025-12-01 10:30:22 +01:00
.gitignore Add category type field support (#2) 2025-12-01 20:19:47 +01:00
AccountsPageTest.php test: expand browser coverage for accounts and linked loans (#277) 2026-04-13 09:33:18 +01:00
AmountInputTest.php fix(transactions): fix toolbar overflow on mobile and shorten button label (#175) 2026-03-01 17:57:59 +00:00
AuthenticationTest.php Support soft-deleted users with reusable emails (#316) 2026-04-22 11:41:41 +01:00
AutomationRuleBuilderTest.php feat(automation-rules): simplify smart rules UI, fix re-evaluation, and localize amounts (#161) 2026-02-28 13:24:57 +00:00
BankAccountsTest.php feat(loans): backfill historical balances on loan creation (#322) 2026-04-24 13:09:34 +01:00
BudgetCrudTest.php feat(budgets): track multiple categories and labels per budget (#466) 2026-06-01 12:32:23 +02:00
BudgetsFeatureNavigationTest.php feat(budgets): track multiple categories and labels per budget (#466) 2026-06-01 12:32:23 +02:00
CashflowCategoryNavigationTest.php feat(cashflow): make income/expense category rows clickable to transactions (#234) 2026-03-17 10:57:40 +00:00
CategoriesTest.php fix(categories): expose cashflow setting on create (#448) 2026-05-29 11:05:04 +02:00
ImportTransactionsTest.php Remove encryption from browser tests and demo user (#129) 2026-02-17 11:45:27 +01:00
OnboardingFlowTest.php fix(accounts): sync currency from first account (#430) 2026-05-25 20:55:24 +02:00
RealEstateAccountTest.php refactor(real-estate): remove Pennant gating (#308) 2026-04-20 13:31:49 +01:00
TransactionsTest.php Fix label creation dropdown refresh (#363) 2026-05-07 10:26:43 +01:00