from abc import ABC, abstractmethod
from typing import Any, List, Optional

from abs_email_core.schema.email_schema import SendMailRequest


class EmailProvider(ABC):
    """Abstract base class for email providers."""

    @abstractmethod
    def __init__(self, **kwargs):
        """Initialize the provider with provider-specific configuration."""
        ...

    @abstractmethod
    def send_email(
        self, request: SendMailRequest, attachments: Optional[List[Any]] = None
    ) -> bool:
        """Send a plain-text email. Returns True on success."""
        ...

    @abstractmethod
    def send_html_email(
        self, request: SendMailRequest, attachments: Optional[List[Any]] = None
    ) -> bool:
        """Send an HTML email. Returns True on success."""
        ...
