* feat - Restrict same email to create more than 'n' active bookings at a time * updated checkbookerbookinglimit function * type fix * minor change * import fix * minor fixes * back to null on disable * back * type check * managed edge cases * chore: name changes * name changes * fix * minor change * changed name * use default value for maxactivebookingsperbooker, and some minor changes * disabling bookerbooking limit for recurring event * disabling bookerbooking limit for recurring event * type fix * ui fix and backend eventtype update check * Add `maxActiveBookingPerBookerOfferReschedule` to schema * Create `MaxActiveBookingsPerBookerController` and offer reschedule option * Add offer reschedule to event type form data * Pass data through to HttpError * When checking max bookings, return last booking info if applicable * removed unused code * minor changes * update validation * chore * Do not check booking limits if rescheduling * Add data for reschedule * Add reschedule specific error code * On maximum booking error, write to booker store reschedule params * Add translations for error codes * Write to error message previous booking time * minor fix * Write to error message previous booking time * Type fixes * Clean up comment * Refactor eventType update errors * Typo fix * Type fix * Type fix * Type fix * Fix test * Fix test * Add migration * Addressed feedback and missed merges --------- Co-authored-by: romit <romitgabani@icloud.com>
Strategies to prevent error during booking
- The
getSchedulecall, fetches only those slots that are bookable including not showing the slots that are reserved by someone else.- The booking call and the get scheduled call share the same availability checking logic to avoid scenario where
getScheduleconsiders a slot as available but Booking call doesn't consider it available.
- The booking call and the get scheduled call share the same availability checking logic to avoid scenario where
- Even though a slot might be available, multiple people might have opened the same booking page and might want to book the same slot.
- We have a reservation system in place that avoid showing a slot that is reserved by someone to other people.
- The
getSchedulecall itself considers the reservations and doesn't show those slots. - When two persons open the same booking page at the same time, they might will see the same slots.
- If Person1 selects slot1, it will be reserved by Person1. Person2 still sees the slot(because
getScheduleis refetched after a long time(in minutes)). But when Person2 selects the same slot1, he will go to "Slot no-longer available" state.- Also when the Person2, comes back to the slots listing page, he will see the slot as unavailable now. It works because getSchedule would have been fetched by that time which happened when he selected the slot earlier.
- If Person1 selects slot1, it will be reserved by Person1. Person2 still sees the slot(because
- We don't check for reservation during the confirm booking call, because a reservation has lower priority then the actual booking.
"Slot no-longer available" state
- When a slot is no longer available, we disable the "Confirm" button which does the booking.
- We show a message to the user that he should select a different slot.
- To ensure that we can go to this state, whenever applicable, we do the following:
getSchedulefetching. It prevents the unavailable slot to not appear in the list.- Fetched on window focus to handle the users who have the page opened for some time then come back to it
- Fetched every 5 mins(configurable by .env) as well to handle users who are just there on the page for a long time.
- Fetched on selecting a slot.
isReservationquery. It prevents the unavailable slot to be not bookable by the User- Fetched on regular quick intervals(currently every 10s(configurable by .env)). Even though it doesn't detect actual busy/booked slots, it still avoids the attempted booking of a reserved slot.