fix(bookings): PPT-2436 keep cancelled recurring occurrences when include_deleted is set - #387
Merged
Merged
Conversation
A cancelled occurrence of a recurring booking should come back, marked deleted, when the list asks for include_deleted, and stay out otherwise.
…lude_deleted is set The index passed the deleted query flag to Booking.expand_bookings! as its include_deleted argument, so a list asking for include_deleted=true without deleted=true dropped every cancelled occurrence of a recurring booking. Concierge's desk list does exactly that, so a cancelled occurrence vanished on reload.
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
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.
Fixes PPT-2436: cancel one occurrence of a recurring desk booking in Concierge and it drops out of the list on reload.
The bookings index passed the
deletedflag into theinclude_deletedargument ofBooking.expand_bookings!, so a request withinclude_deleted=truestill lost every cancelled occurrence. It now passesinclude_deleted.Anything that asks for
include_deleted=truenow gets cancelled occurrences markeddeleted, the same way it already gets cancelled one-off bookings. Concierge report counts go up to match. The native app sendsinclude_deleted=recurring, which reads as false, so it doesn't change.Not covered here: cancelling a whole series still only shows the first occurrence. That needs a change in models and will be a separate PR.
The first commit adds the specs on their own and fails CI against the old code (run). With the fix it's 304 examples, 0 failures (run).