from datetime import datetime

from pydantic import BaseModel


class ServiceInfoOut(BaseModel):
    app_name: str
    environment: str
    api_prefix: str
    app_version: str
    hostname: str
    python_version: str
    platform: str
    service_started_at: datetime
    uptime_seconds: int
    update_source: str
    latest_version: str | None
    latest_ref: str | None
    update_available: bool
    last_checked_at: datetime | None
    last_check_error: str | None


class ServiceInfoCheckResult(BaseModel):
    latest_version: str | None
    latest_ref: str | None
    update_available: bool
    last_checked_at: datetime
    last_check_error: str | None
