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 - latest "prices" API changes #897

Merged
merged 2 commits into from
Apr 1, 2024

Conversation

monsieurtanuki
Copy link
Contributor

What

  • Refactoring about error management consistency.
  • Refactoring about "order by" consistency.
  • 3 new methods: getOSMLocation, getLocations, getPriceProductByCode.

Part of

Files

Deleted files:

  • get_prices_results.dart
  • validation_error.dart
  • validation_error.g.dart
  • validation_errors.dart
  • validation_errors.g.dart

New files:

  • get_locations_order.dart: Field for the "order by" clause of "get locations".
  • get_locations_parameters.dart: Parameters for the "get locations" API query.
  • get_locations_result.dart: List of location objects returned by the "get locations" method.
  • get_locations_result.g.dart: generated
  • order_by.dart: "Order by" clause for "get list" methods (e.g. "get prices")

Impacted files:

  • api_prices_test.dart: impacted by MaybeError refactoring; tests for new methods getOSMLocation, getLocations, getPriceProductByCode
  • get_prices_order.dart: refactored using new class OrderByField
  • get_prices_parameters.dart: refactored using new class OrderBy
  • open_prices_api_client.dart: refactored using more systematically MaybeError; renamed getPriceProduct as getPriceProductById; added methods getOSMLocation, getLocations, getPriceProductByCode
  • openfoodfacts.dart: added the new files; removed the deleted files

Deleted files:
* `get_prices_results.dart`
* `validation_error.dart`
* `validation_error.g.dart`
* `validation_errors.dart`
* `validation_errors.g.dart`

New files:
* `get_locations_order.dart`: Field for the "order by" clause of "get locations".
* `get_locations_parameters.dart`: Parameters for the "get locations" API query.
* `get_locations_result.dart`: List of location objects returned by the "get locations" method.
* `get_locations_result.g.dart`: generated
* `order_by.dart`: "Order by" clause for "get list" methods (e.g. "get prices")

Impacted files:
* `api_prices_test.dart`: impacted by `MaybeError` refactoring; tests for new methods `getOSMLocation`, `getLocations`, `getPriceProductByCode`
* `get_prices_order.dart`: refactored using new class `OrderByField`
* `get_prices_parameters.dart`: refactored using new class `OrderBy`
* `open_prices_api_client.dart`: refactored using more systematically `MaybeError`; renamed `getPriceProduct` as `getPriceProductById`; added methods `getOSMLocation`, `getLocations`, `getPriceProductByCode`
* `openfoodfacts.dart`: added the new files; removed the deleted files
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.

Approving, as to no block work on Prices

@monsieurtanuki monsieurtanuki merged commit 88dada6 into openfoodfacts:master Apr 1, 2024
2 of 3 checks passed
@monsieurtanuki
Copy link
Contributor Author

Approving, as to no block work on Prices

Thank you @teolemon for your approval!
There are some minor "prices" features that could still be implemented in off-dart, but that do not seem very relevant in a first approach, Smoothie-wise, like the list of "prices" users.
Btw, we're still in stand-by regarding "prices" dev in Smoothie, right? cf. openfoodfacts/smooth-app#5072

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

Successfully merging this pull request may close these issues.

2 participants