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: 831 - prices methods getProofs, getProof and getUsers + fixed uploadProof #926

Merged
merged 3 commits into from
May 17, 2024

Conversation

monsieurtanuki
Copy link
Contributor

What

  • The "prices" API evolved since the last time we implemented it in dart. We needed to keep up.
  • New methods: getProofs, getProof and getUsers
  • Fixed method uploadProof
  • Added fields to Price, PriceProduct and Location

Part of

Files

New files:

  • flavor.dart: Flavor is used to refer to a specific Open*Facts project.
  • get_price_count_parameters_helper.dart: Helper class for API query parameters with price count filters.
  • get_proofs_order.dart: Field for the "order by" clause of "get proofs".
  • get_proofs_parameters.dart: Parameters for the "get proofs" API query.
  • get_proofs_result.dart: List of proof objects returned by the "get proofs" method.
  • get_proofs_result.g.dart: generated
  • get_users_order.dart: Field for the "order by" clause of "get users".
  • get_users_parameters.dart: Parameters for the "get users" API query.
  • get_users_result.dart: List of price user objects returned by the "get users" method.
  • get_users_result.g.dart: generated
  • price_user.dart: Price user object.
  • price_user.g.dart: generated

Impacted files:

  • api_prices_test.dart: added tests for new methods getProofs, getProof and getUsers; fixed test of method uploadProof
  • badge_base.g.dart: unrelated file generation change
  • events_base.g.dart: unrelated file generation change
  • get_locations_parameters.dart: refactoring
  • get_locations_result.g.dart: unrelated file generation change
  • get_parameters_helper.dart: refactoring
  • get_prices_parameters.dart: refactoring
  • get_prices_result.g.dart: unrelated file generation change
  • key_stats.g.dart: unrelated file generation change
  • knowledge_panel_element.g.dart: unrelated file generation change
  • leaderboard_entry.g.dart: unrelated file generation change
  • location.dart: new field priceCount
  • location.g.dart: generated
  • ocr_ingredients_result.g.dart: unrelated file generation change
  • ocr_packaging_result.g.dart: unrelated file generation change
  • old_product_result.g.dart: unrelated file generation change
  • open_prices_api_client.dart: new methods getProofs, getProof and getUsers; fixed method uploadProof
  • openfoodfacts.dart: exported the new files
  • price.dart: new fields proof, location and product
  • price.g.dart: generated
  • price_product.dart: new fields
  • price_product.g.dart: generated
  • product.g.dart: unrelated file generation change
  • product_stats.g.dart: unrelated file generation change
  • product_tag.g.dart: unrelated file generation change
  • proof.dart: removed old field (that provoked test failure anyway)
  • proof.g.dart: generated
  • pubspec.yaml: upgraded packages to more recent versions - while not too recent either
  • spelling_corrections.g.dart: unrelated file generation change

…ploadProof

New files:
* `flavor.dart`: Flavor is used to refer to a specific Open*Facts project.
* `get_price_count_parameters_helper.dart`: Helper class for API query parameters with price count filters.
* `get_proofs_order.dart`: Field for the "order by" clause of "get proofs".
* `get_proofs_parameters.dart`: Parameters for the "get proofs" API query.
* `get_proofs_result.dart`: List of proof objects returned by the "get proofs" method.
* `get_proofs_result.g.dart`: generated
* `get_users_order.dart`: Field for the "order by" clause of "get users".
* `get_users_parameters.dart`: Parameters for the "get users" API query.
* `get_users_result.dart`: List of price user objects returned by the "get users" method.
* `get_users_result.g.dart`: generated
* `price_user.dart`: Price user object.
* `price_user.g.dart`: generated

Impacted files:
* `api_prices_test.dart`: added tests for new methods `getProofs`, `getProof` and `getUsers`; fixed test of method `uploadProof`
* `badge_base.g.dart`: unrelated file generation change
* `events_base.g.dart`: unrelated file generation change
* `get_locations_parameters.dart`: refactoring
* `get_locations_result.g.dart`: unrelated file generation change
* `get_parameters_helper.dart`: refactoring
* `get_prices_parameters.dart`: refactoring
* `get_prices_result.g.dart`: unrelated file generation change
* `key_stats.g.dart`: unrelated file generation change
* `knowledge_panel_element.g.dart`: unrelated file generation change
* `leaderboard_entry.g.dart`: unrelated file generation change
* `location.dart`: new field `priceCount`
* `location.g.dart`: generated
* `ocr_ingredients_result.g.dart`: unrelated file generation change
* `ocr_packaging_result.g.dart`: unrelated file generation change
* `old_product_result.g.dart`: unrelated file generation change
* `open_prices_api_client.dart`: new methods `getProofs`, `getProof` and `getUsers`; fixed method `uploadProof`
* `openfoodfacts.dart`: exported the new files
* `price.dart`: new fields `proof`, `location` and `product`
* `price.g.dart`: generated
* `price_product.dart`: new fields
* `price_product.g.dart`: generated
* `product.g.dart`: unrelated file generation change
* `product_stats.g.dart`: unrelated file generation change
* `product_tag.g.dart`: unrelated file generation change
* `proof.dart`: removed old field (that provoked test failure anyway)
* `proof.g.dart`: generated
* `pubspec.yaml`: upgraded packages to more recent versions - while not too recent either
* `spelling_corrections.g.dart`: unrelated file generation change
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.

That's really great @monsieurtanuki 🤑

@monsieurtanuki monsieurtanuki merged commit baa1258 into openfoodfacts:master May 17, 2024
2 of 3 checks passed
@monsieurtanuki
Copy link
Contributor Author

Thank you @teolemon for your review!
With this PR we should be able to code most of the "prices" features inside Smoothie.

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.

2 participants