from __future__ import annotations

from dataclasses import dataclass, field
from datetime import datetime, timezone
from uuid import uuid4

from app.schemas.client_events import ClientEventType


@dataclass(slots=True)
class ClientEventRecord:
    request_id: str
    type: ClientEventType
    source: str
    text: str = ""
    payload: dict = field(default_factory=dict)
    event_id: str = field(default_factory=lambda: f"evt_{uuid4().hex}")
    created_at: datetime = field(default_factory=lambda: datetime.now(timezone.utc))
