Fixes #16378
When a host reschedules a booking, the system now checks if any attendee is a Cal.com user and excludes their busy times from the available slots. This means the host can only pick a time that works for both parties.
The change adds a new step in the slot computation pipeline that runs in parallel with the existing data fetches:
BookingRepository.findByUidIncludeAttendeeEmailsUserRepository.findByEmails — checks both primary and verified secondary emails, case-insensitiveBookingRepository.findByUserIdsAndDateRangeguestBusyTimes into getUserAvailability, where they get merged into the combined busy times arrayThe rescheduled booking’s own time slot is excluded from the guest’s busy times so it remains selectable.
| File | What changed |
|---|---|
UserRepository.ts |
Added findByEmails — email-to-user lookup with secondary email support |
BookingRepository.ts |
Added findByUidIncludeAttendeeEmails and findByUserIdsAndDateRange |
getUserAvailability.ts |
Added guestBusyTimes to initial data type and merged into busy times |
slots/util.ts |
Added _getGuestBusyTimesForReschedule orchestration method |
Include keyword for relations)select everywhere, no include/claim #16378
Bcornish
@bcornish1797
Cal.com, Inc.
@cal