26 lines
555 B
Python
26 lines
555 B
Python
"""Tenant schemas for API validation."""
|
|
|
|
import uuid
|
|
from datetime import datetime
|
|
|
|
from pydantic import BaseModel, ConfigDict, Field
|
|
|
|
|
|
class TenantCreate(BaseModel):
|
|
"""Schema for creating a new tenant."""
|
|
|
|
name: str = Field(..., min_length=1, max_length=255)
|
|
domain: str | None = Field(None, max_length=255)
|
|
|
|
|
|
class TenantResponse(BaseModel):
|
|
"""Schema for tenant response."""
|
|
|
|
model_config = ConfigDict(from_attributes=True)
|
|
|
|
id: uuid.UUID
|
|
name: str
|
|
domain: str | None
|
|
created_at: datetime
|
|
updated_at: datetime
|