fix(booking): PPT-2436 expand a cancelled series when include_deleted is set - #331
Merged
Merged
Conversation
A cancelled series should expand into cancelled occurrences when the caller asks for deleted bookings, and an occurrence of a cancelled series should hydrate as cancelled even when its own override is not.
… is set expand_bookings! only expanded series that were not deleted, so a list asking for deleted bookings got a cancelled series back as one row for its first occurrence. recurring_booking? takes include_deleted and expand_bookings! passes it through. hydrate_booking keeps the series' cancellation when an occurrence's override is not itself deleted, so an occurrence of a cancelled series (for example one checked in earlier) never reads as live.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of PPT-2436. Cancelling a whole recurring series in Concierge left only its first occurrence in the list, because
expand_bookings!never expanded a deleted series.recurring_booking?takesinclude_deleted, andexpand_bookings!passes it through, so a cancelled series expands into cancelled occurrences when the caller asks for deleted bookings. The default is unchanged for every other caller.hydrate_bookingkeeps the series' cancellation when an occurrence's own override isn't deleted, e.g. one that was checked in before the series was cancelled. That also means staff-api refuses check-in and approval on an occurrence of a cancelled series.staff-api needs a matching query change, in a PR that follows this release.
The specs-only commit fails CI against the old code (run). With the fix it's 779 examples, 0 failures (run).