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

Function and route to get all data docs given Net Model + Cluster ID #14

Merged
merged 2 commits into from
Oct 30, 2023

Conversation

hanahhleee
Copy link
Contributor

Overview

Created a function and route that gets all data documents given a net model and a list of cluster IDs. It also takes in two optional parameters minDate and maxDate which specifies the earliest or latest date to query.

Changes Made

I created a Model Class with fields name (string) and cost (number) and updated Net Class to reflect changes in the database schema. I recycled parts of my code from last week's ticket of creating a function and route to get all data docs given a list of cluster IDs. I created a helper function that is shared by the two functions in order to minimize repeated code. For now, a net model is passed into the routes by params modelName and modelCost.

Test Coverage

  1. checkout branch model-query-func
  2. Use Postman or swagger http://localhost:8000/api-docs to create clusters, nets, and data docs (NOTE: list clusterIds is currently hardcoded in views.ts for testing purpose, so after creating a cluster you want to test, copy the id and update clusterIds in views.ts)
  3. Use the routes to get data docs given net model (modelName and modelCost) and cluster IDs (4 different routes: given both minDate and maxDate, given only minDate, given only maxDate, given neither minDate nor maxDate)

@jfeuerstein jfeuerstein self-requested a review October 30, 2023 16:37
@jfeuerstein jfeuerstein merged commit 62463b8 into main Oct 30, 2023
0 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants