init defaults completed
This commit is contained in:
35
service_app/routers/events/models/bind_events_router.py
Normal file
35
service_app/routers/events/models/bind_events_router.py
Normal file
@@ -0,0 +1,35 @@
|
||||
from fastapi.routing import APIRouter
|
||||
from fastapi.requests import Request
|
||||
|
||||
from api_services.redis.auth_actions.token import parse_token_object_to_dict
|
||||
from api_validations.validations_request import (
|
||||
RegisterModules2Occupant,
|
||||
RegisterModules2Employee,
|
||||
PatchRecord,
|
||||
)
|
||||
|
||||
|
||||
bind_modules_route = APIRouter(prefix="/bind/modules", tags=["Binds"])
|
||||
bind_modules_route.include_router(bind_modules_route, include_in_schema=True)
|
||||
|
||||
|
||||
@bind_modules_route.post(path="/occupant", summary="Register Event to Occupant")
|
||||
def bind_events_occupant(request: Request, data: RegisterModules2Occupant):
|
||||
token_dict = parse_token_object_to_dict(request=request)
|
||||
return token_dict.available_event(data=data, token_dict=token_dict)
|
||||
|
||||
|
||||
@bind_modules_route.post(path="/employee", summary="Register Event to Employee")
|
||||
def bind_events_employee(request: Request, data: RegisterModules2Employee):
|
||||
token_dict = parse_token_object_to_dict(request=request)
|
||||
return token_dict.available_event(data=data, token_dict=token_dict)
|
||||
|
||||
|
||||
@bind_modules_route.patch(
|
||||
path="/patch/{event_uu_id}", summary="Patch Bind Events with given auth levels"
|
||||
)
|
||||
def bind_events_patch(request: Request, event_uu_id: str, data: PatchRecord):
|
||||
token_dict = parse_token_object_to_dict(request=request)
|
||||
return token_dict.available_event(
|
||||
data=data, event_uu_id=event_uu_id, token_dict=token_dict
|
||||
)
|
||||
Reference in New Issue
Block a user