48 lines
		
	
	
		
			847 B
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			48 lines
		
	
	
		
			847 B
		
	
	
	
		
			Python
		
	
	
	
	
	
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
 |