IMPORVE ONBOARDING STEPS

This commit is contained in:
Urtzi Alfaro
2025-11-09 09:22:08 +01:00
parent 4678f96f8f
commit cbe19a3cd1
27 changed files with 2801 additions and 1149 deletions

View File

@@ -5,23 +5,41 @@
import { apiClient } from '../client';
import { UserProgress, UpdateStepRequest } from '../types/onboarding';
// Backend onboarding steps (full list from backend)
// Backend onboarding steps (full list from backend - UPDATED to match refactored flow)
export const BACKEND_ONBOARDING_STEPS = [
'user_registered', // Auto-completed: User account created
'setup', // Step 1: Basic bakery setup and tenant creation
'smart-inventory-setup', // Step 2: Sales data upload and inventory configuration
'suppliers', // Step 3: Suppliers configuration (optional)
'ml-training', // Step 4: AI model training
'completion' // Step 5: Onboarding completed
'user_registered', // Phase 0: User account created (auto-completed)
'bakery-type-selection', // Phase 1: Choose bakery type
'setup', // Phase 2: Basic bakery setup and tenant creation
'upload-sales-data', // Phase 2a: File upload, validation, AI classification
'inventory-review', // Phase 2a: Review AI-detected products with type selection
'initial-stock-entry', // Phase 2a: Capture initial stock levels
'product-categorization', // Phase 2b: Advanced categorization (optional)
'suppliers-setup', // Phase 2c: Suppliers configuration
'recipes-setup', // Phase 3: Production recipes (optional)
'production-processes', // Phase 3: Finishing processes (optional)
'quality-setup', // Phase 3: Quality standards (optional)
'team-setup', // Phase 3: Team members (optional)
'ml-training', // Phase 4: AI model training
'setup-review', // Phase 4: Review all configuration
'completion' // Phase 4: Onboarding completed
];
// Frontend step order for navigation (excludes user_registered as it's auto-completed)
export const FRONTEND_STEP_ORDER = [
'setup', // Step 1: Basic bakery setup and tenant creation
'smart-inventory-setup', // Step 2: Sales data upload and inventory configuration
'suppliers', // Step 3: Suppliers configuration (optional)
'ml-training', // Step 4: AI model training
'completion' // Step 5: Onboarding completed
'bakery-type-selection', // Phase 1: Choose bakery type
'setup', // Phase 2: Basic bakery setup and tenant creation
'upload-sales-data', // Phase 2a: File upload and AI classification
'inventory-review', // Phase 2a: Review AI-detected products
'initial-stock-entry', // Phase 2a: Initial stock levels
'product-categorization', // Phase 2b: Advanced categorization (optional)
'suppliers-setup', // Phase 2c: Suppliers configuration
'recipes-setup', // Phase 3: Production recipes (optional)
'production-processes', // Phase 3: Finishing processes (optional)
'quality-setup', // Phase 3: Quality standards (optional)
'team-setup', // Phase 3: Team members (optional)
'ml-training', // Phase 4: AI model training
'setup-review', // Phase 4: Review configuration
'completion' // Phase 4: Onboarding completed
];
export class OnboardingService {