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
Fix: Added missing product fields to ProductField enum #331
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,7 @@ enum ProductField { | |
LANGUAGE, | ||
QUANTITY, | ||
SERVING_SIZE, | ||
SERVING_QUANTITY, | ||
PACKAGING_QUANTITY, | ||
FRONT_IMAGE, | ||
SELECTED_IMAGE, | ||
|
@@ -43,15 +44,20 @@ enum ProductField { | |
CATEGORIES, | ||
CATEGORIES_TAGS, | ||
CATEGORIES_TAGS_IN_LANGUAGES, | ||
LABELS, | ||
LABELS_TAGS, | ||
LABELS_TAGS_IN_LANGUAGES, | ||
PACKAGING, | ||
PACKAGING_TAGS, | ||
MISC_TAGS, | ||
STATES_TAGS, | ||
TRACES_TAGS, | ||
STORES_TAGS, | ||
INGREDIENTS_ANALYSIS_TAGS, | ||
ALLERGENS, | ||
ENVIRONMENT_IMPACT_LEVELS, | ||
ATTRIBUTE_GROUPS, | ||
LAST_MODIFIED, | ||
ECOSCORE_GRADE, | ||
ECOSCORE_SCORE, | ||
ECOSCORE_DATA, | ||
|
@@ -73,6 +79,7 @@ extension ProductFieldExtension on ProductField { | |
ProductField.LANGUAGE: 'lang', | ||
ProductField.QUANTITY: 'quantity', | ||
ProductField.SERVING_SIZE: 'serving_size', | ||
ProductField.SERVING_QUANTITY: 'serving_quantity', | ||
ProductField.PACKAGING_QUANTITY: 'product_quantity', | ||
ProductField.FRONT_IMAGE: 'image_small_url', | ||
ProductField.IMAGE_FRONT_URL: 'image_front_url', | ||
|
@@ -101,15 +108,20 @@ extension ProductFieldExtension on ProductField { | |
ProductField.CATEGORIES: 'categories', | ||
ProductField.CATEGORIES_TAGS: 'categories_tags', | ||
ProductField.CATEGORIES_TAGS_IN_LANGUAGES: 'categories_tags_', | ||
ProductField.LABELS: 'labels', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Probably would be worth checking in a test that when we ask for those fields in a get product query, we actually get them. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On it |
||
ProductField.LABELS_TAGS: 'labels_tags', | ||
ProductField.LABELS_TAGS_IN_LANGUAGES: 'labels_tags_', | ||
ProductField.PACKAGING: 'packaging', | ||
ProductField.PACKAGING_TAGS: 'packaging_tags', | ||
ProductField.MISC_TAGS: 'misc', | ||
ProductField.STATES_TAGS: 'states_tags', | ||
ProductField.TRACES_TAGS: 'traces_tags', | ||
ProductField.STORES_TAGS: 'stores_tags', | ||
ProductField.INGREDIENTS_ANALYSIS_TAGS: 'ingredients_analysis_tags', | ||
ProductField.ALLERGENS: 'allergens_tags', | ||
ProductField.ENVIRONMENT_IMPACT_LEVELS: 'environment_impact_level_tags', | ||
ProductField.ATTRIBUTE_GROUPS: 'attribute_groups', | ||
ProductField.LAST_MODIFIED: 'last_modified_t', | ||
ProductField.ECOSCORE_GRADE: 'ecoscore_grade', | ||
ProductField.ECOSCORE_SCORE: 'ecoscore_score', | ||
ProductField.ECOSCORE_DATA: 'ecoscore_data', | ||
|
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.
What's that?
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.
I checked the diffs and this was in the ProductFields but not in the Product, Its in the normal reponses and since its particially already in the code I just added it
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.
Fair enough!
Nothing personal, but there are already tons of fields in
Product
(50+) and none of them has comments.Adding a
String?
calledgenericName
, why not, next one is going to bedynamic justSomething
?More seriously: we should definitely add comments on the
Product
fields. In another PR.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.
Yes there I agree with you, we should make in any case. In fact, I've been thinking about updating the entire documentation a bit for a while now.
I don't know how to approach this, but it would also be good to somehow manage to have the products in just one place and not in two files in two places each.