"""Domain Entities for Zalo CRM Module."""

from __future__ import annotations

from dataclasses import dataclass
from datetime import datetime


@dataclass(frozen=True)
class ZaloContact:
    """Represents a customer or internal contact on Zalo."""

    id: str
    name: str
    phone_number: str | None = None
    is_internal: bool = False
    is_group: bool = False
    created_at: datetime | None = None
    updated_at: datetime | None = None


@dataclass(frozen=True)
class ZaloConversation:
    """Represents a chat thread between the company Zalo account and a contact/group."""

    id: str
    zalo_account_id: str
    contact_id: str
    is_internal: bool = False
    created_at: datetime | None = None
    updated_at: datetime | None = None


@dataclass(frozen=True)
class ZaloMessage:
    """Represents a single message sent or received via Zalo."""

    id: str
    conversation_id: str
    sender_type: str  # 'contact' or 'user'
    sender_id: str
    content: str
    timestamp: datetime
