whisper-money/app/Http/Requests/OpenBanking
Víctor Falcón cc63a86a1c
refactor(requests): extract user-owned exists rules to trait (#477)
## What

The `Rule::exists('x', 'id')->where(fn => user_id)` ownership closure
was repeated **19×** across 10 Form Requests (categories, labels,
accounts, typed accounts).

New `app/Http/Requests/Concerns/ValidatesUserOwnedResources` trait:

- `$this->userOwned('categories' | 'labels' | 'accounts')`
- `$this->userOwnedAccountOfType(AccountType::Loan | RealEstate)`

`UpdateAutomationRuleRequest` intentionally untouched — #476 makes it
extend Store.

## Stats

- **-110 / +63 lines**

## Checks

- `php artisan test
--filter="Transaction|Budget|Account|AutomationRule|RealEstate|Loan"` —
641 passed (3052 assertions), 1 skipped
- `vendor/bin/pint --dirty` — pass

Part of duplication-removal series (#475, #476).
2026-06-03 17:33:54 +02:00
..
ConnectBinanceRequest.php feat(open-banking): remove feature flag gating (#297) 2026-04-17 10:20:05 +02:00
ConnectBitpandaRequest.php feat(open-banking): remove feature flag gating (#297) 2026-04-17 10:20:05 +02:00
ConnectCoinbaseRequest.php feat: Coinbase banking integration (#388) 2026-05-13 19:53:30 +02:00
ConnectIndexaCapitalRequest.php feat(open-banking): remove feature flag gating (#297) 2026-04-17 10:20:05 +02:00
DestroyConnectionRequest.php feat: Integrate EnableBanking as open banking provider (#106) 2026-02-12 09:09:28 +01:00
ListInstitutionsRequest.php feat(open-banking): remove feature flag gating (#297) 2026-04-17 10:20:05 +02:00
MapAccountsRequest.php refactor(requests): extract user-owned exists rules to trait (#477) 2026-06-03 17:33:54 +02:00
StartAuthorizationRequest.php feat(open-banking): remove feature flag gating (#297) 2026-04-17 10:20:05 +02:00
UpdateConnectionCredentialsRequest.php feat: Coinbase banking integration (#388) 2026-05-13 19:53:30 +02:00