refactor: Rename launch_type to propulsion_system across the codebase

This commit is contained in:
pacnpal
2025-09-18 21:01:13 -04:00
parent 516c847377
commit d5cd6ad0a3
21 changed files with 207 additions and 92 deletions

View File

@@ -173,10 +173,10 @@ class RideListCreateAPIView(APIView):
description="Filter roller coasters by track material (STEEL, WOOD, HYBRID)",
),
OpenApiParameter(
name="launch_type",
name="propulsion_system",
location=OpenApiParameter.QUERY,
type=OpenApiTypes.STR,
description="Filter roller coasters by launch type (CHAIN, LSM, HYDRAULIC, etc.)",
description="Filter roller coasters by propulsion system (CHAIN, LSM, HYDRAULIC, etc.)",
),
OpenApiParameter(
name="min_rating",
@@ -507,9 +507,9 @@ class RideListCreateAPIView(APIView):
if track_material:
qs = qs.filter(coaster_stats__track_material=track_material)
launch_type = params.get("launch_type")
if launch_type:
qs = qs.filter(coaster_stats__launch_type=launch_type)
propulsion_system = params.get("propulsion_system")
if propulsion_system:
qs = qs.filter(coaster_stats__propulsion_system=propulsion_system)
# Height filters
min_height_ft = params.get("min_height_ft")
@@ -762,7 +762,7 @@ class FilterOptionsAPIView(APIView):
post_closing_statuses = get_choices('post_closing_statuses', 'rides')
track_materials = get_choices('track_materials', 'rides')
coaster_types = get_choices('coaster_types', 'rides')
launch_systems = get_choices('launch_systems', 'rides')
propulsion_systems = get_choices('propulsion_systems', 'rides')
target_markets = get_choices('target_markets', 'rides')
# Convert Rich Choice Objects to frontend format with metadata
@@ -831,7 +831,7 @@ class FilterOptionsAPIView(APIView):
for choice in coaster_types
]
launch_systems_data = [
propulsion_systems_data = [
{
"value": choice.value,
"label": choice.label,
@@ -841,7 +841,7 @@ class FilterOptionsAPIView(APIView):
"css_class": choice.metadata.get('css_class'),
"sort_order": choice.metadata.get('sort_order', 0)
}
for choice in launch_systems
for choice in propulsion_systems
]
target_markets_data = [
@@ -894,7 +894,7 @@ class FilterOptionsAPIView(APIView):
{"value": "WING", "label": "Wing", "description": "Seats extend beyond track sides", "color": "indigo", "icon": "wing", "css_class": "bg-indigo-100 text-indigo-800", "sort_order": 5},
{"value": "DIVE", "label": "Dive", "description": "Features steep vertical drops", "color": "red", "icon": "dive", "css_class": "bg-red-100 text-red-800", "sort_order": 6},
]
launch_systems_data = [
propulsion_systems_data = [
{"value": "CHAIN", "label": "Chain Lift", "description": "Traditional chain lift hill", "color": "gray", "icon": "chain", "css_class": "bg-gray-100 text-gray-800", "sort_order": 1},
{"value": "LSM", "label": "LSM Launch", "description": "Linear synchronous motor launch", "color": "blue", "icon": "lightning", "css_class": "bg-blue-100 text-blue-800", "sort_order": 2},
{"value": "HYDRAULIC", "label": "Hydraulic Launch", "description": "High-pressure hydraulic launch", "color": "red", "icon": "hydraulic", "css_class": "bg-red-100 text-red-800", "sort_order": 3},
@@ -934,7 +934,7 @@ class FilterOptionsAPIView(APIView):
{"value": "WOOD", "label": "Wood"},
{"value": "HYBRID", "label": "Hybrid"},
],
"launch_types": [
"propulsion_systems": [
{"value": "CHAIN", "label": "Chain Lift"},
{"value": "LSM", "label": "LSM Launch"},
{"value": "HYDRAULIC", "label": "Hydraulic Launch"},
@@ -1019,7 +1019,7 @@ class FilterOptionsAPIView(APIView):
post_closing_statuses = get_choices('post_closing_statuses', 'rides')
track_materials = get_choices('track_materials', 'rides')
coaster_types = get_choices('coaster_types', 'rides')
launch_systems = get_choices('launch_systems', 'rides')
propulsion_systems = get_choices('propulsion_systems', 'rides')
target_markets = get_choices('target_markets', 'rides')
# Convert Rich Choice Objects to frontend format with metadata
@@ -1088,7 +1088,7 @@ class FilterOptionsAPIView(APIView):
for choice in coaster_types
]
launch_systems_data = [
propulsion_systems_data = [
{
"value": choice.value,
"label": choice.label,
@@ -1098,7 +1098,7 @@ class FilterOptionsAPIView(APIView):
"css_class": choice.metadata.get('css_class'),
"sort_order": choice.metadata.get('sort_order', 0)
}
for choice in launch_systems
for choice in propulsion_systems
]
target_markets_data = [
@@ -1274,7 +1274,7 @@ class FilterOptionsAPIView(APIView):
"post_closing_statuses": post_closing_statuses_data,
"roller_coaster_types": coaster_types_data,
"track_materials": track_materials_data,
"launch_types": launch_systems_data,
"propulsion_systems": propulsion_systems_data,
"ride_model_target_markets": target_markets_data,
"parks": parks,
"park_areas": park_areas,
@@ -1499,7 +1499,7 @@ class RideImageSettingsAPIView(APIView):
OpenApiParameter("capacity_max", OpenApiTypes.INT, description="Maximum hourly capacity"),
OpenApiParameter("roller_coaster_type", OpenApiTypes.STR, description="Filter by roller coaster type (comma-separated for multiple)"),
OpenApiParameter("track_material", OpenApiTypes.STR, description="Filter by track material (comma-separated for multiple)"),
OpenApiParameter("launch_type", OpenApiTypes.STR, description="Filter by launch type (comma-separated for multiple)"),
OpenApiParameter("propulsion_system", OpenApiTypes.STR, description="Filter by propulsion system (comma-separated for multiple)"),
OpenApiParameter("height_ft_min", OpenApiTypes.NUMBER, description="Minimum roller coaster height in feet"),
OpenApiParameter("height_ft_max", OpenApiTypes.NUMBER, description="Maximum roller coaster height in feet"),
OpenApiParameter("speed_mph_min", OpenApiTypes.NUMBER, description="Minimum roller coaster speed in mph"),
@@ -1610,7 +1610,7 @@ class HybridRideAPIView(APIView):
filters = {}
# Handle comma-separated list parameters
list_params = ['category', 'status', 'manufacturer', 'designer', 'ride_model', 'roller_coaster_type', 'track_material', 'launch_type']
list_params = ['category', 'status', 'manufacturer', 'designer', 'ride_model', 'roller_coaster_type', 'track_material', 'propulsion_system']
for param in list_params:
value = query_params.get(param)
if value:
@@ -1692,7 +1692,7 @@ class HybridRideAPIView(APIView):
"statuses": {"type": "array", "items": {"type": "string"}},
"roller_coaster_types": {"type": "array", "items": {"type": "string"}},
"track_materials": {"type": "array", "items": {"type": "string"}},
"launch_types": {"type": "array", "items": {"type": "string"}},
"propulsion_systems": {"type": "array", "items": {"type": "string"}},
"parks": {
"type": "array",
"items": {