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


@dataclass
class MailRequest:
    """
    Representa una solicitud de envío de email.
    La librería no lee configuración externa: todos los valores
    deben venir explícitamente o quedar vacíos.
    """

    sender: Optional[str] = None
    to: Optional[List[str]] = None
    subject: Optional[str] = None
    message: str = ""
    template: Optional[str] = None

    attachments: List[str] = field(default_factory=list)
    cc: List[str] = field(default_factory=list)
    bcc: List[str] = field(default_factory=list)
    context: Dict[str, Any] = field(default_factory=dict)

    def __post_init__(self):
        self.to = self.to or []
        self.attachments = self.attachments or []
        self.cc = self.cc or []
        self.bcc = self.bcc or []
        self.context = self.context or {}