"""Pydantic schemas for Evidence endpoints."""

import uuid
from datetime import datetime

from pydantic import BaseModel, ConfigDict

from app.models.enums import TeamSide


class EvidenceOut(BaseModel):
    """Representation of an evidence record returned by the API.

    ``download_url`` is a presigned URL generated at response time.
    """

    id: uuid.UUID
    test_id: uuid.UUID
    file_name: str
    sha256_hash: str
    uploaded_by: uuid.UUID | None = None
    uploaded_at: datetime | None = None
    team: TeamSide = TeamSide.red
    notes: str | None = None
    download_url: str | None = None

    model_config = ConfigDict(from_attributes=True)


class EvidenceUpload(BaseModel):
    """Metadata sent alongside an evidence file upload."""

    team: TeamSide
    notes: str | None = None
