"""اسکیماهای ServiceRegistry."""
from __future__ import annotations

from datetime import datetime
from uuid import UUID

from pydantic import BaseModel, Field

from app.models.enums import ServiceStatus
from app.schemas.common import ORMModel


class ServiceCreate(BaseModel):
    service_key: str = Field(..., min_length=1, max_length=100)
    name: str = Field(..., min_length=1, max_length=255)
    base_url: str | None = Field(default=None, max_length=500)
    health_check_url: str | None = Field(default=None, max_length=500)
    status: ServiceStatus = ServiceStatus.ACTIVE


class ServiceStatusUpdate(BaseModel):
    status: ServiceStatus


class ServiceRead(ORMModel):
    id: UUID
    service_key: str
    name: str
    base_url: str | None
    status: ServiceStatus
    health_check_url: str | None
    created_at: datetime
