Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement fetch-vaccination-database.ts to fetch data from https://api.vaksinasi.id/docs and store it into wbw-vaccination-database.json file #803

Closed
Tracked by #802
zainfathoni opened this issue Oct 8, 2021 · 3 comments · Fixed by #806
Labels
hacktoberfest Issues for Hacktoberfest

Comments

@zainfathoni
Copy link
Member

No description provided.

@togetherwithasteria
Copy link
Contributor

togetherwithasteria commented Oct 8, 2021

Just want to correct my understanding. The place should be in /etc/fetchers/fetch-vaccination-database.ts, isn't it? I'm new to this project.

@zainfathoni
Copy link
Member Author

Just want to correct my understanding. The place should be in /etc/fetchers/fetch-vaccination-database.ts, isn't it? I'm new to this project.

Yes, correct. If you want to work on it, please submit a draft PR as soon as possible, thanks! 🙏

@togetherwithasteria
Copy link
Contributor

togetherwithasteria commented Oct 9, 2021

I have finished most of the bits, just need to finish the test now 'cuz Test-based Development. I'm at school rn, and I didn't get to commit and push it before school so I'll just leave this message to let everyone know that they shouldn't work in this. Don't worry, I'll be at home at 11 at least.

@zainfathoni zainfathoni added the hacktoberfest Issues for Hacktoberfest label Oct 13, 2021
zainfathoni pushed a commit that referenced this issue Oct 26, 2021
* feat(fetcher): implement vaksinasi.id db fetcher

Fetches vaksinasi.id's DB and store it in wbw-vaccination-database.json

Refs: #803

* style(fetcher): sort union type members in fetch-vaccine-database.ts

There is an ESLint warning in c84e78c, this commit addresses that warn

* refactor(fetcher): move types of vaksinid fetcher to lib

* refactor(fetcher): move the vaksin.id url to the top

* feat(fetcher): fetch vaksinasi.id db in fetch-wbw.ts

* refactor(fetcher): reduce repetition in vaccination types

* fix(fetcher): fix program stuck caused by spinner

fetchVaccinationDatabase() is so fast that a spinner stucks the program.

So, move it to the top and remove line 37.

* refactor(fetcher): transform vaksinid output data to be Contact-compatible

Transforms the output of the vaccination db fetcher to VaccinationContact[].

This will make it ready to be used downstream in the components.

The VaccinationContact interface has a 'map' property.
This is unecessary as WBW's "Buka Peta" button uses the address instead.
Though, I still add it in case we want to use that for the "Buka Peta" button.

* refactor(fetcher): change vaksin.id output to PartialVaccinationProvince[]

Make it easy for the DB to be merged with the other contact DBs.

Using VaccinationContact[] might force us into unnecessarily iterating the array just to merge it.

* refactor(fetcher): change vaksin.id output to an object

Using an object provide an easier iteration than PartialProvinceContact[].

PartialProvinceContact is also removed because it's now useless.

Refs: #806 issue comment 940051302

* chore: switch netlify export to yarn fetch-wbw

* feat(fetcher): log some info from  vaccination db

* feat(fetcher): log the output text of vaccine.db fetcher

* fix(fetcher): fix vaksinasi.id fetcher only fetching 4 provinces

* refactor(fetcher): remove console.log()s from vaccination fetcher
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hacktoberfest Issues for Hacktoberfest
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants