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

@@ -22,9 +22,7 @@ class ParksConfig(AppConfig):
from apps.parks.models import Park
# Register FSM transitions for Park
apply_state_machine(
Park, field_name="status", choice_group="statuses", domain="parks"
)
apply_state_machine(Park, field_name="status", choice_group="statuses", domain="parks")
def _register_callbacks(self):
"""Register FSM transition callbacks for park models."""
@@ -42,31 +40,16 @@ class ParksConfig(AppConfig):
from apps.parks.models import Park
# Cache invalidation for all park status changes
register_callback(
Park, 'status', '*', '*',
ParkCacheInvalidation()
)
register_callback(Park, "status", "*", "*", ParkCacheInvalidation())
# API cache invalidation
register_callback(
Park, 'status', '*', '*',
APICacheInvalidation(include_geo_cache=True)
)
register_callback(Park, "status", "*", "*", APICacheInvalidation(include_geo_cache=True))
# Search text update
register_callback(
Park, 'status', '*', '*',
SearchTextUpdateCallback()
)
register_callback(Park, "status", "*", "*", SearchTextUpdateCallback())
# Notification for significant status changes
register_callback(
Park, 'status', '*', 'CLOSED_PERM',
StatusChangeNotification(notify_admins=True)
)
register_callback(
Park, 'status', '*', 'DEMOLISHED',
StatusChangeNotification(notify_admins=True)
)
register_callback(Park, "status", "*", "CLOSED_PERM", StatusChangeNotification(notify_admins=True))
register_callback(Park, "status", "*", "DEMOLISHED", StatusChangeNotification(notify_admins=True))
logger.debug("Registered park transition callbacks")