# app/api/v1/webhooks/__init__.py
"""
Webhook API endpoints for external service callbacks.

Auto-discovers and aggregates webhook routes from self-contained modules:
- payments: /stripe (Stripe payment webhooks)

Webhooks use signature verification for security, not user authentication.
"""

from fastapi import APIRouter

from app.modules.routes import get_webhooks_api_routes

router = APIRouter()

# Auto-discover webhook routes from modules
for route_info in get_webhooks_api_routes():
    if route_info.custom_prefix:
        router.include_router(
            route_info.router,
            prefix=route_info.custom_prefix,
            tags=route_info.tags,
        )
    else:
        router.include_router(
            route_info.router,
            tags=route_info.tags,
        )
