"""System health and debug endpoints."""

from __future__ import annotations

from typing import Any, Dict

from sd_api.client.base import BaseClient
from sd_api.models.health import HealthStatus


class HealthMixin:
    """Endpoints under /api/health and /api/debug/*."""

    def __init__(self, base: BaseClient) -> None:
        self._base = base

    def health(self) -> HealthStatus:
        """GET /api/health — system health and connection status."""
        data = self._base.get("/api/health")
        return HealthStatus.from_api(data)

    def debug_db(self) -> Dict[str, Any]:
        """GET /api/debug/db — MySQL database debug info."""
        return self._base.get("/api/debug/db")

    def debug_quotes_db(self) -> Dict[str, Any]:
        """GET /api/debug/quotes-db — quote_ticks / latest_quotes debug info."""
        return self._base.get("/api/debug/quotes-db")
