Skip to content

feat: automate event lifecycle transitions on start/end time - #79

Merged
wailbentafat merged 1 commit into
developfrom
feat/automatic-event-lifecycle
Aug 25, 2026
Merged

feat: automate event lifecycle transitions on start/end time#79
wailbentafat merged 1 commit into
developfrom
feat/automatic-event-lifecycle

Conversation

@wailbentafat

Copy link
Copy Markdown
Collaborator

Summary

  • Add events.end_date (nullable timestamptz) via migration.
  • Add ActivateDueEvents / ArchiveEndedEvents queries: draftscheduled once event_date has passed, scheduledarchived (+ archived_at) once end_date has passed.
  • Add a polling worker (app/worker/event_lifecycle) that runs both transitions every EVENT_LIFECYCLE_POLL_INTERVAL_SECONDS (default 60s), wired into make run-workers.
  • Thread end_date through EventCreate / EventResponse / UserEventResponse and CreateEvent / GetUserEvents.

Events with no end_date set are never auto-archived and stay in scheduled until archived manually via the existing endpoint — worth telling admin/frontend that setting an end date is what enables auto-archiving.

Test plan

  • Migration applied cleanly (make m-up), end_date column confirmed in schema
  • Seeded a due draft event and an ended scheduled event, ran the lifecycle pass manually, confirmed draft → scheduled and scheduled → archived (with archived_at set) both fired correctly
  • Worker starts cleanly alongside the rest of make run-workers, runs its first pass on schedule

- Add events.end_date (nullable timestamptz) via migration.
- Add ActivateDueEvents / ArchiveEndedEvents queries: draft -> scheduled
  when event_date has passed, scheduled -> archived (+ archived_at) when
  end_date has passed.
- Add a polling worker (app/worker/event_lifecycle) that runs both
  transitions every EVENT_LIFECYCLE_POLL_INTERVAL_SECONDS (default 60s),
  wired into make run-workers.
- Thread end_date through EventCreate/EventResponse/UserEventResponse
  and CreateEvent/GetUserEvents.

Events with no end_date set are never auto-archived and stay in
scheduled until archived manually via the existing endpoint.
@wailbentafat
wailbentafat merged commit aeb4d23 into develop Aug 25, 2026
1 check passed
@wailbentafat
wailbentafat deleted the feat/automatic-event-lifecycle branch August 25, 2026 00:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant