Files
saas_backend/app/schemas/auth/tenant_schema.py
T
2026-01-17 14:18:00 +05:30

34 lines
937 B
Python

from pydantic import BaseModel, Field
from typing import Optional, List
from datetime import datetime
import uuid
class TenantBase(BaseModel):
tenant_name: str = Field(..., min_length=2, max_length=100)
tenant_domain: str = Field(..., min_length=3, max_length=255)
tenant_logo_url: Optional[str] = None
class TenantCreate(TenantBase):
pass
class TenantUpdate(BaseModel):
tenant_name: Optional[str] = Field(None, min_length=2, max_length=100)
tenant_domain: Optional[str] = Field(None, min_length=3, max_length=255)
tenant_logo_url: Optional[str] = None
is_active: Optional[bool] = None
class TenantResponse(TenantBase):
id: uuid.UUID
is_active: bool
created_at: datetime
updated_at: datetime
class Config:
from_attributes = True
class TenantPaginatedResponse(BaseModel):
items: List[TenantResponse]
total: int
page: int
page_size: int
total_pages: int