25 lines
845 B
Python
25 lines
845 B
Python
"""
|
|
URL routing для subscriptions API.
|
|
"""
|
|
from django.urls import path, include
|
|
from rest_framework.routers import DefaultRouter
|
|
from .views import (
|
|
SubscriptionPlanViewSet,
|
|
SubscriptionViewSet,
|
|
PaymentViewSet,
|
|
WebhookViewSet
|
|
)
|
|
from .promo_code_views import validate_promo_code, calculate_price
|
|
|
|
router = DefaultRouter()
|
|
router.register(r'plans', SubscriptionPlanViewSet, basename='subscriptionplan')
|
|
router.register(r'subscriptions', SubscriptionViewSet, basename='subscription')
|
|
router.register(r'payments', PaymentViewSet, basename='payment')
|
|
router.register(r'webhooks', WebhookViewSet, basename='webhook')
|
|
|
|
urlpatterns = [
|
|
path('', include(router.urls)),
|
|
path('promo-codes/validate/', validate_promo_code, name='validate_promo_code'),
|
|
path('calculate-price/', calculate_price, name='calculate_price'),
|
|
]
|