feat: adding the rest ofthe nutrition properties from schema.org #4301
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What type of PR is this?
What this PR does / why we need it:
Some of the most important schema.org nutrition properties were missing. (See https://schema.org/NutritionInformation)
This adds the remaining ones from schema.org, except for
servingSize
which would cause problems with the current design wrt translating the unit of measure, which is variable. It's also easy to confuse theservingSize
(i.e., "500 g", "4 cups", etc.) concept with the existing and unrelated "servings" (i.e., "serves 4") scaling concept, so I left it out (for now?).In the future it might be nice to allow an EAV type of design to allow users to create arbitrary nutrition entries, but that's more difficult and definitely an edge-case. Out of scope for this regardless.
update: added tests and updated cleaner, migration services, etc.
Which issue(s) this PR fixes:
N/A
Testing
Manually tested with the following URL import: https://www.twopeasandtheirpod.com/vegetarian-taco-skillet/
This recipe included saturated fat and cholesterol.
Updated autoated unit/integration tests to account for these new entries.