"""Schemas for the source endpoints."""

from pydantic import BaseModel

from app.domain.sources import SourceInfo


class SourceInfoOut(BaseModel):
    name: str
    label: str
    kind: str
    available: bool

    @classmethod
    def from_entity(cls, info: SourceInfo) -> SourceInfoOut:
        return cls(name=info.name, label=info.label, kind=info.kind, available=info.available)


class ScanResponse(BaseModel):
    """Result of enqueuing a source scan."""

    source: str
    job_id: str
    status: str = "queued"


class SourceHealthOut(BaseModel):
    name: str
    available: bool
