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:
18
ad_control/urls.py
Normal file
18
ad_control/urls.py
Normal file
@@ -0,0 +1,18 @@
|
||||
from django.urls import path
|
||||
from . import views
|
||||
|
||||
# Admin CRUD endpoints — mounted at /api/v1/ad-control/
|
||||
urlpatterns = [
|
||||
# Surfaces
|
||||
path('surfaces/', views.SurfaceListView.as_view(), name='ad-surfaces'),
|
||||
|
||||
# Placements CRUD
|
||||
path('placements/', views.PlacementListCreateView.as_view(), name='ad-placements'),
|
||||
path('placements/<int:pk>/', views.PlacementDetailView.as_view(), name='ad-placement-detail'),
|
||||
path('placements/<int:pk>/publish/', views.PlacementPublishView.as_view(), name='ad-placement-publish'),
|
||||
path('placements/<int:pk>/unpublish/', views.PlacementUnpublishView.as_view(), name='ad-placement-unpublish'),
|
||||
path('placements/reorder/', views.PlacementReorderView.as_view(), name='ad-placements-reorder'),
|
||||
|
||||
# Events picker
|
||||
path('events/', views.PickerEventsView.as_view(), name='ad-picker-events'),
|
||||
]
|
||||
Reference in New Issue
Block a user