[#543] getServiceAvailableTimeIntervals not considering event duration

Migrated from Redmine #543 | Author: Diego Pettenella
Status: New | Priority: High, I’m very impatient | Created: 2020-06-18


So I have an event that lasts 90 minutes,
my available time slots are [10:30 - 12:30] , [13:30 - 15:30] , [17:00 - 18:30],
I have a service provider and a related resource related to the events and a google calendar linked to my service provider.
If I call getServiceAvailableTimeIntervals and there is already a booking at [10:30 - 12:00] the result contains
{
“from”: “12:00:00”,
“to”: “12:30:00”
},
and that is a problem because 90’ don’t fit in 30’

I thought the problem was that since I linked a service provider the intervals were his intervals but that is not the case because my service provider resource working time is from [9:00 - 18:30] and if I call getServiceAvailableTimeIntervals with no bookings I get the right intervals mentioned above.

my understanding of get service available time intervals is “get the time intervals where the given event fits given it’s opening time and the already done bookings”
am I missing something here? like should I call an other api and calculate the results?

thanks

Redmine Admin wrote:

hi, it seems this issue is not related to API but related to your settings. Please try to book this slot from your booking site and see what happend:

  1. if it will work like it should then it can be an API issue, please provide full raw http request and responce here
  2. if you will face with same problem then it is settings. In this case place contact our live help

Diego Pettenella wrote:

Redmine Admin wrote:

hi, it seems this issue is not related to API but related to your settings. Please try to book this slot from your booking site and see what happend:

  1. if it will work like it should then it can be an API issue, please provide full raw http request and responce here
  2. if you will face with same problem then it is settings. In this case place contact our live help

Ok I looked at my booking site and the slot is not available (correct),

this is my request

curl --location --request POST ‘https://user-api.simplybook.me
–header ‘Content-Type: application/json’
–header ‘X-Company-Login: FamigliaOlivini’
–header ‘X-Token: 6f3124246bb4f91f8cd48d5c1f299574b6c2e31b90680ae79127bc3031b0ee69’
–data-raw ‘{
“jsonrpc” : “2.0”,
“method” : “getServiceAvailableTimeIntervals”,
“params”: [
“2020-06-19”,
“2020-06-19”,
2,
1,
4
],
“id”: 2
}’

this is the result :

{
“result”: {
“2020-06-19”: {
“2”: [
{
“from”: “18:00:00”,
“to”: “18:30:00”
}
]
}
},
“id”: “2”,
“jsonrpc”: “2.0”
}

Redmine Admin wrote:

getServiceAvailableTimeIntervals does not check service duration and just return ALL available time intevals taking in account service and provider schedule if set, breaktimes, google calendar events and company schedule.