from __future__ import annotations

from datetime import datetime
from typing import Optional
from uuid import UUID

from pydantic import BaseModel, ConfigDict


class NotificationResponse(BaseModel):
    """List-item / detail shape. Serialised snake_case; the admin client maps
    to camelCase itself (no interceptor unwraps or renames anything)."""

    model_config = ConfigDict(from_attributes=True)

    id: UUID
    type: str
    title: str
    body: Optional[str] = None
    link: Optional[str] = None
    entity_type: Optional[str] = None
    entity_id: Optional[UUID] = None
    read_at: Optional[datetime] = None
    created_at: datetime


class UnreadCountResponse(BaseModel):
    count: int
