mirror of
https://github.com/pacnpal/thrillwiki_django_no_react.git
synced 2025-12-20 10:51:09 -05:00
65 lines
2.2 KiB
Python
65 lines
2.2 KiB
Python
"""Comprehensive URL routes for Rides domain (API v1).
|
|
|
|
This file exposes a maximal set of "full-fat" endpoints implemented in
|
|
`apps.api.v1.rides.views`. Endpoints are intentionally expansive (aliases,
|
|
bulk operations, action endpoints, analytics, import/export) so the backend
|
|
surface matches the frontend's expectations. Implementations for specific
|
|
actions (bulk, publish, export, import, recommendations) should be added
|
|
to the views module when business logic is available.
|
|
"""
|
|
|
|
from django.urls import path, include
|
|
from rest_framework.routers import DefaultRouter
|
|
|
|
from .views import (
|
|
RideListCreateAPIView,
|
|
RideDetailAPIView,
|
|
FilterOptionsAPIView,
|
|
RideModelSearchAPIView,
|
|
RideSearchSuggestionsAPIView,
|
|
)
|
|
from .company_views import (
|
|
RideCompanyListCreateAPIView,
|
|
RideCompanyDetailAPIView,
|
|
RideCompanySearchAPIView,
|
|
)
|
|
from .photo_views import RidePhotoViewSet
|
|
|
|
# Create router for nested photo endpoints
|
|
router = DefaultRouter()
|
|
router.register(r"photos", RidePhotoViewSet, basename="ridephoto")
|
|
|
|
app_name = "api_v1_rides"
|
|
|
|
urlpatterns = [
|
|
# Core list/create endpoints
|
|
path("", RideListCreateAPIView.as_view(), name="ride-list-create"),
|
|
# Filter options
|
|
path("filter-options/", FilterOptionsAPIView.as_view(), name="ride-filter-options"),
|
|
# Company endpoints - domain-specific CRUD for MANUFACTURER/DESIGNER companies
|
|
path("companies/", RideCompanyListCreateAPIView.as_view(),
|
|
name="ride-companies-list-create"),
|
|
path("companies/<int:pk>/", RideCompanyDetailAPIView.as_view(),
|
|
name="ride-company-detail"),
|
|
# Autocomplete / suggestion endpoints
|
|
path(
|
|
"search/companies/",
|
|
RideCompanySearchAPIView.as_view(),
|
|
name="ride-search-companies",
|
|
),
|
|
path(
|
|
"search/ride-models/",
|
|
RideModelSearchAPIView.as_view(),
|
|
name="ride-search-ride-models",
|
|
),
|
|
path(
|
|
"search-suggestions/",
|
|
RideSearchSuggestionsAPIView.as_view(),
|
|
name="ride-search-suggestions",
|
|
),
|
|
# Detail and action endpoints
|
|
path("<int:pk>/", RideDetailAPIView.as_view(), name="ride-detail"),
|
|
# Ride photo endpoints - domain-specific photo management
|
|
path("<int:ride_pk>/photos/", include(router.urls)),
|
|
]
|