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: 986 - new Prices fields #987

Merged
merged 1 commit into from
Oct 29, 2024

Conversation

monsieurtanuki
Copy link
Contributor

What

  • Added latest Prices fields.
  • Minor fix for createPrice - now we don't care if we cannot fully read the server response body, as long as the status code has the expected value. In order to prevent trying to recreate over and over a Price when the response body evolves.

Fixes bug(s)

Part of

Files

New file:

  • location_type.dart: Type of the Location.

Impacted files:

  • api_prices_test.dart: refactored with the additional fields
  • location.dart: added fields locationType and websiteUrl
  • location.g.dart: generated
  • maybe_error.dart: now we accept valid but unreadable responses
  • open_prices_api_client.dart: safer createPrice method; refactored with the additional fields
  • openfoodfacts.dart: added file location_type.dart
  • price.dart: added field receiptQuantity
  • price.g.dart: generated
  • price_total_stats.dart: added fields locationTypeOsmCount, locationTypeOnlineCount, proofTypeGdprRequestCount and proofTypeShopImportCount
  • price_total_stats.g.dart: generated
  • proof.dart: added fields receiptPriceCount and receiptPriceTotal
  • proof.g.dart: generated
  • update_price_parameters.dart: added field receiptQuantity
  • update_proof_parameters.dart: added fields receiptPriceCount, receiptPriceTotal, locationOSMId and locationOSMType

New file:
* `location_type.dart`: Type of the Location.

Impacted files:
* `api_prices_test.dart`: refactored with the additional fields
* `location.dart`: added fields `locationType` and `websiteUrl`
* `location.g.dart`: generated
* `maybe_error.dart`: now we accept valid but unreadable responses
* `open_prices_api_client.dart`: safer `createPrice` method; refactored with the additional fields
* `openfoodfacts.dart`: added file `location_type.dart`
* `price.dart`: added field `receiptQuantity`
* `price.g.dart`: generated
* `price_total_stats.dart`: added fields `locationTypeOsmCount`, `locationTypeOnlineCount`, `proofTypeGdprRequestCount` and `proofTypeShopImportCount`
* `price_total_stats.g.dart`: generated
* `proof.dart`: added fields `receiptPriceCount` and `receiptPriceTotal`
* `proof.g.dart`: generated
* `update_price_parameters.dart`: added field `receiptQuantity`
* `update_proof_parameters.dart`: added fields `receiptPriceCount`, `receiptPriceTotal`, `locationOSMId` and `locationOSMType`
@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 76.82927% with 19 lines in your changes missing coverage. Please review.

Project coverage is 75.85%. Comparing base (820d145) to head (65010ba).
Report is 65 commits behind head on master.

Files with missing lines Patch % Lines
lib/src/open_prices_api_client.dart 33.33% 4 Missing ⚠️
lib/src/prices/price_total_stats.g.dart 66.66% 4 Missing ⚠️
lib/src/prices/maybe_error.dart 25.00% 3 Missing ⚠️
lib/src/prices/location.g.dart 50.00% 2 Missing ⚠️
lib/src/prices/location_type.dart 0.00% 2 Missing ⚠️
lib/src/prices/proof.g.dart 50.00% 2 Missing ⚠️
lib/src/prices/price.g.dart 50.00% 1 Missing ⚠️
lib/src/prices/update_proof_parameters.dart 80.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #987      +/-   ##
==========================================
- Coverage   76.34%   75.85%   -0.50%     
==========================================
  Files         239      251      +12     
  Lines        8494     9379     +885     
==========================================
+ Hits         6485     7114     +629     
- Misses       2009     2265     +256     

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

Copy link
Member

@teolemon teolemon left a comment

Choose a reason for hiding this comment

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

I had missed it. Thanks @monsieurtanuki 👌

@monsieurtanuki monsieurtanuki merged commit edd18af into openfoodfacts:master Oct 29, 2024
6 checks passed
@monsieurtanuki
Copy link
Contributor Author

Thank you @teolemon for your review!

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

Successfully merging this pull request may close these issues.

New Prices fields
3 participants