Improve the frontend 2
This commit is contained in:
@@ -57,7 +57,7 @@ class BakeryRegistration(BaseModel):
|
||||
return v
|
||||
|
||||
class TenantResponse(BaseModel):
|
||||
"""Tenant response schema - FIXED VERSION"""
|
||||
"""Tenant response schema - Updated to use subscription relationship"""
|
||||
id: str # ✅ Keep as str for Pydantic validation
|
||||
name: str
|
||||
subdomain: Optional[str]
|
||||
@@ -68,12 +68,12 @@ class TenantResponse(BaseModel):
|
||||
postal_code: str
|
||||
phone: Optional[str]
|
||||
is_active: bool
|
||||
subscription_tier: str
|
||||
subscription_plan: Optional[str] = None # Populated from subscription relationship or service
|
||||
ml_model_trained: bool
|
||||
last_training_date: Optional[datetime]
|
||||
owner_id: str # ✅ Keep as str for Pydantic validation
|
||||
created_at: datetime
|
||||
|
||||
|
||||
# ✅ FIX: Add custom validator to convert UUID to string
|
||||
@field_validator('id', 'owner_id', mode='before')
|
||||
@classmethod
|
||||
@@ -82,7 +82,7 @@ class TenantResponse(BaseModel):
|
||||
if isinstance(v, UUID):
|
||||
return str(v)
|
||||
return v
|
||||
|
||||
|
||||
class Config:
|
||||
from_attributes = True
|
||||
|
||||
|
||||
Reference in New Issue
Block a user