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 eGRID data fetcher #66

Open
4 tasks
ryanhu021 opened this issue Feb 15, 2025 · 0 comments · May be fixed by #92
Open
4 tasks

Implement data upload in eGRID data fetcher #66

ryanhu021 opened this issue Feb 15, 2025 · 0 comments · May be fixed by #92
Assignees
Labels
backend Backend scope ready Ready for sprint

Comments

@ryanhu021
Copy link
Collaborator

ryanhu021 commented Feb 15, 2025

Description
Our eGRID 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 transformEgridData() function to convert each object into an EgridRecord type, and populate the database with each record.

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

Steps:

  • Modify the function transformEgridData() in src/services/egrid-fetch.ts to convert an object corresponding to an eGRID record into an EgridRecord
  • In app/egrid/route.ts:
    • Iterate over the EgridRecord objects in transformedData and call addEgridRecord() 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 Feb 20, 2025
@ivantorriani ivantorriani linked a pull request Mar 3, 2025 that will close this issue
6 tasks
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

Successfully merging a pull request may close this issue.

3 participants