44 lines
1.3 KiB
Python
44 lines
1.3 KiB
Python
import uuid
|
|
from datetime import date
|
|
|
|
from pydantic import BaseModel, ConfigDict, Field
|
|
|
|
|
|
class DoctorCreate(BaseModel):
|
|
headquarters_id: uuid.UUID
|
|
name: str = Field(min_length=2, max_length=200)
|
|
clinic_address: str = Field(min_length=2, max_length=500)
|
|
speciality: str | None = Field(default=None, max_length=100)
|
|
qualification: str | None = Field(default=None, max_length=100)
|
|
contact_number: str | None = Field(default=None, max_length=20)
|
|
is_core_doctor: bool = False
|
|
|
|
|
|
class DoctorUpdate(BaseModel):
|
|
name: str | None = Field(default=None, min_length=2, max_length=200)
|
|
clinic_address: str | None = Field(default=None, min_length=2, max_length=500)
|
|
speciality: str | None = Field(default=None, max_length=100)
|
|
qualification: str | None = Field(default=None, max_length=100)
|
|
contact_number: str | None = Field(default=None, max_length=20)
|
|
is_core_doctor: bool | None = None
|
|
is_active: bool | None = None
|
|
|
|
|
|
class DoctorRead(BaseModel):
|
|
model_config = ConfigDict(from_attributes=True)
|
|
|
|
id: uuid.UUID
|
|
headquarters_id: uuid.UUID
|
|
name: str
|
|
clinic_address: str
|
|
speciality: str | None
|
|
qualification: str | None
|
|
contact_number: str | None
|
|
is_core_doctor: bool
|
|
is_active: bool
|
|
|
|
|
|
class AssignToMR(BaseModel):
|
|
mr_user_id: uuid.UUID
|
|
effective_from: date | None = None
|