Show issues from last 30 days

Summary

This PR implements guest availability checking during host reschedule to address issue #16378. When a host reschedules a booking, the system now checks if attendees who are Cal.com users are available at the new time and only shows mutually available slots.

Changes Made

  • Core Logic: Added getGuestBusyTimesForReschedule method in AvailableSlotsService to fetch busy times for Cal.com guest users
  • Availability Integration: Modified getUsersAvailability to include guest busy times in availability calculation
  • Repository Methods: Added findUsersByEmails and findBookingsByUserIdsAndDateRange methods with prismock-compatible filtering
  • Scheduling Logic: Only applies guest availability checking for non-collective scheduling types
  • Comprehensive Testing: Added 4 test cases covering all scenarios

Technical Details

The implementation works by:

  1. Fetching the original booking's attendees during reschedule
  2. Identifying which attendees are Cal.com users via email lookup
  3. Retrieving busy times for those Cal.com users
  4. Including guest busy times in the host's availability calculation
  5. Filtering out slots where any guest is busy

Test Coverage

  • ✅ Excludes slots when Cal.com guest users are busy
  • ✅ Includes all slots when guests are not Cal.com users
  • ✅ Handles multiple Cal.com guest users correctly
  • ✅ Bypasses guest availability check for collective events

Type of Change

  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)

Testing

All tests pass successfully. The implementation includes comprehensive test coverage for various scenarios including single guests, multiple guests, non-Cal.com users, and different scheduling types.

Checklist

  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Closes #16378

Next issue in about 1 hour