"""Schemas for Forgejo validation operations."""

from __future__ import annotations

from datetime import datetime

from pydantic import BaseModel
from sqlmodel import SQLModel


class ValidationStatus(BaseModel):
    """Validation result status."""

    ok: bool
    status: str
    error_message: str | None = None


class ForgejoConnectionValidationResponse(SQLModel):
    """Response for Forgejo connection validation."""

    connection_id: str
    status: ValidationStatus
    response_time_ms: float
    validated_at: datetime


class ForgejoRepositoryValidationResponse(SQLModel):
    """Response for Forgejo repository validation."""

    repository_id: str
    status: ValidationStatus
    response_time_ms: float
    validated_at: datetime
    repo_exists: bool | None = None
