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

feat: 995 - support of the new "product type" filter for "get product" #1004

Merged
merged 3 commits into from
Nov 29, 2024

Conversation

monsieurtanuki
Copy link
Contributor

What

  • Now we have a "product type" filter for "get product"

Fixes bug(s)

Files

New file:

  • product_type_filter.dart: Filter on product type for API get product queries.

Impacted files

  • api_not_food_get_product_test.dart: now testing only in v3 with all product type filters
  • old_product_result.dart: deprecated class OldProductResult
  • open_food_api_client.dart: deprecated method getOldProduct
  • openfoodfacts.dart: export new file product_type_filter.dart
  • product_query_configurations.dart: "product_type_filter" as new optional "get product" parameter; minor refactoring

New file:
* `product_type_filter.dart`: Filter on product type for API get product queries.

Impacted files
* `api_not_food_get_product_test.dart`: now testing only in v3 with all product type filters
* `old_product_result.dart`: deprecated class `OldProductResult`
* `open_food_api_client.dart`: deprecated method `getOldProduct`
* `openfoodfacts.dart`: export new file `product_type_filter.dart`
* `product_query_configurations.dart`: "product_type_filter" as new optional "get product" parameter; minor refactoring
@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 97.87234% with 1 line in your changes missing coverage. Please review.

Project coverage is 75.75%. Comparing base (820d145) to head (04f25ee).
Report is 74 commits behind head on master.

Files with missing lines Patch % Lines
lib/src/open_food_api_client.dart 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1004      +/-   ##
==========================================
- Coverage   76.34%   75.75%   -0.60%     
==========================================
  Files         239      252      +13     
  Lines        8494     9436     +942     
==========================================
+ Hits         6485     7148     +663     
- Misses       2009     2288     +279     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@g123k g123k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one minor comment

ProductTypeFilter(final ProductType productType)
: offTag = productType.offTag;

static const all = ProductTypeFilter._('all');
Copy link
Contributor

@g123k g123k Nov 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you've missed the type here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed. Strange the lint check didn't send a warning.
I'll fix that.

Copy link
Contributor

@g123k g123k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👌
Thank you!

Copy link
Contributor

@g123k g123k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👌
Thank you!

@monsieurtanuki monsieurtanuki merged commit 032a547 into openfoodfacts:master Nov 29, 2024
2 of 3 checks passed
@monsieurtanuki
Copy link
Contributor Author

Thank you @g123k for your review!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Support the universal scan API
3 participants