from __future__ import annotations

from dataclasses import dataclass, field
from typing import Any, Dict, Optional


@dataclass
class MessagingEvent:
    """Provider-neutral inbound message event."""

    provider: str
    event_id: str
    channel_id: str
    user_id: str
    text: str
    message_id: Optional[str] = None
    timestamp: Optional[int] = None
    raw: Dict[str, Any] = field(default_factory=dict)


@dataclass
class UserMapping:
    """Normalized identity mapping for downstream handlers."""

    provider: str
    external_user_id: str
    external_channel_id: str
    username: Optional[str] = None
    display_name: Optional[str] = None

