Files
celtic-life-science/app/chemists/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

40 lines
1.2 KiB
Python

import uuid
from datetime import datetime
from pydantic import BaseModel, ConfigDict, Field
class ChemistCreate(BaseModel):
headquarters_id: uuid.UUID
name: str = Field(min_length=2, max_length=200)
shop_address: str = Field(min_length=2, max_length=500)
contact_number: str | None = Field(default=None, max_length=20)
class ChemistUpdate(BaseModel):
headquarters_id: uuid.UUID | None = None
name: str | None = Field(default=None, min_length=2, max_length=200)
shop_address: str | None = Field(default=None, min_length=2, max_length=500)
contact_number: str | None = Field(default=None, max_length=20)
is_active: bool | None = None
class ChemistRead(BaseModel):
model_config = ConfigDict(from_attributes=True)
id: uuid.UUID
headquarters_id: uuid.UUID
name: str
shop_address: str
contact_number: str | None
is_active: bool
#: PENDING / APPROVED / REJECTED — see app/common/master_approval.py.
approval_status: str
rejection_reason: str | None
requested_by_name: str | None
created_at: datetime
#: Filled by the list endpoint only.
assigned_mr_name: str | None = None
assigned_mr_id: uuid.UUID | None = None