fix(bookings): auto-confirm rescheduled paid bookings when confirmation is not required#28793
Draft
jaydeep-pipaliya wants to merge 1 commit intocalcom:mainfrom
Draft
Conversation
…on is not required When rescheduling a paid booking where the event type does not require confirmation, the new booking was incorrectly created with PENDING status instead of ACCEPTED. This happened because determineIsConfirmedByDefault returned false when price > 0, regardless of whether the original booking was already paid. The fix passes the original booking's paid status into the confirmation check. When the original booking was already paid and the event type does not require confirmation, the rescheduled booking is now auto-confirmed as ACCEPTED. Fixes calcom#22857
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.
What does this PR do?
Fixes #22857
When an attendee reschedules a paid booking on an event type that does not require confirmation, the rescheduled booking was incorrectly created with
PENDINGstatus instead ofACCEPTED. This caused:Root cause
In
getRequiresConfirmationFlags.ts, thedetermineIsConfirmedByDefaultfunction:When
requiresConfirmation = falseandprice > 0(paid event), this returnsfalse— even when rescheduling an already-paid booking. The price check blocks auto-confirmation because it assumes payment hasn't been collected yet.Fix
Added
originalRescheduledBookingPaidparameter todetermineIsConfirmedByDefault. When the original booking was already paid and the event type doesn't require confirmation, the rescheduled booking is auto-confirmed:Changes
packages/features/bookings/lib/handleNewBooking/getRequiresConfirmationFlags.ts— accept and useoriginalRescheduledBookingPaidflagpackages/features/bookings/lib/service/RegularBookingService.ts— passoriginalRescheduledBooking.paidto the flags function