pallupz/covid-vaccine-booking

[Logic for filtering via age is wrong]

Opened this issue · 8 comments

and (session['min_age_limit'] <= min_age_booking)\

In viable_options() function if checks for session[min_age_limit]< min_age_booking.
But in case of booking for people above 45yers, it will accept bth 45yrs and 18-44yrs sessions as viable.

Ohk.. 45+ people cant book for 18+ locations?

I thought that was one way restriction

No it is 18-44 and then 45+
I guess the min_age_limit is a misnomer

Okay.. I will try to get to it in the weekend. Or if you'd like to submit a PR, that's okay with me too. If you do, please do raise to bug/min_age branch.

Hi @sumit7 - Could you share the error you get when trying to book for 45+ beneficiary in a 18+ center?

================================= ATTEMPTING BOOKING ==================================================
Booking Response Code: 400
Booking Response : {"errorCode":"APPOIN0043","error":"Minimum age criteria is 18 years and maximum age 44 for this center"}
Response: 400 : {"errorCode":"APPOIN0043","error":"Minimum age criteria is 18 years and maximum age 44 for this center"}

This seems to be a new restriction, so yes, the code needs to be modified

When I had written this condition - I had explicitly tested for this case.
Also - I was also dumping the session info to a database - it looks like the max_age is a new field - it's not in the API responses I received back then/

Thanks for pointing it out