feat: derive event lifecycle status from dates and flags

Replace persisted event statuses with publication and cancellation flags, and compute public lifecycle labels from event timing and registration capacity. Keep filters, registration checks, and profile responses aligned with the derived status.
This commit is contained in:
2026-10-03 12:46:16 +03:30
parent f268c9b88a
commit 6c5fadef2f
26 changed files with 525 additions and 178 deletions

View File

@@ -80,7 +80,7 @@ def expire_stale_registration_checkouts(*, now=None, event_id=None):
continue
reason = (
Registration.CancellationReasonChoices.EVENT_CANCELLED
if registration.event.status == Event.StatusChoices.CANCELLED
if registration.event.is_cancelled
else Registration.CancellationReasonChoices.CHECKOUT_EXPIRED
)
if mark_checkout_cancelled(registration, reason):
@@ -105,7 +105,7 @@ def expire_user_registration_checkouts(*, event, user, now):
for registration in registrations:
reason = (
Registration.CancellationReasonChoices.EVENT_CANCELLED
if event.status == Event.StatusChoices.CANCELLED
if event.is_cancelled
else Registration.CancellationReasonChoices.CHECKOUT_EXPIRED
)
if mark_checkout_cancelled(registration, reason):