from fastapi import APIRouter, Depends, status

from app.deps import verify_internal_token
from app.schemas.interview_analytics import (
    InterviewAnalyticsRequest,
    InterviewAnalyticsResponse,
)
from app.services.interviews.analytics import InterviewAnalyticsService

router = APIRouter()
_service = InterviewAnalyticsService()


@router.post(
    "/interview-analytics/analyze",
    response_model=InterviewAnalyticsResponse,
    status_code=status.HTTP_200_OK,
    summary="Interview Analytics",
    description=(
        "Track score distributions, question effectiveness, completion rates, "
        "and evaluation quality across interview sessions."
    ),
    dependencies=[Depends(verify_internal_token)],
)
async def analyze_interview_analytics(
    payload: InterviewAnalyticsRequest,
) -> InterviewAnalyticsResponse:
    return await _service.analyze(payload)
