"""willian-billing: Stripe billing module for SaaS products.

Usage:
    from billing import init_billing, BillingConfig, BillingRouter

    config = BillingConfig(
        stripe_secret_key="sk_...",
        stripe_webhook_secret="whsec_...",
        success_url="https://app.example.com/billing/success",
        cancel_url="https://app.example.com/billing/cancel",
        product_plans={"starter": "price_xxx", "pro": "price_yyy"},
    )
    init_billing(config)

    # Mount the router in your FastAPI app
    app.include_router(BillingRouter)
"""

from billing.checkout import create_checkout, create_portal_session
from billing.config import BillingConfig, init_billing
from billing.invoices import get_invoices
from billing.models import (
    CheckoutSession,
    Invoice,
    Subscription,
    UsageRecord,
    WebhookEvent,
)
from billing.router import BillingRouter
from billing.subscriptions import (
    cancel_subscription,
    get_subscription,
    update_subscription,
)
from billing.usage import get_usage, record_usage
from billing.webhooks import handle_webhook

__all__ = [
    "BillingConfig",
    "BillingRouter",
    "CheckoutSession",
    "Invoice",
    "Subscription",
    "UsageRecord",
    "WebhookEvent",
    "cancel_subscription",
    "create_checkout",
    "create_portal_session",
    "get_invoices",
    "get_subscription",
    "get_usage",
    "handle_webhook",
    "init_billing",
    "record_usage",
    "update_subscription",
]
