Commit Graph

1 Commits

Author SHA1 Message Date
Víctor Falcón a73adddb3b refactor(open-banking): extract shared connect flow into base controller
The Binance, Bitpanda, Coinbase, Indexa Capital, and Interactive Brokers connect
controllers each carried a ~60-line store() that was near-identical: subscription
gate, credential validation, Bank + BankingConnection creation, pending-account
mapping, and the onboarding/redirect branch. Any behavior change or bug fix had
to be repeated five times.

Introduce an abstract OpenBankingConnectController that owns the shared flow via a
template method (connect()), with per-provider extension points: provider(),
providerName(), bankLogo(), aspspCountry(), fetchProviderData(),
validationFailureLogMessage(), credentialErrorMessage(), buildPendingAccounts(),
and an optional emptyProviderDataMessage() guard (used by Interactive Brokers).
Each controller now declares only what varies.

Behavior is unchanged; the existing OpenBanking feature tests pass (304/304).

Wise is intentionally left as-is: it builds pending accounts before creating the
connection and has its own empty-result guard, so it does not fit this flow.
2026-07-04 19:59:19 +02:00