promotions/main/urls.py
Ali Asadi d27ae32e27 FEATURE(promotions): add read-only admin endpoints for promotions and referrals
Adds GET /api/v2/promotions/admin/promotions/ and .../referrals/, listing
every Promotion (type derived from Plan.processor) and referral activity
(invited_by = resolved payee, invited_user = raw event.data['user'] --
there's no dedicated referral model or referral_code field in this
codebase). Follows the existing _user/_application file-suffix convention
with a new _admin suffix, backed by real django-filter FilterSets.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-23 17:10:49 +03:30

37 lines
1.8 KiB
Python

"""
URL configuration for main project.
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/5.1/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based views
1. Add an import: from other_app.views import Home
2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
Including another URLconf
1. Import the include() function: from django.urls import include, path
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
"""
from django.conf import settings
from django.conf.urls.static import static
from django.urls import path, include
from django.contrib import admin
from drf_spectacular.views import SpectacularAPIView, SpectacularRedocView, SpectacularSwaggerView
urlpatterns = [
path('swagger/', SpectacularAPIView.as_view(), name='schema'),
path('swagger/swagger-ui/', SpectacularSwaggerView.as_view(url_name='schema'), name='swagger-ui'),
path('swagger/redoc/', SpectacularRedocView.as_view(url_name='schema'), name='redoc'),
path('admin/', admin.site.urls),
path('', include('utils.urls')),
path('oauth2/', include('oauth2_provider.urls', namespace='oauth2_provider')),
path('promotions/', include('apps.promotions.urls_user', namespace='promotions')),
path('api/v2/promotions/application/<user_uuid>/', include('apps.promotions.urls_application', namespace='promotions-application')),
path('api/v2/promotions/admin/', include('apps.promotions.urls_admin', namespace='promotions-admin')),
]
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)