Commit Graph

26 Commits

Author SHA1 Message Date
Urtzi Alfaro
d98558ed97 Refactor demo session architecture: consolidate metadata into fixture files
This commit refactors the demo session architecture to consolidate all demo
configuration data into the fixture files, removing redundant metadata files.

## Changes Made:

### 1. Data Consolidation
- **Removed**: `shared/demo/metadata/demo_users.json`
- **Removed**: `shared/demo/metadata/tenant_configs.json`
- **Updated**: Merged all user data into `02-auth.json` files
- **Updated**: Merged all tenant config data into `01-tenant.json` files

### 2. Enterprise Parent Tenant Updates
- Updated owner name to "Director" (matching auth fixtures)
- Added description field matching tenant_configs.json
- Added `base_tenant_id` to all child tenant entries
- Now includes all 5 child locations (Madrid, Barcelona, Valencia, Seville, Bilbao)

### 3. Professional Tenant Updates
- Added description field from tenant_configs.json
- Ensured consistency with auth fixtures

### 4. Code Updates
- **services/tenant/app/api/internal_demo.py**:
  - Fixed child tenant staff members to use enterprise parent users
  - Changed from professional staff IDs to enterprise staff IDs (Laura López, José Martínez, Francisco Moreno)

- **services/demo_session/app/core/config.py**:
  - Updated DEMO_ACCOUNTS configuration with all 5 child outlets
  - Updated enterprise tenant name and email to match fixtures
  - Added descriptions for all child locations

- **gateway/app/middleware/demo_middleware.py**:
  - Updated comments to reference fixture files as source of truth
  - Clarified that owner IDs come from 01-tenant.json files

- **frontend/src/stores/useTenantInitializer.ts**:
  - Updated tenant names and descriptions to match fixture files
  - Added comments linking to source fixture files

## Benefits:

1. **Single Source of Truth**: All demo data now lives in fixture files
2. **Consistency**: No more sync issues between metadata and fixtures
3. **Maintainability**: Easier to update demo data (one place per tenant type)
4. **Clarity**: Clear separation between template data (fixtures) and runtime config

## Enterprise Demo Fix:

The enterprise owner is now correctly added as a member of all child tenants, fixing
the issue where the tenant switcher didn't show parent/child tenants and the
establishments page didn't load tenants for the demo enterprise user.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-17 15:48:14 +01:00
Urtzi Alfaro
667e6e0404 New alert service 2025-12-05 20:07:01 +01:00
Urtzi Alfaro
972db02f6d New enterprise feature 2025-11-30 09:12:40 +01:00
Urtzi Alfaro
fd657dea02 refactor(demo): Standardize demo account type names across codebase
Standardize demo account type naming from inconsistent variants to clean names:
- individual_bakery, professional_bakery → professional
- central_baker, enterprise_chain → enterprise

This eliminates naming confusion that was causing bugs in the demo session
initialization, particularly for enterprise demo tenants where different
parts of the system used different names for the same concept.

Changes:
- Updated source of truth in demo_session config
- Updated all backend services (middleware, cloning, orchestration)
- Updated frontend types, pages, and stores
- Updated demo session models and schemas
- Removed all backward compatibility code as requested

Related to: Enterprise demo session access fix

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-30 08:48:56 +01:00
Urtzi Alfaro
54b7a5e080 Improve the UI and tests 2025-11-15 21:21:06 +01:00
Claude
7741dd8067 Fix frontend build TypeScript errors
Fixed multiple TypeScript type errors that were preventing the build from working properly:

1. Fixed infinite query type issue in forecasting.ts by excluding 'select' from options
2. Fixed Card variant type errors by changing contentPadding="default" to contentPadding="md"
3. Fixed router export issues by removing non-existent exports (ROUTE_CONFIGS, getRoutesForRole, etc.)
4. Fixed router readonly array type issues by updating RouteConfig interface
5. Fixed ProtectedRoute requiredRoles prop issue by removing invalid prop usage
6. Fixed auth store User type compatibility by allowing null for tenant_id
7. Fixed missing useToasts export from ui.store by removing from exports
8. Fixed permissions utility boolean type issues by wrapping expressions in Boolean()

The frontend build now completes successfully.
2025-11-06 18:39:20 +00:00
Urtzi Alfaro
63f5c6d512 Improve the frontend 3 2025-10-30 21:08:07 +01:00
Urtzi Alfaro
858d985c92 Improve the frontend modals 2025-10-27 16:33:26 +01:00
Urtzi Alfaro
7556a00db7 Improve the demo feature of the project 2025-10-12 18:47:33 +02:00
Urtzi Alfaro
dc8221bd2f Add DEMO feature to the project 2025-10-03 14:09:34 +02:00
Urtzi Alfaro
c9d8d1d071 Fix onboarding process not getting the subcription plan 2025-10-01 21:56:38 +02:00
Urtzi Alfaro
dc6c6f213f Fix some UI issues 2 2025-09-24 21:54:49 +02:00
Urtzi Alfaro
be1fec17c4 Fix some UI issues 2025-09-24 19:15:29 +02:00
Urtzi Alfaro
ee36c45d25 Add i18 support 2025-09-22 11:04:03 +02:00
Urtzi Alfaro
ecfc6a1997 Add frontend pages imporvements 2025-09-21 22:56:55 +02:00
Urtzi Alfaro
105410c9d3 Add order page with real API calls 2025-09-19 11:44:38 +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
2e1e696cb5 Simplify the onboardinf flow components 2025-09-08 17:19:00 +02:00
Urtzi Alfaro
d2083856fa Start integrating the onboarding flow with backend 10 2025-09-06 19:40:47 +02:00
Urtzi Alfaro
069954981a Start integrating the onboarding flow with backend 6 2025-09-05 17:49:48 +02:00
Urtzi Alfaro
9eedc2e5f2 Start integrating the onboarding flow with backend 2 2025-09-04 18:59:56 +02:00
Urtzi Alfaro
a11fdfba24 Start integrating the onboarding flow with backend 1 2025-09-03 18:29:56 +02:00
Urtzi Alfaro
b55da883c5 Improve ondobarding steps 2025-09-02 08:38:49 +02:00
Urtzi Alfaro
bde52d8ca2 Improve frontend 5 2025-08-31 22:14:05 +02:00
Urtzi Alfaro
0fd273cfce ADD new frontend 2025-08-28 10:41:04 +02:00