"""
History API URLs

URL patterns for history-related API endpoints.
"""

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

from .views import (
    ParkHistoryViewSet,
    RideHistoryViewSet,
    UnifiedHistoryViewSet,
)

# Create router for history ViewSets
router = DefaultRouter()
router.register(r"timeline", UnifiedHistoryViewSet, basename="unified-history")

urlpatterns = [
    # Park history endpoints
    path(
        "parks/<str:park_slug>/",
        ParkHistoryViewSet.as_view({"get": "list"}),
        name="park-history-list",
    ),
    path(
        "parks/<str:park_slug>/detail/",
        ParkHistoryViewSet.as_view({"get": "retrieve"}),
        name="park-history-detail",
    ),
    # Ride history endpoints
    path(
        "parks/<str:park_slug>/rides/<str:ride_slug>/",
        RideHistoryViewSet.as_view({"get": "list"}),
        name="ride-history-list",
    ),
    path(
        "parks/<str:park_slug>/rides/<str:ride_slug>/detail/",
        RideHistoryViewSet.as_view({"get": "retrieve"}),
        name="ride-history-detail",
    ),
    # Include router URLs for unified timeline
    path("", include(router.urls)),
]
