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

@@ -202,9 +202,7 @@ class RideFactory(DjangoModelFactory):
manufacturer = factory.SubFactory(ManufacturerCompanyFactory)
designer = factory.SubFactory(DesignerCompanyFactory)
ride_model = factory.SubFactory(RideModelFactory)
park_area = factory.SubFactory(
ParkAreaFactory, park=factory.SelfAttribute("..park")
)
park_area = factory.SubFactory(ParkAreaFactory, park=factory.SelfAttribute("..park"))
@factory.post_generation
def create_location(obj, create, extracted, **kwargs):
@@ -297,9 +295,7 @@ class Traits:
"""Trait for closed parks."""
return {
"status": "CLOSED_PERM",
"closing_date": factory.Faker(
"date_between", start_date="-10y", end_date="today"
),
"closing_date": factory.Faker("date_between", start_date="-10y", end_date="today"),
}
@staticmethod
@@ -310,11 +306,7 @@ class Traits:
@staticmethod
def recent_submission():
"""Trait for recent submissions."""
return {
"submitted_at": factory.Faker(
"date_time_between", start_date="-7d", end_date="now"
)
}
return {"submitted_at": factory.Faker("date_time_between", start_date="-7d", end_date="now")}
# Specialized factories for testing scenarios
@@ -378,11 +370,13 @@ class CloudflareImageFactory(DjangoModelFactory):
@factory.lazy_attribute
def expires_at(self):
from django.utils import timezone
return timezone.now() + timezone.timedelta(days=365)
@factory.lazy_attribute
def uploaded_at(self):
from django.utils import timezone
return timezone.now()