Friday, June 14, 2024
1 change
Resolved issues and error corrections
Fixed an issue where appointment booking pages would show no available slots even when other staff members or resources had openings. Now when the first staff member is fully booked, the system automatically displays available slots from other staff members, allowing customers to complete their bookings without frustration.
Original PR description
__Current behavior before commit:__ When all slots from the first staff user/resource are taken, the `/appointment/<id>` page shows no availabilities even if the following users/resources still have…
__Current behavior before commit:__ When all slots from the first staff user/resource are taken, the `/appointment/<id>` page shows no availabilities even if the following users/resources still have slots. The user/resource selector is also not displayed. This means that it is not possible for a visitor to book an appointment as soon as the first one is fully booked. __Description of the fix:__ A new method `_get_slots_values` has been added to the `AppointmentController` class. This method will compute the available slots for every possible user/resource until there is one that has slots available. And it starts by checking the default one. However if one is specifically selected by the visitor, it will be used even if there is no slots for it. This way the visitor can select it see that it has no availabilities but he can still switch user/resource with the selector. If there is no default nor selected user/resource then the slots are computed for all possible users/resources. A new test has been added to check if the shown staff user is the correct one and if the selector and calendar are visible even when the first one has no availabilities. __Example of steps to reproduce the issue:__ - Create a new `appointment.type` - Set the max scheduling days to 7 - Keep only one schedule time slot (e.g. Monday from 9:00 to 10:00) - Set **Availability on** to *Resources* - Put at least 2 courts in **Resources** - Click on `Share`, select **Assign to** *Any User/Resource* - Open the link - Book the slot of the first court - Come back the slot selector page -> No more slots available although the second court has still one opw-3862746