"""Schemas for board-to-repository linking operations."""

from __future__ import annotations

from datetime import datetime
from uuid import UUID

from pydantic import BaseModel, ConfigDict
from sqlmodel import SQLModel


class BoardRepositoryLinkCreate(SQLModel):
    """Schema for creating a board repository link."""

    repository_id: UUID


class BoardRepositoryLinkRead(SQLModel):
    """Schema for reading a board repository link."""

    id: UUID
    board_id: UUID
    repository_id: UUID
    organization_id: UUID
    created_at: datetime

    model_config = ConfigDict(from_attributes=True)


class BoardRepositoryLinkList(BaseModel):
    """List response for board repository links."""

    links: list[BoardRepositoryLinkRead]


class BoardRepositoryLinkResponse(BaseModel):
    """Single link response with success status."""

    success: bool = True
    link: BoardRepositoryLinkRead | None = None


class BoardRepositoryLinkDeleteResponse(BaseModel):
    """Delete response with success status."""

    success: bool = True
    message: str | None = None
