feat: work shifts planning
This commit is contained in:
		
							
								
								
									
										34
									
								
								routers/work_shifts_planning.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										34
									
								
								routers/work_shifts_planning.py
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,34 @@
 | 
			
		||||
from fastapi import APIRouter
 | 
			
		||||
 | 
			
		||||
from backend.dependecies import SessionDependency
 | 
			
		||||
from schemas.work_shifts_planning import *
 | 
			
		||||
from services.work_shifts_planning import WorkShiftsPlanningService
 | 
			
		||||
 | 
			
		||||
work_shifts_planning_router = APIRouter(
 | 
			
		||||
    prefix="/work-shifts-planning",
 | 
			
		||||
    tags=["work-shifts-planning"],
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@work_shifts_planning_router.post(
 | 
			
		||||
    "/",
 | 
			
		||||
    response_model=GetPlannedWorkShiftsResponse,
 | 
			
		||||
    operation_id="get_work_shifts",
 | 
			
		||||
)
 | 
			
		||||
async def get_work_shifts(
 | 
			
		||||
        session: SessionDependency,
 | 
			
		||||
        request: GetWorkShiftsPlanningDataRequest,
 | 
			
		||||
):
 | 
			
		||||
    return await WorkShiftsPlanningService(session).get_work_shifts(request)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@work_shifts_planning_router.post(
 | 
			
		||||
    "/update",
 | 
			
		||||
    response_model=UpdatePlanningWorkShiftResponse,
 | 
			
		||||
    operation_id="update_work_shift",
 | 
			
		||||
)
 | 
			
		||||
async def update_work_shift(
 | 
			
		||||
        session: SessionDependency,
 | 
			
		||||
        request: UpdatePlanningWorkShiftRequest,
 | 
			
		||||
):
 | 
			
		||||
    return await WorkShiftsPlanningService(session).update_work_shift(request)
 | 
			
		||||
		Reference in New Issue
	
	Block a user