"""
Teams Bot — Webhook notifications for AI Adoption Tracker.

Future implementation. Sends notifications to Teams channels via Incoming Webhook.

Notification triggers:
  - Badge earned by an employee
  - Level up
  - Hackathon reminder (T-1 week, T-1 day)
  - Weekly digest to department channels
  - Content shared with tracked link
  - Anomaly detected (admin channel only)

Implementation approach:
  Option 1 (simplest): Incoming Webhook connector per channel
  Option 2 (richer): Bot Framework with Adaptive Cards
"""

from app.config import get_settings


class TeamsBotNotifier:
    """Stub for Teams webhook notifications."""

    def __init__(self):
        settings = get_settings()
        self.webhook_url = settings.teams_webhook_url
        self.is_configured = bool(self.webhook_url)

    async def send_badge_notification(
        self, user_name: str, badge_name: str, badge_icon: str, channel_webhook: str | None = None
    ) -> bool:
        """Send badge earned notification to Teams channel."""
        # TODO: Implement with Adaptive Card
        # {
        #   "@type": "MessageCard",
        #   "summary": f"{user_name} earned {badge_name}",
        #   "sections": [{
        #     "activityTitle": f"{badge_icon} {user_name} earned a new badge!",
        #     "activitySubtitle": badge_name,
        #   }]
        # }
        return False

    async def send_level_up_notification(
        self, user_name: str, new_level: str, channel_webhook: str | None = None
    ) -> bool:
        """Send level up notification to Teams channel."""
        # TODO: Implement
        return False

    async def send_weekly_digest(
        self, department: str, stats: dict, channel_webhook: str | None = None
    ) -> bool:
        """Send weekly digest to department channel."""
        # TODO: Implement with summary card showing:
        # - Top performers this week
        # - Department XP gained
        # - New completions count
        # - Upcoming hackathons/workshops
        return False

    async def send_content_shared(
        self, title: str, tracked_url: str, shared_by: str, channel_webhook: str | None = None
    ) -> bool:
        """Send content shared notification with tracked link."""
        # TODO: Implement — this is how tracked links get distributed
        return False

    async def send_anomaly_alert(
        self, user_name: str, flag_type: str, description: str, admin_webhook: str | None = None
    ) -> bool:
        """Send anomaly alert to admin channel."""
        # TODO: Implement
        return False
