bcgov / parks-reso-public

Day Use Pass Public
Apache License 2.0
4 stars 17 forks source link

DUP- Trail passes show incorrect number of available passes #368

Closed manuji closed 6 months ago

manuji commented 7 months ago

While testing the DUP, came across this issue.

Scenario:

Expected:

Issue:

https://github.com/bcgov/parks-reso-public/assets/65190263/ee9e4bf1-8ad4-49a7-9a1b-06c9c7708207

cameronpettit commented 6 months ago

This error only occurs in the front end and is just a misrepresentation of the actual number of passes available. It only happens when you look ahead at a future date that has no bookings for it yet - the front end assumes that the max number of trail passes one person can book (4) is available if no reservation object exists.

It will also only occur if the total number of base passes allotted to a trail facility is less than 4, which likely will never occur.

This error does not occur for the current date.

This has been fixed by adding a clause where the front end always shows the minimum of 3 possible pass availability values: the actual number of passes available, the maximum number of passes allotted to the facility, and the max number a user can book at once (hardcoded to 4).

Waiting for the pass timer stuff to be merged before this is merged.

JLWade commented 6 months ago

thanks for the context Cam!

cameronpettit commented 6 months ago

Complete but moving to blocked until the hold pass timer stuff successfully merges.

manuji commented 6 months ago

Tested on TEST: Passed