"""Log schemas."""

from datetime import datetime
from typing import Optional
from uuid import UUID
from pydantic import BaseModel, ConfigDict, Field


class LogIngest(BaseModel):
    """Schema for ingesting a log."""

    message: str = Field(..., min_length=1)
    source: str = Field(default="unknown", max_length=100)


class LogResponse(BaseModel):
    """Schema for log response."""

    model_config = ConfigDict(from_attributes=True)

    id: UUID
    scenario_id: UUID
    received_at: datetime
    message_preview: Optional[str]
    source: str
    size_bytes: int
    has_pii: bool
    token_count: int
    sqs_blocks: int
