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>
274 lines
8.3 KiB
JSON
274 lines
8.3 KiB
JSON
{
|
|
"users": [
|
|
{
|
|
"id": "d2e3f4a5-b6c7-48d9-e0f1-a2b3c4d5e6f7",
|
|
"tenant_id": "80000000-0000-4000-a000-000000000001",
|
|
"name": "Director",
|
|
"full_name": "Director",
|
|
"email": "director@panaderiaartesana.es",
|
|
"role": "owner",
|
|
"is_active": true,
|
|
"created_at": "BASE_TS - 365d",
|
|
"updated_at": "BASE_TS - 365d"
|
|
},
|
|
{
|
|
"id": "ae38accc-1ad4-410d-adbc-a55630908924",
|
|
"tenant_id": "80000000-0000-4000-a000-000000000001",
|
|
"name": "Produccion",
|
|
"email": "produccion@panaderiaartesana.es",
|
|
"role": "production_director",
|
|
"is_active": true,
|
|
"created_at": "BASE_TS - 300d",
|
|
"updated_at": "BASE_TS - 300d"
|
|
},
|
|
{
|
|
"id": "9d04ab32-8b7f-4f71-b88f-d7bf1452a010",
|
|
"tenant_id": "80000000-0000-4000-a000-000000000001",
|
|
"name": "Compras",
|
|
"email": "compras@panaderiaartesana.es",
|
|
"role": "procurement_manager",
|
|
"is_active": true,
|
|
"created_at": "BASE_TS - 280d",
|
|
"updated_at": "BASE_TS - 280d"
|
|
},
|
|
{
|
|
"id": "80765906-0074-4206-8f58-5867df1975fd",
|
|
"tenant_id": "80000000-0000-4000-a000-000000000001",
|
|
"email": "calidad@panaderiaartesana.es",
|
|
"first_name": "Jos\u00e9",
|
|
"last_name": "Mart\u00ednez",
|
|
"role": "quality_control",
|
|
"department": "quality",
|
|
"position": "Responsable de Calidad",
|
|
"phone": "+34 916 123 459",
|
|
"is_active": true,
|
|
"created_at": "BASE_TS - 250d",
|
|
"permissions": [
|
|
"quality_control",
|
|
"batch_approve",
|
|
"quality_reports"
|
|
],
|
|
"name": "Jos\u00e9 Mart\u00ednez",
|
|
"updated_at": "BASE_TS - 250d"
|
|
},
|
|
{
|
|
"id": "f6c54d0f-5899-4952-ad94-7a492c07167a",
|
|
"tenant_id": "80000000-0000-4000-a000-000000000001",
|
|
"email": "logistica@panaderiaartesana.es",
|
|
"first_name": "Laura",
|
|
"last_name": "L\u00f3pez",
|
|
"role": "logistics_coord",
|
|
"department": "logistics",
|
|
"position": "Coordinadora de Log\u00edstica",
|
|
"phone": "+34 916 123 460",
|
|
"is_active": true,
|
|
"created_at": "BASE_TS - 230d",
|
|
"permissions": [
|
|
"distribution_manage",
|
|
"inventory_view",
|
|
"order_manage"
|
|
],
|
|
"name": "Laura L\u00f3pez",
|
|
"updated_at": "BASE_TS - 230d"
|
|
},
|
|
{
|
|
"id": "77621701-e794-48d9-87d7-dc8db905efc0",
|
|
"tenant_id": "80000000-0000-4000-a000-000000000001",
|
|
"email": "maestro1@panaderiaartesana.es",
|
|
"first_name": "Antonio",
|
|
"last_name": "S\u00e1nchez",
|
|
"role": "master_baker",
|
|
"department": "production",
|
|
"position": "Maestro Panadero Principal",
|
|
"phone": "+34 916 123 461",
|
|
"is_active": true,
|
|
"created_at": "BASE_TS - 320d",
|
|
"permissions": [
|
|
"recipe_manage",
|
|
"production_manage",
|
|
"training"
|
|
],
|
|
"name": "Antonio S\u00e1nchez",
|
|
"updated_at": "BASE_TS - 320d"
|
|
},
|
|
{
|
|
"id": "f21dadbf-a37e-4f53-86e6-b5f34a0c792f",
|
|
"tenant_id": "80000000-0000-4000-a000-000000000001",
|
|
"email": "maestro2@panaderiaartesana.es",
|
|
"first_name": "Isabel",
|
|
"last_name": "Ruiz",
|
|
"role": "master_baker",
|
|
"department": "production",
|
|
"position": "Maestra Panadera Senior",
|
|
"phone": "+34 916 123 462",
|
|
"is_active": true,
|
|
"created_at": "BASE_TS - 280d",
|
|
"permissions": [
|
|
"recipe_manage",
|
|
"production_manage",
|
|
"training"
|
|
],
|
|
"name": "Isabel Ruiz",
|
|
"updated_at": "BASE_TS - 280d"
|
|
},
|
|
{
|
|
"id": "701cb9d2-6049-4bb9-8d3a-1b3bd3aae45f",
|
|
"tenant_id": "80000000-0000-4000-a000-000000000001",
|
|
"email": "almacen1@panaderiaartesana.es",
|
|
"first_name": "Francisco",
|
|
"last_name": "Moreno",
|
|
"role": "warehouse_supervisor",
|
|
"department": "warehouse",
|
|
"position": "Supervisor de Almac\u00e9n",
|
|
"phone": "+34 916 123 463",
|
|
"is_active": true,
|
|
"created_at": "BASE_TS - 200d",
|
|
"permissions": [
|
|
"inventory_manage",
|
|
"stock_receive",
|
|
"stock_transfer"
|
|
],
|
|
"name": "Francisco Moreno",
|
|
"updated_at": "BASE_TS - 200d"
|
|
},
|
|
{
|
|
"id": "a98bbee4-96fa-4840-9eb7-1f35c6e83a36",
|
|
"tenant_id": "80000000-0000-4000-a000-000000000001",
|
|
"email": "almacen2@panaderiaartesana.es",
|
|
"first_name": "Carmen",
|
|
"last_name": "Jim\u00e9nez",
|
|
"role": "warehouse_supervisor",
|
|
"department": "warehouse",
|
|
"position": "Supervisora de Almac\u00e9n Turno Noche",
|
|
"phone": "+34 916 123 464",
|
|
"is_active": true,
|
|
"created_at": "BASE_TS - 180d",
|
|
"permissions": [
|
|
"inventory_manage",
|
|
"stock_receive",
|
|
"stock_transfer"
|
|
],
|
|
"name": "Carmen Jim\u00e9nez",
|
|
"updated_at": "BASE_TS - 180d"
|
|
},
|
|
{
|
|
"id": "022fba62-ff2a-4a38-b345-42228e11f04a",
|
|
"tenant_id": "80000000-0000-4000-a000-000000000001",
|
|
"email": "analisis@panaderiaartesana.es",
|
|
"first_name": "David",
|
|
"last_name": "Gonz\u00e1lez",
|
|
"role": "operations_analyst",
|
|
"department": "operations",
|
|
"position": "Analista de Operaciones",
|
|
"phone": "+34 916 123 465",
|
|
"is_active": true,
|
|
"created_at": "BASE_TS - 150d",
|
|
"permissions": [
|
|
"reports_view",
|
|
"analytics_view",
|
|
"forecasting_view"
|
|
],
|
|
"name": "David Gonz\u00e1lez",
|
|
"updated_at": "BASE_TS - 150d"
|
|
},
|
|
{
|
|
"id": "ba2ce42e-efd7-46a6-aa09-d9f9afc1c63f",
|
|
"tenant_id": "80000000-0000-4000-a000-000000000001",
|
|
"email": "mantenimiento@panaderiaartesana.es",
|
|
"first_name": "Pedro",
|
|
"last_name": "D\u00edaz",
|
|
"role": "maintenance_tech",
|
|
"department": "maintenance",
|
|
"position": "T\u00e9cnico de Mantenimiento",
|
|
"phone": "+34 916 123 466",
|
|
"is_active": true,
|
|
"created_at": "BASE_TS - 200d",
|
|
"permissions": [
|
|
"equipment_view",
|
|
"maintenance_log"
|
|
],
|
|
"name": "Pedro D\u00edaz",
|
|
"updated_at": "BASE_TS - 200d"
|
|
},
|
|
{
|
|
"id": "ba8ca79b-b81e-4fe9-b064-e58a34bf0fa3",
|
|
"tenant_id": "80000000-0000-4000-a000-000000000001",
|
|
"email": "turno.dia@panaderiaartesana.es",
|
|
"first_name": "Rosa",
|
|
"last_name": "Navarro",
|
|
"role": "shift_supervisor",
|
|
"department": "production",
|
|
"position": "Supervisora Turno D\u00eda",
|
|
"phone": "+34 916 123 467",
|
|
"is_active": true,
|
|
"created_at": "BASE_TS - 180d",
|
|
"permissions": [
|
|
"production_view",
|
|
"batch_create",
|
|
"staff_manage"
|
|
],
|
|
"name": "Rosa Navarro",
|
|
"updated_at": "BASE_TS - 180d"
|
|
},
|
|
{
|
|
"id": "75e92fec-e052-4e90-bd96-804eed44926c",
|
|
"tenant_id": "80000000-0000-4000-a000-000000000001",
|
|
"email": "turno.tarde@panaderiaartesana.es",
|
|
"first_name": "Manuel",
|
|
"last_name": "Torres",
|
|
"role": "shift_supervisor",
|
|
"department": "production",
|
|
"position": "Supervisor Turno Tarde",
|
|
"phone": "+34 916 123 468",
|
|
"is_active": true,
|
|
"created_at": "BASE_TS - 160d",
|
|
"permissions": [
|
|
"production_view",
|
|
"batch_create",
|
|
"staff_manage"
|
|
],
|
|
"name": "Manuel Torres",
|
|
"updated_at": "BASE_TS - 160d"
|
|
},
|
|
{
|
|
"id": "6fec3a43-f83d-47c3-b760-54105fcbf7f1",
|
|
"tenant_id": "80000000-0000-4000-a000-000000000001",
|
|
"email": "turno.noche@panaderiaartesana.es",
|
|
"first_name": "Luc\u00eda",
|
|
"last_name": "Romero",
|
|
"role": "shift_supervisor",
|
|
"department": "production",
|
|
"position": "Supervisora Turno Noche",
|
|
"phone": "+34 916 123 469",
|
|
"is_active": true,
|
|
"created_at": "BASE_TS - 140d",
|
|
"permissions": [
|
|
"production_view",
|
|
"batch_create",
|
|
"staff_manage"
|
|
],
|
|
"name": "Luc\u00eda Romero",
|
|
"updated_at": "BASE_TS - 140d"
|
|
},
|
|
{
|
|
"id": "743fd2c8-58b8-4431-a49f-085e0c284ff0",
|
|
"tenant_id": "80000000-0000-4000-a000-000000000001",
|
|
"email": "it@panaderiaartesana.es",
|
|
"first_name": "Javier",
|
|
"last_name": "Vargas",
|
|
"role": "it_admin",
|
|
"department": "it",
|
|
"position": "Administrador de Sistemas",
|
|
"phone": "+34 916 123 470",
|
|
"is_active": true,
|
|
"created_at": "BASE_TS - 200d",
|
|
"permissions": [
|
|
"system_admin",
|
|
"user_manage",
|
|
"settings_manage"
|
|
],
|
|
"name": "Javier Vargas",
|
|
"updated_at": "BASE_TS - 200d"
|
|
}
|
|
]
|
|
} |