56 lines
1.2 KiB
Python
56 lines
1.2 KiB
Python
from pydantic import BaseModel
|
|
from typing import Optional
|
|
from datetime import datetime
|
|
|
|
class TechnicianProfileCreate(BaseModel):
|
|
user_id: str
|
|
|
|
class TechnicianProfileResponse(BaseModel):
|
|
technician_id: str
|
|
user_id: str
|
|
active: bool
|
|
|
|
class Config:
|
|
from_attributes = True
|
|
|
|
class TechnicianSkillCreate(BaseModel):
|
|
service_id: str
|
|
skill_level: int = 1
|
|
|
|
class TechnicianSkillResponse(BaseModel):
|
|
technician_id: str
|
|
service_id: str
|
|
skill_level: int
|
|
|
|
class Config:
|
|
from_attributes = True
|
|
|
|
class TechnicianWorkingHoursCreate(BaseModel):
|
|
day_of_week: int
|
|
start_time: str # "HH:MM"
|
|
end_time: str # "HH:MM"
|
|
|
|
class TechnicianWorkingHoursResponse(BaseModel):
|
|
working_hour_id: str
|
|
technician_id: str
|
|
day_of_week: int
|
|
start_time: str
|
|
end_time: str
|
|
|
|
class Config:
|
|
from_attributes = True
|
|
|
|
class TechnicianLeaveCreate(BaseModel):
|
|
start_datetime: datetime
|
|
end_datetime: datetime
|
|
reason: Optional[str] = None
|
|
|
|
class TechnicianLeaveResponse(BaseModel):
|
|
leave_id: str
|
|
technician_id: str
|
|
start_datetime: datetime
|
|
end_datetime: datetime
|
|
reason: Optional[str]
|
|
|
|
class Config:
|
|
from_attributes = True
|