"""Stripe webhook event handlers (stub implementations).

These handlers log events but don't process them until Stripe is fully configured.
"""
import logging
from sqlalchemy.ext.asyncio import AsyncSession

logger = logging.getLogger(__name__)


async def handle_checkout_completed(event: dict, db: AsyncSession) -> None:
    logger.info("Stripe: checkout.session.completed — %s", event.get("id"))


async def handle_invoice_paid(event: dict, db: AsyncSession) -> None:
    logger.info("Stripe: invoice.paid — %s", event.get("id"))


async def handle_invoice_payment_failed(event: dict, db: AsyncSession) -> None:
    logger.warning("Stripe: invoice.payment_failed — %s", event.get("id"))


async def handle_subscription_updated(event: dict, db: AsyncSession) -> None:
    logger.info("Stripe: customer.subscription.updated — %s", event.get("id"))


async def handle_subscription_deleted(event: dict, db: AsyncSession) -> None:
    logger.info("Stripe: customer.subscription.deleted — %s", event.get("id"))


WEBHOOK_HANDLERS = {
    "checkout.session.completed": handle_checkout_completed,
    "invoice.paid": handle_invoice_paid,
    "invoice.payment_failed": handle_invoice_payment_failed,
    "customer.subscription.updated": handle_subscription_updated,
    "customer.subscription.deleted": handle_subscription_deleted,
}
