Skip to content

Feat: Add event instance cascade service to event and organization routes#194

Open
evanpetzoldt wants to merge 12 commits intodevfrom
feat-event-instance-cascading
Open

Feat: Add event instance cascade service to event and organization routes#194
evanpetzoldt wants to merge 12 commits intodevfrom
feat-event-instance-cascading

Conversation

@evanpetzoldt
Copy link
Copy Markdown
Collaborator

This pull request introduces a service to manage instances of a series as the series and org endpoints are used. Now, changes to recurring events (series) will automatically propagate to their future instances, and deleting an event or organization will also handle related series and instances appropriately. The most important changes are grouped below.

Event Series Cascade Management:

  • When creating or updating an event with a recurrence pattern, future instances are now automatically created or updated based on the series' recurrence pattern. Structural changes to a series (such as changing the recurrence rule) will trigger deletion and recreation of future instances, while non-structural changes will update future instances in place (event.ts) [1] [2].
  • Deleting an event that is part of a series will now also soft-delete all its future instances (event.ts) [1] [2].

Organization Cascade Management:

  • Deleting an organization now includes a check for the organization type. If it is an AO (Area of Operation), all associated event series and their future instances will also be soft-deleted (org.ts) [1] [2].

👋 TL;DR

Added a service to event and org routes that manage underlying event instances.

🥜 GIF

lack-of-hustle

@evanpetzoldt evanpetzoldt marked this pull request as draft March 25, 2026 12:31
@evanpetzoldt evanpetzoldt requested a review from Copilot March 25, 2026 12:31
@evanpetzoldt evanpetzoldt changed the title Add event instance cascade service to event and organization routes Feat: Add event instance cascade service to event and organization routes Mar 25, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Introduces a new cascade service used by the API’s event and org routers to automatically manage recurring event instances (create/update/recreate on series changes, and cascade soft-deletes on series/org deletion).

Changes:

  • Add cascade-service with functions to create/update/recreate/delete future event_instances from a recurring series.
  • Invoke cascade logic from event.crupdate and event.delete.
  • Invoke AO-specific cascade logic from org.delete, and update route descriptions accordingly.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 14 comments.

File Description
packages/api/src/router/org.ts Updates org delete behavior/docs and adds AO-only cascade soft-delete of series and future instances.
packages/api/src/router/event.ts Adds cascade behavior to series create/update and cascaded future-instance soft-delete on event delete.
packages/api/src/lib/cascade-service.ts New service implementing instance generation, future updates, and (soft/hard) deletion helpers.
packages/api/src/lib/cascade-service.test.ts New integration-style tests for cascade-service behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@evanpetzoldt evanpetzoldt marked this pull request as ready for review March 25, 2026 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Draft

Development

Successfully merging this pull request may close these issues.

2 participants