Migrated from Redmine #947 | Author: Leonardy Huang
Status: Closed | Priority: Immediate, there is BUG! | Created: 2022-10-19
Hello,
Our configurations:
- We have services (duration: 80 minutes) with possible add-ons (duration: 40 minutes per add-on) starting from 09:00 - 18:00
- 1 service provider can only handle 1 client at a time
h2. What happened
There was an appointment with let’s say 7 addons at 09:00, and a service provider was already booked at 10:20 - 11:40. The booking duration was supposed to be 80 + 40*7, or 360 minutes. But this provider was still considered available (getAvailableUnits function returned this provider) thus the booking was attempted and it returned “Selected time not available” error.
h2. Expectation
getAvailableUnits function was not supposed to return this service provider since he was already booked within the duration of 360 minutes
This function was working fine before, but now the behavior was not the same.
Sample request:
curl --location --request POST 'https://user-api.simplybook.vip' \
--header 'X-Company-Login: acompany' \
--header 'X-Token: atoken' \
--header 'Content-Type: application/json' \
--data-raw '{
"jsonrpc": "2.0",
"method": "getAvailableUnits",
"params": [
4,
"2022-10-21 09:00:00",
null,
null,
[
1,
1,
1,
1,
1,
1,
1
]
],
"id": 1
}'
Sample response (service provider 11 is the one that was not available):
{
"result": [
14,
3,
7,
4,
12,
13,
6,
11,
8,
5,
2,
1,
9
],
"id": "1",
"jsonrpc": "2.0"
}
Kindly assist.
Screenshot:
!https://i.ibb.co/K2CnhyS/screencapture-malaysiatest2-secure-simplybook-vip-v2-2022-10-19-16-43-14.png!