| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- """
- Pydantic schemas for Organization model.
- """
- from datetime import datetime
- from pydantic import BaseModel, EmailStr
- class OrganizationBase(BaseModel):
- """Base organization schema."""
- name: str
- contact_email: EmailStr
- contact_phone: str | None = None
- class OrganizationCreate(OrganizationBase):
- """Schema for creating an organization."""
- wifi_enabled: bool = False
- ble_enabled: bool = False
- class OrganizationUpdate(BaseModel):
- """Schema for updating an organization."""
- name: str | None = None
- contact_email: EmailStr | None = None
- contact_phone: str | None = None
- wifi_enabled: bool | None = None
- ble_enabled: bool | None = None
- status: str | None = None
- notes: str | None = None
- class OrganizationResponse(OrganizationBase):
- """Schema for organization response."""
- id: int
- wifi_enabled: bool
- ble_enabled: bool
- status: str
- notes: str | None
- created_at: datetime
- class Config:
- from_attributes = True
- class OrganizationListResponse(BaseModel):
- """Schema for list of organizations."""
- organizations: list[OrganizationResponse]
- total: int
|