from fastapi import Request
from fastapi.routing import APIRouter

from api_services.redis.auth_actions.token import parse_token_object_to_dict
from api_validations.validations_request import (
    # CreateEvents,
    ListOptions,
)


event_route = APIRouter(prefix="/event", tags=["Events"])
event_route.include_router(event_route, include_in_schema=True)


@event_route.post(path="/list", summary="List Events")
def events_list(request: Request, data: ListOptions):
    token_dict = parse_token_object_to_dict(request=request)
    return token_dict.available_event(data=data, token_dict=token_dict)
