from fastapi import APIRouter, Depends, status

from app.deps import verify_internal_token
from app.schemas.proctoring import ProctoringAnalyzeRequest, ProctoringAnalyzeResponse
from app.services.proctoring import ProctoringService

router = APIRouter(prefix="/proctoring")
_service = ProctoringService()


@router.post(
    "/analyze",
    response_model=ProctoringAnalyzeResponse,
    status_code=status.HTTP_200_OK,
    summary="Browser Proctoring / Anti-Cheat",
    dependencies=[Depends(verify_internal_token)],
)
async def analyze_proctoring(
    payload: ProctoringAnalyzeRequest,
) -> ProctoringAnalyzeResponse:
    return await _service.analyze(payload)
