Commit Graph

72 Commits

Author SHA1 Message Date
Urtzi Alfaro
cbe19a3cd1 IMPORVE ONBOARDING STEPS 2025-11-09 09:22:08 +01:00
Claude
4c647f4182 Fix onboarding API dependencies after removing manual path
**Root Cause:**
Frontend removed data-source-choice step and manual path, but backend
still required data-source-choice as dependency for smart-inventory-setup.

This caused: "Cannot complete step smart-inventory-setup: dependencies not met"

**Changes:**

1. **Removed data-source-choice step** (line 48)
   - No longer in ONBOARDING_STEPS list
   - AI-assisted is now the only path

2. **Updated setup dependencies** (line 79)
   - Before: "setup": ["user_registered", "data-source-choice"]
   - After: "setup": ["user_registered", "bakery-type-selection"]
   - Removed dependency on non-existent step

3. **Removed manual path steps**
   - Removed "inventory-setup" from ONBOARDING_STEPS
   - Kept only AI-assisted path steps

4. **Updated suppliers dependencies** (line 87)
   - Now requires "smart-inventory-setup" completion
   - Makes logical sense: need inventory before suppliers

5. **Simplified ML training validation** (lines 278-299)
   - Removed manual path check (inventory-setup)
   - Only validates AI path (smart-inventory-setup)
   - Cleaner logic without dual-path complexity

**Step Order (Updated):**
```
1. user_registered
2. bakery-type-selection
3. setup (tenant creation)
4. smart-inventory-setup (AI inventory)
5. product-categorization
6. initial-stock-entry
7. suppliers-setup
8. recipes-setup (optional)
9. production-processes (optional)
10. quality-setup (optional)
11. team-setup (optional)
12. ml-training
13. setup-review
14. completion
```

**Dependency Chain (Fixed):**
```
smart-inventory-setup → setup → bakery-type-selection → user_registered
(was broken: smart-inventory-setup → setup → data-source-choice [MISSING!])
```

**Files Modified:**
- services/auth/app/api/onboarding_progress.py:42-101,278-299

**Impact:**
 Onboarding steps now work correctly from initial bakery registration
 No more "dependencies not met" errors
 Backend matches frontend architecture
2025-11-07 08:18:39 +00:00
Claude
b22634388d Make backend robust with comprehensive onboarding steps
Backend Changes (services/auth/app/api/onboarding_progress.py):
- Expanded ONBOARDING_STEPS to include all 19 frontend steps
  - Phase 0: user_registered (system)
  - Phase 1: bakery-type-selection, data-source-choice (discovery)
  - Phase 2: setup, smart-inventory-setup, product-categorization, initial-stock-entry (core setup & AI path)
  - Phase 2b: suppliers-setup, inventory-setup, recipes-setup, production-processes (manual path)
  - Phase 3: quality-setup, team-setup (advanced config)
  - Phase 4: ml-training, setup-review, completion (finalization)

- Updated STEP_DEPENDENCIES with granular requirements
  - AI path: smart-inventory-setup → product-categorization → initial-stock-entry
  - Manual path: Independent setup for suppliers, inventory, recipes, processes
  - Flexible ML training: accepts either AI or manual inventory path

- Enhanced ML training validation
  - Supports both AI-assisted path (sales data) and manual inventory path
  - More flexible validation logic for multi-path onboarding

Frontend Changes (UnifiedOnboardingWizard.tsx):
- Fixed auto-complete step name: 'suppliers' → 'suppliers-setup'
- All step IDs now match backend ONBOARDING_STEPS exactly
- Removed temporary step mapping workarounds

Frontend Changes (apiClient.ts):
- Fixed tenant ID requirement warnings for onboarding endpoints
- Added noTenantEndpoints list for user-level endpoints:
  - /auth/me/onboarding (tenant created during onboarding)
  - /auth/me (user profile)
  - /auth/register, /auth/login
- Eliminated false warnings during onboarding flow

This makes the onboarding system fully functional with:
 Backend validates all 19 onboarding steps
 Proper dependency tracking for multi-path onboarding
 No more "Invalid step name" errors
 No more tenant ID warnings for onboarding
 Robust state tracking for complete user journey
