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 {

View File

@@ -95,10 +95,11 @@ export interface IngredientCreate {
// Note: average_cost is calculated automatically from purchases (not accepted on create)
standard_cost?: number | null;
// Stock management
low_stock_threshold?: number; // Default: 10.0
reorder_point?: number; // Default: 20.0
reorder_quantity?: number; // Default: 50.0
// Stock management - all optional for onboarding
// These can be configured later based on actual usage patterns
low_stock_threshold?: number | null;
reorder_point?: number | null;
reorder_quantity?: number | null;
max_stock_level?: number | null;
// Shelf life (default value only - actual per batch)
@@ -158,9 +159,9 @@ export interface IngredientResponse {
average_cost: number | null;
last_purchase_price: number | null;
standard_cost: number | null;
low_stock_threshold: number;
reorder_point: number;
reorder_quantity: number;
low_stock_threshold: number | null; // Now optional
reorder_point: number | null; // Now optional
reorder_quantity: number | null; // Now optional
max_stock_level: number | null;
shelf_life_days: number | null; // Default value only
is_active: boolean;