feat: work shifts planning
This commit is contained in:
47
schemas/work_shifts_planning.py
Normal file
47
schemas/work_shifts_planning.py
Normal file
@@ -0,0 +1,47 @@
|
||||
from datetime import datetime, date
|
||||
|
||||
from schemas.base import BaseSchema, OkMessageSchema
|
||||
from schemas.position import PositionSchema
|
||||
from schemas.user import UserSchema
|
||||
|
||||
|
||||
# region Entities
|
||||
|
||||
class PlannedWorkShiftSchema(BaseSchema):
|
||||
id: int
|
||||
shift_date: datetime
|
||||
positions: list[PositionSchema]
|
||||
|
||||
|
||||
class PlanningTableRow(BaseSchema):
|
||||
user: UserSchema
|
||||
shifts: list[PlannedWorkShiftSchema]
|
||||
|
||||
|
||||
# endregion
|
||||
|
||||
# region Requests
|
||||
|
||||
class GetWorkShiftsPlanningDataRequest(BaseSchema):
|
||||
date_from: date
|
||||
date_to: date
|
||||
|
||||
|
||||
class UpdatePlanningWorkShiftRequest(BaseSchema):
|
||||
shift_date: date
|
||||
position_keys: list[str]
|
||||
user_id: int
|
||||
|
||||
|
||||
# endregion
|
||||
|
||||
# region Responses
|
||||
|
||||
class GetPlannedWorkShiftsResponse(BaseSchema):
|
||||
shifts: list[PlanningTableRow]
|
||||
|
||||
|
||||
class UpdatePlanningWorkShiftResponse(OkMessageSchema):
|
||||
pass
|
||||
|
||||
# endregion
|
||||
Reference in New Issue
Block a user