# subscriptions/urls.py
from django.urls import path
from . import views

app_name = 'subscriptions'

urlpatterns = [
    # ── Public ──────────────────────────────────────────
    path('register/',        views.company_register, name='register'),
    path('pricing/',         views.public_pricing,   name='pricing'),

    # Webhooks (no auth, HMAC-verified)
    path('webhooks/monnify/',  views.monnify_webhook,  name='monnify_webhook'),
    path('webhooks/paystack/', views.paystack_webhook, name='paystack_webhook'),

    # ── Company-scoped (requires login) ─────────────────
    # These are mounted under /<company_slug>/subscription/
    path('choose-plan/',     views.choose_plan,          name='choose_plan'),
    path('checkout/<int:plan_id>/', views.checkout,      name='checkout'),
    path('promo/validate/',  views.validate_promo_ajax,  name='validate_promo'),
    path('payment/callback/',           views.payment_callback,    name='payment_callback'),
    path('payment/paystack-callback/',  views.paystack_callback,   name='paystack_callback'),
    path('manage/',          views.subscription_manage,  name='manage'),
    path('billing/',         views.billing_history,      name='billing_history'),
    # Superadmin-only: confirm a manual bank transfer payment
    path('confirm-manual/<str:reference>/', views.admin_mark_manual_paid, name='confirm_manual_payment'),
]
