bombardier-gif / covid-vaccine-booking

This very basic script can be used to automate COVID-19 vaccination slot booking on India's Co-WIN Platform.
375 stars 216 forks source link

dose2_due_date #280

Closed ghost closed 3 years ago

ghost commented 3 years ago

Fetching registered beneficiaries.. 'dose2_due_date' Exiting Script

generating token but after that not working

Nakul93 commented 3 years ago

Are you able to get the list of beneficiaries? Does all the beneficiaries that you are trying book have the same vaccination status?

Kanchangk commented 3 years ago

new code has messed it up somewhere.

bombardier-gif commented 3 years ago

There were a bunch of PRs merged yesterday. The problem is that we cannot test these changes thoroughly, so any change introduces bugs

Nakul93 commented 3 years ago

Yeah sorry about that. I missed one corner case where beneficiaries have different vacc status. As a suggestion, I think from now on we should submit our pr into a different branch (lets say dev) rather than the main and only after testing it thoroughly we should rebase it to main

Kanchangk commented 3 years ago

some kind of unethical way to test is to register a "fake" beneficiary, as cowin do allow to add anyone and cancel the appointments later on. They don't verify any IDs except PAN while registering.

Nakul93 commented 3 years ago

some kind of unethical way to test is to register a "fake" beneficiary, as cowin do allow to add anyone and cancel the appointments later on. They don't verify any IDs except PAN while registering.

Yeah true, thats how I tested it yesterday.

bombardier-gif commented 3 years ago

@Nakul93 Could you please fix the corner-case and raise a PR?

Nakul93 commented 3 years ago

@bombardier-gif Already did. Its in #272

bombardier-gif commented 3 years ago

merged. @gitmnj Can you please re open this issue if you see the problem again?

bombardier-gif commented 3 years ago

@bombardier-gif Already did. Its in #272

Ideally you should make it a separate PR for bugs so that its easy to revert in case of a problem.

Nakul93 commented 3 years ago

@bombardier-gif Already did. Its in #272

Ideally you should make it a separate PR for bugs so that its easy to revert in case of a problem.

Agree, will do that from next time. And also we should have separate branches for features/enhancements and main branch should only be used for bug fixes

Kanchangk commented 3 years ago

i guess you can simply do something like this

`def vaccine_dose2_duedate(vaccine_type, dose1_date):

if vaccine_type == "COVISHIELD":
    dose1 = datetime.datetime.strptime(dose1_date, "%d-%m-%Y")
    covishield_due_date = dose1 + datetime.timedelta(84)
    return covishield_due_date
elif vaccine_type == "COVAXIN":
    dose1 = datetime.datetime.strptime(dose1_date, "%d-%m-%Y")
    covaxin_due_date = dose1 + datetime.timedelta(28)
    return covaxin_due_date
elif vaccine_type == "SPUTNIK V":
    dose1 = datetime.datetime.strptime(dose1_date, "%d-%m-%Y")
    sputnikV_due_date = dose1 + datetime.timedelta(21)
    return sputnikV_due_date`

and inside get beneficiaries

if beneficiary["vaccination_status"] == "Partially Vaccinated" : dose2_date_calculated = vaccine_dose2_duedate(beneficiary["vaccine"], beneficiary["dose1_date"]) beneficiary["dose2_date"] = dose2_date_calculated