-
-
Notifications
You must be signed in to change notification settings - Fork 68
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: Integrate all routes from nutripatrol's API #991
base: master
Are you sure you want to change the base?
Changes from 13 commits
74d2d47
9a8f218
934bb33
a499d84
9713eb4
83c0c64
117de10
7a58401
e2c1017
c253ad4
3f20cca
290d3fa
7525254
e5507fa
affc5d6
8f3fd4f
0235932
abc2777
03b4697
0b8e697
6ea970b
7dec703
753a4fa
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please don't use this file. Nobody does. |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You'll probably need to add the other nutripatrol classes. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. And |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,15 +48,19 @@ export 'src/model/parameter/without_additives.dart'; | |
export 'src/model/per_size.dart'; | ||
export 'src/model/product.dart'; | ||
export 'src/model/product_freshness.dart'; | ||
<<<<<<< HEAD | ||
Valimp marked this conversation as resolved.
Show resolved
Hide resolved
|
||
export 'src/model/product_type.dart'; | ||
export 'src/model/product_type_filter.dart'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Some confusion with these guys: one is moved and copied, the other is not. |
||
======= | ||
>>>>>>> 3b974b5 (Fixes) | ||
Valimp marked this conversation as resolved.
Show resolved
Hide resolved
|
||
export 'src/model/product_image.dart'; | ||
export 'src/model/product_packaging.dart'; | ||
export 'src/model/product_result_field_answer.dart'; | ||
export 'src/model/product_result_v3.dart'; | ||
export 'src/model/product_state.dart'; | ||
export 'src/model/product_stats.dart'; | ||
export 'src/model/product_tag.dart'; | ||
export 'src/model/product_type.dart'; | ||
export 'src/model/recommended_daily_intake.dart'; | ||
export 'src/model/robotoff_question.dart'; | ||
export 'src/model/robotoff_question_order.dart'; | ||
|
@@ -81,6 +85,12 @@ export 'src/model/taxonomy_packaging_recycling.dart'; | |
export 'src/model/taxonomy_packaging_shape.dart'; | ||
export 'src/model/user.dart'; | ||
export 'src/model/user_agent.dart'; | ||
export 'src/nutripatrol/create_flag.dart'; | ||
export 'src/nutripatrol/get_flag.dart'; | ||
export 'src/nutripatrol/get_ticket.dart'; | ||
export 'src/nutripatrol/get_tickets.dart'; | ||
export 'src/nutripatrol/update_ticket_status.dart'; | ||
export 'src/nutripatrol_api_client.dart'; | ||
export 'src/open_food_api_client.dart'; | ||
export 'src/open_food_search_api_client.dart'; | ||
export 'src/open_prices_api_client.dart'; | ||
|
@@ -97,14 +107,14 @@ export 'src/prices/flavor.dart'; | |
export 'src/prices/get_locations_order.dart'; | ||
export 'src/prices/get_locations_parameters.dart'; | ||
export 'src/prices/get_locations_result.dart'; | ||
export 'src/prices/get_price_count_parameters_helper.dart'; | ||
// export 'src/prices/get_parameters_helper.dart'; // uncomment if really needed | ||
export 'src/prices/get_prices_order.dart'; | ||
export 'src/prices/get_prices_parameters.dart'; | ||
export 'src/prices/get_price_products_order.dart'; | ||
export 'src/prices/get_price_products_parameters.dart'; | ||
export 'src/prices/get_price_products_result.dart'; | ||
export 'src/prices/get_prices_result.dart'; | ||
export 'src/prices/get_price_count_parameters_helper.dart'; | ||
export 'src/prices/get_proofs_order.dart'; | ||
export 'src/prices/get_proofs_parameters.dart'; | ||
export 'src/prices/get_proofs_result.dart'; | ||
|
@@ -127,6 +137,7 @@ export 'src/prices/proof_type.dart'; | |
export 'src/prices/session.dart'; | ||
export 'src/prices/update_price_parameters.dart'; | ||
export 'src/prices/update_proof_parameters.dart'; | ||
export 'src/robot_off_api_client.dart'; | ||
export 'src/search/autocomplete_search_result.dart'; | ||
export 'src/search/autocomplete_single_result.dart'; | ||
export 'src/search/fuzziness.dart'; | ||
|
@@ -158,4 +169,3 @@ export 'src/utils/too_many_requests_manager.dart'; | |
export 'src/utils/unit_helper.dart'; | ||
export 'src/utils/uri_helper.dart'; | ||
export 'src/utils/uri_reader.dart'; | ||
export 'src/robot_off_api_client.dart'; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
import 'package:json_annotation/json_annotation.dart'; | ||
import 'package:openfoodfacts/src/nutripatrol/get_ticket.dart'; | ||
|
||
import '../interface/json_object.dart'; | ||
|
||
part 'create_flag.g.dart'; | ||
|
||
@JsonSerializable() | ||
Valimp marked this conversation as resolved.
Show resolved
Hide resolved
|
||
class CreateFlag extends JsonObject { | ||
/// Ticket ID associated with the flag | ||
@JsonKey() | ||
late Ticket ticket; | ||
|
||
/// Barcode of the product. | ||
@JsonKey() | ||
String? barcode; | ||
|
||
/// Type of the flag | ||
@JsonKey() | ||
late String type; | ||
Valimp marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
/// Url of the product | ||
@JsonKey() | ||
late String url; | ||
|
||
/// User ID | ||
@JsonKey(name: 'user_id') | ||
late String userId; | ||
|
||
/// Device ID | ||
@JsonKey(name: 'device_id') | ||
late String deviceId; | ||
|
||
/// Source of the flag | ||
@JsonKey() | ||
late String source; | ||
Valimp marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
/// Confidence of the flag | ||
@JsonKey() | ||
double? confidence; | ||
|
||
/// Image ID of the flag | ||
@JsonKey(name: 'image_id') | ||
String? imageId; | ||
|
||
/// Flavor of the flag | ||
@JsonKey() | ||
late String flavor; | ||
Valimp marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
/// Reason for the flag | ||
@JsonKey() | ||
String? reason; | ||
|
||
/// Comment associated with the flag | ||
@JsonKey() | ||
String? comment; | ||
|
||
/// Created date of the flag | ||
@JsonKey(name: 'created_at') | ||
Valimp marked this conversation as resolved.
Show resolved
Hide resolved
|
||
late DateTime createdAt; | ||
|
||
CreateFlag(); | ||
|
||
factory CreateFlag.fromJson(Map<String, dynamic> json) => | ||
_$CreateFlagFromJson(json); | ||
|
||
@override | ||
Map<String, dynamic> toJson() => _$CreateFlagToJson(this); | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
import 'package:json_annotation/json_annotation.dart'; | ||
|
||
import '../interface/json_object.dart'; | ||
|
||
part 'create_flag_request.g.dart'; | ||
|
||
@JsonSerializable() | ||
class CreateFlagRequest extends JsonObject { | ||
/// Barcode of the product. | ||
@JsonKey() | ||
String? barcode; | ||
|
||
/// Type of the flag | ||
@JsonKey() | ||
late String type; | ||
Valimp marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
/// Url of the product | ||
@JsonKey() | ||
late String url; | ||
|
||
/// User ID | ||
@JsonKey(name: 'user_id') | ||
late String userId; | ||
|
||
/// Device ID | ||
@JsonKey(name: 'device_id') | ||
late String deviceId; | ||
|
||
/// Source of the flag | ||
@JsonKey() | ||
late String source; | ||
Valimp marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
/// Confidence of the flag | ||
@JsonKey() | ||
double? confidence; | ||
|
||
/// Image ID of the flag | ||
@JsonKey(name: 'image_id') | ||
String? imageId; | ||
|
||
/// Flavor of the flag | ||
@JsonKey() | ||
late String flavor; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There's an enum for that. |
||
|
||
/// Reason for the flag | ||
@JsonKey() | ||
String? reason; | ||
Valimp marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
/// Comment associated with the flag | ||
@JsonKey() | ||
String? comment; | ||
|
||
/// Created date of the flag | ||
@JsonKey(name: 'created_at') | ||
late DateTime createdAt; | ||
|
||
CreateFlagRequest(); | ||
|
||
factory CreateFlagRequest.fromJson(Map<String, dynamic> json) => | ||
_$CreateFlagRequestFromJson(json); | ||
|
||
@override | ||
Map<String, dynamic> toJson() => _$CreateFlagRequestToJson(this); | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
import 'package:json_annotation/json_annotation.dart'; | ||
import 'package:openfoodfacts/src/nutripatrol/get_ticket.dart'; | ||
Valimp marked this conversation as resolved.
Show resolved
Hide resolved
|
||
import 'package:openfoodfacts/src/prices/flavor.dart'; | ||
Valimp marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
import '../interface/json_object.dart'; | ||
import '../utils/nutripatrol_source.dart'; | ||
|
||
part 'get_flag.g.dart'; | ||
|
||
@JsonSerializable() | ||
class Flag extends JsonObject { | ||
Valimp marked this conversation as resolved.
Show resolved
Hide resolved
|
||
/// Flag ID. Read-only. | ||
@JsonKey() | ||
late String id; | ||
|
||
/// Ticket ID. Read-only. | ||
@JsonKey() | ||
late Ticket ticket; | ||
|
||
/// Barcode of the product. Read-only. | ||
@JsonKey() | ||
String? barcode; | ||
|
||
/// Type of the flag | ||
@JsonKey() | ||
late NutripatrolType type; | ||
|
||
/// Url of the product. Read-only. | ||
@JsonKey() | ||
late String url; | ||
|
||
/// User ID. Read-only. | ||
@JsonKey(name: 'user_id') | ||
late String userId; | ||
|
||
/// Device ID. Read-only. | ||
@JsonKey(name: 'device_id') | ||
late String deviceId; | ||
|
||
/// Source of the flag | ||
@JsonKey() | ||
late NutripatrolSource source; | ||
|
||
/// Confidence of the flag | ||
@JsonKey() | ||
double? confidence; | ||
|
||
/// Image ID of the flag. Read-only. | ||
@JsonKey(name: 'image_id') | ||
String? imageId; | ||
|
||
/// Flavor of the flag | ||
@JsonKey() | ||
late Flavor flavor; | ||
|
||
/// Reason of the flag | ||
@JsonKey() | ||
String? reason; | ||
|
||
/// Comment of the flag | ||
@JsonKey() | ||
String? comment; | ||
|
||
/// created date of the ticket. Read-only. | ||
@JsonKey(name: 'created_at') | ||
late String createdAt; | ||
Valimp marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
Flag(); | ||
|
||
factory Flag.fromJson(Map<String, dynamic> json) => _$FlagFromJson(json); | ||
|
||
@override | ||
Map<String, dynamic> toJson() => _$FlagToJson(this); | ||
} |
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.
Quickly said: test your code in test files, not in main.