from django.urls import path, include
from rest_framework.routers import DefaultRouter
from . import views

app_name = 'notifications'

# Create router for viewsets
router = DefaultRouter()
router.register(r'notification-tags', views.NotificationTagViewSet, basename='notification-tag')

urlpatterns = [
    # Router URLs for viewsets
    path('api/', include(router.urls)),
    
    # Combined endpoint for homepage (notifications + stats)
    path('api/notifications-and-stats/', views.notifications_and_stats, name='notifications-and-stats'),
    
    # Individual endpoints
    path('api/notifications/', views.NotificationListView.as_view(), name='notification-list'),
    path('api/notifications/<slug:slug>/', views.NotificationDetailView.as_view(), name='notification-detail'),
    path('api/statistics/', views.SiteStatisticListView.as_view(), name='statistics-list'),
    path('api/notification-categories/', views.notification_categories, name='notification-categories'),
    path('api/featured-notifications/', views.featured_notifications, name='featured-notifications'),
]
