"""
Schedule App URLs

UNUSED_ENDPOINT tags mark endpoints not currently used by the frontend.
Search for "UNUSED_ENDPOINT" to find all unused endpoints in the codebase.
"""
from django.urls import path, include
from rest_framework.routers import DefaultRouter
from .views import (
    ResourceViewSet, EventViewSet, ParticipantViewSet,
    CustomerViewSet, ServiceViewSet, StaffViewSet, ResourceTypeViewSet,
    ScheduledTaskViewSet, TaskExecutionLogViewSet,
    HolidayViewSet, TimeBlockViewSet, LocationViewSet,
    AlbumViewSet, MediaFileViewSet, StorageUsageView,
    StaffRoleViewSet,
)
from .export_views import ExportViewSet

# Create router and register viewsets
router = DefaultRouter()
router.register(r'resource-types', ResourceTypeViewSet, basename='resourcetype')
router.register(r'staff-roles', StaffRoleViewSet, basename='staffrole')
router.register(r'resources', ResourceViewSet, basename='resource')
router.register(r'appointments', EventViewSet, basename='appointment')  # Alias for frontend
router.register(r'events', EventViewSet, basename='event')
router.register(r'participants', ParticipantViewSet, basename='participant')  # UNUSED_ENDPOINT: Participants managed via Event serializer
router.register(r'customers', CustomerViewSet, basename='customer')
router.register(r'services', ServiceViewSet, basename='service')
router.register(r'staff', StaffViewSet, basename='staff')
router.register(r'scheduled-tasks', ScheduledTaskViewSet, basename='scheduledtask')
router.register(r'task-logs', TaskExecutionLogViewSet, basename='tasklog')  # UNUSED_ENDPOINT: Logs accessed via scheduled-tasks/{id}/logs action
router.register(r'export', ExportViewSet, basename='export')
router.register(r'holidays', HolidayViewSet, basename='holiday')
router.register(r'time-blocks', TimeBlockViewSet, basename='timeblock')
router.register(r'locations', LocationViewSet, basename='location')
router.register(r'albums', AlbumViewSet, basename='album')
router.register(r'media', MediaFileViewSet, basename='media')

# URL patterns
urlpatterns = [
    path('', include(router.urls)),
    path('storage-usage/', StorageUsageView.as_view(), name='storage-usage'),
]
