-
Notifications
You must be signed in to change notification settings - Fork 1
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
Nutrition data and Environment Data parsing #128
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #128 +/- ##
==========================================
+ Coverage 89.11% 93.17% +4.06%
==========================================
Files 41 38 -3
Lines 1653 1671 +18
==========================================
+ Hits 1473 1557 +84
+ Misses 180 114 -66 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for creating the PR.
Looks good to me.
We have to see how we handle these new lints causing errors. Either we disable them or we fix what they tell us (if they are not too much work and don't say anything stupid I think I would prefer the latter)
That is some progress for #124
One further question: @uglrl did you include that in the test cases? It looks like but I want to make sure. |
Looks good to me as well. I would suggest parsing more than just the nutrition stats, as we're here:
Tell me how you think about that idea. https://www.sw-ka.de/de/hochschulgastronomie/qualitaet_nachhaltigkeit/nachhaltigkeit/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool that you continued working hereon!
There are some problems, however...
I think it is not worth it to change all those names with an external dependency now (database, API) as it is too much of a hassle and too dangerous (that can break things).
Changes to the Graphql schema: type Meal {
# The identifier of the main course.
id: UUID!
# The name of the main course.
name: String!
# ...
# Provides the environment information of this meal.
environmentInfo: EnvironmentInfo
# Provides the nutrition data of this meal.
nutritionData: NutritionData
}
type Side {
# The id of the side
id: UUID!
# The name of the side
name: String!
# ...
# Provides the environment information of this meal.
environmentInfo: EnvironmentInfo
# Provides the nutrition data of this meal.
nutritionData: NutritionData
}
# This struct contains all environmental information. co2 in grams, water in litres
type EnvironmentInfo {
# The average environmental rating. Out of `max_rating`
averageRating: Int!
# The number of stars the food has for CO2 emmissions. Out of `max_rating`
co2Rating: Int!
# The amount of CO2 emitted by the production of the food. In grams
co2Value: Int!
# The number of stars the food has for water consumption. Out of `max_rating`
waterRating: Int!
# The amount of water used for the production of the food. In Millilitres
waterValue: Int!
# The number of stars the food has for animal welfare. Out of `max_rating`
animalWelfareRating: Int!
# The number of stars the food has for rainforest preservation. Out of `max_rating`
rainforestRating: Int!
# The maximum amount of stars for each category
maxRating: Int!
}
# The nutrients of a dish
type NutritionData {
# Energy in Kcal
energy: Int!
# Protein in grams
protein: Int!
# Carbs in grams
carbohydrates: Int!
# Sugar in grams
sugar: Int!
# Fat in grams
fat: Int!
# Saturated fat in grams
saturatedFat: Int!
# Salt in grams
salt: Int!
}
|
Merge nutrition resolving into nutrition feature branch
Besides these notes, I think we are ready to merge. |
FYI: I have also ignored the startup files regarding test coverage, so we are now well above 90% again |
Pull Request
Added Nutrition Data
Backend
Make sure, you have done de following before merging this pull request:
cargo format
andcargo clippy
to format your code and check for improvements.