"""Pydantic models for approval endpoints."""

from __future__ import annotations

from datetime import datetime
from typing import Literal
from uuid import UUID

from pydantic import BaseModel


class ApprovalResponse(BaseModel):
    id: UUID
    agent_session_id: int | None = None
    task_id: int | None = None
    title: str
    context: str
    options: list[str]
    priority: Literal["critical", "medium", "low"]
    status: Literal["pending", "approved", "rejected", "deferred", "expired"]
    response: str | None = None
    expires_at: datetime | None = None
    created_at: datetime
    updated_at: datetime


class CreateApprovalRequest(BaseModel):
    agent_session_id: int | None = None
    task_id: int | None = None
    title: str
    context: str = ""
    options: list[str] = ["Approve", "Reject"]
    priority: Literal["critical", "medium", "low"] = "medium"


class RespondApprovalRequest(BaseModel):
    response: str
    status: Literal["approved", "rejected", "deferred"]
