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");
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;
}
diff --git a/lib/ProductOpener/PackagingFoodContact.pm b/lib/ProductOpener/PackagingFoodContact.pm
index 155fdbbed4d16..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;
}
@@ -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;
}
@@ -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)
@@ -231,7 +235,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);
}
@@ -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/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 @@