Files
celtic-life-science/app/organization/schemas.py
T
Shubhankar45 0d30c58bf0 Server backup 2026-11-07 of uncommitted work in projects/pharma-web-celtic
Snapshot of the working tree on srv1071960 (branch main), taken during
server cleanup. .env files, node_modules, builds, logs and media were excluded.
2026-11-07 05:43:12 +00:00

60 lines
1.5 KiB
Python

import uuid
from datetime import date
from pydantic import BaseModel, ConfigDict, Field
class CompanyCreate(BaseModel):
name: str = Field(min_length=2, max_length=200)
address: str | None = Field(default=None, max_length=500)
class CompanyRead(BaseModel):
model_config = ConfigDict(from_attributes=True)
id: uuid.UUID
name: str
address: str | None
is_active: bool
class HeadquartersCreate(BaseModel):
code: str = Field(min_length=1, max_length=20)
name: str = Field(min_length=2, max_length=200)
district: str | None = Field(default=None, max_length=100)
state: str | None = Field(default=None, max_length=100)
class HeadquartersRead(BaseModel):
model_config = ConfigDict(from_attributes=True)
id: uuid.UUID
company_id: uuid.UUID
code: str
name: str
district: str | None
state: str | None
is_active: bool
class AssignAreaManager(BaseModel):
area_manager_user_id: uuid.UUID
effective_from: date | None = None
class SetAreaManagerHeadquarters(BaseModel):
"""The complete list of headquarters an Area Business Manager should manage (may be empty)."""
headquarters_ids: list[uuid.UUID] = Field(default_factory=list, max_length=500)
effective_from: date | None = None
class AMHeadquartersRead(BaseModel):
model_config = ConfigDict(from_attributes=True)
id: uuid.UUID
area_manager_user_id: uuid.UUID
headquarters_id: uuid.UUID
effective_from: date
effective_to: date | None