"""Health check response schemas."""

from pydantic import BaseModel, Field


class DatabaseHealth(BaseModel):
    """Database health check result."""

    status: str = Field(description="Database health status", examples=["healthy"])
    response_time_ms: float = Field(
        description="Query response time in milliseconds", examples=[5.2]
    )


class DiskHealth(BaseModel):
    """Disk space health check result."""

    status: str = Field(description="Disk health status", examples=["healthy"])
    free_gb: float = Field(description="Free disk space in GB", examples=[45.2])
    total_gb: float = Field(description="Total disk space in GB", examples=[100.0])


class HealthChecks(BaseModel):
    """Individual health checks."""

    database: DatabaseHealth | None = None
    disk: DiskHealth | None = None


class HealthResponse(BaseModel):
    """Overall health check response."""

    status: str = Field(description="Overall health status", examples=["healthy"])
    timestamp: str = Field(
        description="ISO 8601 timestamp", examples=["2026-05-19T12:00:00Z"]
    )
    version: str = Field(description="API version", examples=["0.1.0"])
    checks: HealthChecks = Field(description="Individual health checks")
    uptime_seconds: float = Field(
        description="Server uptime in seconds", examples=[3600.0]
    )


class DatabaseHealthResponse(BaseModel):
    """Database-specific health check response."""

    status: str = Field(description="Database health status", examples=["healthy"])
    response_time_ms: float = Field(
        description="Query response time in milliseconds", examples=[5.2]
    )
