from fastapi import APIRouter, Depends from src.api.dependencies import require_database from src.api.schemas import Error, Health from src.utils.constants import HEALTH_LIVE_PATH, HEALTH_READY_PATH # вне версии API и без идентификации; из итоговой записи о запросе исключены router = APIRouter(tags=["health"]) @router.get(HEALTH_LIVE_PATH, response_model=Health) async def liveness() -> Health: """Процесс жив и обслуживает HTTP.""" return Health(status="ok") @router.get( HEALTH_READY_PATH, response_model=Health, responses={503: {"model": Error}}, dependencies=[Depends(require_database)], ) async def readiness() -> Health: """Postgres отвечает — можно обслуживать запросы; иначе 503.""" return Health(status="ok")