From cf01fe69a292424ea5f04ca3b1f6f7b326ccfdc3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Gigandet?= Date: Fri, 7 Feb 2025 11:30:04 +0100 Subject: [PATCH 1/6] fix: match parent shapes --- lib/ProductOpener/PackagingFoodContact.pm | 4 ++-- tests/unit/packaging_food_contact.t | 7 +++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/ProductOpener/PackagingFoodContact.pm b/lib/ProductOpener/PackagingFoodContact.pm index 155fdbbed4d16..c464fe7431257 100644 --- a/lib/ProductOpener/PackagingFoodContact.pm +++ b/lib/ProductOpener/PackagingFoodContact.pm @@ -156,7 +156,7 @@ sub get_matching_and_non_matching_packaging_components ($packagings_ref, $condit my $matched_value = 0; foreach my $value (@values) { - if (is_a($packaging_taxonomies{$property}, $value, $packaging_ref->{$property})) { + if (is_a($packaging_taxonomies{$property}, $packaging_ref->{$property}, $value)) { $matched_value = 1; last; } @@ -231,7 +231,7 @@ sub determine_food_contact_of_packaging_components ($packagings_ref) { # Otherwise, if there is a lid or a cap, it is in contact wit the food else { my ($lids_ref, $non_lids_ref) - = get_matching_and_non_matching_packaging_components($non_bottles_ref, {shape => ["en:lid", "en:cap"]}); + = get_matching_and_non_matching_packaging_components($non_bottles_ref, {shape => ["en:lid-or-cap"]}); if (@$lids_ref) { set_food_contact_property_of_packaging_components($lids_ref, 1); } diff --git a/tests/unit/packaging_food_contact.t b/tests/unit/packaging_food_contact.t index 074364373d3b3..f1beff67926e7 100644 --- a/tests/unit/packaging_food_contact.t +++ b/tests/unit/packaging_food_contact.t @@ -66,6 +66,13 @@ my @tests = ( packaging_text => "glass bottle, cork, paper label", } ], + [ + 'plastic_bottle', + { + lc => "en", + packaging_text => "plastic bottle, plastic cap, plastic label", + } + ] ); From c86d501d9934e9e3fafb630f0f9d2866e99c8d96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Gigandet?= Date: Fri, 7 Feb 2025 11:36:37 +0100 Subject: [PATCH 2/6] renamed tests --- ...ned_tomatoes.json => canned-tomatoes.json} | 0 .../packaging_food_contact/chocolate-bar.json | 41 +++++++++++++++++++ ...offee_capsule.json => coffee-capsule.json} | 0 ..._packagings.json => empty-packagings.json} | 0 .../fr-tablette-de-chocolat.json | 41 +++++++++++++++++++ ...jar.json => hazelnut-paste-glass-jar.json} | 0 .../{meat_tray.json => meat-tray.json} | 0 .../plastic-bottle.json | 41 +++++++++++++++++++ .../{wine_bottle.json => wine-bottle.json} | 0 tests/unit/packaging_food_contact.t | 28 +++++++++---- 10 files changed, 144 insertions(+), 7 deletions(-) rename tests/unit/expected_test_results/packaging_food_contact/{canned_tomatoes.json => canned-tomatoes.json} (100%) create mode 100644 tests/unit/expected_test_results/packaging_food_contact/chocolate-bar.json rename tests/unit/expected_test_results/packaging_food_contact/{coffee_capsule.json => coffee-capsule.json} (100%) rename tests/unit/expected_test_results/packaging_food_contact/{empty_packagings.json => empty-packagings.json} (100%) create mode 100644 tests/unit/expected_test_results/packaging_food_contact/fr-tablette-de-chocolat.json rename tests/unit/expected_test_results/packaging_food_contact/{hazelnut_paste_glass_jar.json => hazelnut-paste-glass-jar.json} (100%) rename tests/unit/expected_test_results/packaging_food_contact/{meat_tray.json => meat-tray.json} (100%) create mode 100644 tests/unit/expected_test_results/packaging_food_contact/plastic-bottle.json rename tests/unit/expected_test_results/packaging_food_contact/{wine_bottle.json => wine-bottle.json} (100%) diff --git a/tests/unit/expected_test_results/packaging_food_contact/canned_tomatoes.json b/tests/unit/expected_test_results/packaging_food_contact/canned-tomatoes.json similarity index 100% rename from tests/unit/expected_test_results/packaging_food_contact/canned_tomatoes.json rename to tests/unit/expected_test_results/packaging_food_contact/canned-tomatoes.json diff --git a/tests/unit/expected_test_results/packaging_food_contact/chocolate-bar.json b/tests/unit/expected_test_results/packaging_food_contact/chocolate-bar.json new file mode 100644 index 0000000000000..77607c00e2f22 --- /dev/null +++ b/tests/unit/expected_test_results/packaging_food_contact/chocolate-bar.json @@ -0,0 +1,41 @@ +{ + "lc" : "en", + "misc_tags" : [ + "en:packagings-number-of-components-3", + "en:packagings-not-complete", + "en:packagings-not-empty-but-not-complete", + "en:packagings-not-empty" + ], + "packaging_materials_tags" : [ + "en:aluminium", + "en:cardboard", + "en:paper" + ], + "packaging_recycling_tags" : [], + "packaging_shapes_tags" : [ + "en:film", + "en:label", + "en:sleeve" + ], + "packaging_text" : "cardboard sleeve, aluminium foil, paper label", + "packagings" : [ + { + "material" : "en:cardboard", + "shape" : "en:sleeve" + }, + { + "material" : "en:aluminium", + "shape" : "en:film" + }, + { + "material" : "en:paper", + "shape" : "en:label" + } + ], + "packagings_materials" : { + "all" : {}, + "en:metal" : {}, + "en:paper-or-cardboard" : {} + }, + "packagings_n" : 3 +} diff --git a/tests/unit/expected_test_results/packaging_food_contact/coffee_capsule.json b/tests/unit/expected_test_results/packaging_food_contact/coffee-capsule.json similarity index 100% rename from tests/unit/expected_test_results/packaging_food_contact/coffee_capsule.json rename to tests/unit/expected_test_results/packaging_food_contact/coffee-capsule.json diff --git a/tests/unit/expected_test_results/packaging_food_contact/empty_packagings.json b/tests/unit/expected_test_results/packaging_food_contact/empty-packagings.json similarity index 100% rename from tests/unit/expected_test_results/packaging_food_contact/empty_packagings.json rename to tests/unit/expected_test_results/packaging_food_contact/empty-packagings.json diff --git a/tests/unit/expected_test_results/packaging_food_contact/fr-tablette-de-chocolat.json b/tests/unit/expected_test_results/packaging_food_contact/fr-tablette-de-chocolat.json new file mode 100644 index 0000000000000..bc2288c099df6 --- /dev/null +++ b/tests/unit/expected_test_results/packaging_food_contact/fr-tablette-de-chocolat.json @@ -0,0 +1,41 @@ +{ + "lc" : "fr", + "misc_tags" : [ + "en:packagings-number-of-components-3", + "en:packagings-not-complete", + "en:packagings-not-empty-but-not-complete", + "en:packagings-not-empty" + ], + "packaging_materials_tags" : [ + "en:aluminium", + "en:cardboard", + "en:paper" + ], + "packaging_recycling_tags" : [], + "packaging_shapes_tags" : [ + "en:label", + "en:sheet", + "en:sleeve" + ], + "packaging_text" : "étui en carton, feuille d'aluminium, étiquette papier", + "packagings" : [ + { + "material" : "en:cardboard", + "shape" : "en:sleeve" + }, + { + "material" : "en:aluminium", + "shape" : "en:sheet" + }, + { + "material" : "en:paper", + "shape" : "en:label" + } + ], + "packagings_materials" : { + "all" : {}, + "en:metal" : {}, + "en:paper-or-cardboard" : {} + }, + "packagings_n" : 3 +} diff --git a/tests/unit/expected_test_results/packaging_food_contact/hazelnut_paste_glass_jar.json b/tests/unit/expected_test_results/packaging_food_contact/hazelnut-paste-glass-jar.json similarity index 100% rename from tests/unit/expected_test_results/packaging_food_contact/hazelnut_paste_glass_jar.json rename to tests/unit/expected_test_results/packaging_food_contact/hazelnut-paste-glass-jar.json diff --git a/tests/unit/expected_test_results/packaging_food_contact/meat_tray.json b/tests/unit/expected_test_results/packaging_food_contact/meat-tray.json similarity index 100% rename from tests/unit/expected_test_results/packaging_food_contact/meat_tray.json rename to tests/unit/expected_test_results/packaging_food_contact/meat-tray.json diff --git a/tests/unit/expected_test_results/packaging_food_contact/plastic-bottle.json b/tests/unit/expected_test_results/packaging_food_contact/plastic-bottle.json new file mode 100644 index 0000000000000..e48149e886c3f --- /dev/null +++ b/tests/unit/expected_test_results/packaging_food_contact/plastic-bottle.json @@ -0,0 +1,41 @@ +{ + "lc" : "en", + "misc_tags" : [ + "en:packagings-number-of-components-3", + "en:packagings-not-complete", + "en:packagings-not-empty-but-not-complete", + "en:packagings-not-empty" + ], + "packaging_materials_tags" : [ + "en:plastic" + ], + "packaging_recycling_tags" : [], + "packaging_shapes_tags" : [ + "en:bottle", + "en:bottle-cap", + "en:label" + ], + "packaging_text" : "plastic bottle, plastic cap, plastic label", + "packagings" : [ + { + "food_contact" : 1, + "material" : "en:plastic", + "shape" : "en:bottle" + }, + { + "food_contact" : 1, + "material" : "en:plastic", + "shape" : "en:bottle-cap" + }, + { + "food_contact" : 0, + "material" : "en:plastic", + "shape" : "en:label" + } + ], + "packagings_materials" : { + "all" : {}, + "en:plastic" : {} + }, + "packagings_n" : 3 +} diff --git a/tests/unit/expected_test_results/packaging_food_contact/wine_bottle.json b/tests/unit/expected_test_results/packaging_food_contact/wine-bottle.json similarity index 100% rename from tests/unit/expected_test_results/packaging_food_contact/wine_bottle.json rename to tests/unit/expected_test_results/packaging_food_contact/wine-bottle.json diff --git a/tests/unit/packaging_food_contact.t b/tests/unit/packaging_food_contact.t index f1beff67926e7..682341381ce35 100644 --- a/tests/unit/packaging_food_contact.t +++ b/tests/unit/packaging_food_contact.t @@ -25,53 +25,67 @@ init_packaging_taxonomies_regexps(); my @tests = ( [ - 'empty_packagings', + 'empty-packagings', { lc => "en", packaging_text => "", } ], [ - 'hazelnut_paste_glass_jar', + 'hazelnut-paste-glass-jar', { lc => "en", packaging_text => "glass jar, plastic lid, paper label, paper seal, cardboard box", } ], [ - 'canned_tomatoes', + 'canned-tomatoes', { lc => "en", packaging_text => "can, paper label", } ], [ - 'coffee_capsule', + 'coffee-capsule', { lc => "en", packaging_text => "carboard box, plastic capsule, plastic film", } ], [ - 'meat_tray', + 'meat-tray', { lc => "en", packaging_text => "plastic tray, plastic film, paper label", } ], [ - 'wine_bottle', + 'wine-bottle', { lc => "en", packaging_text => "glass bottle, cork, paper label", } ], [ - 'plastic_bottle', + 'plastic-bottle', { lc => "en", packaging_text => "plastic bottle, plastic cap, plastic label", } + ], + [ + 'chocolate-bar', + { + lc => "en", + packaging_text => "cardboard sleeve, aluminium foil, paper label", + } + ], + [ + 'fr-tablette-de-chocolat', + { + lc => "fr", + packaging_text => "étui en carton, feuille d'aluminium, étiquette papier", + } ] ); From efb3b23f421f801442ca9f8c72cff21021b883fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Gigandet?= Date: Fri, 7 Feb 2025 12:08:17 +0100 Subject: [PATCH 3/6] chocolate packaging contact --- lib/ProductOpener/PackagingFoodContact.pm | 40 ++++++++++++++-- .../chocolate-bar-2.json | 48 +++++++++++++++++++ .../packaging_food_contact/chocolate-bar.json | 4 ++ .../fr-tablette-de-chocolat.json | 4 ++ .../only-one-packaging.json | 29 +++++++++++ tests/unit/packaging_food_contact.t | 20 +++++++- 6 files changed, 141 insertions(+), 4 deletions(-) create mode 100644 tests/unit/expected_test_results/packaging_food_contact/chocolate-bar-2.json create mode 100644 tests/unit/expected_test_results/packaging_food_contact/only-one-packaging.json diff --git a/lib/ProductOpener/PackagingFoodContact.pm b/lib/ProductOpener/PackagingFoodContact.pm index c464fe7431257..5428dc568db7b 100644 --- a/lib/ProductOpener/PackagingFoodContact.pm +++ b/lib/ProductOpener/PackagingFoodContact.pm @@ -108,7 +108,7 @@ sub determine_food_contact_of_packaging_components_service ( # indicate that the service is updating the "packagings" structure $updated_product_fields_ref->{packagings} = 1; - determine_food_contact_of_packaging_components($packagings_ref); + determine_food_contact_of_packaging_components($packagings_ref, $product_ref); return; } @@ -193,7 +193,7 @@ sub set_food_contact_property_of_packaging_components ($packagings_ref, $food_co return; } -=head2 determine_food_contact_of_packaging_components ($packagings_ref) +=head2 determine_food_contact_of_packaging_components ($packagings_ref, $product_ref = {}) Determine if packaging components are in contact with the food. @@ -201,9 +201,13 @@ Determine if packaging components are in contact with the food. =head4 $packagings_ref packaging data +=head4 $product_ref product data (optional) + +Used to apply specific rules (e.g. for products in specific categories) + =cut -sub determine_food_contact_of_packaging_components ($packagings_ref) { +sub determine_food_contact_of_packaging_components ($packagings_ref, $product_ref = {}) { # Cans: only the can itself is in contact with the food my ($cans_ref, $non_cans_ref) @@ -264,6 +268,36 @@ sub determine_food_contact_of_packaging_components ($packagings_ref) { return; } + # Specific rules for chocolate bars + if (has_tag($product_ref, "categories", "en:chocolates")) { + + # We could have a plastic wrap in contact with the chocolate, or as an outside packaging if there are several paper bars.. + + # If there is a metallic film, sheet, wrap etc., it is in contact with the food + my ($metals_ref, $non_metals_ref) + = get_matching_and_non_matching_packaging_components($packagings_ref, + {material => "en:metal", shape => ["en:film", "en:sheet"]}); + if (@$metals_ref) { + set_food_contact_property_of_packaging_components($metals_ref, 1); + return; + } + + # Otherwise, if there is a plastic film, sheet, wrap etc. , it is in contact with the food + my ($plastics_ref, $non_plastics_ref) + = get_matching_and_non_matching_packaging_components($packagings_ref, + {material => "en:plastic", shape => ["en:film", "en:sheet"]}); + if (@$plastics_ref) { + set_food_contact_property_of_packaging_components($plastics_ref, 1); + return; + } + } + + # If there is only one packaging component, it is in contact with the food + if (@$packagings_ref == 1) { + set_food_contact_property_of_packaging_components($packagings_ref, 1); + return; + } + return; } diff --git a/tests/unit/expected_test_results/packaging_food_contact/chocolate-bar-2.json b/tests/unit/expected_test_results/packaging_food_contact/chocolate-bar-2.json new file mode 100644 index 0000000000000..a31d8ddb89480 --- /dev/null +++ b/tests/unit/expected_test_results/packaging_food_contact/chocolate-bar-2.json @@ -0,0 +1,48 @@ +{ + "categories_tags" : [ + "en:chocolates" + ], + "lc" : "en", + "misc_tags" : [ + "en:packagings-number-of-components-3", + "en:packagings-not-complete", + "en:packagings-not-empty-but-not-complete", + "en:packagings-not-empty" + ], + "packaging_materials_tags" : [ + "en:aluminium", + "en:cardboard", + "en:plastic" + ], + "packaging_recycling_tags" : [], + "packaging_shapes_tags" : [ + "en:film", + "en:sleeve" + ], + "packaging_text" : "3 cardboard sleeve, 3 aluminium foil, 1 plastic wrap", + "packagings" : [ + { + "material" : "en:cardboard", + "number_of_units" : 3, + "shape" : "en:sleeve" + }, + { + "food_contact" : 1, + "material" : "en:aluminium", + "number_of_units" : 3, + "shape" : "en:film" + }, + { + "material" : "en:plastic", + "number_of_units" : 1, + "shape" : "en:film" + } + ], + "packagings_materials" : { + "all" : {}, + "en:metal" : {}, + "en:paper-or-cardboard" : {}, + "en:plastic" : {} + }, + "packagings_n" : 3 +} diff --git a/tests/unit/expected_test_results/packaging_food_contact/chocolate-bar.json b/tests/unit/expected_test_results/packaging_food_contact/chocolate-bar.json index 77607c00e2f22..896ee63ddb81b 100644 --- a/tests/unit/expected_test_results/packaging_food_contact/chocolate-bar.json +++ b/tests/unit/expected_test_results/packaging_food_contact/chocolate-bar.json @@ -1,4 +1,7 @@ { + "categories_tags" : [ + "en:chocolates" + ], "lc" : "en", "misc_tags" : [ "en:packagings-number-of-components-3", @@ -24,6 +27,7 @@ "shape" : "en:sleeve" }, { + "food_contact" : 1, "material" : "en:aluminium", "shape" : "en:film" }, diff --git a/tests/unit/expected_test_results/packaging_food_contact/fr-tablette-de-chocolat.json b/tests/unit/expected_test_results/packaging_food_contact/fr-tablette-de-chocolat.json index bc2288c099df6..3661fbb65eba2 100644 --- a/tests/unit/expected_test_results/packaging_food_contact/fr-tablette-de-chocolat.json +++ b/tests/unit/expected_test_results/packaging_food_contact/fr-tablette-de-chocolat.json @@ -1,4 +1,7 @@ { + "categories_tags" : [ + "en:chocolates" + ], "lc" : "fr", "misc_tags" : [ "en:packagings-number-of-components-3", @@ -24,6 +27,7 @@ "shape" : "en:sleeve" }, { + "food_contact" : 1, "material" : "en:aluminium", "shape" : "en:sheet" }, diff --git a/tests/unit/expected_test_results/packaging_food_contact/only-one-packaging.json b/tests/unit/expected_test_results/packaging_food_contact/only-one-packaging.json new file mode 100644 index 0000000000000..fe2ef74b08305 --- /dev/null +++ b/tests/unit/expected_test_results/packaging_food_contact/only-one-packaging.json @@ -0,0 +1,29 @@ +{ + "lc" : "en", + "misc_tags" : [ + "en:packagings-number-of-components-1", + "en:packagings-not-complete", + "en:packagings-not-empty-but-not-complete", + "en:packagings-not-empty" + ], + "packaging_materials_tags" : [ + "en:plastic" + ], + "packaging_recycling_tags" : [], + "packaging_shapes_tags" : [ + "en:film" + ], + "packaging_text" : "plastic wrap", + "packagings" : [ + { + "food_contact" : 1, + "material" : "en:plastic", + "shape" : "en:film" + } + ], + "packagings_materials" : { + "all" : {}, + "en:plastic" : {} + }, + "packagings_n" : 1 +} diff --git a/tests/unit/packaging_food_contact.t b/tests/unit/packaging_food_contact.t index 682341381ce35..74e2572fbd8d8 100644 --- a/tests/unit/packaging_food_contact.t +++ b/tests/unit/packaging_food_contact.t @@ -31,6 +31,13 @@ my @tests = ( packaging_text => "", } ], + [ + 'only-one-packaging', + { + lc => "en", + packaging_text => "plastic wrap", + } + ], [ 'hazelnut-paste-glass-jar', { @@ -78,6 +85,7 @@ my @tests = ( { lc => "en", packaging_text => "cardboard sleeve, aluminium foil, paper label", + categories_tags => ["en:chocolates"], } ], [ @@ -85,6 +93,16 @@ my @tests = ( { lc => "fr", packaging_text => "étui en carton, feuille d'aluminium, étiquette papier", + categories_tags => ["en:chocolates"], + } + ], + [ + # plastic film wrap could be used to wrap multiple chocolate bars + 'chocolate-bar-2', + { + lc => "en", + packaging_text => "3 cardboard sleeve, 3 aluminium foil, 1 plastic wrap", + categories_tags => ["en:chocolates"], } ] @@ -105,7 +123,7 @@ foreach my $test_ref (@tests) { my $response_ref = get_initialized_response(); analyze_and_combine_packaging_data($product_ref, $response_ref); - determine_food_contact_of_packaging_components($product_ref->{packagings}); + determine_food_contact_of_packaging_components($product_ref->{packagings}, $product_ref); compare_to_expected_results($product_ref, "$expected_result_dir/$testid.json", $update_expected_results); } From 035215453e22c20fe3237db6a511ad6c90b3aa0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Gigandet?= Date: Fri, 7 Feb 2025 15:42:15 +0100 Subject: [PATCH 4/6] fix: remove %options --- lib/ProductOpener/Config.pm | 4 ---- 1 file changed, 4 deletions(-) diff --git a/lib/ProductOpener/Config.pm b/lib/ProductOpener/Config.pm index dcda4c38b3917..defed07e14a88 100644 --- a/lib/ProductOpener/Config.pm +++ b/lib/ProductOpener/Config.pm @@ -32,10 +32,6 @@ if (not defined $flavor) { die("The PRODUCT_OPENER_FLAVOR_SHORT environment variable must be set."); } -# %options will be redefined by autoload below -# but we need it to avoid Perl complaining -%ProductOpener::Config:: % options = (); - use Module::Load; autoload("ProductOpener::Config_$flavor"); From 3eb6178f4f3cfdd95ab66e6de349b99f9b653268 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Gigandet?= Date: Fri, 7 Feb 2025 16:17:30 +0100 Subject: [PATCH 5/6] update tests --- .../get-existing-product.json | 4 ++++ .../get-fields-all-knowledge-panels.json | 8 +++++-- .../api_v2_product_read/get-fields-all.json | 4 ++++ ...attribute-groups-all-knowledge-panels.json | 8 +++++-- ...knowledge_panels_excluded-health_card.json | 4 ++-- ...included-health_card-environment_card.json | 4 ++-- .../api_v2_product_read/get-fields-raw.json | 4 ++++ .../get-knowledge-panels-fr.json | 4 ++-- .../get-knowledge-panels.json | 4 ++-- .../get-packagings-fr.json | 4 ++++ .../api_v2_product_read/get-packagings.json | 4 ++++ .../get-existing-product-api-v3-1.json | 4 ++++ .../get-existing-product-gs1-ai-data-str.json | 4 ++++ .../get-existing-product-gs1-caret.json | 4 ++++ .../get-existing-product-gs1-data-uri.json | 4 ++++ .../get-existing-product-gs1-fnc1.json | 4 ++++ .../get-existing-product-gs1-gs.json | 4 ++++ ...et-existing-product-with-leading-zero.json | 4 ++++ .../get-existing-product.json | 4 ++++ .../get-fields-all-knowledge-panels.json | 8 +++++-- .../api_v3_product_read/get-fields-all.json | 4 ++++ ...attribute-groups-all-knowledge-panels.json | 8 +++++-- ...knowledge_panels_excluded-health_card.json | 4 ++-- ...included-health_card-environment_card.json | 4 ++-- .../api_v3_product_read/get-fields-raw.json | 4 ++++ .../get-knowledge-panels-fr.json | 4 ++-- .../get-knowledge-panels.json | 4 ++-- .../get-packagings-fr.json | 4 ++++ .../api_v3_product_read/get-packagings.json | 4 ++++ .../patch-auth-good-password.json | 1 + ...gs-add-components-to-existing-product.json | 2 ++ .../patch-packagings-add-one-component.json | 1 + .../patch-packagings-complete-0.json | 1 + .../patch-packagings-complete-1.json | 2 ++ .../patch-packagings-complete-2.json | 2 ++ .../patch-packagings-fr-fields.json | 4 ++++ .../patch-packagings-quantity-and-weight.json | 2 ++ ...kagings-weights-as-strings-with-units.json | 3 +++ .../patch-packagings-weights-as-strings.json | 3 +++ ...roperties-with-lc-name-fr-and-spanish.json | 1 + ...h-lc-name-fr-and-unrecognized-spanish.json | 1 + .../patch-properties-with-lc-name-fr.json | 1 + .../patch-properties-with-lc-name.json | 1 + .../patch-request-fields-all.json | 1 + .../patch-request-fields-packagings.json | 1 + .../patch-request-fields-undef.json | 1 + ...ted-attribute-groups-knowledge-panels.json | 3 ++- .../patch-request-fields-updated.json | 1 + .../patch-weight-as-number-or-string.json | 3 +++ .../products/3250390020806.json | 1 + .../products/3250390020998.json | 3 +++ .../products/3250390021926.json | 1 + .../products/3250390024804.json | 4 ++++ .../products/3250390024842.json | 4 ++++ .../products/3250390024866.json | 4 ++++ .../products/3250390025399.json | 3 +++ .../products/3250390025863.json | 1 + .../products/3250390026044.json | 3 +++ .../products/3250390026754.json | 3 +++ .../test/products/3270190128403.json | 1 + .../3003004006001.json | 1 + .../3003004006002.json | 1 + .../3003004006003.json | 14 +++++++++-- .../3003004006004.json | 1 + .../3003004006005.json | 2 ++ .../3003004006006.json | 2 ++ .../3003004006007.json | 15 ++++++++++-- .../replace_existing_values/stats.json | 24 +++++++++++++++---- .../import_csv_file/test/2003004006001.json | 1 + .../import_csv_file/test/2003004006002.json | 1 + .../import_csv_file/test/2003004006003.json | 1 + .../import_csv_file/test/2003004006004.json | 1 + .../import_csv_file/test/2003004006005.json | 2 ++ .../import_csv_file/test/2003004006006.json | 2 ++ .../import_csv_file/test/2003004006007.json | 2 ++ .../product_read/get-existing-product.html | 4 ++++ ...ed-protected-product-api-v2-moderator.json | 8 +++++++ .../get-edited-protected-product-api-v2.json | 8 +++++++ ...-protected-product-web-form-moderator.json | 8 +++++++ ...get-edited-protected-product-web-form.json | 8 +++++++ ...get-edited-unprotected-product-api-v2.json | 8 +++++++ ...t-edited-unprotected-product-web-form.json | 8 +++++++ ...ch-fields-packagings-in-api-v3-format.json | 3 +++ .../search_v1/search-fields-packagings.json | 3 +++ .../search_v1/search-no-filter.json | 3 +++ 85 files changed, 293 insertions(+), 33 deletions(-) diff --git a/tests/integration/expected_test_results/api_v2_product_read/get-existing-product.json b/tests/integration/expected_test_results/api_v2_product_read/get-existing-product.json index 2eafe4a5d64e1..031b7120452cc 100644 --- a/tests/integration/expected_test_results/api_v2_product_read/get-existing-product.json +++ b/tests/integration/expected_test_results/api_v2_product_read/get-existing-product.json @@ -1188,12 +1188,14 @@ "packaging_text_en" : "1 wooden box to recycle, 6 25cl glass bottles to reuse, 3 steel lids to recycle, 1 plastic film to discard", "packagings" : [ { + "food_contact" : 0, "material" : "en:wood", "number_of_units" : 1, "recycling" : "en:recycle", "shape" : "en:box" }, { + "food_contact" : 1, "material" : "en:glass", "number_of_units" : 6, "quantity_per_unit" : "25cl", @@ -1203,12 +1205,14 @@ "shape" : "en:bottle" }, { + "food_contact" : 1, "material" : "en:steel", "number_of_units" : 3, "recycling" : "en:recycle", "shape" : "en:lid" }, { + "food_contact" : 0, "material" : "en:plastic", "number_of_units" : 1, "recycling" : "en:discard", diff --git a/tests/integration/expected_test_results/api_v2_product_read/get-fields-all-knowledge-panels.json b/tests/integration/expected_test_results/api_v2_product_read/get-fields-all-knowledge-panels.json index d94c818804169..de64927a9c958 100644 --- a/tests/integration/expected_test_results/api_v2_product_read/get-fields-all-knowledge-panels.json +++ b/tests/integration/expected_test_results/api_v2_product_read/get-fields-all-knowledge-panels.json @@ -2596,7 +2596,7 @@ "element_type" : "text", "text_element" : { "evaluation" : "good", - "html" : "\n \n \n 1 x \n \n Box\n \n \n \n (Wood)\n \n \n
\n \n \n \n \n \n 3 x \n \n Lid\n \n \n \n (Steel)\n \n \n
\n \n \n \n \n ", + "html" : "\n \n \n 1 x \n \n Box\n \n \n \n (Wood)\n \n \n
\n \n \n \n \n \n 3 x \n \n Lid\n \n \n \n (Steel)\n \n \n - In contact with food\n \n
\n \n \n \n \n ", "icon_alt" : "Recycle", "icon_color_from_evaluation" : true, "icon_url" : "http://static.openfoodfacts.localhost/images/icons/dist/recycle-variant.svg", @@ -2618,7 +2618,7 @@ "element_type" : "text", "text_element" : { "evaluation" : "neutral", - "html" : "\n \n \n \n \n 6 x \n \n Bottle\n 25cl \n \n \n (Glass)\n \n \n
\n \n \n \n \n \n \n ", + "html" : "\n \n \n \n \n 6 x \n \n Bottle\n 25cl \n \n \n (Glass)\n \n \n - In contact with food\n \n
\n \n \n \n \n \n \n ", "icon_alt" : "Unknown", "icon_color_from_evaluation" : true, "icon_url" : "http://static.openfoodfacts.localhost/images/icons/dist/help.svg", @@ -3279,12 +3279,14 @@ "packaging_text_en" : "1 wooden box to recycle, 6 25cl glass bottles to reuse, 3 steel lids to recycle, 1 plastic film to discard", "packagings" : [ { + "food_contact" : 0, "material" : "en:wood", "number_of_units" : "1", "recycling" : "en:recycle", "shape" : "en:box" }, { + "food_contact" : 1, "material" : "en:glass", "number_of_units" : "6", "quantity_per_unit" : "25cl", @@ -3294,12 +3296,14 @@ "shape" : "en:bottle" }, { + "food_contact" : 1, "material" : "en:steel", "number_of_units" : "3", "recycling" : "en:recycle", "shape" : "en:lid" }, { + "food_contact" : 0, "material" : "en:plastic", "number_of_units" : "1", "recycling" : "en:discard", diff --git a/tests/integration/expected_test_results/api_v2_product_read/get-fields-all.json b/tests/integration/expected_test_results/api_v2_product_read/get-fields-all.json index 76155a3551da3..025af1b5ebb44 100644 --- a/tests/integration/expected_test_results/api_v2_product_read/get-fields-all.json +++ b/tests/integration/expected_test_results/api_v2_product_read/get-fields-all.json @@ -1188,12 +1188,14 @@ "packaging_text_en" : "1 wooden box to recycle, 6 25cl glass bottles to reuse, 3 steel lids to recycle, 1 plastic film to discard", "packagings" : [ { + "food_contact" : 0, "material" : "en:wood", "number_of_units" : 1, "recycling" : "en:recycle", "shape" : "en:box" }, { + "food_contact" : 1, "material" : "en:glass", "number_of_units" : 6, "quantity_per_unit" : "25cl", @@ -1203,12 +1205,14 @@ "shape" : "en:bottle" }, { + "food_contact" : 1, "material" : "en:steel", "number_of_units" : 3, "recycling" : "en:recycle", "shape" : "en:lid" }, { + "food_contact" : 0, "material" : "en:plastic", "number_of_units" : 1, "recycling" : "en:discard", diff --git a/tests/integration/expected_test_results/api_v2_product_read/get-fields-attribute-groups-all-knowledge-panels.json b/tests/integration/expected_test_results/api_v2_product_read/get-fields-attribute-groups-all-knowledge-panels.json index 8006c2f556d31..79b4d6e390d02 100644 --- a/tests/integration/expected_test_results/api_v2_product_read/get-fields-attribute-groups-all-knowledge-panels.json +++ b/tests/integration/expected_test_results/api_v2_product_read/get-fields-attribute-groups-all-knowledge-panels.json @@ -3250,7 +3250,7 @@ "element_type" : "text", "text_element" : { "evaluation" : "good", - "html" : "\n \n \n 1 x \n \n Box\n \n \n \n (Wood)\n \n \n
\n \n \n \n \n \n 3 x \n \n Lid\n \n \n \n (Steel)\n \n \n
\n \n \n \n \n ", + "html" : "\n \n \n 1 x \n \n Box\n \n \n \n (Wood)\n \n \n
\n \n \n \n \n \n 3 x \n \n Lid\n \n \n \n (Steel)\n \n \n - In contact with food\n \n
\n \n \n \n \n ", "icon_alt" : "Recycle", "icon_color_from_evaluation" : true, "icon_url" : "http://static.openfoodfacts.localhost/images/icons/dist/recycle-variant.svg", @@ -3272,7 +3272,7 @@ "element_type" : "text", "text_element" : { "evaluation" : "neutral", - "html" : "\n \n \n \n \n 6 x \n \n Bottle\n 25cl \n \n \n (Glass)\n \n \n
\n \n \n \n \n \n \n ", + "html" : "\n \n \n \n \n 6 x \n \n Bottle\n 25cl \n \n \n (Glass)\n \n \n - In contact with food\n \n
\n \n \n \n \n \n \n ", "icon_alt" : "Unknown", "icon_color_from_evaluation" : true, "icon_url" : "http://static.openfoodfacts.localhost/images/icons/dist/help.svg", @@ -3933,12 +3933,14 @@ "packaging_text_en" : "1 wooden box to recycle, 6 25cl glass bottles to reuse, 3 steel lids to recycle, 1 plastic film to discard", "packagings" : [ { + "food_contact" : 0, "material" : "en:wood", "number_of_units" : "1", "recycling" : "en:recycle", "shape" : "en:box" }, { + "food_contact" : 1, "material" : "en:glass", "number_of_units" : "6", "quantity_per_unit" : "25cl", @@ -3948,12 +3950,14 @@ "shape" : "en:bottle" }, { + "food_contact" : 1, "material" : "en:steel", "number_of_units" : "3", "recycling" : "en:recycle", "shape" : "en:lid" }, { + "food_contact" : 0, "material" : "en:plastic", "number_of_units" : "1", "recycling" : "en:discard", diff --git a/tests/integration/expected_test_results/api_v2_product_read/get-fields-knowledge-panels-knowledge-panels_included-health_card-environment_card-knowledge_panels_excluded-health_card.json b/tests/integration/expected_test_results/api_v2_product_read/get-fields-knowledge-panels-knowledge-panels_included-health_card-environment_card-knowledge_panels_excluded-health_card.json index a89b615a3acf0..ad5a47ed1a069 100644 --- a/tests/integration/expected_test_results/api_v2_product_read/get-fields-knowledge-panels-knowledge-panels_included-health_card-environment_card-knowledge_panels_excluded-health_card.json +++ b/tests/integration/expected_test_results/api_v2_product_read/get-fields-knowledge-panels-knowledge-panels_included-health_card-environment_card-knowledge_panels_excluded-health_card.json @@ -604,7 +604,7 @@ "element_type" : "text", "text_element" : { "evaluation" : "good", - "html" : "\n \n \n 1 x \n \n Box\n \n \n \n (Wood)\n \n \n
\n \n \n \n \n \n 3 x \n \n Lid\n \n \n \n (Steel)\n \n \n
\n \n \n \n \n ", + "html" : "\n \n \n 1 x \n \n Box\n \n \n \n (Wood)\n \n \n
\n \n \n \n \n \n 3 x \n \n Lid\n \n \n \n (Steel)\n \n \n - In contact with food\n \n
\n \n \n \n \n ", "icon_alt" : "Recycle", "icon_color_from_evaluation" : true, "icon_url" : "http://static.openfoodfacts.localhost/images/icons/dist/recycle-variant.svg", @@ -626,7 +626,7 @@ "element_type" : "text", "text_element" : { "evaluation" : "neutral", - "html" : "\n \n \n \n \n 6 x \n \n Bottle\n 25cl \n \n \n (Glass)\n \n \n
\n \n \n \n \n \n \n ", + "html" : "\n \n \n \n \n 6 x \n \n Bottle\n 25cl \n \n \n (Glass)\n \n \n - In contact with food\n \n
\n \n \n \n \n \n \n ", "icon_alt" : "Unknown", "icon_color_from_evaluation" : true, "icon_url" : "http://static.openfoodfacts.localhost/images/icons/dist/help.svg", diff --git a/tests/integration/expected_test_results/api_v2_product_read/get-fields-knowledge-panels-knowledge-panels_included-health_card-environment_card.json b/tests/integration/expected_test_results/api_v2_product_read/get-fields-knowledge-panels-knowledge-panels_included-health_card-environment_card.json index 11bee25858fa6..916ca6803bfe7 100644 --- a/tests/integration/expected_test_results/api_v2_product_read/get-fields-knowledge-panels-knowledge-panels_included-health_card-environment_card.json +++ b/tests/integration/expected_test_results/api_v2_product_read/get-fields-knowledge-panels-knowledge-panels_included-health_card-environment_card.json @@ -1770,7 +1770,7 @@ "element_type" : "text", "text_element" : { "evaluation" : "good", - "html" : "\n \n \n 1 x \n \n Box\n \n \n \n (Wood)\n \n \n
\n \n \n \n \n \n 3 x \n \n Lid\n \n \n \n (Steel)\n \n \n
\n \n \n \n \n ", + "html" : "\n \n \n 1 x \n \n Box\n \n \n \n (Wood)\n \n \n
\n \n \n \n \n \n 3 x \n \n Lid\n \n \n \n (Steel)\n \n \n - In contact with food\n \n
\n \n \n \n \n ", "icon_alt" : "Recycle", "icon_color_from_evaluation" : true, "icon_url" : "http://static.openfoodfacts.localhost/images/icons/dist/recycle-variant.svg", @@ -1792,7 +1792,7 @@ "element_type" : "text", "text_element" : { "evaluation" : "neutral", - "html" : "\n \n \n \n \n 6 x \n \n Bottle\n 25cl \n \n \n (Glass)\n \n \n
\n \n \n \n \n \n \n ", + "html" : "\n \n \n \n \n 6 x \n \n Bottle\n 25cl \n \n \n (Glass)\n \n \n - In contact with food\n \n
\n \n \n \n \n \n \n ", "icon_alt" : "Unknown", "icon_color_from_evaluation" : true, "icon_url" : "http://static.openfoodfacts.localhost/images/icons/dist/help.svg", diff --git a/tests/integration/expected_test_results/api_v2_product_read/get-fields-raw.json b/tests/integration/expected_test_results/api_v2_product_read/get-fields-raw.json index f29c0775f626b..a051ad2a91ea3 100644 --- a/tests/integration/expected_test_results/api_v2_product_read/get-fields-raw.json +++ b/tests/integration/expected_test_results/api_v2_product_read/get-fields-raw.json @@ -1186,12 +1186,14 @@ "packaging_text_en" : "1 wooden box to recycle, 6 25cl glass bottles to reuse, 3 steel lids to recycle, 1 plastic film to discard", "packagings" : [ { + "food_contact" : 0, "material" : "en:wood", "number_of_units" : 1, "recycling" : "en:recycle", "shape" : "en:box" }, { + "food_contact" : 1, "material" : "en:glass", "number_of_units" : 6, "quantity_per_unit" : "25cl", @@ -1201,12 +1203,14 @@ "shape" : "en:bottle" }, { + "food_contact" : 1, "material" : "en:steel", "number_of_units" : 3, "recycling" : "en:recycle", "shape" : "en:lid" }, { + "food_contact" : 0, "material" : "en:plastic", "number_of_units" : 1, "recycling" : "en:discard", diff --git a/tests/integration/expected_test_results/api_v2_product_read/get-knowledge-panels-fr.json b/tests/integration/expected_test_results/api_v2_product_read/get-knowledge-panels-fr.json index 13b36b56786b1..50a69e1465095 100644 --- a/tests/integration/expected_test_results/api_v2_product_read/get-knowledge-panels-fr.json +++ b/tests/integration/expected_test_results/api_v2_product_read/get-knowledge-panels-fr.json @@ -1822,7 +1822,7 @@ "element_type" : "text", "text_element" : { "evaluation" : "good", - "html" : "\n \n \n 1 x \n \n Boîte\n \n \n \n (Bois)\n \n \n
\n \n \n \n \n \n 3 x \n \n Couvercle\n \n \n \n (Acier)\n \n \n
\n \n \n \n \n ", + "html" : "\n \n \n 1 x \n \n Boîte\n \n \n \n (Bois)\n \n \n
\n \n \n \n \n \n 3 x \n \n Couvercle\n \n \n \n (Acier)\n \n \n - En contact avec l'aliment\n \n
\n \n \n \n \n ", "icon_alt" : "Recycler", "icon_color_from_evaluation" : true, "icon_url" : "http://static.openfoodfacts.localhost/images/icons/dist/recycle-variant.svg", @@ -1844,7 +1844,7 @@ "element_type" : "text", "text_element" : { "evaluation" : "neutral", - "html" : "\n \n \n \n \n 6 x \n \n Bouteille\n 25cl \n \n \n (Verre)\n \n \n
\n \n \n \n \n \n \n ", + "html" : "\n \n \n \n \n 6 x \n \n Bouteille\n 25cl \n \n \n (Verre)\n \n \n - En contact avec l'aliment\n \n
\n \n \n \n \n \n \n ", "icon_alt" : "Inconnu", "icon_color_from_evaluation" : true, "icon_url" : "http://static.openfoodfacts.localhost/images/icons/dist/help.svg", diff --git a/tests/integration/expected_test_results/api_v2_product_read/get-knowledge-panels.json b/tests/integration/expected_test_results/api_v2_product_read/get-knowledge-panels.json index d0e6ce6ac7900..50b36d4a00cbe 100644 --- a/tests/integration/expected_test_results/api_v2_product_read/get-knowledge-panels.json +++ b/tests/integration/expected_test_results/api_v2_product_read/get-knowledge-panels.json @@ -1815,7 +1815,7 @@ "element_type" : "text", "text_element" : { "evaluation" : "good", - "html" : "\n \n \n 1 x \n \n Box\n \n \n \n (Wood)\n \n \n
\n \n \n \n \n \n 3 x \n \n Lid\n \n \n \n (Steel)\n \n \n
\n \n \n \n \n ", + "html" : "\n \n \n 1 x \n \n Box\n \n \n \n (Wood)\n \n \n
\n \n \n \n \n \n 3 x \n \n Lid\n \n \n \n (Steel)\n \n \n - In contact with food\n \n
\n \n \n \n \n ", "icon_alt" : "Recycle", "icon_color_from_evaluation" : true, "icon_url" : "http://static.openfoodfacts.localhost/images/icons/dist/recycle-variant.svg", @@ -1837,7 +1837,7 @@ "element_type" : "text", "text_element" : { "evaluation" : "neutral", - "html" : "\n \n \n \n \n 6 x \n \n Bottle\n 25cl \n \n \n (Glass)\n \n \n
\n \n \n \n \n \n \n ", + "html" : "\n \n \n \n \n 6 x \n \n Bottle\n 25cl \n \n \n (Glass)\n \n \n - In contact with food\n \n
\n \n \n \n \n \n \n ", "icon_alt" : "Unknown", "icon_color_from_evaluation" : true, "icon_url" : "http://static.openfoodfacts.localhost/images/icons/dist/help.svg", diff --git a/tests/integration/expected_test_results/api_v2_product_read/get-packagings-fr.json b/tests/integration/expected_test_results/api_v2_product_read/get-packagings-fr.json index a627245d9dae7..1181a328ea1b3 100644 --- a/tests/integration/expected_test_results/api_v2_product_read/get-packagings-fr.json +++ b/tests/integration/expected_test_results/api_v2_product_read/get-packagings-fr.json @@ -3,12 +3,14 @@ "product" : { "packagings" : [ { + "food_contact" : 0, "material" : "en:wood", "number_of_units" : 1, "recycling" : "en:recycle", "shape" : "en:box" }, { + "food_contact" : 1, "material" : "en:glass", "number_of_units" : 6, "quantity_per_unit" : "25cl", @@ -18,12 +20,14 @@ "shape" : "en:bottle" }, { + "food_contact" : 1, "material" : "en:steel", "number_of_units" : 3, "recycling" : "en:recycle", "shape" : "en:lid" }, { + "food_contact" : 0, "material" : "en:plastic", "number_of_units" : 1, "recycling" : "en:discard", diff --git a/tests/integration/expected_test_results/api_v2_product_read/get-packagings.json b/tests/integration/expected_test_results/api_v2_product_read/get-packagings.json index a627245d9dae7..1181a328ea1b3 100644 --- a/tests/integration/expected_test_results/api_v2_product_read/get-packagings.json +++ b/tests/integration/expected_test_results/api_v2_product_read/get-packagings.json @@ -3,12 +3,14 @@ "product" : { "packagings" : [ { + "food_contact" : 0, "material" : "en:wood", "number_of_units" : 1, "recycling" : "en:recycle", "shape" : "en:box" }, { + "food_contact" : 1, "material" : "en:glass", "number_of_units" : 6, "quantity_per_unit" : "25cl", @@ -18,12 +20,14 @@ "shape" : "en:bottle" }, { + "food_contact" : 1, "material" : "en:steel", "number_of_units" : 3, "recycling" : "en:recycle", "shape" : "en:lid" }, { + "food_contact" : 0, "material" : "en:plastic", "number_of_units" : 1, "recycling" : "en:discard", diff --git a/tests/integration/expected_test_results/api_v3_product_read/get-existing-product-api-v3-1.json b/tests/integration/expected_test_results/api_v3_product_read/get-existing-product-api-v3-1.json index 6356949adce05..42eecaf4e9842 100644 --- a/tests/integration/expected_test_results/api_v3_product_read/get-existing-product-api-v3-1.json +++ b/tests/integration/expected_test_results/api_v3_product_read/get-existing-product-api-v3-1.json @@ -972,6 +972,7 @@ "packaging_text_en" : "1 wooden box to recycle, 6 25cl glass bottles to reuse, 3 steel lids to recycle, 1 plastic film to discard", "packagings" : [ { + "food_contact" : 0, "material" : { "id" : "en:wood" }, @@ -984,6 +985,7 @@ } }, { + "food_contact" : 1, "material" : { "id" : "en:glass" }, @@ -999,6 +1001,7 @@ } }, { + "food_contact" : 1, "material" : { "id" : "en:steel" }, @@ -1011,6 +1014,7 @@ } }, { + "food_contact" : 0, "material" : { "id" : "en:plastic" }, diff --git a/tests/integration/expected_test_results/api_v3_product_read/get-existing-product-gs1-ai-data-str.json b/tests/integration/expected_test_results/api_v3_product_read/get-existing-product-gs1-ai-data-str.json index 76bab894fc690..3e823dcbecf91 100644 --- a/tests/integration/expected_test_results/api_v3_product_read/get-existing-product-gs1-ai-data-str.json +++ b/tests/integration/expected_test_results/api_v3_product_read/get-existing-product-gs1-ai-data-str.json @@ -972,6 +972,7 @@ "packaging_text_en" : "1 wooden box to recycle, 6 25cl glass bottles to reuse, 3 steel lids to recycle, 1 plastic film to discard", "packagings" : [ { + "food_contact" : 0, "material" : { "id" : "en:wood" }, @@ -984,6 +985,7 @@ } }, { + "food_contact" : 1, "material" : { "id" : "en:glass" }, @@ -999,6 +1001,7 @@ } }, { + "food_contact" : 1, "material" : { "id" : "en:steel" }, @@ -1011,6 +1014,7 @@ } }, { + "food_contact" : 0, "material" : { "id" : "en:plastic" }, diff --git a/tests/integration/expected_test_results/api_v3_product_read/get-existing-product-gs1-caret.json b/tests/integration/expected_test_results/api_v3_product_read/get-existing-product-gs1-caret.json index 4a5c4ef3ba3ac..8a77455e8caa9 100644 --- a/tests/integration/expected_test_results/api_v3_product_read/get-existing-product-gs1-caret.json +++ b/tests/integration/expected_test_results/api_v3_product_read/get-existing-product-gs1-caret.json @@ -972,6 +972,7 @@ "packaging_text_en" : "1 wooden box to recycle, 6 25cl glass bottles to reuse, 3 steel lids to recycle, 1 plastic film to discard", "packagings" : [ { + "food_contact" : 0, "material" : { "id" : "en:wood" }, @@ -984,6 +985,7 @@ } }, { + "food_contact" : 1, "material" : { "id" : "en:glass" }, @@ -999,6 +1001,7 @@ } }, { + "food_contact" : 1, "material" : { "id" : "en:steel" }, @@ -1011,6 +1014,7 @@ } }, { + "food_contact" : 0, "material" : { "id" : "en:plastic" }, diff --git a/tests/integration/expected_test_results/api_v3_product_read/get-existing-product-gs1-data-uri.json b/tests/integration/expected_test_results/api_v3_product_read/get-existing-product-gs1-data-uri.json index 4a5c4ef3ba3ac..8a77455e8caa9 100644 --- a/tests/integration/expected_test_results/api_v3_product_read/get-existing-product-gs1-data-uri.json +++ b/tests/integration/expected_test_results/api_v3_product_read/get-existing-product-gs1-data-uri.json @@ -972,6 +972,7 @@ "packaging_text_en" : "1 wooden box to recycle, 6 25cl glass bottles to reuse, 3 steel lids to recycle, 1 plastic film to discard", "packagings" : [ { + "food_contact" : 0, "material" : { "id" : "en:wood" }, @@ -984,6 +985,7 @@ } }, { + "food_contact" : 1, "material" : { "id" : "en:glass" }, @@ -999,6 +1001,7 @@ } }, { + "food_contact" : 1, "material" : { "id" : "en:steel" }, @@ -1011,6 +1014,7 @@ } }, { + "food_contact" : 0, "material" : { "id" : "en:plastic" }, diff --git a/tests/integration/expected_test_results/api_v3_product_read/get-existing-product-gs1-fnc1.json b/tests/integration/expected_test_results/api_v3_product_read/get-existing-product-gs1-fnc1.json index 76bab894fc690..3e823dcbecf91 100644 --- a/tests/integration/expected_test_results/api_v3_product_read/get-existing-product-gs1-fnc1.json +++ b/tests/integration/expected_test_results/api_v3_product_read/get-existing-product-gs1-fnc1.json @@ -972,6 +972,7 @@ "packaging_text_en" : "1 wooden box to recycle, 6 25cl glass bottles to reuse, 3 steel lids to recycle, 1 plastic film to discard", "packagings" : [ { + "food_contact" : 0, "material" : { "id" : "en:wood" }, @@ -984,6 +985,7 @@ } }, { + "food_contact" : 1, "material" : { "id" : "en:glass" }, @@ -999,6 +1001,7 @@ } }, { + "food_contact" : 1, "material" : { "id" : "en:steel" }, @@ -1011,6 +1014,7 @@ } }, { + "food_contact" : 0, "material" : { "id" : "en:plastic" }, diff --git a/tests/integration/expected_test_results/api_v3_product_read/get-existing-product-gs1-gs.json b/tests/integration/expected_test_results/api_v3_product_read/get-existing-product-gs1-gs.json index 4a5c4ef3ba3ac..8a77455e8caa9 100644 --- a/tests/integration/expected_test_results/api_v3_product_read/get-existing-product-gs1-gs.json +++ b/tests/integration/expected_test_results/api_v3_product_read/get-existing-product-gs1-gs.json @@ -972,6 +972,7 @@ "packaging_text_en" : "1 wooden box to recycle, 6 25cl glass bottles to reuse, 3 steel lids to recycle, 1 plastic film to discard", "packagings" : [ { + "food_contact" : 0, "material" : { "id" : "en:wood" }, @@ -984,6 +985,7 @@ } }, { + "food_contact" : 1, "material" : { "id" : "en:glass" }, @@ -999,6 +1001,7 @@ } }, { + "food_contact" : 1, "material" : { "id" : "en:steel" }, @@ -1011,6 +1014,7 @@ } }, { + "food_contact" : 0, "material" : { "id" : "en:plastic" }, diff --git a/tests/integration/expected_test_results/api_v3_product_read/get-existing-product-with-leading-zero.json b/tests/integration/expected_test_results/api_v3_product_read/get-existing-product-with-leading-zero.json index 76bab894fc690..3e823dcbecf91 100644 --- a/tests/integration/expected_test_results/api_v3_product_read/get-existing-product-with-leading-zero.json +++ b/tests/integration/expected_test_results/api_v3_product_read/get-existing-product-with-leading-zero.json @@ -972,6 +972,7 @@ "packaging_text_en" : "1 wooden box to recycle, 6 25cl glass bottles to reuse, 3 steel lids to recycle, 1 plastic film to discard", "packagings" : [ { + "food_contact" : 0, "material" : { "id" : "en:wood" }, @@ -984,6 +985,7 @@ } }, { + "food_contact" : 1, "material" : { "id" : "en:glass" }, @@ -999,6 +1001,7 @@ } }, { + "food_contact" : 1, "material" : { "id" : "en:steel" }, @@ -1011,6 +1014,7 @@ } }, { + "food_contact" : 0, "material" : { "id" : "en:plastic" }, diff --git a/tests/integration/expected_test_results/api_v3_product_read/get-existing-product.json b/tests/integration/expected_test_results/api_v3_product_read/get-existing-product.json index 2b261a8ae80ab..43167b87077ac 100644 --- a/tests/integration/expected_test_results/api_v3_product_read/get-existing-product.json +++ b/tests/integration/expected_test_results/api_v3_product_read/get-existing-product.json @@ -972,6 +972,7 @@ "packaging_text_en" : "1 wooden box to recycle, 6 25cl glass bottles to reuse, 3 steel lids to recycle, 1 plastic film to discard", "packagings" : [ { + "food_contact" : 0, "material" : { "id" : "en:wood" }, @@ -984,6 +985,7 @@ } }, { + "food_contact" : 1, "material" : { "id" : "en:glass" }, @@ -999,6 +1001,7 @@ } }, { + "food_contact" : 1, "material" : { "id" : "en:steel" }, @@ -1011,6 +1014,7 @@ } }, { + "food_contact" : 0, "material" : { "id" : "en:plastic" }, diff --git a/tests/integration/expected_test_results/api_v3_product_read/get-fields-all-knowledge-panels.json b/tests/integration/expected_test_results/api_v3_product_read/get-fields-all-knowledge-panels.json index a83cf9525d9a0..0c3b7807d02f6 100644 --- a/tests/integration/expected_test_results/api_v3_product_read/get-fields-all-knowledge-panels.json +++ b/tests/integration/expected_test_results/api_v3_product_read/get-fields-all-knowledge-panels.json @@ -2220,7 +2220,7 @@ "element_type" : "text", "text_element" : { "evaluation" : "good", - "html" : "\n \n \n 1 x \n \n Box\n \n \n \n (Wood)\n \n \n
\n \n \n \n \n \n 3 x \n \n Lid\n \n \n \n (Steel)\n \n \n
\n \n \n \n \n ", + "html" : "\n \n \n 1 x \n \n Box\n \n \n \n (Wood)\n \n \n
\n \n \n \n \n \n 3 x \n \n Lid\n \n \n \n (Steel)\n \n \n - In contact with food\n \n
\n \n \n \n \n ", "icon_alt" : "Recycle", "icon_color_from_evaluation" : true, "icon_url" : "http://static.openfoodfacts.localhost/images/icons/dist/recycle-variant.svg", @@ -2242,7 +2242,7 @@ "element_type" : "text", "text_element" : { "evaluation" : "neutral", - "html" : "\n \n \n \n \n 6 x \n \n Bottle\n 25cl \n \n \n (Glass)\n \n \n
\n \n \n \n \n \n \n ", + "html" : "\n \n \n \n \n 6 x \n \n Bottle\n 25cl \n \n \n (Glass)\n \n \n - In contact with food\n \n
\n \n \n \n \n \n \n ", "icon_alt" : "Unknown", "icon_color_from_evaluation" : true, "icon_url" : "http://static.openfoodfacts.localhost/images/icons/dist/help.svg", @@ -2693,6 +2693,7 @@ "packaging_text_en" : "1 wooden box to recycle, 6 25cl glass bottles to reuse, 3 steel lids to recycle, 1 plastic film to discard", "packagings" : [ { + "food_contact" : 0, "material" : { "id" : "en:wood" }, @@ -2705,6 +2706,7 @@ } }, { + "food_contact" : 1, "material" : { "id" : "en:glass" }, @@ -2720,6 +2722,7 @@ } }, { + "food_contact" : 1, "material" : { "id" : "en:steel" }, @@ -2732,6 +2735,7 @@ } }, { + "food_contact" : 0, "material" : { "id" : "en:plastic" }, diff --git a/tests/integration/expected_test_results/api_v3_product_read/get-fields-all.json b/tests/integration/expected_test_results/api_v3_product_read/get-fields-all.json index 2b261a8ae80ab..43167b87077ac 100644 --- a/tests/integration/expected_test_results/api_v3_product_read/get-fields-all.json +++ b/tests/integration/expected_test_results/api_v3_product_read/get-fields-all.json @@ -972,6 +972,7 @@ "packaging_text_en" : "1 wooden box to recycle, 6 25cl glass bottles to reuse, 3 steel lids to recycle, 1 plastic film to discard", "packagings" : [ { + "food_contact" : 0, "material" : { "id" : "en:wood" }, @@ -984,6 +985,7 @@ } }, { + "food_contact" : 1, "material" : { "id" : "en:glass" }, @@ -999,6 +1001,7 @@ } }, { + "food_contact" : 1, "material" : { "id" : "en:steel" }, @@ -1011,6 +1014,7 @@ } }, { + "food_contact" : 0, "material" : { "id" : "en:plastic" }, diff --git a/tests/integration/expected_test_results/api_v3_product_read/get-fields-attribute-groups-all-knowledge-panels.json b/tests/integration/expected_test_results/api_v3_product_read/get-fields-attribute-groups-all-knowledge-panels.json index 0435af0972041..3e4511e98697b 100644 --- a/tests/integration/expected_test_results/api_v3_product_read/get-fields-attribute-groups-all-knowledge-panels.json +++ b/tests/integration/expected_test_results/api_v3_product_read/get-fields-attribute-groups-all-knowledge-panels.json @@ -2866,7 +2866,7 @@ "element_type" : "text", "text_element" : { "evaluation" : "good", - "html" : "\n \n \n 1 x \n \n Box\n \n \n \n (Wood)\n \n \n
\n \n \n \n \n \n 3 x \n \n Lid\n \n \n \n (Steel)\n \n \n
\n \n \n \n \n ", + "html" : "\n \n \n 1 x \n \n Box\n \n \n \n (Wood)\n \n \n
\n \n \n \n \n \n 3 x \n \n Lid\n \n \n \n (Steel)\n \n \n - In contact with food\n \n
\n \n \n \n \n ", "icon_alt" : "Recycle", "icon_color_from_evaluation" : true, "icon_url" : "http://static.openfoodfacts.localhost/images/icons/dist/recycle-variant.svg", @@ -2888,7 +2888,7 @@ "element_type" : "text", "text_element" : { "evaluation" : "neutral", - "html" : "\n \n \n \n \n 6 x \n \n Bottle\n 25cl \n \n \n (Glass)\n \n \n
\n \n \n \n \n \n \n ", + "html" : "\n \n \n \n \n 6 x \n \n Bottle\n 25cl \n \n \n (Glass)\n \n \n - In contact with food\n \n
\n \n \n \n \n \n \n ", "icon_alt" : "Unknown", "icon_color_from_evaluation" : true, "icon_url" : "http://static.openfoodfacts.localhost/images/icons/dist/help.svg", @@ -3339,6 +3339,7 @@ "packaging_text_en" : "1 wooden box to recycle, 6 25cl glass bottles to reuse, 3 steel lids to recycle, 1 plastic film to discard", "packagings" : [ { + "food_contact" : 0, "material" : { "id" : "en:wood" }, @@ -3351,6 +3352,7 @@ } }, { + "food_contact" : 1, "material" : { "id" : "en:glass" }, @@ -3366,6 +3368,7 @@ } }, { + "food_contact" : 1, "material" : { "id" : "en:steel" }, @@ -3378,6 +3381,7 @@ } }, { + "food_contact" : 0, "material" : { "id" : "en:plastic" }, diff --git a/tests/integration/expected_test_results/api_v3_product_read/get-fields-knowledge-panels-knowledge-panels_included-health_card-environment_card-knowledge_panels_excluded-health_card.json b/tests/integration/expected_test_results/api_v3_product_read/get-fields-knowledge-panels-knowledge-panels_included-health_card-environment_card-knowledge_panels_excluded-health_card.json index 4f2d7f7c762f2..9348bd30913e3 100644 --- a/tests/integration/expected_test_results/api_v3_product_read/get-fields-knowledge-panels-knowledge-panels_included-health_card-environment_card-knowledge_panels_excluded-health_card.json +++ b/tests/integration/expected_test_results/api_v3_product_read/get-fields-knowledge-panels-knowledge-panels_included-health_card-environment_card-knowledge_panels_excluded-health_card.json @@ -605,7 +605,7 @@ "element_type" : "text", "text_element" : { "evaluation" : "good", - "html" : "\n \n \n 1 x \n \n Box\n \n \n \n (Wood)\n \n \n
\n \n \n \n \n \n 3 x \n \n Lid\n \n \n \n (Steel)\n \n \n
\n \n \n \n \n ", + "html" : "\n \n \n 1 x \n \n Box\n \n \n \n (Wood)\n \n \n
\n \n \n \n \n \n 3 x \n \n Lid\n \n \n \n (Steel)\n \n \n - In contact with food\n \n
\n \n \n \n \n ", "icon_alt" : "Recycle", "icon_color_from_evaluation" : true, "icon_url" : "http://static.openfoodfacts.localhost/images/icons/dist/recycle-variant.svg", @@ -627,7 +627,7 @@ "element_type" : "text", "text_element" : { "evaluation" : "neutral", - "html" : "\n \n \n \n \n 6 x \n \n Bottle\n 25cl \n \n \n (Glass)\n \n \n
\n \n \n \n \n \n \n ", + "html" : "\n \n \n \n \n 6 x \n \n Bottle\n 25cl \n \n \n (Glass)\n \n \n - In contact with food\n \n
\n \n \n \n \n \n \n ", "icon_alt" : "Unknown", "icon_color_from_evaluation" : true, "icon_url" : "http://static.openfoodfacts.localhost/images/icons/dist/help.svg", diff --git a/tests/integration/expected_test_results/api_v3_product_read/get-fields-knowledge-panels-knowledge-panels_included-health_card-environment_card.json b/tests/integration/expected_test_results/api_v3_product_read/get-fields-knowledge-panels-knowledge-panels_included-health_card-environment_card.json index e2466fd2a71f3..2f9cf4fe3bdbf 100644 --- a/tests/integration/expected_test_results/api_v3_product_read/get-fields-knowledge-panels-knowledge-panels_included-health_card-environment_card.json +++ b/tests/integration/expected_test_results/api_v3_product_read/get-fields-knowledge-panels-knowledge-panels_included-health_card-environment_card.json @@ -1401,7 +1401,7 @@ "element_type" : "text", "text_element" : { "evaluation" : "good", - "html" : "\n \n \n 1 x \n \n Box\n \n \n \n (Wood)\n \n \n
\n \n \n \n \n \n 3 x \n \n Lid\n \n \n \n (Steel)\n \n \n
\n \n \n \n \n ", + "html" : "\n \n \n 1 x \n \n Box\n \n \n \n (Wood)\n \n \n
\n \n \n \n \n \n 3 x \n \n Lid\n \n \n \n (Steel)\n \n \n - In contact with food\n \n
\n \n \n \n \n ", "icon_alt" : "Recycle", "icon_color_from_evaluation" : true, "icon_url" : "http://static.openfoodfacts.localhost/images/icons/dist/recycle-variant.svg", @@ -1423,7 +1423,7 @@ "element_type" : "text", "text_element" : { "evaluation" : "neutral", - "html" : "\n \n \n \n \n 6 x \n \n Bottle\n 25cl \n \n \n (Glass)\n \n \n
\n \n \n \n \n \n \n ", + "html" : "\n \n \n \n \n 6 x \n \n Bottle\n 25cl \n \n \n (Glass)\n \n \n - In contact with food\n \n
\n \n \n \n \n \n \n ", "icon_alt" : "Unknown", "icon_color_from_evaluation" : true, "icon_url" : "http://static.openfoodfacts.localhost/images/icons/dist/help.svg", diff --git a/tests/integration/expected_test_results/api_v3_product_read/get-fields-raw.json b/tests/integration/expected_test_results/api_v3_product_read/get-fields-raw.json index 2c8824d9b526a..546422eaa7cd6 100644 --- a/tests/integration/expected_test_results/api_v3_product_read/get-fields-raw.json +++ b/tests/integration/expected_test_results/api_v3_product_read/get-fields-raw.json @@ -970,12 +970,14 @@ "packaging_text_en" : "1 wooden box to recycle, 6 25cl glass bottles to reuse, 3 steel lids to recycle, 1 plastic film to discard", "packagings" : [ { + "food_contact" : 0, "material" : "en:wood", "number_of_units" : 1, "recycling" : "en:recycle", "shape" : "en:box" }, { + "food_contact" : 1, "material" : "en:glass", "number_of_units" : 6, "quantity_per_unit" : "25cl", @@ -985,12 +987,14 @@ "shape" : "en:bottle" }, { + "food_contact" : 1, "material" : "en:steel", "number_of_units" : 3, "recycling" : "en:recycle", "shape" : "en:lid" }, { + "food_contact" : 0, "material" : "en:plastic", "number_of_units" : 1, "recycling" : "en:discard", diff --git a/tests/integration/expected_test_results/api_v3_product_read/get-knowledge-panels-fr.json b/tests/integration/expected_test_results/api_v3_product_read/get-knowledge-panels-fr.json index ebcd7eb51193e..76cac49da4431 100644 --- a/tests/integration/expected_test_results/api_v3_product_read/get-knowledge-panels-fr.json +++ b/tests/integration/expected_test_results/api_v3_product_read/get-knowledge-panels-fr.json @@ -1453,7 +1453,7 @@ "element_type" : "text", "text_element" : { "evaluation" : "good", - "html" : "\n \n \n 1 x \n \n Boîte\n \n \n \n (Bois)\n \n \n
\n \n \n \n \n \n 3 x \n \n Couvercle\n \n \n \n (Acier)\n \n \n
\n \n \n \n \n ", + "html" : "\n \n \n 1 x \n \n Boîte\n \n \n \n (Bois)\n \n \n
\n \n \n \n \n \n 3 x \n \n Couvercle\n \n \n \n (Acier)\n \n \n - En contact avec l'aliment\n \n
\n \n \n \n \n ", "icon_alt" : "Recycler", "icon_color_from_evaluation" : true, "icon_url" : "http://static.openfoodfacts.localhost/images/icons/dist/recycle-variant.svg", @@ -1475,7 +1475,7 @@ "element_type" : "text", "text_element" : { "evaluation" : "neutral", - "html" : "\n \n \n \n \n 6 x \n \n Bouteille\n 25cl \n \n \n (Verre)\n \n \n
\n \n \n \n \n \n \n ", + "html" : "\n \n \n \n \n 6 x \n \n Bouteille\n 25cl \n \n \n (Verre)\n \n \n - En contact avec l'aliment\n \n
\n \n \n \n \n \n \n ", "icon_alt" : "Inconnu", "icon_color_from_evaluation" : true, "icon_url" : "http://static.openfoodfacts.localhost/images/icons/dist/help.svg", diff --git a/tests/integration/expected_test_results/api_v3_product_read/get-knowledge-panels.json b/tests/integration/expected_test_results/api_v3_product_read/get-knowledge-panels.json index e8983c22b662e..cd90f7abacde4 100644 --- a/tests/integration/expected_test_results/api_v3_product_read/get-knowledge-panels.json +++ b/tests/integration/expected_test_results/api_v3_product_read/get-knowledge-panels.json @@ -1446,7 +1446,7 @@ "element_type" : "text", "text_element" : { "evaluation" : "good", - "html" : "\n \n \n 1 x \n \n Box\n \n \n \n (Wood)\n \n \n
\n \n \n \n \n \n 3 x \n \n Lid\n \n \n \n (Steel)\n \n \n
\n \n \n \n \n ", + "html" : "\n \n \n 1 x \n \n Box\n \n \n \n (Wood)\n \n \n
\n \n \n \n \n \n 3 x \n \n Lid\n \n \n \n (Steel)\n \n \n - In contact with food\n \n
\n \n \n \n \n ", "icon_alt" : "Recycle", "icon_color_from_evaluation" : true, "icon_url" : "http://static.openfoodfacts.localhost/images/icons/dist/recycle-variant.svg", @@ -1468,7 +1468,7 @@ "element_type" : "text", "text_element" : { "evaluation" : "neutral", - "html" : "\n \n \n \n \n 6 x \n \n Bottle\n 25cl \n \n \n (Glass)\n \n \n
\n \n \n \n \n \n \n ", + "html" : "\n \n \n \n \n 6 x \n \n Bottle\n 25cl \n \n \n (Glass)\n \n \n - In contact with food\n \n
\n \n \n \n \n \n \n ", "icon_alt" : "Unknown", "icon_color_from_evaluation" : true, "icon_url" : "http://static.openfoodfacts.localhost/images/icons/dist/help.svg", diff --git a/tests/integration/expected_test_results/api_v3_product_read/get-packagings-fr.json b/tests/integration/expected_test_results/api_v3_product_read/get-packagings-fr.json index 4ba6d99cbf905..3a1188b169526 100644 --- a/tests/integration/expected_test_results/api_v3_product_read/get-packagings-fr.json +++ b/tests/integration/expected_test_results/api_v3_product_read/get-packagings-fr.json @@ -4,6 +4,7 @@ "product" : { "packagings" : [ { + "food_contact" : 0, "material" : { "id" : "en:wood", "lc_name" : "Bois" @@ -19,6 +20,7 @@ } }, { + "food_contact" : 1, "material" : { "id" : "en:glass", "lc_name" : "Verre" @@ -37,6 +39,7 @@ } }, { + "food_contact" : 1, "material" : { "id" : "en:steel", "lc_name" : "Acier" @@ -52,6 +55,7 @@ } }, { + "food_contact" : 0, "material" : { "id" : "en:plastic", "lc_name" : "Plastique" diff --git a/tests/integration/expected_test_results/api_v3_product_read/get-packagings.json b/tests/integration/expected_test_results/api_v3_product_read/get-packagings.json index 5b80869531bf8..341609f9e611a 100644 --- a/tests/integration/expected_test_results/api_v3_product_read/get-packagings.json +++ b/tests/integration/expected_test_results/api_v3_product_read/get-packagings.json @@ -4,6 +4,7 @@ "product" : { "packagings" : [ { + "food_contact" : 0, "material" : { "id" : "en:wood" }, @@ -16,6 +17,7 @@ } }, { + "food_contact" : 1, "material" : { "id" : "en:glass" }, @@ -31,6 +33,7 @@ } }, { + "food_contact" : 1, "material" : { "id" : "en:steel" }, @@ -43,6 +46,7 @@ } }, { + "food_contact" : 0, "material" : { "id" : "en:plastic" }, diff --git a/tests/integration/expected_test_results/api_v3_product_write/patch-auth-good-password.json b/tests/integration/expected_test_results/api_v3_product_write/patch-auth-good-password.json index 5c21dfcdba740..07b3d00f836f6 100644 --- a/tests/integration/expected_test_results/api_v3_product_write/patch-auth-good-password.json +++ b/tests/integration/expected_test_results/api_v3_product_write/patch-auth-good-password.json @@ -8,6 +8,7 @@ ], "packagings" : [ { + "food_contact" : 1, "number_of_units" : 1, "recycling" : { "id" : "en:recycle", diff --git a/tests/integration/expected_test_results/api_v3_product_write/patch-packagings-add-components-to-existing-product.json b/tests/integration/expected_test_results/api_v3_product_write/patch-packagings-add-components-to-existing-product.json index aca76c7013a1b..ce9b9df014dd0 100644 --- a/tests/integration/expected_test_results/api_v3_product_write/patch-packagings-add-components-to-existing-product.json +++ b/tests/integration/expected_test_results/api_v3_product_write/patch-packagings-add-components-to-existing-product.json @@ -4,6 +4,7 @@ "product" : { "packagings" : [ { + "food_contact" : 1, "material" : { "id" : "en:plastic", "lc_name" : "Plastic" @@ -19,6 +20,7 @@ } }, { + "food_contact" : 0, "material" : { "id" : "en:cardboard", "lc_name" : "Cardboard" diff --git a/tests/integration/expected_test_results/api_v3_product_write/patch-packagings-add-one-component.json b/tests/integration/expected_test_results/api_v3_product_write/patch-packagings-add-one-component.json index 5ea1686363faa..c05e1417d34f0 100644 --- a/tests/integration/expected_test_results/api_v3_product_write/patch-packagings-add-one-component.json +++ b/tests/integration/expected_test_results/api_v3_product_write/patch-packagings-add-one-component.json @@ -4,6 +4,7 @@ "product" : { "packagings" : [ { + "food_contact" : 1, "shape" : { "id" : "en:bottle", "lc_name" : "Bottle" diff --git a/tests/integration/expected_test_results/api_v3_product_write/patch-packagings-complete-0.json b/tests/integration/expected_test_results/api_v3_product_write/patch-packagings-complete-0.json index 076905303d149..8f63e5f1a582d 100644 --- a/tests/integration/expected_test_results/api_v3_product_write/patch-packagings-complete-0.json +++ b/tests/integration/expected_test_results/api_v3_product_write/patch-packagings-complete-0.json @@ -4,6 +4,7 @@ "product" : { "packagings" : [ { + "food_contact" : 1, "number_of_units" : 1, "recycling" : { "id" : "en:recycle", diff --git a/tests/integration/expected_test_results/api_v3_product_write/patch-packagings-complete-1.json b/tests/integration/expected_test_results/api_v3_product_write/patch-packagings-complete-1.json index 401122b8327af..8027f7f3f4572 100644 --- a/tests/integration/expected_test_results/api_v3_product_write/patch-packagings-complete-1.json +++ b/tests/integration/expected_test_results/api_v3_product_write/patch-packagings-complete-1.json @@ -4,6 +4,7 @@ "product" : { "packagings" : [ { + "food_contact" : 1, "number_of_units" : 1, "recycling" : { "id" : "en:recycle", @@ -15,6 +16,7 @@ } }, { + "food_contact" : 1, "number_of_units" : 1, "recycling" : { "id" : "en:recycle", diff --git a/tests/integration/expected_test_results/api_v3_product_write/patch-packagings-complete-2.json b/tests/integration/expected_test_results/api_v3_product_write/patch-packagings-complete-2.json index 34409847fca07..f91b577679eef 100644 --- a/tests/integration/expected_test_results/api_v3_product_write/patch-packagings-complete-2.json +++ b/tests/integration/expected_test_results/api_v3_product_write/patch-packagings-complete-2.json @@ -20,6 +20,7 @@ "product" : { "packagings" : [ { + "food_contact" : 1, "number_of_units" : 1, "recycling" : { "id" : "en:recycle", @@ -31,6 +32,7 @@ } }, { + "food_contact" : 1, "number_of_units" : 1, "recycling" : { "id" : "en:recycle", diff --git a/tests/integration/expected_test_results/api_v3_product_write/patch-packagings-fr-fields.json b/tests/integration/expected_test_results/api_v3_product_write/patch-packagings-fr-fields.json index 97efcb3018e28..4a4e8c3244e03 100644 --- a/tests/integration/expected_test_results/api_v3_product_write/patch-packagings-fr-fields.json +++ b/tests/integration/expected_test_results/api_v3_product_write/patch-packagings-fr-fields.json @@ -25,6 +25,7 @@ ], "packagings" : [ { + "food_contact" : 1, "material" : { "id" : "en:plastic", "lc_name" : "Plastique" @@ -40,6 +41,7 @@ } }, { + "food_contact" : 0, "material" : { "id" : "en:cardboard", "lc_name" : "Carton" @@ -55,6 +57,7 @@ } }, { + "food_contact" : 1, "material" : { "id" : "en:plastic", "lc_name" : "Plastique" @@ -66,6 +69,7 @@ } }, { + "food_contact" : 1, "material" : { "id" : "en:glass", "lc_name" : "Verre" diff --git a/tests/integration/expected_test_results/api_v3_product_write/patch-packagings-quantity-and-weight.json b/tests/integration/expected_test_results/api_v3_product_write/patch-packagings-quantity-and-weight.json index 61afb19b60a07..d5f010a1ff33a 100644 --- a/tests/integration/expected_test_results/api_v3_product_write/patch-packagings-quantity-and-weight.json +++ b/tests/integration/expected_test_results/api_v3_product_write/patch-packagings-quantity-and-weight.json @@ -28,6 +28,7 @@ ], "packagings" : [ { + "food_contact" : 1, "material" : { "id" : "en:pet-1-polyethylene-terephthalate", "lc_name" : "PET 1 - Polyethylene terephthalate" @@ -43,6 +44,7 @@ "weight_measured" : 10 }, { + "food_contact" : 0, "material" : { "id" : "en:wood", "lc_name" : "Wood" diff --git a/tests/integration/expected_test_results/api_v3_product_write/patch-packagings-weights-as-strings-with-units.json b/tests/integration/expected_test_results/api_v3_product_write/patch-packagings-weights-as-strings-with-units.json index 6692649b0a12a..1ca9168e20fdd 100644 --- a/tests/integration/expected_test_results/api_v3_product_write/patch-packagings-weights-as-strings-with-units.json +++ b/tests/integration/expected_test_results/api_v3_product_write/patch-packagings-weights-as-strings-with-units.json @@ -28,6 +28,7 @@ ], "packagings" : [ { + "food_contact" : 1, "material" : { "id" : "en:pet-1-polyethylene-terephthalate", "lc_name" : "PET 1 - Polyethylene terephthalate" @@ -43,6 +44,7 @@ "weight_measured" : 10 }, { + "food_contact" : 0, "material" : { "id" : "en:wood", "lc_name" : "Wood" @@ -55,6 +57,7 @@ "weight_specified" : 25.5 }, { + "food_contact" : 0, "material" : { "id" : "en:plastic", "lc_name" : "Plastic" diff --git a/tests/integration/expected_test_results/api_v3_product_write/patch-packagings-weights-as-strings.json b/tests/integration/expected_test_results/api_v3_product_write/patch-packagings-weights-as-strings.json index 69a77847ba4da..f69911d74fd57 100644 --- a/tests/integration/expected_test_results/api_v3_product_write/patch-packagings-weights-as-strings.json +++ b/tests/integration/expected_test_results/api_v3_product_write/patch-packagings-weights-as-strings.json @@ -28,6 +28,7 @@ ], "packagings" : [ { + "food_contact" : 1, "material" : { "id" : "en:pet-1-polyethylene-terephthalate", "lc_name" : "PET 1 - Polyethylene terephthalate" @@ -43,6 +44,7 @@ "weight_measured" : 10 }, { + "food_contact" : 0, "material" : { "id" : "en:wood", "lc_name" : "Wood" @@ -55,6 +57,7 @@ "weight_specified" : 25.5 }, { + "food_contact" : 0, "material" : { "id" : "en:plastic", "lc_name" : "Plastic" diff --git a/tests/integration/expected_test_results/api_v3_product_write/patch-properties-with-lc-name-fr-and-spanish.json b/tests/integration/expected_test_results/api_v3_product_write/patch-properties-with-lc-name-fr-and-spanish.json index 7a52c8b713d75..17b8cb72b1e83 100644 --- a/tests/integration/expected_test_results/api_v3_product_write/patch-properties-with-lc-name-fr-and-spanish.json +++ b/tests/integration/expected_test_results/api_v3_product_write/patch-properties-with-lc-name-fr-and-spanish.json @@ -4,6 +4,7 @@ "product" : { "packagings" : [ { + "food_contact" : 1, "material" : { "id" : "en:paper", "lc_name" : "Papier" diff --git a/tests/integration/expected_test_results/api_v3_product_write/patch-properties-with-lc-name-fr-and-unrecognized-spanish.json b/tests/integration/expected_test_results/api_v3_product_write/patch-properties-with-lc-name-fr-and-unrecognized-spanish.json index 674d77f28917f..a1961e91dd8de 100644 --- a/tests/integration/expected_test_results/api_v3_product_write/patch-properties-with-lc-name-fr-and-unrecognized-spanish.json +++ b/tests/integration/expected_test_results/api_v3_product_write/patch-properties-with-lc-name-fr-and-unrecognized-spanish.json @@ -4,6 +4,7 @@ "product" : { "packagings" : [ { + "food_contact" : 1, "material" : { "id" : "en:paper", "lc_name" : "Papier" diff --git a/tests/integration/expected_test_results/api_v3_product_write/patch-properties-with-lc-name-fr.json b/tests/integration/expected_test_results/api_v3_product_write/patch-properties-with-lc-name-fr.json index 2375da7f4b56a..38d511e1706c7 100644 --- a/tests/integration/expected_test_results/api_v3_product_write/patch-properties-with-lc-name-fr.json +++ b/tests/integration/expected_test_results/api_v3_product_write/patch-properties-with-lc-name-fr.json @@ -4,6 +4,7 @@ "product" : { "packagings" : [ { + "food_contact" : 1, "material" : { "id" : "en:paper", "lc_name" : "Papier" diff --git a/tests/integration/expected_test_results/api_v3_product_write/patch-properties-with-lc-name.json b/tests/integration/expected_test_results/api_v3_product_write/patch-properties-with-lc-name.json index ce84db1a538d6..5968882dd8ba1 100644 --- a/tests/integration/expected_test_results/api_v3_product_write/patch-properties-with-lc-name.json +++ b/tests/integration/expected_test_results/api_v3_product_write/patch-properties-with-lc-name.json @@ -4,6 +4,7 @@ "product" : { "packagings" : [ { + "food_contact" : 1, "material" : { "id" : "en:pet-1-polyethylene-terephthalate", "lc_name" : "PET 1 - Polyethylene terephthalate" diff --git a/tests/integration/expected_test_results/api_v3_product_write/patch-request-fields-all.json b/tests/integration/expected_test_results/api_v3_product_write/patch-request-fields-all.json index 7f3650a0101ad..c2ab25f69a7cf 100644 --- a/tests/integration/expected_test_results/api_v3_product_write/patch-request-fields-all.json +++ b/tests/integration/expected_test_results/api_v3_product_write/patch-request-fields-all.json @@ -450,6 +450,7 @@ ], "packagings" : [ { + "food_contact" : 1, "material" : { "id" : "en:plastic", "lc_name" : "Plastic" diff --git a/tests/integration/expected_test_results/api_v3_product_write/patch-request-fields-packagings.json b/tests/integration/expected_test_results/api_v3_product_write/patch-request-fields-packagings.json index 14ac9d017c1fe..5dc3c1d15e63d 100644 --- a/tests/integration/expected_test_results/api_v3_product_write/patch-request-fields-packagings.json +++ b/tests/integration/expected_test_results/api_v3_product_write/patch-request-fields-packagings.json @@ -4,6 +4,7 @@ "product" : { "packagings" : [ { + "food_contact" : 1, "material" : { "id" : "en:plastic", "lc_name" : "Plastic" diff --git a/tests/integration/expected_test_results/api_v3_product_write/patch-request-fields-undef.json b/tests/integration/expected_test_results/api_v3_product_write/patch-request-fields-undef.json index 14ac9d017c1fe..5dc3c1d15e63d 100644 --- a/tests/integration/expected_test_results/api_v3_product_write/patch-request-fields-undef.json +++ b/tests/integration/expected_test_results/api_v3_product_write/patch-request-fields-undef.json @@ -4,6 +4,7 @@ "product" : { "packagings" : [ { + "food_contact" : 1, "material" : { "id" : "en:plastic", "lc_name" : "Plastic" diff --git a/tests/integration/expected_test_results/api_v3_product_write/patch-request-fields-updated-attribute-groups-knowledge-panels.json b/tests/integration/expected_test_results/api_v3_product_write/patch-request-fields-updated-attribute-groups-knowledge-panels.json index 78752fc8332d8..562418ed73082 100644 --- a/tests/integration/expected_test_results/api_v3_product_write/patch-request-fields-updated-attribute-groups-knowledge-panels.json +++ b/tests/integration/expected_test_results/api_v3_product_write/patch-request-fields-updated-attribute-groups-knowledge-panels.json @@ -837,7 +837,7 @@ "element_type" : "text", "text_element" : { "evaluation" : "neutral", - "html" : "\n \n \n 1 x \n \n Bag\n \n \n \n (Plastic)\n \n \n
\n \n \n ", + "html" : "\n \n \n 1 x \n \n Bag\n \n \n \n (Plastic)\n \n \n - In contact with food\n \n
\n \n \n ", "icon_alt" : "Unknown", "icon_color_from_evaluation" : true, "icon_url" : "http://static.openfoodfacts.localhost/images/icons/dist/help.svg", @@ -974,6 +974,7 @@ }, "packagings" : [ { + "food_contact" : 1, "material" : { "id" : "en:plastic", "lc_name" : "Plastic" diff --git a/tests/integration/expected_test_results/api_v3_product_write/patch-request-fields-updated.json b/tests/integration/expected_test_results/api_v3_product_write/patch-request-fields-updated.json index 14ac9d017c1fe..5dc3c1d15e63d 100644 --- a/tests/integration/expected_test_results/api_v3_product_write/patch-request-fields-updated.json +++ b/tests/integration/expected_test_results/api_v3_product_write/patch-request-fields-updated.json @@ -4,6 +4,7 @@ "product" : { "packagings" : [ { + "food_contact" : 1, "material" : { "id" : "en:plastic", "lc_name" : "Plastic" diff --git a/tests/integration/expected_test_results/api_v3_product_write/patch-weight-as-number-or-string.json b/tests/integration/expected_test_results/api_v3_product_write/patch-weight-as-number-or-string.json index b7c98eaaafefd..0b2e107517820 100644 --- a/tests/integration/expected_test_results/api_v3_product_write/patch-weight-as-number-or-string.json +++ b/tests/integration/expected_test_results/api_v3_product_write/patch-weight-as-number-or-string.json @@ -28,6 +28,7 @@ ], "packagings" : [ { + "food_contact" : 1, "number_of_units" : 1, "shape" : { "id" : "en:bottle", @@ -36,6 +37,7 @@ "weight_measured" : 0.43 }, { + "food_contact" : 0, "number_of_units" : 2, "shape" : { "id" : "en:box", @@ -44,6 +46,7 @@ "weight_measured" : 0.43 }, { + "food_contact" : 1, "number_of_units" : 3, "shape" : { "id" : "en:lid", diff --git a/tests/integration/expected_test_results/convert_and_import_excel_file/packagings-mousquetaires/products/3250390020806.json b/tests/integration/expected_test_results/convert_and_import_excel_file/packagings-mousquetaires/products/3250390020806.json index d179c90499c76..f1fc0db6a9195 100644 --- a/tests/integration/expected_test_results/convert_and_import_excel_file/packagings-mousquetaires/products/3250390020806.json +++ b/tests/integration/expected_test_results/convert_and_import_excel_file/packagings-mousquetaires/products/3250390020806.json @@ -488,6 +488,7 @@ ], "packagings" : [ { + "food_contact" : 1, "material" : "en:ldpe-4-low-density-polyethylene", "number_of_units" : 1, "shape" : "en:film", diff --git a/tests/integration/expected_test_results/convert_and_import_excel_file/packagings-mousquetaires/products/3250390020998.json b/tests/integration/expected_test_results/convert_and_import_excel_file/packagings-mousquetaires/products/3250390020998.json index e4fb868296a82..511423170b563 100644 --- a/tests/integration/expected_test_results/convert_and_import_excel_file/packagings-mousquetaires/products/3250390020998.json +++ b/tests/integration/expected_test_results/convert_and_import_excel_file/packagings-mousquetaires/products/3250390020998.json @@ -506,18 +506,21 @@ ], "packagings" : [ { + "food_contact" : 1, "material" : "en:aluminium", "number_of_units" : 1, "shape" : "en:tray", "weight_specified" : 8.2 }, { + "food_contact" : 1, "material" : "en:pp-5-polypropylene", "number_of_units" : 1, "shape" : "en:film", "weight_specified" : 2.4 }, { + "food_contact" : 0, "material" : "en:non-corrugated-cardboard", "number_of_units" : 1, "shape" : "en:box", diff --git a/tests/integration/expected_test_results/convert_and_import_excel_file/packagings-mousquetaires/products/3250390021926.json b/tests/integration/expected_test_results/convert_and_import_excel_file/packagings-mousquetaires/products/3250390021926.json index 5014a6e3f7d78..4b148010c4d93 100644 --- a/tests/integration/expected_test_results/convert_and_import_excel_file/packagings-mousquetaires/products/3250390021926.json +++ b/tests/integration/expected_test_results/convert_and_import_excel_file/packagings-mousquetaires/products/3250390021926.json @@ -486,6 +486,7 @@ ], "packagings" : [ { + "food_contact" : 1, "material" : "en:ldpe-4-low-density-polyethylene", "number_of_units" : 1, "shape" : "en:bag", diff --git a/tests/integration/expected_test_results/convert_and_import_excel_file/packagings-mousquetaires/products/3250390024804.json b/tests/integration/expected_test_results/convert_and_import_excel_file/packagings-mousquetaires/products/3250390024804.json index 5f4f2e6931050..2e54e12ad58b6 100644 --- a/tests/integration/expected_test_results/convert_and_import_excel_file/packagings-mousquetaires/products/3250390024804.json +++ b/tests/integration/expected_test_results/convert_and_import_excel_file/packagings-mousquetaires/products/3250390024804.json @@ -514,24 +514,28 @@ ], "packagings" : [ { + "food_contact" : 1, "material" : "en:non-corrugated-cardboard", "number_of_units" : 1, "shape" : "en:tray", "weight_specified" : 13.4 }, { + "food_contact" : 0, "material" : "en:non-corrugated-cardboard", "number_of_units" : 1, "shape" : "en:sleeve", "weight_specified" : 32.3 }, { + "food_contact" : 1, "material" : "en:pet-1-polyethylene-terephthalate", "number_of_units" : 1, "shape" : "en:tray", "weight_specified" : 13.4 }, { + "food_contact" : 0, "material" : "en:pp-5-polypropylene", "number_of_units" : 1, "shape" : "en:bag", diff --git a/tests/integration/expected_test_results/convert_and_import_excel_file/packagings-mousquetaires/products/3250390024842.json b/tests/integration/expected_test_results/convert_and_import_excel_file/packagings-mousquetaires/products/3250390024842.json index adc9c0eb91c3e..f9ded577488f8 100644 --- a/tests/integration/expected_test_results/convert_and_import_excel_file/packagings-mousquetaires/products/3250390024842.json +++ b/tests/integration/expected_test_results/convert_and_import_excel_file/packagings-mousquetaires/products/3250390024842.json @@ -515,24 +515,28 @@ ], "packagings" : [ { + "food_contact" : 1, "material" : "en:pet-1-polyethylene-terephthalate", "number_of_units" : 1, "shape" : "en:tray", "weight_specified" : 24.5 }, { + "food_contact" : 1, "material" : "en:non-corrugated-cardboard", "number_of_units" : 1, "shape" : "en:tray", "weight_specified" : 24.5 }, { + "food_contact" : 0, "material" : "en:non-corrugated-cardboard", "number_of_units" : 1, "shape" : "en:sleeve", "weight_specified" : 54.9 }, { + "food_contact" : 0, "material" : "en:pp-5-polypropylene", "number_of_units" : 1, "shape" : "en:bag", diff --git a/tests/integration/expected_test_results/convert_and_import_excel_file/packagings-mousquetaires/products/3250390024866.json b/tests/integration/expected_test_results/convert_and_import_excel_file/packagings-mousquetaires/products/3250390024866.json index 4a8b3a1d86b30..5b1986972f2d9 100644 --- a/tests/integration/expected_test_results/convert_and_import_excel_file/packagings-mousquetaires/products/3250390024866.json +++ b/tests/integration/expected_test_results/convert_and_import_excel_file/packagings-mousquetaires/products/3250390024866.json @@ -515,24 +515,28 @@ ], "packagings" : [ { + "food_contact" : 1, "material" : "en:non-corrugated-cardboard", "number_of_units" : 1, "shape" : "en:tray", "weight_specified" : 13.4 }, { + "food_contact" : 1, "material" : "en:pet-1-polyethylene-terephthalate", "number_of_units" : 1, "shape" : "en:tray", "weight_specified" : 13.4 }, { + "food_contact" : 0, "material" : "en:non-corrugated-cardboard", "number_of_units" : 1, "shape" : "en:sleeve", "weight_specified" : 32.3 }, { + "food_contact" : 0, "material" : "en:pp-5-polypropylene", "number_of_units" : 1, "shape" : "en:bag", diff --git a/tests/integration/expected_test_results/convert_and_import_excel_file/packagings-mousquetaires/products/3250390025399.json b/tests/integration/expected_test_results/convert_and_import_excel_file/packagings-mousquetaires/products/3250390025399.json index 9437aed98b999..e3aca6788fbd2 100644 --- a/tests/integration/expected_test_results/convert_and_import_excel_file/packagings-mousquetaires/products/3250390025399.json +++ b/tests/integration/expected_test_results/convert_and_import_excel_file/packagings-mousquetaires/products/3250390025399.json @@ -507,18 +507,21 @@ ], "packagings" : [ { + "food_contact" : 1, "material" : "en:pp-5-polypropylene", "number_of_units" : 1, "shape" : "en:film", "weight_specified" : 2.4 }, { + "food_contact" : 1, "material" : "en:aluminium", "number_of_units" : 1, "shape" : "en:tray", "weight_specified" : 8.2 }, { + "food_contact" : 0, "material" : "en:non-corrugated-cardboard", "number_of_units" : 1, "shape" : "en:box", diff --git a/tests/integration/expected_test_results/convert_and_import_excel_file/packagings-mousquetaires/products/3250390025863.json b/tests/integration/expected_test_results/convert_and_import_excel_file/packagings-mousquetaires/products/3250390025863.json index 08902c5a4af75..165f8ba91d237 100644 --- a/tests/integration/expected_test_results/convert_and_import_excel_file/packagings-mousquetaires/products/3250390025863.json +++ b/tests/integration/expected_test_results/convert_and_import_excel_file/packagings-mousquetaires/products/3250390025863.json @@ -485,6 +485,7 @@ ], "packagings" : [ { + "food_contact" : 1, "material" : "en:non-corrugated-cardboard", "number_of_units" : 1, "shape" : "en:box", diff --git a/tests/integration/expected_test_results/convert_and_import_excel_file/packagings-mousquetaires/products/3250390026044.json b/tests/integration/expected_test_results/convert_and_import_excel_file/packagings-mousquetaires/products/3250390026044.json index cd018afd497bd..7450819a75c35 100644 --- a/tests/integration/expected_test_results/convert_and_import_excel_file/packagings-mousquetaires/products/3250390026044.json +++ b/tests/integration/expected_test_results/convert_and_import_excel_file/packagings-mousquetaires/products/3250390026044.json @@ -510,18 +510,21 @@ ], "packagings" : [ { + "food_contact" : 0, "material" : "en:non-corrugated-cardboard", "number_of_units" : 1, "shape" : "en:sleeve", "weight_specified" : 52 }, { + "food_contact" : 1, "material" : "en:ps-6-polystyrene", "number_of_units" : 4, "shape" : "en:pot", "weight_specified" : 4.8 }, { + "food_contact" : 1, "material" : "en:ps-6-polystyrene", "number_of_units" : 4, "shape" : "en:lid-or-cap", diff --git a/tests/integration/expected_test_results/convert_and_import_excel_file/packagings-mousquetaires/products/3250390026754.json b/tests/integration/expected_test_results/convert_and_import_excel_file/packagings-mousquetaires/products/3250390026754.json index b50f0214d6009..334aab01fcc17 100644 --- a/tests/integration/expected_test_results/convert_and_import_excel_file/packagings-mousquetaires/products/3250390026754.json +++ b/tests/integration/expected_test_results/convert_and_import_excel_file/packagings-mousquetaires/products/3250390026754.json @@ -507,18 +507,21 @@ ], "packagings" : [ { + "food_contact" : 0, "material" : "en:pe-7-polyethylene", "number_of_units" : 1, "shape" : "en:bag", "weight_specified" : 9.8 }, { + "food_contact" : 0, "material" : "en:pet-1-polyethylene-terephthalate", "number_of_units" : 1, "shape" : "en:bag", "weight_specified" : 9.8 }, { + "food_contact" : 1, "material" : "en:ps-6-polystyrene", "number_of_units" : 1, "shape" : "en:tray", diff --git a/tests/integration/expected_test_results/convert_and_import_excel_file/test/products/3270190128403.json b/tests/integration/expected_test_results/convert_and_import_excel_file/test/products/3270190128403.json index 6fba1bd308db0..ce18c220adff5 100644 --- a/tests/integration/expected_test_results/convert_and_import_excel_file/test/products/3270190128403.json +++ b/tests/integration/expected_test_results/convert_and_import_excel_file/test/products/3270190128403.json @@ -958,6 +958,7 @@ "packaging_text_fr_imported" : "boite carton à recycler", "packagings" : [ { + "food_contact" : 1, "material" : "en:cardboard", "recycling" : "en:recycle", "shape" : "en:box" diff --git a/tests/integration/expected_test_results/import_csv_file/replace_existing_values/3003004006001.json b/tests/integration/expected_test_results/import_csv_file/replace_existing_values/3003004006001.json index 4c97d4d803fd5..ee08bdbf3b416 100644 --- a/tests/integration/expected_test_results/import_csv_file/replace_existing_values/3003004006001.json +++ b/tests/integration/expected_test_results/import_csv_file/replace_existing_values/3003004006001.json @@ -672,6 +672,7 @@ ], "packagings" : [ { + "food_contact" : 1, "material" : "en:cardboard", "number_of_units" : 1, "quantity_per_unit" : "200g", diff --git a/tests/integration/expected_test_results/import_csv_file/replace_existing_values/3003004006002.json b/tests/integration/expected_test_results/import_csv_file/replace_existing_values/3003004006002.json index 2fb078903a2bc..19adc0fd7ece9 100644 --- a/tests/integration/expected_test_results/import_csv_file/replace_existing_values/3003004006002.json +++ b/tests/integration/expected_test_results/import_csv_file/replace_existing_values/3003004006002.json @@ -486,6 +486,7 @@ ], "packagings" : [ { + "food_contact" : 1, "material" : "en:steel", "number_of_units" : 2, "shape" : "en:food-can", diff --git a/tests/integration/expected_test_results/import_csv_file/replace_existing_values/3003004006003.json b/tests/integration/expected_test_results/import_csv_file/replace_existing_values/3003004006003.json index f0b98b6962c4c..8a0ce9d82d4cf 100644 --- a/tests/integration/expected_test_results/import_csv_file/replace_existing_values/3003004006003.json +++ b/tests/integration/expected_test_results/import_csv_file/replace_existing_values/3003004006003.json @@ -310,7 +310,7 @@ "non_recyclable_and_non_biodegradable" : "no", "quantity_per_unit" : "1l", "quantity_per_unit_unit" : "l", - "quantity_per_unit_value" : 1, + "quantity_per_unit_value" : "1", "shape" : "en:bottle", "weight_specified" : 42.3 } @@ -481,6 +481,7 @@ ], "packagings" : [ { + "food_contact" : 1, "material" : "en:rpet-recycled-polyethylene-terephthalate", "quantity_per_unit" : "1l", "quantity_per_unit_unit" : "l", @@ -519,7 +520,7 @@ "product_name_fr_imported" : "Packagings fr g", "product_type" : "food", "removed_countries_tags" : [], - "rev" : 1, + "rev" : 2, "sources" : [ { "fields" : [ @@ -533,6 +534,15 @@ "manufacturer" : null, "name" : null, "url" : null + }, + { + "fields" : [], + "id" : null, + "images" : [], + "import_t" : "--ignore--", + "manufacturer" : null, + "name" : null, + "url" : null } ], "states" : "en:to-be-completed, en:nutrition-facts-to-be-completed, en:ingredients-to-be-completed, en:expiration-date-to-be-completed, en:packaging-code-to-be-completed, en:characteristics-to-be-completed, en:origins-to-be-completed, en:categories-to-be-completed, en:brands-to-be-completed, en:packaging-to-be-completed, en:quantity-to-be-completed, en:product-name-completed, en:photos-to-be-uploaded", diff --git a/tests/integration/expected_test_results/import_csv_file/replace_existing_values/3003004006004.json b/tests/integration/expected_test_results/import_csv_file/replace_existing_values/3003004006004.json index 5557c591a4b28..39ec31461d390 100644 --- a/tests/integration/expected_test_results/import_csv_file/replace_existing_values/3003004006004.json +++ b/tests/integration/expected_test_results/import_csv_file/replace_existing_values/3003004006004.json @@ -696,6 +696,7 @@ ], "packagings" : [ { + "food_contact" : 1, "material" : "en:pot", "quantity_per_unit" : "glass", "shape" : "en:1", diff --git a/tests/integration/expected_test_results/import_csv_file/replace_existing_values/3003004006005.json b/tests/integration/expected_test_results/import_csv_file/replace_existing_values/3003004006005.json index 2681425bc52a3..28f9137604b5b 100644 --- a/tests/integration/expected_test_results/import_csv_file/replace_existing_values/3003004006005.json +++ b/tests/integration/expected_test_results/import_csv_file/replace_existing_values/3003004006005.json @@ -498,6 +498,7 @@ ], "packagings" : [ { + "food_contact" : 1, "material" : "en:glass", "number_of_units" : 1, "quantity_per_unit" : "15ml", @@ -508,6 +509,7 @@ "weight_specified" : 55.2 }, { + "food_contact" : 1, "material" : "en:pet-1-polyethylene-terephthalate", "number_of_units" : 1, "shape" : "en:lid", diff --git a/tests/integration/expected_test_results/import_csv_file/replace_existing_values/3003004006006.json b/tests/integration/expected_test_results/import_csv_file/replace_existing_values/3003004006006.json index 903ac4b628b95..a36096e979493 100644 --- a/tests/integration/expected_test_results/import_csv_file/replace_existing_values/3003004006006.json +++ b/tests/integration/expected_test_results/import_csv_file/replace_existing_values/3003004006006.json @@ -490,6 +490,7 @@ ], "packagings" : [ { + "food_contact" : 1, "material" : "en:glass", "quantity_per_unit" : "15ml", "quantity_per_unit_unit" : "ml", @@ -497,6 +498,7 @@ "shape" : "en:pot" }, { + "food_contact" : 1, "number_of_units" : 1, "shape" : "en:lid", "weight_specified" : 3.3 diff --git a/tests/integration/expected_test_results/import_csv_file/replace_existing_values/3003004006007.json b/tests/integration/expected_test_results/import_csv_file/replace_existing_values/3003004006007.json index 0a9c1c5fb6eb3..f512ee272948e 100644 --- a/tests/integration/expected_test_results/import_csv_file/replace_existing_values/3003004006007.json +++ b/tests/integration/expected_test_results/import_csv_file/replace_existing_values/3003004006007.json @@ -313,7 +313,7 @@ "material" : "en:pet-1-polyethylene-terephthalate", "material_shape" : "en:pet-1-polyethylene-terephthalate.en:bottle", "non_recyclable_and_non_biodegradable" : "no", - "number_of_units" : 1, + "number_of_units" : "1", "shape" : "en:bottle", "weight_measured" : 24.5 } @@ -484,10 +484,12 @@ ], "packagings" : [ { + "food_contact" : 1, "material" : "en:plastic", "shape" : "en:bottle" }, { + "food_contact" : 1, "material" : "en:pet-1-polyethylene-terephthalate", "number_of_units" : 1, "shape" : "en:bottle", @@ -523,7 +525,7 @@ "product_name_fr_imported" : "Packagings en - several components of the same type", "product_type" : "food", "removed_countries_tags" : [], - "rev" : 1, + "rev" : 2, "sources" : [ { "fields" : [ @@ -537,6 +539,15 @@ "manufacturer" : null, "name" : null, "url" : null + }, + { + "fields" : [], + "id" : null, + "images" : [], + "import_t" : "--ignore--", + "manufacturer" : null, + "name" : null, + "url" : null } ], "states" : "en:empty, en:to-be-completed, en:nutrition-facts-to-be-completed, en:ingredients-to-be-completed, en:expiration-date-to-be-completed, en:packaging-code-to-be-completed, en:characteristics-to-be-completed, en:origins-to-be-completed, en:categories-to-be-completed, en:brands-to-be-completed, en:packaging-to-be-completed, en:quantity-to-be-completed, en:product-name-to-be-completed, en:photos-to-be-uploaded", diff --git a/tests/integration/expected_test_results/import_csv_file/replace_existing_values/stats.json b/tests/integration/expected_test_results/import_csv_file/replace_existing_values/stats.json index 02074edd3feec..927d192c88c52 100644 --- a/tests/integration/expected_test_results/import_csv_file/replace_existing_values/stats.json +++ b/tests/integration/expected_test_results/import_csv_file/replace_existing_values/stats.json @@ -26,9 +26,11 @@ "products_data_updated" : { "3003004006001" : 1, "3003004006002" : 1, + "3003004006003" : 1, "3003004006004" : 1, "3003004006005" : 1, - "3003004006006" : 1 + "3003004006006" : 1, + "3003004006007" : 1 }, "products_images_added" : {}, "products_imported_field_allergens_updated" : { @@ -111,17 +113,31 @@ }, "products_nutrition_updated" : {}, "products_packagings_changed" : { - "3003004006004" : 1 + "3003004006001" : 1, + "3003004006002" : 1, + "3003004006003" : 1, + "3003004006004" : 1, + "3003004006005" : 1, + "3003004006006" : 1, + "3003004006007" : 1 }, "products_packagings_updated" : { - "3003004006004" : 1 + "3003004006001" : 1, + "3003004006002" : 1, + "3003004006003" : 1, + "3003004006004" : 1, + "3003004006005" : 1, + "3003004006006" : 1, + "3003004006007" : 1 }, "products_updated" : { "3003004006001" : 1, "3003004006002" : 1, + "3003004006003" : 1, "3003004006004" : 1, "3003004006005" : 1, - "3003004006006" : 1 + "3003004006006" : 1, + "3003004006007" : 1 }, "products_with_data" : { "3003004006001" : 1, diff --git a/tests/integration/expected_test_results/import_csv_file/test/2003004006001.json b/tests/integration/expected_test_results/import_csv_file/test/2003004006001.json index 9905e600ceeea..5c9ce07eb7928 100644 --- a/tests/integration/expected_test_results/import_csv_file/test/2003004006001.json +++ b/tests/integration/expected_test_results/import_csv_file/test/2003004006001.json @@ -666,6 +666,7 @@ ], "packagings" : [ { + "food_contact" : 1, "material" : "en:cardboard", "number_of_units" : 1, "quantity_per_unit" : "200g", diff --git a/tests/integration/expected_test_results/import_csv_file/test/2003004006002.json b/tests/integration/expected_test_results/import_csv_file/test/2003004006002.json index 138dab92c8324..289f7a5136feb 100644 --- a/tests/integration/expected_test_results/import_csv_file/test/2003004006002.json +++ b/tests/integration/expected_test_results/import_csv_file/test/2003004006002.json @@ -478,6 +478,7 @@ ], "packagings" : [ { + "food_contact" : 1, "material" : "en:steel", "number_of_units" : 2, "shape" : "en:food-can", diff --git a/tests/integration/expected_test_results/import_csv_file/test/2003004006003.json b/tests/integration/expected_test_results/import_csv_file/test/2003004006003.json index 66a3669f9702e..358f321402ba4 100644 --- a/tests/integration/expected_test_results/import_csv_file/test/2003004006003.json +++ b/tests/integration/expected_test_results/import_csv_file/test/2003004006003.json @@ -481,6 +481,7 @@ ], "packagings" : [ { + "food_contact" : 1, "material" : "en:rpet-recycled-polyethylene-terephthalate", "quantity_per_unit" : "1l", "quantity_per_unit_unit" : "l", diff --git a/tests/integration/expected_test_results/import_csv_file/test/2003004006004.json b/tests/integration/expected_test_results/import_csv_file/test/2003004006004.json index ad887da88a259..4627f21ab74ad 100644 --- a/tests/integration/expected_test_results/import_csv_file/test/2003004006004.json +++ b/tests/integration/expected_test_results/import_csv_file/test/2003004006004.json @@ -659,6 +659,7 @@ ], "packagings" : [ { + "food_contact" : 1, "material" : "en:glass", "number_of_units" : 1, "quantity_per_unit" : "15ml", diff --git a/tests/integration/expected_test_results/import_csv_file/test/2003004006005.json b/tests/integration/expected_test_results/import_csv_file/test/2003004006005.json index dd78d0e5a5b7d..c3f72a838e082 100644 --- a/tests/integration/expected_test_results/import_csv_file/test/2003004006005.json +++ b/tests/integration/expected_test_results/import_csv_file/test/2003004006005.json @@ -490,6 +490,7 @@ ], "packagings" : [ { + "food_contact" : 1, "material" : "en:glass", "number_of_units" : 1, "quantity_per_unit" : "15ml", @@ -500,6 +501,7 @@ "weight_specified" : 55.2 }, { + "food_contact" : 1, "material" : "en:pet-1-polyethylene-terephthalate", "number_of_units" : 1, "shape" : "en:lid", diff --git a/tests/integration/expected_test_results/import_csv_file/test/2003004006006.json b/tests/integration/expected_test_results/import_csv_file/test/2003004006006.json index 5fb55783b18d4..d8baec70cf60c 100644 --- a/tests/integration/expected_test_results/import_csv_file/test/2003004006006.json +++ b/tests/integration/expected_test_results/import_csv_file/test/2003004006006.json @@ -488,6 +488,7 @@ ], "packagings" : [ { + "food_contact" : 1, "material" : "en:glass", "quantity_per_unit" : "15ml", "quantity_per_unit_unit" : "ml", @@ -495,6 +496,7 @@ "shape" : "en:pot" }, { + "food_contact" : 1, "number_of_units" : 1, "shape" : "en:lid", "weight_specified" : 3.3 diff --git a/tests/integration/expected_test_results/import_csv_file/test/2003004006007.json b/tests/integration/expected_test_results/import_csv_file/test/2003004006007.json index 90b60e7896606..07e461b5d5f8c 100644 --- a/tests/integration/expected_test_results/import_csv_file/test/2003004006007.json +++ b/tests/integration/expected_test_results/import_csv_file/test/2003004006007.json @@ -484,10 +484,12 @@ ], "packagings" : [ { + "food_contact" : 1, "material" : "en:plastic", "shape" : "en:bottle" }, { + "food_contact" : 1, "material" : "en:pet-1-polyethylene-terephthalate", "number_of_units" : 1, "shape" : "en:bottle", diff --git a/tests/integration/expected_test_results/product_read/get-existing-product.html b/tests/integration/expected_test_results/product_read/get-existing-product.html index 53aad2c3f375c..bb567da894f18 100644 --- a/tests/integration/expected_test_results/product_read/get-existing-product.html +++ b/tests/integration/expected_test_results/product_read/get-existing-product.html @@ -4255,6 +4255,8 @@

Packaging

(Steel) + - In contact with food +
@@ -4345,6 +4347,8 @@

Packaging

(Glass) + - In contact with food +
diff --git a/tests/integration/expected_test_results/protected_product/get-edited-protected-product-api-v2-moderator.json b/tests/integration/expected_test_results/protected_product/get-edited-protected-product-api-v2-moderator.json index 0c6c6ffe0ab91..22c8393d1b32e 100644 --- a/tests/integration/expected_test_results/protected_product/get-edited-protected-product-api-v2-moderator.json +++ b/tests/integration/expected_test_results/protected_product/get-edited-protected-product-api-v2-moderator.json @@ -325,6 +325,7 @@ { "environmental_score_material_score" : 50, "environmental_score_shape_ratio" : 1, + "food_contact" : 0, "material" : "en:wood", "number_of_units" : 1, "recycling" : "en:recycle", @@ -333,6 +334,7 @@ { "environmental_score_material_score" : 81, "environmental_score_shape_ratio" : 1, + "food_contact" : 1, "material" : "en:glass", "number_of_units" : 6, "quantity_per_unit" : "25cl", @@ -344,6 +346,7 @@ { "environmental_score_material_score" : 76, "environmental_score_shape_ratio" : 0.2, + "food_contact" : 1, "material" : "en:steel", "number_of_units" : 3, "recycling" : "en:recycle", @@ -352,6 +355,7 @@ { "environmental_score_material_score" : 0, "environmental_score_shape_ratio" : 0.1, + "food_contact" : 0, "material" : "en:plastic", "non_recyclable_and_non_biodegradable" : "maybe", "number_of_units" : 1, @@ -812,12 +816,14 @@ "packaging_text_en" : "1 wooden box to recycle, 6 25cl glass bottles to reuse, 3 steel lids to recycle, 1 plastic film to discard", "packagings" : [ { + "food_contact" : 0, "material" : "en:wood", "number_of_units" : 1, "recycling" : "en:recycle", "shape" : "en:box" }, { + "food_contact" : 1, "material" : "en:glass", "number_of_units" : 6, "quantity_per_unit" : "25cl", @@ -827,12 +833,14 @@ "shape" : "en:bottle" }, { + "food_contact" : 1, "material" : "en:steel", "number_of_units" : 3, "recycling" : "en:recycle", "shape" : "en:lid" }, { + "food_contact" : 0, "material" : "en:plastic", "number_of_units" : 1, "recycling" : "en:discard", diff --git a/tests/integration/expected_test_results/protected_product/get-edited-protected-product-api-v2.json b/tests/integration/expected_test_results/protected_product/get-edited-protected-product-api-v2.json index 243ccf077c616..7b802658c4b35 100644 --- a/tests/integration/expected_test_results/protected_product/get-edited-protected-product-api-v2.json +++ b/tests/integration/expected_test_results/protected_product/get-edited-protected-product-api-v2.json @@ -326,6 +326,7 @@ { "environmental_score_material_score" : 50, "environmental_score_shape_ratio" : 1, + "food_contact" : 0, "material" : "en:wood", "number_of_units" : 1, "recycling" : "en:recycle", @@ -334,6 +335,7 @@ { "environmental_score_material_score" : 81, "environmental_score_shape_ratio" : 1, + "food_contact" : 1, "material" : "en:glass", "number_of_units" : 6, "quantity_per_unit" : "25cl", @@ -345,6 +347,7 @@ { "environmental_score_material_score" : 76, "environmental_score_shape_ratio" : 0.2, + "food_contact" : 1, "material" : "en:steel", "number_of_units" : 3, "recycling" : "en:recycle", @@ -353,6 +356,7 @@ { "environmental_score_material_score" : 0, "environmental_score_shape_ratio" : 0.1, + "food_contact" : 0, "material" : "en:plastic", "non_recyclable_and_non_biodegradable" : "maybe", "number_of_units" : 1, @@ -813,12 +817,14 @@ "packaging_text_en" : "1 wooden box to recycle, 6 25cl glass bottles to reuse, 3 steel lids to recycle, 1 plastic film to discard", "packagings" : [ { + "food_contact" : 0, "material" : "en:wood", "number_of_units" : 1, "recycling" : "en:recycle", "shape" : "en:box" }, { + "food_contact" : 1, "material" : "en:glass", "number_of_units" : 6, "quantity_per_unit" : "25cl", @@ -828,12 +834,14 @@ "shape" : "en:bottle" }, { + "food_contact" : 1, "material" : "en:steel", "number_of_units" : 3, "recycling" : "en:recycle", "shape" : "en:lid" }, { + "food_contact" : 0, "material" : "en:plastic", "number_of_units" : 1, "recycling" : "en:discard", diff --git a/tests/integration/expected_test_results/protected_product/get-edited-protected-product-web-form-moderator.json b/tests/integration/expected_test_results/protected_product/get-edited-protected-product-web-form-moderator.json index 59b1a98281204..c97d618f316b1 100644 --- a/tests/integration/expected_test_results/protected_product/get-edited-protected-product-web-form-moderator.json +++ b/tests/integration/expected_test_results/protected_product/get-edited-protected-product-web-form-moderator.json @@ -329,6 +329,7 @@ { "environmental_score_material_score" : 50, "environmental_score_shape_ratio" : 1, + "food_contact" : 0, "material" : "en:wood", "number_of_units" : 1, "recycling" : "en:recycle", @@ -337,6 +338,7 @@ { "environmental_score_material_score" : 81, "environmental_score_shape_ratio" : 1, + "food_contact" : 1, "material" : "en:glass", "number_of_units" : 6, "quantity_per_unit" : "25cl", @@ -348,6 +350,7 @@ { "environmental_score_material_score" : 76, "environmental_score_shape_ratio" : 0.2, + "food_contact" : 1, "material" : "en:steel", "number_of_units" : 3, "recycling" : "en:recycle", @@ -356,6 +359,7 @@ { "environmental_score_material_score" : 0, "environmental_score_shape_ratio" : 0.1, + "food_contact" : 0, "material" : "en:plastic", "non_recyclable_and_non_biodegradable" : "maybe", "number_of_units" : 1, @@ -816,12 +820,14 @@ "packaging_text_en" : "1 wooden box to recycle, 6 25cl glass bottles to reuse, 3 steel lids to recycle, 1 plastic film to discard", "packagings" : [ { + "food_contact" : 0, "material" : "en:wood", "number_of_units" : 1, "recycling" : "en:recycle", "shape" : "en:box" }, { + "food_contact" : 1, "material" : "en:glass", "number_of_units" : 6, "quantity_per_unit" : "25cl", @@ -831,12 +837,14 @@ "shape" : "en:bottle" }, { + "food_contact" : 1, "material" : "en:steel", "number_of_units" : 3, "recycling" : "en:recycle", "shape" : "en:lid" }, { + "food_contact" : 0, "material" : "en:plastic", "number_of_units" : 1, "recycling" : "en:discard", diff --git a/tests/integration/expected_test_results/protected_product/get-edited-protected-product-web-form.json b/tests/integration/expected_test_results/protected_product/get-edited-protected-product-web-form.json index e64c333e1d3e8..842b4f7d45d33 100644 --- a/tests/integration/expected_test_results/protected_product/get-edited-protected-product-web-form.json +++ b/tests/integration/expected_test_results/protected_product/get-edited-protected-product-web-form.json @@ -330,6 +330,7 @@ { "environmental_score_material_score" : 50, "environmental_score_shape_ratio" : 1, + "food_contact" : 0, "material" : "en:wood", "number_of_units" : 1, "recycling" : "en:recycle", @@ -338,6 +339,7 @@ { "environmental_score_material_score" : 81, "environmental_score_shape_ratio" : 1, + "food_contact" : 1, "material" : "en:glass", "number_of_units" : 6, "quantity_per_unit" : "25cl", @@ -349,6 +351,7 @@ { "environmental_score_material_score" : 76, "environmental_score_shape_ratio" : 0.2, + "food_contact" : 1, "material" : "en:steel", "number_of_units" : 3, "recycling" : "en:recycle", @@ -357,6 +360,7 @@ { "environmental_score_material_score" : 0, "environmental_score_shape_ratio" : 0.1, + "food_contact" : 0, "material" : "en:plastic", "non_recyclable_and_non_biodegradable" : "maybe", "number_of_units" : 1, @@ -817,12 +821,14 @@ "packaging_text_en" : "1 wooden box to recycle, 6 25cl glass bottles to reuse, 3 steel lids to recycle, 1 plastic film to discard", "packagings" : [ { + "food_contact" : 0, "material" : "en:wood", "number_of_units" : 1, "recycling" : "en:recycle", "shape" : "en:box" }, { + "food_contact" : 1, "material" : "en:glass", "number_of_units" : 6, "quantity_per_unit" : "25cl", @@ -832,12 +838,14 @@ "shape" : "en:bottle" }, { + "food_contact" : 1, "material" : "en:steel", "number_of_units" : 3, "recycling" : "en:recycle", "shape" : "en:lid" }, { + "food_contact" : 0, "material" : "en:plastic", "number_of_units" : 1, "recycling" : "en:discard", diff --git a/tests/integration/expected_test_results/protected_product/get-edited-unprotected-product-api-v2.json b/tests/integration/expected_test_results/protected_product/get-edited-unprotected-product-api-v2.json index da0a34e74cc49..8a0d5e1d28d23 100644 --- a/tests/integration/expected_test_results/protected_product/get-edited-unprotected-product-api-v2.json +++ b/tests/integration/expected_test_results/protected_product/get-edited-unprotected-product-api-v2.json @@ -325,6 +325,7 @@ { "environmental_score_material_score" : 50, "environmental_score_shape_ratio" : 1, + "food_contact" : 0, "material" : "en:wood", "number_of_units" : 1, "recycling" : "en:recycle", @@ -333,6 +334,7 @@ { "environmental_score_material_score" : 81, "environmental_score_shape_ratio" : 1, + "food_contact" : 1, "material" : "en:glass", "number_of_units" : 6, "quantity_per_unit" : "25cl", @@ -344,6 +346,7 @@ { "environmental_score_material_score" : 76, "environmental_score_shape_ratio" : 0.2, + "food_contact" : 1, "material" : "en:steel", "number_of_units" : 3, "recycling" : "en:recycle", @@ -352,6 +355,7 @@ { "environmental_score_material_score" : 0, "environmental_score_shape_ratio" : 0.1, + "food_contact" : 0, "material" : "en:plastic", "non_recyclable_and_non_biodegradable" : "maybe", "number_of_units" : 1, @@ -810,12 +814,14 @@ "packaging_text_en" : "1 wooden box to recycle, 6 25cl glass bottles to reuse, 3 steel lids to recycle, 1 plastic film to discard", "packagings" : [ { + "food_contact" : 0, "material" : "en:wood", "number_of_units" : 1, "recycling" : "en:recycle", "shape" : "en:box" }, { + "food_contact" : 1, "material" : "en:glass", "number_of_units" : 6, "quantity_per_unit" : "25cl", @@ -825,12 +831,14 @@ "shape" : "en:bottle" }, { + "food_contact" : 1, "material" : "en:steel", "number_of_units" : 3, "recycling" : "en:recycle", "shape" : "en:lid" }, { + "food_contact" : 0, "material" : "en:plastic", "number_of_units" : 1, "recycling" : "en:discard", diff --git a/tests/integration/expected_test_results/protected_product/get-edited-unprotected-product-web-form.json b/tests/integration/expected_test_results/protected_product/get-edited-unprotected-product-web-form.json index 16fd01e8c3bf6..ebf47796ead49 100644 --- a/tests/integration/expected_test_results/protected_product/get-edited-unprotected-product-web-form.json +++ b/tests/integration/expected_test_results/protected_product/get-edited-unprotected-product-web-form.json @@ -329,6 +329,7 @@ { "environmental_score_material_score" : 50, "environmental_score_shape_ratio" : 1, + "food_contact" : 0, "material" : "en:wood", "number_of_units" : 1, "recycling" : "en:recycle", @@ -337,6 +338,7 @@ { "environmental_score_material_score" : 81, "environmental_score_shape_ratio" : 1, + "food_contact" : 1, "material" : "en:glass", "number_of_units" : 6, "quantity_per_unit" : "25cl", @@ -348,6 +350,7 @@ { "environmental_score_material_score" : 76, "environmental_score_shape_ratio" : 0.2, + "food_contact" : 1, "material" : "en:steel", "number_of_units" : 3, "recycling" : "en:recycle", @@ -356,6 +359,7 @@ { "environmental_score_material_score" : 0, "environmental_score_shape_ratio" : 0.1, + "food_contact" : 0, "material" : "en:plastic", "non_recyclable_and_non_biodegradable" : "maybe", "number_of_units" : 1, @@ -814,12 +818,14 @@ "packaging_text_en" : "1 wooden box to recycle, 6 25cl glass bottles to reuse, 3 steel lids to recycle, 1 plastic film to discard", "packagings" : [ { + "food_contact" : 0, "material" : "en:wood", "number_of_units" : 1, "recycling" : "en:recycle", "shape" : "en:box" }, { + "food_contact" : 1, "material" : "en:glass", "number_of_units" : 6, "quantity_per_unit" : "25cl", @@ -829,12 +835,14 @@ "shape" : "en:bottle" }, { + "food_contact" : 1, "material" : "en:steel", "number_of_units" : 3, "recycling" : "en:recycle", "shape" : "en:lid" }, { + "food_contact" : 0, "material" : "en:plastic", "number_of_units" : 1, "recycling" : "en:discard", diff --git a/tests/integration/expected_test_results/search_v1/search-fields-packagings-in-api-v3-format.json b/tests/integration/expected_test_results/search_v1/search-fields-packagings-in-api-v3-format.json index 414470b480ad3..9e26754a3f481 100644 --- a/tests/integration/expected_test_results/search_v1/search-fields-packagings-in-api-v3-format.json +++ b/tests/integration/expected_test_results/search_v1/search-fields-packagings-in-api-v3-format.json @@ -9,6 +9,7 @@ "packaging_text_en" : "1 25cl glass bottle, 1 steel lid, 1 plastic wrap", "packagings" : [ { + "food_contact" : 1, "material" : { "id" : "en:glass" }, @@ -24,6 +25,7 @@ } }, { + "food_contact" : 1, "material" : { "id" : "en:steel" }, @@ -33,6 +35,7 @@ } }, { + "food_contact" : 0, "material" : { "id" : "en:plastic" }, diff --git a/tests/integration/expected_test_results/search_v1/search-fields-packagings.json b/tests/integration/expected_test_results/search_v1/search-fields-packagings.json index 9eb4e9aa8226a..aac54df161db1 100644 --- a/tests/integration/expected_test_results/search_v1/search-fields-packagings.json +++ b/tests/integration/expected_test_results/search_v1/search-fields-packagings.json @@ -9,6 +9,7 @@ "packaging_text_en" : "1 25cl glass bottle, 1 steel lid, 1 plastic wrap", "packagings" : [ { + "food_contact" : 1, "material" : "en:glass", "number_of_units" : 1, "quantity_per_unit" : "25cl", @@ -18,11 +19,13 @@ "shape" : "en:bottle" }, { + "food_contact" : 1, "material" : "en:steel", "number_of_units" : 1, "shape" : "en:lid" }, { + "food_contact" : 0, "material" : "en:plastic", "number_of_units" : 1, "shape" : "en:film" diff --git a/tests/integration/expected_test_results/search_v1/search-no-filter.json b/tests/integration/expected_test_results/search_v1/search-no-filter.json index 8b2b2a4ede1c3..638c4e5c444b0 100644 --- a/tests/integration/expected_test_results/search_v1/search-no-filter.json +++ b/tests/integration/expected_test_results/search_v1/search-no-filter.json @@ -884,6 +884,7 @@ "packaging_text_en" : "1 25cl glass bottle, 1 steel lid, 1 plastic wrap", "packagings" : [ { + "food_contact" : 1, "material" : "en:glass", "number_of_units" : 1, "quantity_per_unit" : "25cl", @@ -893,11 +894,13 @@ "shape" : "en:bottle" }, { + "food_contact" : 1, "material" : "en:steel", "number_of_units" : 1, "shape" : "en:lid" }, { + "food_contact" : 0, "material" : "en:plastic", "number_of_units" : 1, "shape" : "en:film" From f2b64ba49e7a08c0e7bf91389132ccaebe197c97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Gigandet?= Date: Fri, 7 Feb 2025 16:17:45 +0100 Subject: [PATCH 6/6] store food contact info --- lib/ProductOpener/Display.pm | 6 ++---- lib/ProductOpener/FoodProducts.pm | 4 ++++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/ProductOpener/Display.pm b/lib/ProductOpener/Display.pm index a9c8ff7ca395e..b62c04f7bc9ad 100644 --- a/lib/ProductOpener/Display.pm +++ b/lib/ProductOpener/Display.pm @@ -8004,12 +8004,10 @@ JS $product_ref->{environmental_score_data}); } - # 2025/01 - For moderators, determine which packaging components are in contact with food, so that we can display them + # 2025/02 - Determine which packaging components are in contact with food, so that we can display them # This is for initial development of the feature, once finalized, we could compute and store this data in the product - if ($User{moderator}) { - ProductOpener::PackagingFoodContact::determine_food_contact_of_packaging_components_service($product_ref); - } + ProductOpener::PackagingFoodContact::determine_food_contact_of_packaging_components_service($product_ref); # Activate knowledge panels for all users diff --git a/lib/ProductOpener/FoodProducts.pm b/lib/ProductOpener/FoodProducts.pm index ce57fec8f911d..7a57dd36a19f2 100644 --- a/lib/ProductOpener/FoodProducts.pm +++ b/lib/ProductOpener/FoodProducts.pm @@ -58,6 +58,7 @@ use ProductOpener::FoodGroups qw/compute_food_groups/; use ProductOpener::Nutriscore qw/:all/; use ProductOpener::EnvironmentalScore qw/compute_environmental_score/; use ProductOpener::ForestFootprint qw/compute_forest_footprint/; +use ProductOpener::PackagingFoodContact qw/determine_food_contact_of_packaging_components_service/; use Log::Any qw($log); @@ -112,6 +113,9 @@ sub specific_processes_for_food_product ($product_ref) { compute_environmental_score($product_ref); compute_forest_footprint($product_ref); + # Determine packaging components in contact with food + determine_food_contact_of_packaging_components_service($product_ref); + return; }