# Adtlas TV Advertising Platform - Channels URL Configuration
# URL routing for TV channels, networks, and coverage management

from django.urls import path, include
from django.views.decorators.cache import cache_page
from . import views

# App namespace for URL reversing
app_name = 'channels'

# Main URL patterns for the channels app
urlpatterns = [
     # Channel Management URLs
     path('', views.ChannelListView.as_view(), name='channel_list'),
     path('channels/', views.ChannelListView.as_view(), name='channel_list_alt'),
     path('channels/<int:pk>/', views.ChannelDetailView.as_view(), name='channel_detail'),

     # Network Management URLs
     path('networks/', views.NetworkListView.as_view(), name='network_list'),
     path('networks/<int:pk>/', views.NetworkDetailView.as_view(), name='network_detail'),

     # Coverage and Geographic URLs
     path('coverage/',  cache_page(300)(views.CoverageMapView.as_view()),  name='coverage_map'),

     # API Endpoints
     path('api/', include([
          # Channel Schedule API
          path('channels/<int:channel_id>/schedule/', 
               views.channel_schedule_api, 
               name='api_channel_schedule'),

          # Zone Channels API
          path('zones/<int:zone_id>/channels/', 
               views.zone_channels_api, 
               name='api_zone_channels'),
          
          # Network Coverage API
          path('networks/<int:network_id>/coverage/', 
               views.network_coverage_api, 
               name='api_network_coverage'),
     ])),
]

# Additional URL patterns for specific functionalities
# These can be uncommented and customized as needed

# Geographic Zone URLs (if needed as separate views)
# urlpatterns += [
#     path('zones/', views.ZoneListView.as_view(), name='zone_list'),
#     path('zones/<int:pk>/', views.ZoneDetailView.as_view(), name='zone_detail'),
# ]

# Content Schedule URLs (if needed as separate views)
# urlpatterns += [
#     path('schedule/', views.ScheduleListView.as_view(), name='schedule_list'),
#     path('schedule/<int:pk>/', views.ScheduleDetailView.as_view(), name='schedule_detail'),
# ]

# Audience Demographics URLs (if needed as separate views)
# urlpatterns += [
#     path('demographics/', views.DemographicsListView.as_view(), name='demographics_list'),
#     path('demographics/<int:pk>/', views.DemographicsDetailView.as_view(), name='demographics_detail'),
# ]

# Advanced API endpoints (can be added later)
# urlpatterns += [
#     path('api/channels/<int:channel_id>/demographics/', 
#          views.channel_demographics_api, 
#          name='api_channel_demographics'),
#     
#     path('api/channels/<int:channel_id>/advertising/', 
#          views.channel_advertising_api, 
#          name='api_channel_advertising'),
#     
#     path('api/zones/<int:zone_id>/demographics/', 
#          views.zone_demographics_api, 
#          name='api_zone_demographics'),
#     
#     path('api/networks/<int:network_id>/analytics/', 
#          views.network_analytics_api, 
#          name='api_network_analytics'),
#     
#     path('api/coverage/search/', 
#          views.coverage_search_api, 
#          name='api_coverage_search'),
# ]