Add comprehensive API documentation for ThrillWiki integration and features

- Introduced Next.js integration guide for ThrillWiki API, detailing authentication, core domain APIs, data structures, and implementation patterns.
- Documented the migration to Rich Choice Objects, highlighting changes for frontend developers and enhanced metadata availability.
- Fixed the missing `get_by_slug` method in the Ride model, ensuring proper functionality of ride detail endpoints.
- Created a test script to verify manufacturer syncing with ride models, ensuring data integrity across related models.
This commit is contained in:
pacnpal
2025-09-16 11:29:17 -04:00
parent 61d73a2147
commit c2c26cfd1d
98 changed files with 11476 additions and 4803 deletions

View File

@@ -17,12 +17,10 @@ Architecture:
- Hybrid: Combine both approaches based on data characteristics
"""
from typing import Dict, List, Any, Optional, Tuple
from typing import Dict, List, Any, Optional
from django.core.cache import cache
from django.db import models
from django.db.models import Q, Count, Min, Max, Avg
from django.utils import timezone
from datetime import timedelta
from django.db.models import Q, Min, Max
import logging
logger = logging.getLogger(__name__)
@@ -67,7 +65,6 @@ class SmartRideLoader:
- has_more: Whether more data is available
- filter_metadata: Available filter options
"""
from apps.rides.models import Ride
# Get total count for strategy decision
total_count = self._get_total_count(filters)
@@ -89,7 +86,6 @@ class SmartRideLoader:
Returns:
Dict containing additional ride records
"""
from apps.rides.models import Ride
# Build queryset with filters
queryset = self._build_filtered_queryset(filters)
@@ -713,7 +709,10 @@ class SmartRideLoader:
'TR': 'Transport Ride',
'OT': 'Other',
}
return category_labels.get(category, category)
if category in category_labels:
return category_labels[category]
else:
raise ValueError(f"Unknown ride category: {category}")
def _get_status_label(self, status: str) -> str:
"""Convert status code to human-readable label."""
@@ -727,7 +726,10 @@ class SmartRideLoader:
'DEMOLISHED': 'Demolished',
'RELOCATED': 'Relocated',
}
return status_labels.get(status, status)
if status in status_labels:
return status_labels[status]
else:
raise ValueError(f"Unknown ride status: {status}")
def _get_rc_type_label(self, rc_type: str) -> str:
"""Convert roller coaster type to human-readable label."""
@@ -745,7 +747,10 @@ class SmartRideLoader:
'PIPELINE': 'Pipeline',
'FOURTH_DIMENSION': '4th Dimension',
}
return rc_type_labels.get(rc_type, rc_type.replace('_', ' ').title())
if rc_type in rc_type_labels:
return rc_type_labels[rc_type]
else:
raise ValueError(f"Unknown roller coaster type: {rc_type}")
def _get_track_material_label(self, material: str) -> str:
"""Convert track material to human-readable label."""
@@ -754,7 +759,10 @@ class SmartRideLoader:
'WOOD': 'Wood',
'HYBRID': 'Hybrid (Steel/Wood)',
}
return material_labels.get(material, material)
if material in material_labels:
return material_labels[material]
else:
raise ValueError(f"Unknown track material: {material}")
def _get_launch_type_label(self, launch_type: str) -> str:
"""Convert launch type to human-readable label."""
@@ -768,4 +776,7 @@ class SmartRideLoader:
'FLYWHEEL': 'Flywheel Launch',
'NONE': 'No Launch System',
}
return launch_labels.get(launch_type, launch_type.replace('_', ' ').title())
if launch_type in launch_labels:
return launch_labels[launch_type]
else:
raise ValueError(f"Unknown launch type: {launch_type}")