feat(ad_control): new AdSurface + AdPlacement module for placement-based featured/top events

- New ad_control Django app: AdSurface + AdPlacement models with GLOBAL/LOCAL scope
- Admin CRUD API at /api/v1/ad-control/ (JWT-protected): surfaces, placements, picker events
- Placement lifecycle: DRAFT → ACTIVE|SCHEDULED → EXPIRED|DISABLED
- LOCAL scope: Haversine ≤ 50km from event lat/lng (fixed radius, no config needed)
- Consumer APIs: /api/events/featured-events/ and /api/events/top-events/ rewritten
  to use placement-based queries (same URL paths + response shape — no breaking changes)
- Seed command: seed_surfaces --migrate converts existing is_featured/is_top_event booleans
- mount: admin_api/urls.py → ad-control/, mobile_api/urls.py → replaced consumer views
- settings.py: added ad_control to INSTALLED_APPS
This commit is contained in:
2026-04-06 12:10:06 +05:30
parent 635a1224cd
commit b2a2cbad5f
14 changed files with 917 additions and 3 deletions

View File

@@ -1,4 +1,4 @@
from django.urls import path
from django.urls import path, include
from rest_framework_simplejwt.views import TokenRefreshView
from . import views
@@ -74,4 +74,7 @@ urlpatterns = [
path('rbac/scopes/', views.ScopeListView.as_view(), name='rbac-scope-list'),
path('rbac/org-tree/', views.OrgTreeView.as_view(), name='rbac-org-tree'),
path('rbac/audit-log/', views.AuditLogListView.as_view(), name='rbac-audit-log'),
# Ad Control
path('ad-control/', include('ad_control.urls')),
]