whisper-money/tests/Feature
Víctor Falcón c433088806
User Onboarding Flow (#23)
## Summary

Implements a complete user onboarding flow that guides new users through
setting up their account after registration.

## Features

- **Step-by-step wizard UI** with progress indicator and smooth
animations
- **E2E Encryption setup** with password strength indicator and
explanation of how encryption works
- **Account creation** supporting all account types (checking, savings,
credit card, investment, pension)
- **Category customization** with explanation of category types
(expenses, income, transfer)
- **Smart rules explanation** covering why there is no AI
auto-categorization (privacy & E2EE)
- **Transaction/balance import** based on account type
- **Sync integration** to ensure data consistency with backend

## Flow Diagram

```mermaid
flowchart TD
    A[User Registration] --> B[Welcome]

    B --> E[Encryption Explained]
    
    E --> C{Has encryption key?}

    C -->|No|F[Encryption Setup]
    C -->|Yes|G{Has Existing Accounts?}
    G -->|Yes| H[Show Existing Accounts]
    G -->|No| I[Create First Account]
    
    H --> J[Continue]
    I --> K{Account Type?}
    
    K -->|Checking/Savings/Credit Card| L[Import Transactions]
    K -->|Investment/Pension| M[Import Balances]
    
    J --> N[Category Types Explanation]
    L --> N
    M --> N
    
    N --> O[Customize Categories]
    O --> P[Smart Rules Explanation]
    P --> Q[More Accounts?]
    
    Q -->|Add More| I
    Q -->|Finish| R[Complete]
    
    R --> S[Redirect to Dashboard]
    S --> T{Subscribed?}
    T -->|No| U[Subscribe Page]
    T -->|Yes| V[Dashboard]
```

## Technical Changes

### Backend
- Added `onboarded_at` field to users table with migration
- Created `EnsureOnboardingComplete` middleware for redirect logic
- Created `OnboardingController` with index and complete actions
- Custom `RegisterResponse` to redirect new users to onboarding
- Updated `AccountController::store` to return JSON for fetch requests

### Frontend
- `OnboardingLayout` - fullscreen layout with step progress
- `useOnboardingState` hook - manages step navigation and state
- 12 step components for each onboarding screen
- Backend sync after account creation and imports

### Tests
- Feature tests for onboarding middleware
- Updated existing tests to use `onboarded()` factory state
2025-12-12 13:06:08 +01:00
..
Auth User Onboarding Flow (#23) 2025-12-12 13:06:08 +01:00
Console Fix improve testing 2025-11-26 11:52:01 +01:00
Onboarding User Onboarding Flow (#23) 2025-12-12 13:06:08 +01:00
Settings Accounts: Allow users to create custom banks with his own logo, and name (#12) 2025-12-04 15:24:04 +01:00
Sync Save transaction source (manually_created, or imported) 2025-11-28 12:36:48 +01:00
AccountBalanceControllerTest.php Accounts: new pages to list, and see account details (#13) 2025-12-05 14:33:18 +01:00
AccountBalanceSyncControllerTest.php feat(AccountBalanceSync): Update existing balances and add new ones efficiently 2025-12-01 11:04:50 +01:00
AccountControllerTest.php User Onboarding Flow (#23) 2025-12-12 13:06:08 +01:00
AutomationRuleTest.php Quick Categorization Wizard (#21) 2025-12-09 14:38:39 +01:00
DashboardAnalyticsTest.php Add bank relation to account model and update related components 2025-12-04 16:24:12 +01:00
DashboardTest.php User Onboarding Flow (#23) 2025-12-12 13:06:08 +01:00
EncryptionTest.php User Onboarding Flow (#23) 2025-12-12 13:06:08 +01:00
ExampleTest.php Install Pest 2025-11-07 12:01:58 +00:00
InertiaSharedDataTest.php SEO landing page 2025-11-25 11:33:11 +01:00
SitemapTest.php User Onboarding Flow (#23) 2025-12-12 13:06:08 +01:00
SubscriptionTest.php User Onboarding Flow (#23) 2025-12-12 13:06:08 +01:00
TransactionTest.php User Onboarding Flow (#23) 2025-12-12 13:06:08 +01:00
UserLeadTest.php Add User Lead functionality and tests 2025-11-25 10:31:25 +01:00