Commit 4a8db7b
committed
feat(reschedule): check guest availability when host reschedules
When a host reschedules a booking, the slot picker now filters out time
slots that conflict with the guests' (attendees') existing accepted
bookings — preventing double-booking guests.
Changes:
- BookingRepository: add getAcceptedBookingsByAttendeeEmails() to query
bookings where any attendee email appears in a given list, within a
date range, excluding the booking being rescheduled
- AvailableSlotsService.calculateHostsAndAvailabilities(): when
rescheduleUid is present, look up the original booking's attendees,
filter out host emails to get guest-only emails, fetch their accepted
bookings in the slot search window, and pass them as guestBusyTimes
- GetUserAvailabilityInitialData: add optional guestBusyTimes field
- getUserAvailability(): spread guestBusyTimes into detailedBusyTimes so
guest conflicts are treated as busy time during availability calculation
Fixes calcom#163781 parent 17af50b commit 4a8db7b
File tree
3 files changed
+88
-0
lines changed- packages
- features
- availability/lib
- bookings/repositories
- trpc/server/routers/viewer/slots
3 files changed
+88
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
148 | 148 | | |
149 | 149 | | |
150 | 150 | | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
151 | 157 | | |
152 | 158 | | |
153 | 159 | | |
| |||
622 | 628 | | |
623 | 629 | | |
624 | 630 | | |
| 631 | + | |
| 632 | + | |
625 | 633 | | |
626 | 634 | | |
627 | 635 | | |
| |||
Lines changed: 41 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2220 | 2220 | | |
2221 | 2221 | | |
2222 | 2222 | | |
| 2223 | + | |
| 2224 | + | |
| 2225 | + | |
| 2226 | + | |
| 2227 | + | |
| 2228 | + | |
| 2229 | + | |
| 2230 | + | |
| 2231 | + | |
| 2232 | + | |
| 2233 | + | |
| 2234 | + | |
| 2235 | + | |
| 2236 | + | |
| 2237 | + | |
| 2238 | + | |
| 2239 | + | |
| 2240 | + | |
| 2241 | + | |
| 2242 | + | |
| 2243 | + | |
| 2244 | + | |
| 2245 | + | |
| 2246 | + | |
| 2247 | + | |
| 2248 | + | |
| 2249 | + | |
| 2250 | + | |
| 2251 | + | |
| 2252 | + | |
| 2253 | + | |
| 2254 | + | |
| 2255 | + | |
| 2256 | + | |
| 2257 | + | |
| 2258 | + | |
| 2259 | + | |
| 2260 | + | |
| 2261 | + | |
| 2262 | + | |
| 2263 | + | |
2223 | 2264 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
839 | 839 | | |
840 | 840 | | |
841 | 841 | | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
842 | 880 | | |
843 | 881 | | |
844 | 882 | | |
| |||
962 | 1000 | | |
963 | 1001 | | |
964 | 1002 | | |
| 1003 | + | |
965 | 1004 | | |
966 | 1005 | | |
967 | 1006 | | |
| |||
0 commit comments