[#200] [BUG] - Calculate end time does not work properly

Migrated from Redmine #200 | Author: Franjo Eric
Status: New | Priority: Normal | Created: 2018-07-23


Hi there,
I have this issue with calculating endTime

I have nodejs service and I’m getting data over APi.

I’m wondering about function calculateEndTime, in documentation it says “Returns end datetime if booking is available, else return false”.
So even if my startDateTime is unavailable I’m getting endTime in response instead of false.
Am I something figured wrong or API does not work properly?

This is my req URL

http://localhost:8585/v1/calculate-end-time/startDateTime/2018-07-25 10:30:00/service/1/unit/1

NODEJS GET route

router.get(“/calculate-end-time/startDateTime/:startDateTime/service/:service/unit/:unit”, function (req, res) {
let { startDateTime } = req.params;
let service = parseInt(req.params.service)
let unit = parseInt(req.params.unit)
let data = adminAPI.calculateEndTime(startDateTime, service, unit)
res.send(data)
})

and response is always endTime as string, never false.

In Screenshoot you can see that datetime is unavailable.

Thank you,
kind regards

Redmine Admin wrote:

we need raw http request and response to/from our server to investigate this

Franjo Eric wrote:

Redmine Admin wrote:

we need raw http request and response to/from our server to investigate this

GET http://booking.crospitality.eu/v1/calculate-end-time/startDateTime/2018-07-28 10:30:00/service/1/unit/1
And there is booking website created by your service
https://marche.simplybook.it/v2/#book .

As you can see datetime 2018-07-25 10:30:00 for service “Private Panorama Dubrovnik Tour” // . {id:1}
and provider/unit “Crospitality” // {id:1} is unavailable

I hope this helps you for debugging.

Thanks, regards

Franjo Eric wrote:

any news here?

(Short original content)

Dmytro Bondarev wrote:

Hi! Sorry for misunderstanding in documentation . The unavailability in this case can be only if booking does not fit to working time. It does not take into account bookings in this time.