from app.channels.base import NotificationChannel, DeliveryResult


class WhatsAppAdapter(NotificationChannel):
    """
    WhatsApp Business API adapter (stub implementation)
    
    To enable WhatsApp:
    1. Register WhatsApp Business API account
    2. Set env vars:
       - WHATSAPP_API_URL (e.g., https://graph.facebook.com/v17.0/{phone_number_id}/messages)
       - WHATSAPP_ACCESS_TOKEN
    3. Implement send() logic below using httpx similar to Telegram/VK
    
    Docs: https://developers.facebook.com/docs/whatsapp/cloud-api/guides/send-messages
    """
    
    @property
    def channel_name(self) -> str:
        return "whatsapp"
    
    async def send(self, target: str, content: str, **kwargs) -> DeliveryResult:
        """
        Stub: WhatsApp not yet configured
        
        Args:
            target: phone number in international format (e.g., +79991234567)
            content: message text
        """
        return DeliveryResult(
            success=False,
            error=(
                "WhatsApp adapter not configured. "
                "Set WHATSAPP_API_URL and WHATSAPP_ACCESS_TOKEN env vars. "
                "See app/channels/whatsapp.py for integration guide."
            )
        )





























