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

Alberto Martín Casado alberto.martin at bitergia.com
Wed Feb 17 13:26:48 CET 2016


Forwarding to the list (forgot to cc)

---------- Forwarded message ----------
From: Pablo Fernández Moniz <pablofernandezmoniz at gmail.com>
Date: Wed, Feb 17, 2016 at 1:18 PM
Subject: Re: [Fiware-developer-experience] Issue related to occupancy levels
To: Alberto Martín Casado <alberto.martin at bitergia.com>


Great!

Thank you

2016-02-17 11:55 GMT+00:00 Alberto Martín Casado <
alberto.martin at bitergia.com>:

> Hi Pablo!
>
> While doing the cast for the 'partySize' values, I've found the bug you
> are reporting right now.  The issue is fixed here
> <https://github.com/Fiware/tutorials.TourGuide-App/commit/8780e2ba49a7ae90d83a8dde4a1753e6929a418c> so,
> if you pull the latest changes it should work.
>
> I've tested myself and it works in the client :)
>
> Best,
>
>
> Alberto Martín
>
> On Wed, Feb 17, 2016 at 12:45 PM, Pablo Fernández Moniz <
> pablofernandezmoniz at gmail.com> wrote:
>
>> 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>
>>
>
>


-- 

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/57e89963/attachment.html>


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