"""Pydantic schemas for disclosure request endpoints."""

from datetime import datetime
from typing import Optional

from pydantic import BaseModel


class DisclosureRequestCreate(BaseModel):
    """Payload for creating a disclosure request."""
    reason: str


class DisclosureRequestResponse(BaseModel):
    """Response for a single disclosure request."""
    id: int
    case_id: int
    requester_id: int
    requester_username: Optional[str] = None
    fall_id: Optional[str] = None
    reason: str
    status: str
    reviewed_by: Optional[int] = None
    reviewed_at: Optional[datetime] = None
    expires_at: Optional[datetime] = None
    created_at: datetime

    model_config = {"from_attributes": True}


class DisclosureRequestUpdate(BaseModel):
    """Payload for approving/rejecting a disclosure request."""
    status: str  # "approved" or "rejected"


class DisclosureCountResponse(BaseModel):
    """Count of pending disclosure requests."""
    pending_count: int
