kshannon / vaxspotter

WebApp to allow communities easier access to vaccine appointment info and links to make reservations.
https://www.vaxspotter.info/
Apache License 2.0
2 stars 0 forks source link

extract importing appointments to separate model/controller/view #32

Open kshannon opened 3 years ago

kshannon commented 3 years ago

Currently csv importing is weakly done via a self.import function in the appointment model, via an import method in the appointment controller. This should be a separate import_appointment.rbmodel and import_appointment_controller.rb file with its own view so we can pass back errors on rows and handle validations with grace.

But for now as a one off for myself the csv importer works.

kshannon commented 3 years ago

The importer currently does not handle updates. I think it needs to check for a compound key of location_id and date, this also assumes that each location can only have one "appointment" record per date. This might break how some organizations provide appointments (e.g. 500 appointments on fri the 13th.) However, I can use that number and store it in the vaccines_available column, as that acts as a fairly good surrogate for number of appts.