-
-
Notifications
You must be signed in to change notification settings - Fork 67
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 getLocation, getPriceProduct, getStatus methods #855
Conversation
New files: * `location.dart`: Location object in the Prices API. * `location.g.dart`: generated * `price_product.dart`: Product object in the Prices API. * `price_product.g.dart`: generated Impacted files: * `api_prices_test.dart`: added tests for `getLocation`, `getPriceProduct` and `getStatus` * `open_prices_api_client.dart`: new methods `getLocation`, `getPriceProduct` and `getStatus` * `openfoodfacts.dart`: exported the 2 new files * `price.dart`: minor refactoring * `price.g.dart`: generated
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #855 +/- ##
==========================================
- Coverage 73.00% 72.97% -0.03%
==========================================
Files 224 228 +4
Lines 7895 7990 +95
==========================================
+ Hits 5764 5831 +67
- Misses 2131 2159 +28 ☔ View full report in Codecov by Sentry. |
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.
Some minor comments
|
||
/// Date when the product was bought. | ||
@JsonKey(fromJson: JsonHelper.stringTimestampToDate) | ||
late DateTime created; |
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.
Since you renamed latitude/longitude, I would rename it to createDate
|
||
/// Date when the product was bought. | ||
@JsonKey(fromJson: JsonHelper.nullableStringTimestampToDate) | ||
DateTime? updated; |
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.
Since you renamed latitude/longitude, I would rename it to updatedDate
String? imageURL; | ||
|
||
@JsonKey(fromJson: JsonHelper.stringTimestampToDate) | ||
late DateTime created; |
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.
Same suggestion as before
@@ -40,27 +40,27 @@ class Price extends JsonObject { | |||
/// If the price is about a barcode-less product, it must be the price per | |||
/// kilogram or per liter. | |||
@JsonKey() | |||
num? price; | |||
late num price; |
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.
By curiosity, why don't you include JsonKeys in this file?
Thanks @monsieurtanuki ! Related to your PR, we have 2 upcoming PRs that add new endpoints :
|
For the record we need this PR to go a step further for Prices in Smoothie. |
Some unanswered suggestions from Edouard, other than that I think we should be fine |
I have read Edouard's comments. |
Tests are failing @monsieurtanuki (and we're in the Open Prices call right now ;-) https://meet.google.com/oin-hiqp-tmd ) |
|
@teolemon btw here we don't the tests to pass to merge (especially unrelated platform-dependent tests). |
@teolemon For the record currently 4 tests are failing:
|
Folksonomy bug fixed by #881 |
What
getLocation
,getPriceProduct
andgetStatus
.Part of
Files
New files:
location.dart
: Location object in the Prices API.location.g.dart
: generatedprice_product.dart
: Product object in the Prices API.price_product.g.dart
: generatedImpacted files:
api_prices_test.dart
: added tests forgetLocation
,getPriceProduct
andgetStatus
open_prices_api_client.dart
: new methodsgetLocation
,getPriceProduct
andgetStatus
openfoodfacts.dart
: exported the 2 new filesprice.dart
: minor refactoringprice.g.dart
: generated