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>
This commit is contained in:
Urtzi Alfaro
2025-11-30 08:48:56 +01:00
parent 2d9fc01515
commit fd657dea02
13 changed files with 2186 additions and 650 deletions

View File

@@ -32,16 +32,16 @@ async def get_demo_accounts():
"password": "DemoSanPablo2024!" if "sanpablo" in config["email"] else "DemoLaEspiga2024!",
"description": (
"Panadería individual que produce todo localmente"
if account_type == "individual_bakery"
if account_type == "professional"
else "Punto de venta con obrador central"
),
"features": (
["Gestión de Producción", "Recetas", "Inventario", "Ventas", "Previsión de Demanda"]
if account_type == "individual_bakery"
if account_type == "professional"
else ["Gestión de Proveedores", "Pedidos", "Inventario", "Ventas", "Previsión de Demanda"]
),
"business_model": (
"Producción Local" if account_type == "individual_bakery" else "Obrador Central + Punto de Venta"
"Producción Local" if account_type == "professional" else "Obrador Central + Punto de Venta"
)
})

View File

@@ -9,7 +9,8 @@ from datetime import datetime
class DemoSessionCreate(BaseModel):
"""Create demo session request"""
demo_account_type: str = Field(..., description="individual_bakery or central_baker")
demo_account_type: str = Field(..., description="professional or enterprise")
subscription_tier: Optional[str] = Field(None, description="Force specific subscription tier (professional/enterprise)")
user_id: Optional[str] = Field(None, description="Optional authenticated user ID")
ip_address: Optional[str] = None
user_agent: Optional[str] = None