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 data upload in AVERT data fetcher #99

Open
4 tasks
ryanchansf opened this issue Mar 6, 2025 · 0 comments
Open
4 tasks

Implement data upload in AVERT data fetcher #99

ryanchansf opened this issue Mar 6, 2025 · 0 comments
Assignees
Labels
backend Backend scope ready Ready for sprint

Comments

@ryanchansf
Copy link
Collaborator

ryanchansf commented Mar 6, 2025

Description
Our AVERT data fetcher successfully fetches the data from the EPA website, but it currently only returns the data in the response rather than writing it to our MongoDB collection.

Modify the transformAvertData() function to convert each object into an AvertRecord type, and populate the database with each record.

Acceptance Criteria
The database is populated with the fetched AVERT data with a request to /api/avert.

Steps:

  • Modify the function transformAvertData() in src/services/avert-fetch.ts to convert an object corresponding to an AVERT record into an AvertRecord
  • In app/avert/route.ts:
    • Iterate over the AvertRecord objects in transformedData and call addAvertRecord() for each to save them as a document in the collection
    • Update the response to remove the transformed data and return success or failure on upload

Additional Information

@ryanchansf ryanchansf added ready Ready for sprint backend Backend scope labels Mar 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Backend scope ready Ready for sprint
Projects
None yet
Development

No branches or pull requests

2 participants