from fastapi import APIRouter, status

from src.schema.admin.healthcheck import HealthCheck

health_router = APIRouter()


@health_router.get(
    "/health",
    tags=["healthcheck"],
    summary="Perform a health check",
    response_description="Return HTTP status code 200 (OK)",
    status_code=status.HTTP_200_OK
)
def health_check() -> HealthCheck:
    """
    ## Perform a health check
    Endpoint to perform a healthcheck on. This endpoint can primarily be used Docker
    to ensure a robust container orchestration and management is in place. Other
    services which rely on proper functioning of the API service will not deploy if this
    endpoint returns any other HTTP status code except 200 (OK).
    :return:
        HealthCheck: Returns a JSON response with the health status
    """
    return HealthCheck(status="ok")
