Scheduling infrastructure for absolutely everyone.
Fix/correctly handle Pending Status and fix conditional require confirmation (#7911)
Hariom Balhara74ab6d209eb4
diff --git a/apps/web/pages/booking/[uid].tsx b/apps/web/pages/booking/[uid].tsxindex 9b541ffe96f..b509f1e333a 100644--- a/apps/web/pages/booking/[uid].tsx+++ b/apps/web/pages/booking/[uid].tsx@@ -266,7 +266,11 @@ export default function Success(props: SuccessProps) {const giphyImage = giphyAppData?.thankYouPage;const eventName = getEventName(eventNameObject, true);- const needsConfirmation = eventType.requiresConfirmation && reschedule != true;+ // Confirmation can be needed in two cases as of now+ // - Event Type has require confirmation option enabled always+ // - EventType has conditionally enabled confirmation option based on how far the booking is scheduled.+ // - It's a paid event and payment is pending.+ const needsConfirmation = bookingInfo.status === BookingStatus.PENDING;const userIsOwner = !!(session?.user?.id && eventType.owner?.id === session.user.id);const isCancelled =diff --git a/packages/features/bookings/lib/handleNewBooking.ts b/packages/features/bookings/lib/handleNewBooking.tsindex 9a58d26c540..2979663201b 100644--- a/packages/features/bookings/lib/handleNewBooking.ts+++ b/packages/features/bookings/lib/handleNewBooking.ts@@ -1445,8 +1445,7 @@ async function handler(// Otherwise, an owner rescheduling should be always accepted.// Before comparing make sure that userId is set, otherwise undefined === undefinedconst userReschedulingIsOwner = userId && originalRescheduledBooking?.user?.id === userId;- const isConfirmedByDefault =- (!eventType.requiresConfirmation && !paymentAppData.price) || userReschedulingIsOwner;+ const isConfirmedByDefault = (!requiresConfirmation && !paymentAppData.price) || userReschedulingIsOwner;const attendeesData = evt.attendees.map((attendee) => {//if attendee is team member, it should fetch their locale not booker's locale