whisper-money/tests/Feature/OpenBanking
Víctor Falcón d48fea15b2
perf: make banking syncs incremental on subsequent runs (#141)
## Summary

- Subsequent syncs (every 6h) now only process recent data instead of
re-syncing full history, reducing unnecessary API calls and database
writes
- Full sync still runs automatically on first connection and can be
forced anytime with `banking:sync --full`
- Centralizes `isFirstSync` logic in `SyncBankingConnectionJob` and
propagates the `fullSync` flag through the entire chain: Command →
`SyncAllBankingConnectionsJob` → `SyncBankingConnectionJob` → provider
services

## Changes by provider

- **Indexa Capital**: Skips portfolio entries older than the last
recorded balance date on incremental syncs (the API doesn't support date
filtering, so filtering is done client-side)
- **Binance**: Reuses stored `invested_amount` from the database on
subsequent syncs instead of fetching up to 2 years of deposit/withdrawal
history in 90-day windows
- **EnableBanking / Bitpanda**: Already minimal — no changes needed

## Testing

- Fixed 6 existing Binance tests to pass `isFirstSync: true` for
invested amount calculation
- Added 7 new tests covering incremental sync behavior, full sync
override, and `--full` flag propagation
2026-02-23 15:10:40 +01:00
..
AccountMappingTest.php feat: Integrate EnableBanking as open banking provider (#106) 2026-02-12 09:09:28 +01:00
AuthorizationControllerTest.php fix: Delete pending connection and show toast on cancelled bank authorization (#111) 2026-02-12 11:10:15 +01:00
BalanceSyncServiceTest.php feat: Integrate EnableBanking as open banking provider (#106) 2026-02-12 09:09:28 +01:00
BinanceBalanceSyncTest.php perf: make banking syncs incremental on subsequent runs (#141) 2026-02-23 15:10:40 +01:00
BinanceControllerTest.php feat: Add Binance integration (#131) 2026-02-18 15:23:46 +01:00
BitpandaBalanceSyncTest.php feat: investment benefits — show gains/losses on investment accounts (#140) 2026-02-23 13:59:10 +01:00
BitpandaControllerTest.php feat: Add Bitpanda exchange integration (#132) 2026-02-19 09:26:31 +01:00
ConnectionControllerTest.php feat: Add Indexa Capital integration (#130) 2026-02-18 10:42:13 +01:00
IndexaCapitalBalanceSyncTest.php perf: make banking syncs incremental on subsequent runs (#141) 2026-02-23 15:10:40 +01:00
IndexaCapitalControllerTest.php feat: Add Indexa Capital integration (#130) 2026-02-18 10:42:13 +01:00
InstitutionControllerTest.php feat: Integrate EnableBanking as open banking provider (#106) 2026-02-12 09:09:28 +01:00
OpenBankingFeatureFlagTest.php feat: Integrate EnableBanking as open banking provider (#106) 2026-02-12 09:09:28 +01:00
SyncBankingConnectionJobTest.php perf: make banking syncs incremental on subsequent runs (#141) 2026-02-23 15:10:40 +01:00
SyncBinanceHistoricalBalancesJobTest.php feat: Add Binance integration (#131) 2026-02-18 15:23:46 +01:00
TransactionSyncServiceTest.php feat: Add per-bank description formatter for bank-synced transactions (#120) 2026-02-13 09:54:58 +01:00