feat: Implement initial schema and add various API, service, and management command enhancements across the application.

This commit is contained in:
pacnpal
2026-01-01 15:13:01 -05:00
parent c95f99ca10
commit b243b17af7
413 changed files with 11164 additions and 17433 deletions

View File

@@ -1,4 +1,3 @@
from django.utils import timezone
from drf_spectacular.utils import extend_schema
from rest_framework.permissions import AllowAny
@@ -13,6 +12,7 @@ class DiscoveryAPIView(APIView):
"""
API endpoint for discovery content (Top Lists, Opening/Closing Soon).
"""
permission_classes = [AllowAny]
@extend_schema(
@@ -68,7 +68,7 @@ class DiscoveryAPIView(APIView):
"recently_closed": {
"parks": self._serialize(recently_closed_parks, "park"),
"rides": self._serialize(recently_closed_rides, "ride"),
}
},
}
return Response(data)
@@ -83,14 +83,13 @@ class DiscoveryAPIView(APIView):
"average_rating": item.average_rating,
}
if type_ == "park":
data.update({
"city": item.location.city if item.location else None,
"state": item.location.state if item.location else None,
})
data.update(
{
"city": item.location.city if item.location else None,
"state": item.location.state if item.location else None,
}
)
elif type_ == "ride":
data.update({
"park_name": item.park.name,
"park_slug": item.park.slug
})
data.update({"park_name": item.park.name, "park_slug": item.park.slug})
results.append(data)
return results