2025-11-06 13:38:06 +00:00
Urtzi Alfaro
269d3b5032 Add user delete process 2025-10-31 11:54:19 +01:00
Urtzi Alfaro
36217a2729 Improve the frontend 2 2025-10-29 06:58:05 +01:00
Urtzi Alfaro
858d985c92 Improve the frontend modals 2025-10-27 16:33:26 +01:00
Urtzi Alfaro
61376b7a9f Improve the frontend and fix TODOs 2025-10-24 13:05:04 +02:00
Urtzi Alfaro
b6cb800758 Improve GDPR implementation 2025-10-16 07:28:04 +02:00
Urtzi Alfaro
8f9e9a7edc Add role-based filtering and imporve code 2025-10-15 16:12:49 +02:00
Urtzi Alfaro
7c72f83c51 REFACTOR ALL APIs fix 1 2025-10-07 07:15:07 +02:00
Urtzi Alfaro
38fb98bc27 REFACTOR ALL APIs 2025-10-06 15:27:01 +02:00
Urtzi Alfaro
c9d8d1d071 Fix onboarding process not getting the subcription plan 2025-10-01 21:56:38 +02:00
Urtzi Alfaro
2eeebfc1e0 Fix Alembic issue 2025-10-01 11:24:06 +02:00
Urtzi Alfaro
7cc4b957a5 Fix DB issue 2s 2025-09-30 21:58:10 +02:00
Urtzi Alfaro
ec6bcb4c7d Add migration services 2025-09-30 08:12:45 +02:00
Urtzi Alfaro
befcc126b0 Refactor all main.py 2025-09-29 13:13:12 +02:00
Urtzi Alfaro
4777e59e7a Add base kubernetes support final fix 4 2025-09-29 07:54:25 +02:00
Urtzi Alfaro
222f945466 Add base kubernetes support 2 2025-09-27 12:10:43 +02:00
Urtzi Alfaro
63a3f9c77a Add base kubernetes support 2025-09-27 11:18:13 +02:00
Urtzi Alfaro
dcb3ce441b Improve the inventory page 2025-09-17 16:06:30 +02:00
Urtzi Alfaro
5269a083b6 Imporve the role based forntend protected roles 2025-09-09 07:32:59 +02:00
Urtzi Alfaro
b73f3b4993 Start integrating the onboarding flow with backend 12 2025-09-07 17:25:30 +02:00
Urtzi Alfaro
a11fdfba24 Start integrating the onboarding flow with backend 1 2025-09-03 18:29:56 +02:00
Urtzi Alfaro
c4d4aeb449 Add onboardin steps improvements 2025-08-11 07:01:08 +02:00
Urtzi Alfaro
62ca49d4b8 Improve the design of the frontend 2025-08-08 19:21:23 +02:00
Urtzi Alfaro
488bb3ef93 REFACTOR - Database logic 2025-08-08 09:08:41 +02:00
Urtzi Alfaro
b0d83720fd Fix user delete flow 12 2025-08-03 14:42:33 +02:00
Urtzi Alfaro
b35eb7c875 Fix user delete flow 11 2025-08-03 00:16:31 +02:00
Urtzi Alfaro
a65386e138 Fix user delete flow 10 2025-08-02 23:42:59 +02:00
Urtzi Alfaro
abe74f32f8 Fix user delete flow 9 2025-08-02 23:29:18 +02:00
Urtzi Alfaro
8d1b7c1efb Fix user delete flow 4 2025-08-02 18:38:14 +02:00
Urtzi Alfaro
eedbc2401e Fix user delete flow 3 2025-08-02 18:18:05 +02:00
Urtzi Alfaro
66716c054d Fix user delete flow 2 2025-08-02 17:53:28 +02:00
Urtzi Alfaro
3681429e11 Improve user delete flow 2025-08-02 17:09:53 +02:00
Urtzi Alfaro
277e8bec73 Add user role 2025-08-02 09:41:50 +02:00
Urtzi Alfaro
d4687e6375 Add the initial user admin delete code 2025-08-01 22:20:32 +02:00
Urtzi Alfaro
97ae58fb06 REFACTOR API gateway fix 8 2025-07-26 23:29:57 +02:00
Urtzi Alfaro
1291d05183 REFACTOR API gateway fix 7 2025-07-26 22:03:55 +02:00
Urtzi Alfaro
de3bd5e541 REFACTOR API gateway fix 6 2025-07-26 21:48:53 +02:00
Urtzi Alfaro
dacf114922 REFACTOR API gateway fix 4 2025-07-26 20:24:21 +02:00
Urtzi Alfaro
735f8c233c REFACTOR API gateway fix 4 2025-07-26 20:14:17 +02:00
Urtzi Alfaro
6176d5c4d8 REFACTOR API gateway fix 3 2025-07-26 20:04:24 +02:00
Urtzi Alfaro
b0629c5971 REFACTOR API gateway fix 1 2025-07-26 19:15:18 +02:00
Urtzi Alfaro
e4885db828 REFACTOR API gateway 2025-07-26 18:46:52 +02:00
Urtzi Alfaro
5959eb6e15 Add new frontend - fix 8 2025-07-22 13:46:05 +02:00
Urtzi Alfaro
153ae3f154 Fix forecasting service 2025-07-21 20:43:17 +02:00
Urtzi Alfaro
2d85dd3e9e Imporve gateway auth for all services 2025-07-21 14:41:33 +02:00
Urtzi Alfaro
2ee5117d48 Fix tenant register 2 2025-07-20 23:43:42 +02:00
Urtzi Alfaro
daab1b77e1 Fix login issue 2025-07-20 21:29:58 +02:00
Urtzi Alfaro
608585c72c Improve auth process 4 2025-07-20 09:18:08 +02:00