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 all 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,21 @@ 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, | ||
STORES, | ||
INGREDIENTS_ANALYSIS_TAGS, | ||
ALLERGENS, | ||
ENVIRONMENT_IMPACT_LEVELS, | ||
ATTRIBUTE_GROUPS, | ||
LAST_MODIFIED, | ||
ECOSCORE_GRADE, | ||
ECOSCORE_SCORE, | ||
ECOSCORE_DATA, | ||
|
@@ -73,6 +80,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 +109,21 @@ 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.STORES: 'stores', | ||
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.
Thanks for the comment and the example!
Beyond that good start will come later painful questions like: is that always in English? ;)
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.
Just looked into a response and it has generic_name, generic_name_fr as well as a generic_name_fr_debug_tags list, interesting