fix(bookings): PPT-2436 list a cancelled series when include_deleted is set - #388
Merged
Merged
Conversation
Temporary until the models change is released, then this becomes a normal placeos-models version bump.
Cancelling a whole series should leave every occurrence in an include_deleted list, marked deleted. The pagination specs now expect a cancelled series to come back expanded, and mix in a rejected series to keep a page of expanded and unexpanded rows.
…is set The index only fetched a recurring series whose deleted_at was null, and sorted and counted a deleted series as a single unexpanded row. With include_deleted it now fetches cancelled series too and treats them as expanded, matching Booking#recurring_booking?(include_deleted) in models, so a cancelled series shows every occurrence in the period, marked deleted.
Replaces the temporary models branch override with the released version that expands a cancelled series.
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.
Second half of PPT-2436, after #387. Cancelling a whole recurring series in Concierge left only its first occurrence in the list, and later days showed nothing.
With
include_deleted=truethe bookings index now fetches cancelled series too, and sorts and counts them as expanded rows to matchBooking#recurring_booking?(include_deleted)from models 9.117.1 (PlaceOS/models#331). Each occurrence in the period comes back markeddeleted. Withoutinclude_deletednothing changes.Two pagination specs assumed a cancelled series comes back as one row, which is the behaviour being fixed, so they now expect its occurrences. One also mixes in a rejected series to keep a page of expanded and unexpanded rows.
The specs-only commit fails CI against the old code (run).