[Fiware-developer-experience] Issue related to occupancy levels

Alberto Martín Casado alberto.martin at bitergia.com
Tue Feb 16 10:38:41 CET 2016


Hi Pablo!

On Mon, Feb 15, 2016 at 10:08 PM, Pablo Fernández Moniz <
pablofernandezmoniz at gmail.com> wrote:

> Hi!
>
> we are updating the client with the last API changes, and we think that we
> have found an issue.
>
> The problem is related to the occupancyLevel field that is treated as
> string instead of integer.
>
> This causes that if a user make two reservations, the number of commensals
> are concatenated as a string instead of being added. The screenshot
> [reservation_5.png] shows the occupancyLevel after reserved five commensals
> while the [reservation_5_more.png] image shows the occupancyLevel after
> reserve five more commensals.
>
> The consequences of the issue are that neither the backend nor the front
> end can control the max reservations allowing to the app virtually make
> reservations for a infinite number of
> commensals.[allow_infinite_reservations.png]
>
> Any sugesttions?
>

I've been testing the API, and if the Reservation field 'partySize' is
posted as an integer in the reservation, the back-end works as expected
(see attachments). But as you said, if you generate reservations adding the
field as a String, the behavior is wrong and it concatenates the values.

Even though using the right variable types does not generate any issue, I
will add a cast for that field in every reservation generation to avoid it.

Hope it works for you!

Best,


Alberto Martín
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.fiware.org/private/fiware-developer-experience/attachments/20160216/c1988b3a/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: reservations_list.png
Type: image/png
Size: 158021 bytes
Desc: not available
URL: <https://lists.fiware.org/private/fiware-developer-experience/attachments/20160216/c1988b3a/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: get_restaurant_with_date_filter.png
Type: image/png
Size: 147451 bytes
Desc: not available
URL: <https://lists.fiware.org/private/fiware-developer-experience/attachments/20160216/c1988b3a/attachment-0001.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: create_reservation.png
Type: image/png
Size: 67799 bytes
Desc: not available
URL: <https://lists.fiware.org/private/fiware-developer-experience/attachments/20160216/c1988b3a/attachment-0002.png>


More information about the Fiware-developer-experience mailing list

You can get more information about our cookies and privacy policies clicking on the following links: Privacy policy   Cookies policy