"""
Notification Providers.
Abstract base and concrete implementations for SMS, Email, Panel channels.
"""
from abc import ABC, abstractmethod
from dataclasses import dataclass
from typing import Any

from ..models import NotificationChannel



@dataclass
class ProviderResponse:
    """Standard response from notification providers."""
    success: bool
    message_id: str | None = None
    error: str | None = None
    raw_response: dict | None = None


class BaseNotificationProvider(ABC):
    """
    Abstract base class for notification providers.
    All providers must implement the send method.
    """
    
    channel: NotificationChannel
    
    @abstractmethod
    def send(
        self,
        recipient: str,
        content: str,
        subject: str | None = None,
        **kwargs: Any
    ) -> ProviderResponse:
        """
        Send a notification through this provider.
        
        Args:
            recipient: The recipient identifier (phone, email, user_id)
            content: The notification content
            subject: Optional subject (for email)
            **kwargs: Additional provider-specific arguments
            
        Returns:
            ProviderResponse with success status and details
        """
        pass
    
    @abstractmethod
    def validate_recipient(self, recipient: str) -> bool:
        """
        Validate the recipient format for this channel.
        
        Args:
            recipient: The recipient identifier to validate
            
        Returns:
            True if valid, False otherwise
        """
        pass
