## 🚪 Why? ### Problem The onboarding flow had no integration with connected (bank-linked) accounts. Users who connected a bank via OAuth were redirected to a separate account-mapping page, breaking the onboarding flow. After returning, there was no way to resume at the correct step. Additionally, connected accounts were incorrectly shown in the manual import steps (import-transactions / import-balances), which don't apply to them. ## 🔑 What? ### Changes - **Inline bank connect wizard**: Added `ConnectAccountInline` component that embeds the full 3-step bank OAuth flow within the onboarding `create-account` step, replacing the redirect to a separate page. - **Manual / Connected selection UI**: `StepCreateAccount` now presents a choice between manual and connected account setup before proceeding. - **Auto-account creation on OAuth callback**: `AccountMappingController` and `AuthorizationController` auto-create accounts for non-onboarded users and redirect back to `/onboarding?step=create-account` instead of showing the mapping UI. - **`?step=` deep-linking**: The onboarding page reads a `?step=` query param on mount and starts at that step, so returning from bank OAuth lands at the right place. - **Skip import steps for connected accounts**: `handleAccountCreated` detects `connected: true` and skips `import-transactions` / `import-balances`, going directly to `category-types` (first account) or `more-accounts` (subsequent accounts). - **Fix phantom account in more-accounts**: Connected accounts are no longer added to `createdAccounts` state (they already appear via `existingAccounts`), preventing a duplicate nameless entry in the final account list. - **Feature flags enabled in non-production**: `open-banking` and `account-mapping` Pennant flags now resolve to `! app()->isProduction()` instead of always `false`. - **Open-banking routes accessible during onboarding**: Removed `onboarded`/`subscribed` middleware from open-banking routes; `EnsureOnboardingComplete` middleware explicitly allows `open-banking.*` routes through. ## ✅ Verification ### Tests - Updated `tests/Browser/OnboardingFlowTest.php` to reflect new UI (manual/connected selection). - Existing feature tests for open-banking controllers pass (pre-existing failures in Binance/Bitpanda/IndexaCapital/AuthorizationController tests are from a prior commit unrelated to this work). ### Manual Verification - Connected account flow tested end-to-end: bank OAuth → auto-account creation → redirect to `create-account` step → Continue → skip import steps → `category-types`. - 7-account BBVA user correctly shows all accounts in `more-accounts` via `filteredExistingAccounts` with no phantom entry. - Feature flags confirmed active in local environment via tinker. |
||
|---|---|---|
| .. | ||
| cache | ||
| app.php | ||
| providers.php | ||