"""Billing routes including bank transfer confirmation and credit endpoints."""
from django.urls import path, include
from rest_framework.routers import DefaultRouter
from .views import (
    BillingViewSet,
    InvoiceViewSet,
    PaymentViewSet,
    CreditPackageViewSet,
    AccountPaymentMethodViewSet,
)
from igny8_core.modules.billing.views import (
    CreditBalanceViewSet,
    CreditUsageViewSet,
    CreditTransactionViewSet,
)

router = DefaultRouter()
router.register(r'admin', BillingViewSet, basename='billing-admin')
# Canonical credits endpoints (unified billing)
router.register(r'credits/balance', CreditBalanceViewSet, basename='credit-balance')
router.register(r'credits/usage', CreditUsageViewSet, basename='credit-usage')
router.register(r'credits/transactions', CreditTransactionViewSet, basename='credit-transactions')
# User-facing billing endpoints
router.register(r'invoices', InvoiceViewSet, basename='invoices')
router.register(r'payments', PaymentViewSet, basename='payments')
router.register(r'credit-packages', CreditPackageViewSet, basename='credit-packages')
router.register(r'payment-methods', AccountPaymentMethodViewSet, basename='payment-methods')

urlpatterns = [
    path('', include(router.urls)),
]
