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

Pablo Fernández Moniz pablofernandezmoniz at gmail.com
Wed Feb 17 12:45:49 CET 2016


Hi!

you were right, we was providing the party_size field incorrectly. We
forced a cast to integer and now the occupancy level is increased as a
number with each reservation. With this fix, we can check if we can perform
a reservation or not.

Due to a bug in the reservation control from the client, we found that the
restriction from the backend does not seem to work for us. We could make
more reservations even if occupancyLevel raises the capacity value
 [occupancy_exceeds_capacity_1.png] [occupancy_exceeds_capacity_2.png].

Are we requesting the reservations correctly?


2016-02-16 9:38 GMT+00:00 Alberto Martín Casado <alberto.martin at bitergia.com
>:

> 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
>



-- 

Pablo Fernández Moniz
GIT Analyst

Web <http://www.pablofm.com>    Linkedin
<http://www.linkedin.com/in/pablofernandezmoniz/>   Twitter
<http://www.twitter.com/monizpablo>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.fiware.org/private/fiware-developer-experience/attachments/20160217/f93f855c/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: occupancy_exceeds_capacity_1.png
Type: image/png
Size: 54349 bytes
Desc: not available
URL: <https://lists.fiware.org/private/fiware-developer-experience/attachments/20160217/f93f855c/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: occupancy_exceeds_capacity_2.png
Type: image/png
Size: 39257 bytes
Desc: not available
URL: <https://lists.fiware.org/private/fiware-developer-experience/attachments/20160217/f93f855c/attachment-0001.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