+ [% lang("nutrient_info_" _ panel.id _ "_benefit") %]
+ [% lang("nutrient_info_" _ panel.id _ "_risk") %]
+
+ `,
+ }
+ },
+ ]
+}
diff --git a/templates/api/knowledge-panels/health/nutriscore/nutriscore_description.tt.json b/templates/api/knowledge-panels/health/nutriscore/nutriscore_description.tt.json
new file mode 100644
index 0000000000000..3026a3c066a61
--- /dev/null
+++ b/templates/api/knowledge-panels/health/nutriscore/nutriscore_description.tt.json
@@ -0,0 +1,38 @@
+{
+ "level": "info",
+ "topics": [
+ "health"
+ ],
+ "title_element": {
+ "icon_url": "[% static_subdomain %]/images/icons/dist/info.svg",
+ "icon_size": "small",
+ "title": "[% lang("nutriscore_explanation_title") %]",
+ "type": "info",
+ },
+ "elements": [
+ // Explanation of Nutri-Score
+ {
+ "element_type": "text",
+ "text_element": {
+ "type": "info",
+ "html": `
+[% lang("nutriscore_explanation_what_it_takes_into_account") %]
+[% lang("nutriscore_explanation_where_the_data_comes_from") %]
+
+[% IF cc == 'be' || cc == 'es' || cc == 'ch' || cc == 'de' || cc == 'fr' || cc == 'nl' || cc == 'lu' %]
+ [% lang("nutriscore_count_proteins_reason_" _ product.nutriscore.2023.data.count_proteins_reason )%]
+
+
[% END %]
+ [% IF panel_group_element.icon_url.defined %]
+
+ [% END %]
+
[% IF panel_group_element.title.defined %]
-
[% panel_group_element.title %]
+
[% panel_group_element.title %]
[% END %]
[% FOREACH panel_id IN panel_group_element.panel_ids %]
[% INCLUDE web/panels/panel.tt.html panel_id = panel_id %]
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 34db6b4178051..675c9cae2a4b6 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
@@ -872,41 +872,77 @@
"2023" : {
"category_available" : 1,
"data" : {
+ "components" : {
+ "negative" : [
+ {
+ "id" : "energy",
+ "points" : 1,
+ "points_max" : 10,
+ "unit" : "kJ",
+ "value" : 558.75
+ },
+ {
+ "id" : "sugars",
+ "points" : 2,
+ "points_max" : 15,
+ "unit" : "g",
+ "value" : 7.26
+ },
+ {
+ "id" : "saturated_fat",
+ "points" : 4,
+ "points_max" : 10,
+ "unit" : "g",
+ "value" : 4.9
+ },
+ {
+ "id" : "salt",
+ "points" : 0,
+ "points_max" : 20,
+ "unit" : "g",
+ "value" : 0.05
+ }
+ ],
+ "positive" : [
+ {
+ "id" : "proteins",
+ "points" : 0,
+ "points_max" : 7,
+ "unit" : "g",
+ "value" : 1.97
+ },
+ {
+ "id" : "fiber",
+ "points" : 0,
+ "points_max" : 5,
+ "unit" : "g",
+ "value" : 0.81
+ },
+ {
+ "id" : "fruits_vegetables_legumes",
+ "points" : 2,
+ "points_max" : 5,
+ "unit" : "%",
+ "value" : 62.5
+ }
+ ]
+ },
"count_proteins" : 1,
"count_proteins_reason" : "negative_points_less_than_11",
- "energy" : 558.75,
- "energy_points" : 1,
- "fiber" : 0.8125,
- "fiber_points" : 0,
- "fruits_vegetables_legumes" : 62.5,
- "fruits_vegetables_legumes_points" : 2,
"is_beverage" : 0,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 0,
"is_red_meat_product" : 0,
"is_water" : 0,
- "negative_nutrients" : [
- "energy",
- "sugars",
- "saturated_fat",
- "salt",
- "non_nutritive_sweeteners"
- ],
"negative_points" : 7,
+ "negative_points_max" : 55,
"positive_nutrients" : [
- "fruits_vegetables_legumes",
+ "proteins",
"fiber",
- "proteins"
+ "fruits_vegetables_legumes"
],
"positive_points" : 2,
- "proteins" : 1.974375,
- "proteins_points" : 0,
- "salt" : 0.0496875,
- "salt_points" : 0,
- "saturated_fat" : 4.903125,
- "saturated_fat_points" : 4,
- "sugars" : 7.2621875,
- "sugars_points" : 2
+ "positive_points_max" : 17
},
"grade" : "c",
"nutrients_available" : 1,
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 3b0605189da34..6471c8ee7c499 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
@@ -1512,6 +1512,29 @@
"health"
]
},
+ "nutrient_levels" : {
+ "elements" : [
+ {
+ "element_type" : "panel_group",
+ "panel_group_element" : {
+ "panel_group_id" : "nutrient_levels_group",
+ "panel_ids" : []
+ }
+ }
+ ],
+ "evaluation" : "unknown",
+ "expand_for" : "large",
+ "expanded" : false,
+ "level" : "info",
+ "title_element" : {
+ "icon_color_from_evaluation" : true,
+ "icon_url" : "http://static.openfoodfacts.localhost/images/icons/dist/nutrition.svg",
+ "title" : "Nutrient levels"
+ },
+ "topics" : [
+ "health"
+ ]
+ },
"nutriscore" : {
"elements" : [
{
@@ -1531,7 +1554,7 @@
{
"element_type" : "text",
"text_element" : {
- "html" : "\n\n
This product is not considered a beverage for the calculation of the Nutri-Score.
\n\n\n\n\n\n
\n Positive points: 3 \n
\n\n
\n \n - \n Proteins:\n1 / 5\n(value: 1.974375, \n rounded value: 1.97)\n
\n \n - \n Fiber:\n0 / 5\n(value: 0.8125, \n rounded value: 0.81)\n
\n \n - \n Fruits, vegetables, nuts, and colza/walnut/olive oils:\n2 / 5\n(value: 62.5, \n rounded value: 62.5)\n
\n \n
\n\n\n\n
\n Negative points: 6 \n
\n\n
\n \n - \n Energy:\n1 / 10\n(value: 558.75, \n rounded value: 558.8)\n
\n \n - \n Sugars:\n1 / 10\n(value: 7.2621875, \n rounded value: 7.26)\n
\n \n - \n Saturated fat:\n4 / 10\n(value: 4.903125, \n rounded value: 4.9)\n
\n \n - \n Sodium:\n0 / 10\n(value: 19.725, \n rounded value: 19.7)\n
\n \n
\n\n\n\n
The points for proteins are counted because the negative points are less than 11.
\n\n
\n Nutritional score: 3\n (6 - 3)\n
\n
Nutri-Score: C
\n\n"
+ "html" : "\n\n
This product is not considered a beverage for the calculation of the Nutri-Score.
\n\n\n\n\n\n
\n Positive points: 3 \n
\n\n
\n \n - \n Proteins:\n1 / 5\n(value: 1.974375, \n rounded value: 1.97)\n
\n \n - \n Fiber:\n0 / 5\n(value: 0.8125, \n rounded value: 0.81)\n
\n \n - \n Fruits, vegetables, nuts, and colza/walnut/olive oils:\n2 / 5\n(value: 62.5, \n rounded value: 62.5)\n
\n \n
\n\n\n\n
\n Negative points: 6 \n
\n\n
\n \n - \n Energy:\n1 / 10\n(value: 558.75, \n rounded value: 558.8)\n
\n \n - \n Sugars:\n1 / 10\n(value: 7.2621875, \n rounded value: 7.26)\n
\n \n - \n Saturated fat:\n4 / 10\n(value: 4.903125, \n rounded value: 4.9)\n
\n \n - \n Sodium:\n0 / 10\n(value: 19.725, \n rounded value: 19.7)\n
\n \n
\n\n\n\n
The points for proteins are counted because the negative points are less than 11.
\n\n
\n Nutritional score: \n (6 - 3)\n
\n
Nutri-Score:
\n\n"
}
},
{
@@ -2163,41 +2186,77 @@
"2023" : {
"category_available" : 1,
"data" : {
+ "components" : {
+ "negative" : [
+ {
+ "id" : "energy",
+ "points" : 1,
+ "points_max" : 10,
+ "unit" : "kJ",
+ "value" : 558.75
+ },
+ {
+ "id" : "sugars",
+ "points" : 2,
+ "points_max" : 15,
+ "unit" : "g",
+ "value" : 7.26
+ },
+ {
+ "id" : "saturated_fat",
+ "points" : 4,
+ "points_max" : 10,
+ "unit" : "g",
+ "value" : 4.9
+ },
+ {
+ "id" : "salt",
+ "points" : 0,
+ "points_max" : 20,
+ "unit" : "g",
+ "value" : 0.05
+ }
+ ],
+ "positive" : [
+ {
+ "id" : "proteins",
+ "points" : 0,
+ "points_max" : 7,
+ "unit" : "g",
+ "value" : 1.97
+ },
+ {
+ "id" : "fiber",
+ "points" : 0,
+ "points_max" : 5,
+ "unit" : "g",
+ "value" : 0.81
+ },
+ {
+ "id" : "fruits_vegetables_legumes",
+ "points" : 2,
+ "points_max" : 5,
+ "unit" : "%",
+ "value" : 62.5
+ }
+ ]
+ },
"count_proteins" : 1,
"count_proteins_reason" : "negative_points_less_than_11",
- "energy" : 558.75,
- "energy_points" : 1,
- "fiber" : 0.8125,
- "fiber_points" : 0,
- "fruits_vegetables_legumes" : 62.5,
- "fruits_vegetables_legumes_points" : 2,
"is_beverage" : 0,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 0,
"is_red_meat_product" : 0,
"is_water" : 0,
- "negative_nutrients" : [
- "energy",
- "sugars",
- "saturated_fat",
- "salt",
- "non_nutritive_sweeteners"
- ],
"negative_points" : 7,
+ "negative_points_max" : 55,
"positive_nutrients" : [
- "fruits_vegetables_legumes",
+ "proteins",
"fiber",
- "proteins"
+ "fruits_vegetables_legumes"
],
"positive_points" : 2,
- "proteins" : 1.974375,
- "proteins_points" : 0,
- "salt" : 0.0496875,
- "salt_points" : 0,
- "saturated_fat" : 4.903125,
- "saturated_fat_points" : 4,
- "sugars" : 7.2621875,
- "sugars_points" : 2
+ "positive_points_max" : 17
},
"grade" : "c",
"nutrients_available" : 1,
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 15ec668b42201..36d1959d05ed8 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
@@ -872,41 +872,77 @@
"2023" : {
"category_available" : 1,
"data" : {
+ "components" : {
+ "negative" : [
+ {
+ "id" : "energy",
+ "points" : 1,
+ "points_max" : 10,
+ "unit" : "kJ",
+ "value" : 558.75
+ },
+ {
+ "id" : "sugars",
+ "points" : 2,
+ "points_max" : 15,
+ "unit" : "g",
+ "value" : 7.26
+ },
+ {
+ "id" : "saturated_fat",
+ "points" : 4,
+ "points_max" : 10,
+ "unit" : "g",
+ "value" : 4.9
+ },
+ {
+ "id" : "salt",
+ "points" : 0,
+ "points_max" : 20,
+ "unit" : "g",
+ "value" : 0.05
+ }
+ ],
+ "positive" : [
+ {
+ "id" : "proteins",
+ "points" : 0,
+ "points_max" : 7,
+ "unit" : "g",
+ "value" : 1.97
+ },
+ {
+ "id" : "fiber",
+ "points" : 0,
+ "points_max" : 5,
+ "unit" : "g",
+ "value" : 0.81
+ },
+ {
+ "id" : "fruits_vegetables_legumes",
+ "points" : 2,
+ "points_max" : 5,
+ "unit" : "%",
+ "value" : 62.5
+ }
+ ]
+ },
"count_proteins" : 1,
"count_proteins_reason" : "negative_points_less_than_11",
- "energy" : 558.75,
- "energy_points" : 1,
- "fiber" : 0.8125,
- "fiber_points" : 0,
- "fruits_vegetables_legumes" : 62.5,
- "fruits_vegetables_legumes_points" : 2,
"is_beverage" : 0,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 0,
"is_red_meat_product" : 0,
"is_water" : 0,
- "negative_nutrients" : [
- "energy",
- "sugars",
- "saturated_fat",
- "salt",
- "non_nutritive_sweeteners"
- ],
"negative_points" : 7,
+ "negative_points_max" : 55,
"positive_nutrients" : [
- "fruits_vegetables_legumes",
+ "proteins",
"fiber",
- "proteins"
+ "fruits_vegetables_legumes"
],
"positive_points" : 2,
- "proteins" : 1.974375,
- "proteins_points" : 0,
- "salt" : 0.0496875,
- "salt_points" : 0,
- "saturated_fat" : 4.903125,
- "saturated_fat_points" : 4,
- "sugars" : 7.2621875,
- "sugars_points" : 2
+ "positive_points_max" : 17
},
"grade" : "c",
"nutrients_available" : 1,
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 acfcfc26dfce0..ac48de896087d 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
@@ -2160,6 +2160,29 @@
"health"
]
},
+ "nutrient_levels" : {
+ "elements" : [
+ {
+ "element_type" : "panel_group",
+ "panel_group_element" : {
+ "panel_group_id" : "nutrient_levels_group",
+ "panel_ids" : []
+ }
+ }
+ ],
+ "evaluation" : "unknown",
+ "expand_for" : "large",
+ "expanded" : false,
+ "level" : "info",
+ "title_element" : {
+ "icon_color_from_evaluation" : true,
+ "icon_url" : "http://static.openfoodfacts.localhost/images/icons/dist/nutrition.svg",
+ "title" : "Nutrient levels"
+ },
+ "topics" : [
+ "health"
+ ]
+ },
"nutriscore" : {
"elements" : [
{
@@ -2179,7 +2202,7 @@
{
"element_type" : "text",
"text_element" : {
- "html" : "\n\n
This product is not considered a beverage for the calculation of the Nutri-Score.
\n\n\n\n\n\n
\n Positive points: 3 \n
\n\n
\n \n - \n Proteins:\n1 / 5\n(value: 1.974375, \n rounded value: 1.97)\n
\n \n - \n Fiber:\n0 / 5\n(value: 0.8125, \n rounded value: 0.81)\n
\n \n - \n Fruits, vegetables, nuts, and colza/walnut/olive oils:\n2 / 5\n(value: 62.5, \n rounded value: 62.5)\n
\n \n
\n\n\n\n
\n Negative points: 6 \n
\n\n
\n \n - \n Energy:\n1 / 10\n(value: 558.75, \n rounded value: 558.8)\n
\n \n - \n Sugars:\n1 / 10\n(value: 7.2621875, \n rounded value: 7.26)\n
\n \n - \n Saturated fat:\n4 / 10\n(value: 4.903125, \n rounded value: 4.9)\n
\n \n - \n Sodium:\n0 / 10\n(value: 19.725, \n rounded value: 19.7)\n
\n \n
\n\n\n\n
The points for proteins are counted because the negative points are less than 11.
\n\n
\n Nutritional score: 3\n (6 - 3)\n
\n
Nutri-Score: C
\n\n"
+ "html" : "\n\n
This product is not considered a beverage for the calculation of the Nutri-Score.
\n\n\n\n\n\n
\n Positive points: 3 \n
\n\n
\n \n - \n Proteins:\n1 / 5\n(value: 1.974375, \n rounded value: 1.97)\n
\n \n - \n Fiber:\n0 / 5\n(value: 0.8125, \n rounded value: 0.81)\n
\n \n - \n Fruits, vegetables, nuts, and colza/walnut/olive oils:\n2 / 5\n(value: 62.5, \n rounded value: 62.5)\n
\n \n
\n\n\n\n
\n Negative points: 6 \n
\n\n
\n \n - \n Energy:\n1 / 10\n(value: 558.75, \n rounded value: 558.8)\n
\n \n - \n Sugars:\n1 / 10\n(value: 7.2621875, \n rounded value: 7.26)\n
\n \n - \n Saturated fat:\n4 / 10\n(value: 4.903125, \n rounded value: 4.9)\n
\n \n - \n Sodium:\n0 / 10\n(value: 19.725, \n rounded value: 19.7)\n
\n \n
\n\n\n\n
The points for proteins are counted because the negative points are less than 11.
\n\n
\n Nutritional score: \n (6 - 3)\n
\n
Nutri-Score:
\n\n"
}
},
{
@@ -2811,41 +2834,77 @@
"2023" : {
"category_available" : 1,
"data" : {
+ "components" : {
+ "negative" : [
+ {
+ "id" : "energy",
+ "points" : 1,
+ "points_max" : 10,
+ "unit" : "kJ",
+ "value" : 558.75
+ },
+ {
+ "id" : "sugars",
+ "points" : 2,
+ "points_max" : 15,
+ "unit" : "g",
+ "value" : 7.26
+ },
+ {
+ "id" : "saturated_fat",
+ "points" : 4,
+ "points_max" : 10,
+ "unit" : "g",
+ "value" : 4.9
+ },
+ {
+ "id" : "salt",
+ "points" : 0,
+ "points_max" : 20,
+ "unit" : "g",
+ "value" : 0.05
+ }
+ ],
+ "positive" : [
+ {
+ "id" : "proteins",
+ "points" : 0,
+ "points_max" : 7,
+ "unit" : "g",
+ "value" : 1.97
+ },
+ {
+ "id" : "fiber",
+ "points" : 0,
+ "points_max" : 5,
+ "unit" : "g",
+ "value" : 0.81
+ },
+ {
+ "id" : "fruits_vegetables_legumes",
+ "points" : 2,
+ "points_max" : 5,
+ "unit" : "%",
+ "value" : 62.5
+ }
+ ]
+ },
"count_proteins" : 1,
"count_proteins_reason" : "negative_points_less_than_11",
- "energy" : 558.75,
- "energy_points" : 1,
- "fiber" : 0.8125,
- "fiber_points" : 0,
- "fruits_vegetables_legumes" : 62.5,
- "fruits_vegetables_legumes_points" : 2,
"is_beverage" : 0,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 0,
"is_red_meat_product" : 0,
"is_water" : 0,
- "negative_nutrients" : [
- "energy",
- "sugars",
- "saturated_fat",
- "salt",
- "non_nutritive_sweeteners"
- ],
"negative_points" : 7,
+ "negative_points_max" : 55,
"positive_nutrients" : [
- "fruits_vegetables_legumes",
+ "proteins",
"fiber",
- "proteins"
+ "fruits_vegetables_legumes"
],
"positive_points" : 2,
- "proteins" : 1.974375,
- "proteins_points" : 0,
- "salt" : 0.0496875,
- "salt_points" : 0,
- "saturated_fat" : 4.903125,
- "saturated_fat_points" : 4,
- "sugars" : 7.2621875,
- "sugars_points" : 2
+ "positive_points_max" : 17
},
"grade" : "c",
"nutrients_available" : 1,
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 ed684ab10c8fc..65b2023440678 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
@@ -867,41 +867,77 @@
"2023" : {
"category_available" : 1,
"data" : {
+ "components" : {
+ "negative" : [
+ {
+ "id" : "energy",
+ "points" : 1,
+ "points_max" : 10,
+ "unit" : "kJ",
+ "value" : 558.75
+ },
+ {
+ "id" : "sugars",
+ "points" : 2,
+ "points_max" : 15,
+ "unit" : "g",
+ "value" : 7.26
+ },
+ {
+ "id" : "saturated_fat",
+ "points" : 4,
+ "points_max" : 10,
+ "unit" : "g",
+ "value" : 4.9
+ },
+ {
+ "id" : "salt",
+ "points" : 0,
+ "points_max" : 20,
+ "unit" : "g",
+ "value" : 0.05
+ }
+ ],
+ "positive" : [
+ {
+ "id" : "proteins",
+ "points" : 0,
+ "points_max" : 7,
+ "unit" : "g",
+ "value" : 1.97
+ },
+ {
+ "id" : "fiber",
+ "points" : 0,
+ "points_max" : 5,
+ "unit" : "g",
+ "value" : 0.81
+ },
+ {
+ "id" : "fruits_vegetables_legumes",
+ "points" : 2,
+ "points_max" : 5,
+ "unit" : "%",
+ "value" : 62.5
+ }
+ ]
+ },
"count_proteins" : 1,
"count_proteins_reason" : "negative_points_less_than_11",
- "energy" : 558.75,
- "energy_points" : 1,
- "fiber" : 0.8125,
- "fiber_points" : 0,
- "fruits_vegetables_legumes" : 62.5,
- "fruits_vegetables_legumes_points" : 2,
"is_beverage" : 0,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 0,
"is_red_meat_product" : 0,
"is_water" : 0,
- "negative_nutrients" : [
- "energy",
- "sugars",
- "saturated_fat",
- "salt",
- "non_nutritive_sweeteners"
- ],
"negative_points" : 7,
+ "negative_points_max" : 55,
"positive_nutrients" : [
- "fruits_vegetables_legumes",
+ "proteins",
"fiber",
- "proteins"
+ "fruits_vegetables_legumes"
],
"positive_points" : 2,
- "proteins" : 1.974375,
- "proteins_points" : 0,
- "salt" : 0.0496875,
- "salt_points" : 0,
- "saturated_fat" : 4.903125,
- "saturated_fat_points" : 4,
- "sugars" : 7.2621875,
- "sugars_points" : 2
+ "positive_points_max" : 17
},
"grade" : "c",
"nutrients_available" : 1,
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 18a1de0db0d76..854552f65b990 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
@@ -821,6 +821,29 @@
"health"
]
},
+ "nutrient_levels" : {
+ "elements" : [
+ {
+ "element_type" : "panel_group",
+ "panel_group_element" : {
+ "panel_group_id" : "nutrient_levels_group",
+ "panel_ids" : []
+ }
+ }
+ ],
+ "evaluation" : "unknown",
+ "expand_for" : "large",
+ "expanded" : false,
+ "level" : "info",
+ "title_element" : {
+ "icon_color_from_evaluation" : true,
+ "icon_url" : "http://static.openfoodfacts.localhost/images/icons/dist/nutrition.svg",
+ "title" : "Repères nutritionnels"
+ },
+ "topics" : [
+ "health"
+ ]
+ },
"nutriscore" : {
"elements" : [
{
@@ -840,7 +863,7 @@
{
"element_type" : "text",
"text_element" : {
- "html" : "\n\n
Ce produit n'est pas considéré comme une boisson pour le calcul du Nutri-Score.
\n\n\n\n\n\n
\n Points positifs : 3 \n
\n\n
\n \n - \n Protéines :\n1 / 5\n(valeur : 1.974375, \n valeur arrondie : 1.97)\n
\n \n - \n Fibre :\n0 / 5\n(valeur : 0.8125, \n valeur arrondie : 0.81)\n
\n \n - \n Fruits, légumes, noix et huiles de colza / noix / olive :\n2 / 5\n(valeur : 62.5, \n valeur arrondie : 62.5)\n
\n \n
\n\n\n\n
\n Points négatifs : 6 \n
\n\n
\n \n - \n Énergie :\n1 / 10\n(valeur : 558.75, \n valeur arrondie : 558.8)\n
\n \n - \n Sucres :\n1 / 10\n(valeur : 7.2621875, \n valeur arrondie : 7.26)\n
\n \n - \n Graisses saturées :\n4 / 10\n(valeur : 4.903125, \n valeur arrondie : 4.9)\n
\n \n - \n Sodium :\n0 / 10\n(valeur : 19.725, \n valeur arrondie : 19.7)\n
\n \n
\n\n\n\n
Les points pour les protéines sont comptés car les points négatifs sont inférieurs à 11.
\n\n
\n Score nutritionnel : 3\n (6 - 3)\n
\n
Nutri-Score : C
\n\n"
+ "html" : "\n\n
Ce produit n'est pas considéré comme une boisson pour le calcul du Nutri-Score.
\n\n\n\n\n\n
\n Points positifs : 3 \n
\n\n
\n \n - \n Protéines :\n1 / 5\n(valeur : 1.974375, \n valeur arrondie : 1.97)\n
\n \n - \n Fibre :\n0 / 5\n(valeur : 0.8125, \n valeur arrondie : 0.81)\n
\n \n - \n Fruits, légumes, noix et huiles de colza / noix / olive :\n2 / 5\n(valeur : 62.5, \n valeur arrondie : 62.5)\n
\n \n
\n\n\n\n
\n Points négatifs : 6 \n
\n\n
\n \n - \n Énergie :\n1 / 10\n(valeur : 558.75, \n valeur arrondie : 558.8)\n
\n \n - \n Sucres :\n1 / 10\n(valeur : 7.2621875, \n valeur arrondie : 7.26)\n
\n \n - \n Graisses saturées :\n4 / 10\n(valeur : 4.903125, \n valeur arrondie : 4.9)\n
\n \n - \n Sodium :\n0 / 10\n(valeur : 19.725, \n valeur arrondie : 19.7)\n
\n \n
\n\n\n\n
Les points pour les protéines sont comptés car les points négatifs sont inférieurs à 11.
\n\n
\n Score nutritionnel : \n (6 - 3)\n
\n
Nutri-Score :
\n\n"
}
},
{
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 22e474d88c3a5..7bea315570310 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
@@ -821,6 +821,29 @@
"health"
]
},
+ "nutrient_levels" : {
+ "elements" : [
+ {
+ "element_type" : "panel_group",
+ "panel_group_element" : {
+ "panel_group_id" : "nutrient_levels_group",
+ "panel_ids" : []
+ }
+ }
+ ],
+ "evaluation" : "unknown",
+ "expand_for" : "large",
+ "expanded" : false,
+ "level" : "info",
+ "title_element" : {
+ "icon_color_from_evaluation" : true,
+ "icon_url" : "http://static.openfoodfacts.localhost/images/icons/dist/nutrition.svg",
+ "title" : "Nutrient levels"
+ },
+ "topics" : [
+ "health"
+ ]
+ },
"nutriscore" : {
"elements" : [
{
@@ -840,7 +863,7 @@
{
"element_type" : "text",
"text_element" : {
- "html" : "\n\n
This product is not considered a beverage for the calculation of the Nutri-Score.
\n\n\n\n\n\n
\n Positive points: 3 \n
\n\n
\n \n - \n Proteins:\n1 / 5\n(value: 1.974375, \n rounded value: 1.97)\n
\n \n - \n Fiber:\n0 / 5\n(value: 0.8125, \n rounded value: 0.81)\n
\n \n - \n Fruits, vegetables, nuts, and colza/walnut/olive oils:\n2 / 5\n(value: 62.5, \n rounded value: 62.5)\n
\n \n
\n\n\n\n
\n Negative points: 6 \n
\n\n
\n \n - \n Energy:\n1 / 10\n(value: 558.75, \n rounded value: 558.8)\n
\n \n - \n Sugars:\n1 / 10\n(value: 7.2621875, \n rounded value: 7.26)\n
\n \n - \n Saturated fat:\n4 / 10\n(value: 4.903125, \n rounded value: 4.9)\n
\n \n - \n Sodium:\n0 / 10\n(value: 19.725, \n rounded value: 19.7)\n
\n \n
\n\n\n\n
The points for proteins are counted because the negative points are less than 11.
\n\n
\n Nutritional score: 3\n (6 - 3)\n
\n
Nutri-Score: C
\n\n"
+ "html" : "\n\n
This product is not considered a beverage for the calculation of the Nutri-Score.
\n\n\n\n\n\n
\n Positive points: 3 \n
\n\n
\n \n - \n Proteins:\n1 / 5\n(value: 1.974375, \n rounded value: 1.97)\n
\n \n - \n Fiber:\n0 / 5\n(value: 0.8125, \n rounded value: 0.81)\n
\n \n - \n Fruits, vegetables, nuts, and colza/walnut/olive oils:\n2 / 5\n(value: 62.5, \n rounded value: 62.5)\n
\n \n
\n\n\n\n
\n Negative points: 6 \n
\n\n
\n \n - \n Energy:\n1 / 10\n(value: 558.75, \n rounded value: 558.8)\n
\n \n - \n Sugars:\n1 / 10\n(value: 7.2621875, \n rounded value: 7.26)\n
\n \n - \n Saturated fat:\n4 / 10\n(value: 4.903125, \n rounded value: 4.9)\n
\n \n - \n Sodium:\n0 / 10\n(value: 19.725, \n rounded value: 19.7)\n
\n \n
\n\n\n\n
The points for proteins are counted because the negative points are less than 11.
\n\n
\n Nutritional score: \n (6 - 3)\n
\n
Nutri-Score:
\n\n"
}
},
{
diff --git a/tests/integration/expected_test_results/api_v2_product_write/get-product-ingredients-text-without-language.json b/tests/integration/expected_test_results/api_v2_product_write/get-product-ingredients-text-without-language.json
index f10b1f4656d01..511a27cd8f75f 100644
--- a/tests/integration/expected_test_results/api_v2_product_write/get-product-ingredients-text-without-language.json
+++ b/tests/integration/expected_test_results/api_v2_product_write/get-product-ingredients-text-without-language.json
@@ -603,47 +603,76 @@
"2023" : {
"category_available" : 1,
"data" : {
+ "components" : {
+ "negative" : [
+ {
+ "id" : "energy",
+ "points" : 1,
+ "points_max" : 10,
+ "unit" : "kJ",
+ "value" : 645
+ },
+ {
+ "id" : "sugars",
+ "points" : 0,
+ "points_max" : 15,
+ "unit" : "g",
+ "value" : 0
+ },
+ {
+ "id" : "saturated_fat",
+ "points" : 2,
+ "points_max" : 10,
+ "unit" : "g",
+ "value" : 2.64
+ },
+ {
+ "id" : "salt",
+ "points" : 20,
+ "points_max" : 20,
+ "unit" : "g",
+ "value" : 24.54
+ }
+ ],
+ "positive" : [
+ {
+ "id" : "fiber",
+ "points" : 0,
+ "points_max" : 5,
+ "unit" : "g",
+ "value" : 0
+ },
+ {
+ "id" : "fruits_vegetables_legumes",
+ "points" : 0,
+ "points_max" : 5,
+ "unit" : "%",
+ "value" : 0
+ }
+ ]
+ },
"count_proteins" : 0,
- "count_proteins_reason" : "negative_points_more_than_11",
- "energy" : 645,
- "energy_points" : 1,
- "fiber" : 0,
- "fiber_points" : 0,
- "fruits_vegetables_legumes" : 0,
- "fruits_vegetables_legumes_points" : 0,
+ "count_proteins_reason" : "negative_points_greater_than_or_equal_to_11",
"is_beverage" : 0,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 0,
"is_red_meat_product" : 1,
"is_water" : 0,
- "negative_nutrients" : [
- "energy",
- "sugars",
- "saturated_fat",
- "salt",
- "non_nutritive_sweeteners"
- ],
- "negative_points" : 24,
+ "negative_points" : 23,
+ "negative_points_max" : 55,
"positive_nutrients" : [
- "fruits_vegetables_legumes",
- "fiber"
+ "fiber",
+ "fruits_vegetables_legumes"
],
"positive_points" : 0,
- "proteins" : 21.825,
- "proteins_points" : 2,
- "proteins_points_limited_reason" : "red_meat_product",
- "salt" : 24.54,
- "salt_points" : 21,
- "saturated_fat" : 2.64,
- "saturated_fat_points" : 2,
- "sugars" : 0,
- "sugars_points" : 0
+ "positive_points_max" : 10,
+ "proteins_points_limited_reason" : "red_meat_product"
},
"grade" : "e",
"nutrients_available" : 1,
"nutriscore_applicable" : 1,
"nutriscore_computed" : 1,
- "score" : 24
+ "score" : 23
}
},
"nutriscore_2021_tags" : [
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 16db1d44ed322..6c06ea430e490 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
@@ -874,41 +874,77 @@
"2023" : {
"category_available" : 1,
"data" : {
+ "components" : {
+ "negative" : [
+ {
+ "id" : "energy",
+ "points" : 1,
+ "points_max" : 10,
+ "unit" : "kJ",
+ "value" : 558.75
+ },
+ {
+ "id" : "sugars",
+ "points" : 2,
+ "points_max" : 15,
+ "unit" : "g",
+ "value" : 7.26
+ },
+ {
+ "id" : "saturated_fat",
+ "points" : 4,
+ "points_max" : 10,
+ "unit" : "g",
+ "value" : 4.9
+ },
+ {
+ "id" : "salt",
+ "points" : 0,
+ "points_max" : 20,
+ "unit" : "g",
+ "value" : 0.05
+ }
+ ],
+ "positive" : [
+ {
+ "id" : "proteins",
+ "points" : 0,
+ "points_max" : 7,
+ "unit" : "g",
+ "value" : 1.97
+ },
+ {
+ "id" : "fiber",
+ "points" : 0,
+ "points_max" : 5,
+ "unit" : "g",
+ "value" : 0.81
+ },
+ {
+ "id" : "fruits_vegetables_legumes",
+ "points" : 2,
+ "points_max" : 5,
+ "unit" : "%",
+ "value" : 62.5
+ }
+ ]
+ },
"count_proteins" : 1,
"count_proteins_reason" : "negative_points_less_than_11",
- "energy" : 558.75,
- "energy_points" : 1,
- "fiber" : 0.8125,
- "fiber_points" : 0,
- "fruits_vegetables_legumes" : 62.5,
- "fruits_vegetables_legumes_points" : 2,
"is_beverage" : 0,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 0,
"is_red_meat_product" : 0,
"is_water" : 0,
- "negative_nutrients" : [
- "energy",
- "sugars",
- "saturated_fat",
- "salt",
- "non_nutritive_sweeteners"
- ],
"negative_points" : 7,
+ "negative_points_max" : 55,
"positive_nutrients" : [
- "fruits_vegetables_legumes",
+ "proteins",
"fiber",
- "proteins"
+ "fruits_vegetables_legumes"
],
"positive_points" : 2,
- "proteins" : 1.974375,
- "proteins_points" : 0,
- "salt" : 0.0496875,
- "salt_points" : 0,
- "saturated_fat" : 4.903125,
- "saturated_fat_points" : 4,
- "sugars" : 7.2621875,
- "sugars_points" : 2
+ "positive_points_max" : 17
},
"grade" : "c",
"nutrients_available" : 1,
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 463bd6800c9b4..38e6c0ec611e8 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
@@ -874,41 +874,77 @@
"2023" : {
"category_available" : 1,
"data" : {
+ "components" : {
+ "negative" : [
+ {
+ "id" : "energy",
+ "points" : 1,
+ "points_max" : 10,
+ "unit" : "kJ",
+ "value" : 558.75
+ },
+ {
+ "id" : "sugars",
+ "points" : 2,
+ "points_max" : 15,
+ "unit" : "g",
+ "value" : 7.26
+ },
+ {
+ "id" : "saturated_fat",
+ "points" : 4,
+ "points_max" : 10,
+ "unit" : "g",
+ "value" : 4.9
+ },
+ {
+ "id" : "salt",
+ "points" : 0,
+ "points_max" : 20,
+ "unit" : "g",
+ "value" : 0.05
+ }
+ ],
+ "positive" : [
+ {
+ "id" : "proteins",
+ "points" : 0,
+ "points_max" : 7,
+ "unit" : "g",
+ "value" : 1.97
+ },
+ {
+ "id" : "fiber",
+ "points" : 0,
+ "points_max" : 5,
+ "unit" : "g",
+ "value" : 0.81
+ },
+ {
+ "id" : "fruits_vegetables_legumes",
+ "points" : 2,
+ "points_max" : 5,
+ "unit" : "%",
+ "value" : 62.5
+ }
+ ]
+ },
"count_proteins" : 1,
"count_proteins_reason" : "negative_points_less_than_11",
- "energy" : 558.75,
- "energy_points" : 1,
- "fiber" : 0.8125,
- "fiber_points" : 0,
- "fruits_vegetables_legumes" : 62.5,
- "fruits_vegetables_legumes_points" : 2,
"is_beverage" : 0,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 0,
"is_red_meat_product" : 0,
"is_water" : 0,
- "negative_nutrients" : [
- "energy",
- "sugars",
- "saturated_fat",
- "salt",
- "non_nutritive_sweeteners"
- ],
"negative_points" : 7,
+ "negative_points_max" : 55,
"positive_nutrients" : [
- "fruits_vegetables_legumes",
+ "proteins",
"fiber",
- "proteins"
+ "fruits_vegetables_legumes"
],
"positive_points" : 2,
- "proteins" : 1.974375,
- "proteins_points" : 0,
- "salt" : 0.0496875,
- "salt_points" : 0,
- "saturated_fat" : 4.903125,
- "saturated_fat_points" : 4,
- "sugars" : 7.2621875,
- "sugars_points" : 2
+ "positive_points_max" : 17
},
"grade" : "c",
"nutrients_available" : 1,
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 463bd6800c9b4..38e6c0ec611e8 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
@@ -874,41 +874,77 @@
"2023" : {
"category_available" : 1,
"data" : {
+ "components" : {
+ "negative" : [
+ {
+ "id" : "energy",
+ "points" : 1,
+ "points_max" : 10,
+ "unit" : "kJ",
+ "value" : 558.75
+ },
+ {
+ "id" : "sugars",
+ "points" : 2,
+ "points_max" : 15,
+ "unit" : "g",
+ "value" : 7.26
+ },
+ {
+ "id" : "saturated_fat",
+ "points" : 4,
+ "points_max" : 10,
+ "unit" : "g",
+ "value" : 4.9
+ },
+ {
+ "id" : "salt",
+ "points" : 0,
+ "points_max" : 20,
+ "unit" : "g",
+ "value" : 0.05
+ }
+ ],
+ "positive" : [
+ {
+ "id" : "proteins",
+ "points" : 0,
+ "points_max" : 7,
+ "unit" : "g",
+ "value" : 1.97
+ },
+ {
+ "id" : "fiber",
+ "points" : 0,
+ "points_max" : 5,
+ "unit" : "g",
+ "value" : 0.81
+ },
+ {
+ "id" : "fruits_vegetables_legumes",
+ "points" : 2,
+ "points_max" : 5,
+ "unit" : "%",
+ "value" : 62.5
+ }
+ ]
+ },
"count_proteins" : 1,
"count_proteins_reason" : "negative_points_less_than_11",
- "energy" : 558.75,
- "energy_points" : 1,
- "fiber" : 0.8125,
- "fiber_points" : 0,
- "fruits_vegetables_legumes" : 62.5,
- "fruits_vegetables_legumes_points" : 2,
"is_beverage" : 0,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 0,
"is_red_meat_product" : 0,
"is_water" : 0,
- "negative_nutrients" : [
- "energy",
- "sugars",
- "saturated_fat",
- "salt",
- "non_nutritive_sweeteners"
- ],
"negative_points" : 7,
+ "negative_points_max" : 55,
"positive_nutrients" : [
- "fruits_vegetables_legumes",
+ "proteins",
"fiber",
- "proteins"
+ "fruits_vegetables_legumes"
],
"positive_points" : 2,
- "proteins" : 1.974375,
- "proteins_points" : 0,
- "salt" : 0.0496875,
- "salt_points" : 0,
- "saturated_fat" : 4.903125,
- "saturated_fat_points" : 4,
- "sugars" : 7.2621875,
- "sugars_points" : 2
+ "positive_points_max" : 17
},
"grade" : "c",
"nutrients_available" : 1,
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 16db1d44ed322..6c06ea430e490 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
@@ -874,41 +874,77 @@
"2023" : {
"category_available" : 1,
"data" : {
+ "components" : {
+ "negative" : [
+ {
+ "id" : "energy",
+ "points" : 1,
+ "points_max" : 10,
+ "unit" : "kJ",
+ "value" : 558.75
+ },
+ {
+ "id" : "sugars",
+ "points" : 2,
+ "points_max" : 15,
+ "unit" : "g",
+ "value" : 7.26
+ },
+ {
+ "id" : "saturated_fat",
+ "points" : 4,
+ "points_max" : 10,
+ "unit" : "g",
+ "value" : 4.9
+ },
+ {
+ "id" : "salt",
+ "points" : 0,
+ "points_max" : 20,
+ "unit" : "g",
+ "value" : 0.05
+ }
+ ],
+ "positive" : [
+ {
+ "id" : "proteins",
+ "points" : 0,
+ "points_max" : 7,
+ "unit" : "g",
+ "value" : 1.97
+ },
+ {
+ "id" : "fiber",
+ "points" : 0,
+ "points_max" : 5,
+ "unit" : "g",
+ "value" : 0.81
+ },
+ {
+ "id" : "fruits_vegetables_legumes",
+ "points" : 2,
+ "points_max" : 5,
+ "unit" : "%",
+ "value" : 62.5
+ }
+ ]
+ },
"count_proteins" : 1,
"count_proteins_reason" : "negative_points_less_than_11",
- "energy" : 558.75,
- "energy_points" : 1,
- "fiber" : 0.8125,
- "fiber_points" : 0,
- "fruits_vegetables_legumes" : 62.5,
- "fruits_vegetables_legumes_points" : 2,
"is_beverage" : 0,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 0,
"is_red_meat_product" : 0,
"is_water" : 0,
- "negative_nutrients" : [
- "energy",
- "sugars",
- "saturated_fat",
- "salt",
- "non_nutritive_sweeteners"
- ],
"negative_points" : 7,
+ "negative_points_max" : 55,
"positive_nutrients" : [
- "fruits_vegetables_legumes",
+ "proteins",
"fiber",
- "proteins"
+ "fruits_vegetables_legumes"
],
"positive_points" : 2,
- "proteins" : 1.974375,
- "proteins_points" : 0,
- "salt" : 0.0496875,
- "salt_points" : 0,
- "saturated_fat" : 4.903125,
- "saturated_fat_points" : 4,
- "sugars" : 7.2621875,
- "sugars_points" : 2
+ "positive_points_max" : 17
},
"grade" : "c",
"nutrients_available" : 1,
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 463bd6800c9b4..38e6c0ec611e8 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
@@ -874,41 +874,77 @@
"2023" : {
"category_available" : 1,
"data" : {
+ "components" : {
+ "negative" : [
+ {
+ "id" : "energy",
+ "points" : 1,
+ "points_max" : 10,
+ "unit" : "kJ",
+ "value" : 558.75
+ },
+ {
+ "id" : "sugars",
+ "points" : 2,
+ "points_max" : 15,
+ "unit" : "g",
+ "value" : 7.26
+ },
+ {
+ "id" : "saturated_fat",
+ "points" : 4,
+ "points_max" : 10,
+ "unit" : "g",
+ "value" : 4.9
+ },
+ {
+ "id" : "salt",
+ "points" : 0,
+ "points_max" : 20,
+ "unit" : "g",
+ "value" : 0.05
+ }
+ ],
+ "positive" : [
+ {
+ "id" : "proteins",
+ "points" : 0,
+ "points_max" : 7,
+ "unit" : "g",
+ "value" : 1.97
+ },
+ {
+ "id" : "fiber",
+ "points" : 0,
+ "points_max" : 5,
+ "unit" : "g",
+ "value" : 0.81
+ },
+ {
+ "id" : "fruits_vegetables_legumes",
+ "points" : 2,
+ "points_max" : 5,
+ "unit" : "%",
+ "value" : 62.5
+ }
+ ]
+ },
"count_proteins" : 1,
"count_proteins_reason" : "negative_points_less_than_11",
- "energy" : 558.75,
- "energy_points" : 1,
- "fiber" : 0.8125,
- "fiber_points" : 0,
- "fruits_vegetables_legumes" : 62.5,
- "fruits_vegetables_legumes_points" : 2,
"is_beverage" : 0,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 0,
"is_red_meat_product" : 0,
"is_water" : 0,
- "negative_nutrients" : [
- "energy",
- "sugars",
- "saturated_fat",
- "salt",
- "non_nutritive_sweeteners"
- ],
"negative_points" : 7,
+ "negative_points_max" : 55,
"positive_nutrients" : [
- "fruits_vegetables_legumes",
+ "proteins",
"fiber",
- "proteins"
+ "fruits_vegetables_legumes"
],
"positive_points" : 2,
- "proteins" : 1.974375,
- "proteins_points" : 0,
- "salt" : 0.0496875,
- "salt_points" : 0,
- "saturated_fat" : 4.903125,
- "saturated_fat_points" : 4,
- "sugars" : 7.2621875,
- "sugars_points" : 2
+ "positive_points_max" : 17
},
"grade" : "c",
"nutrients_available" : 1,
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 3051244cc969c..98883913d8d4f 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
@@ -874,41 +874,77 @@
"2023" : {
"category_available" : 1,
"data" : {
+ "components" : {
+ "negative" : [
+ {
+ "id" : "energy",
+ "points" : 1,
+ "points_max" : 10,
+ "unit" : "kJ",
+ "value" : 558.75
+ },
+ {
+ "id" : "sugars",
+ "points" : 2,
+ "points_max" : 15,
+ "unit" : "g",
+ "value" : 7.26
+ },
+ {
+ "id" : "saturated_fat",
+ "points" : 4,
+ "points_max" : 10,
+ "unit" : "g",
+ "value" : 4.9
+ },
+ {
+ "id" : "salt",
+ "points" : 0,
+ "points_max" : 20,
+ "unit" : "g",
+ "value" : 0.05
+ }
+ ],
+ "positive" : [
+ {
+ "id" : "proteins",
+ "points" : 0,
+ "points_max" : 7,
+ "unit" : "g",
+ "value" : 1.97
+ },
+ {
+ "id" : "fiber",
+ "points" : 0,
+ "points_max" : 5,
+ "unit" : "g",
+ "value" : 0.81
+ },
+ {
+ "id" : "fruits_vegetables_legumes",
+ "points" : 2,
+ "points_max" : 5,
+ "unit" : "%",
+ "value" : 62.5
+ }
+ ]
+ },
"count_proteins" : 1,
"count_proteins_reason" : "negative_points_less_than_11",
- "energy" : 558.75,
- "energy_points" : 1,
- "fiber" : 0.8125,
- "fiber_points" : 0,
- "fruits_vegetables_legumes" : 62.5,
- "fruits_vegetables_legumes_points" : 2,
"is_beverage" : 0,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 0,
"is_red_meat_product" : 0,
"is_water" : 0,
- "negative_nutrients" : [
- "energy",
- "sugars",
- "saturated_fat",
- "salt",
- "non_nutritive_sweeteners"
- ],
"negative_points" : 7,
+ "negative_points_max" : 55,
"positive_nutrients" : [
- "fruits_vegetables_legumes",
+ "proteins",
"fiber",
- "proteins"
+ "fruits_vegetables_legumes"
],
"positive_points" : 2,
- "proteins" : 1.974375,
- "proteins_points" : 0,
- "salt" : 0.0496875,
- "salt_points" : 0,
- "saturated_fat" : 4.903125,
- "saturated_fat_points" : 4,
- "sugars" : 7.2621875,
- "sugars_points" : 2
+ "positive_points_max" : 17
},
"grade" : "c",
"nutrients_available" : 1,
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 437845525bd78..566cda59247b0 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
@@ -1514,6 +1514,29 @@
"health"
]
},
+ "nutrient_levels" : {
+ "elements" : [
+ {
+ "element_type" : "panel_group",
+ "panel_group_element" : {
+ "panel_group_id" : "nutrient_levels_group",
+ "panel_ids" : []
+ }
+ }
+ ],
+ "evaluation" : "unknown",
+ "expand_for" : "large",
+ "expanded" : false,
+ "level" : "info",
+ "title_element" : {
+ "icon_color_from_evaluation" : true,
+ "icon_url" : "http://static.openfoodfacts.localhost/images/icons/dist/nutrition.svg",
+ "title" : "Nutrient levels"
+ },
+ "topics" : [
+ "health"
+ ]
+ },
"nutriscore" : {
"elements" : [
{
@@ -1533,7 +1556,7 @@
{
"element_type" : "text",
"text_element" : {
- "html" : "\n\n
This product is not considered a beverage for the calculation of the Nutri-Score.
\n\n\n\n\n\n
\n Positive points: 3 \n
\n\n
\n \n - \n Proteins:\n1 / 5\n(value: 1.974375, \n rounded value: 1.97)\n
\n \n - \n Fiber:\n0 / 5\n(value: 0.8125, \n rounded value: 0.81)\n
\n \n - \n Fruits, vegetables, nuts, and colza/walnut/olive oils:\n2 / 5\n(value: 62.5, \n rounded value: 62.5)\n
\n \n
\n\n\n\n
\n Negative points: 6 \n
\n\n
\n \n - \n Energy:\n1 / 10\n(value: 558.75, \n rounded value: 558.8)\n
\n \n - \n Sugars:\n1 / 10\n(value: 7.2621875, \n rounded value: 7.26)\n
\n \n - \n Saturated fat:\n4 / 10\n(value: 4.903125, \n rounded value: 4.9)\n
\n \n - \n Sodium:\n0 / 10\n(value: 19.725, \n rounded value: 19.7)\n
\n \n
\n\n\n\n
The points for proteins are counted because the negative points are less than 11.
\n\n
\n Nutritional score: 3\n (6 - 3)\n
\n
Nutri-Score: C
\n\n"
+ "html" : "\n\n
This product is not considered a beverage for the calculation of the Nutri-Score.
\n\n\n\n\n\n
\n Positive points: 3 \n
\n\n
\n \n - \n Proteins:\n1 / 5\n(value: 1.974375, \n rounded value: 1.97)\n
\n \n - \n Fiber:\n0 / 5\n(value: 0.8125, \n rounded value: 0.81)\n
\n \n - \n Fruits, vegetables, nuts, and colza/walnut/olive oils:\n2 / 5\n(value: 62.5, \n rounded value: 62.5)\n
\n \n
\n\n\n\n
\n Negative points: 6 \n
\n\n
\n \n - \n Energy:\n1 / 10\n(value: 558.75, \n rounded value: 558.8)\n
\n \n - \n Sugars:\n1 / 10\n(value: 7.2621875, \n rounded value: 7.26)\n
\n \n - \n Saturated fat:\n4 / 10\n(value: 4.903125, \n rounded value: 4.9)\n
\n \n - \n Sodium:\n0 / 10\n(value: 19.725, \n rounded value: 19.7)\n
\n \n
\n\n\n\n
The points for proteins are counted because the negative points are less than 11.
\n\n
\n Nutritional score: \n (6 - 3)\n
\n
Nutri-Score:
\n\n"
}
},
{
@@ -2165,41 +2188,77 @@
"2023" : {
"category_available" : 1,
"data" : {
+ "components" : {
+ "negative" : [
+ {
+ "id" : "energy",
+ "points" : 1,
+ "points_max" : 10,
+ "unit" : "kJ",
+ "value" : 558.75
+ },
+ {
+ "id" : "sugars",
+ "points" : 2,
+ "points_max" : 15,
+ "unit" : "g",
+ "value" : 7.26
+ },
+ {
+ "id" : "saturated_fat",
+ "points" : 4,
+ "points_max" : 10,
+ "unit" : "g",
+ "value" : 4.9
+ },
+ {
+ "id" : "salt",
+ "points" : 0,
+ "points_max" : 20,
+ "unit" : "g",
+ "value" : 0.05
+ }
+ ],
+ "positive" : [
+ {
+ "id" : "proteins",
+ "points" : 0,
+ "points_max" : 7,
+ "unit" : "g",
+ "value" : 1.97
+ },
+ {
+ "id" : "fiber",
+ "points" : 0,
+ "points_max" : 5,
+ "unit" : "g",
+ "value" : 0.81
+ },
+ {
+ "id" : "fruits_vegetables_legumes",
+ "points" : 2,
+ "points_max" : 5,
+ "unit" : "%",
+ "value" : 62.5
+ }
+ ]
+ },
"count_proteins" : 1,
"count_proteins_reason" : "negative_points_less_than_11",
- "energy" : 558.75,
- "energy_points" : 1,
- "fiber" : 0.8125,
- "fiber_points" : 0,
- "fruits_vegetables_legumes" : 62.5,
- "fruits_vegetables_legumes_points" : 2,
"is_beverage" : 0,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 0,
"is_red_meat_product" : 0,
"is_water" : 0,
- "negative_nutrients" : [
- "energy",
- "sugars",
- "saturated_fat",
- "salt",
- "non_nutritive_sweeteners"
- ],
"negative_points" : 7,
+ "negative_points_max" : 55,
"positive_nutrients" : [
- "fruits_vegetables_legumes",
+ "proteins",
"fiber",
- "proteins"
+ "fruits_vegetables_legumes"
],
"positive_points" : 2,
- "proteins" : 1.974375,
- "proteins_points" : 0,
- "salt" : 0.0496875,
- "salt_points" : 0,
- "saturated_fat" : 4.903125,
- "saturated_fat_points" : 4,
- "sugars" : 7.2621875,
- "sugars_points" : 2
+ "positive_points_max" : 17
},
"grade" : "c",
"nutrients_available" : 1,
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 d8e993f3fcde7..7a584db7fb6fc 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
@@ -874,41 +874,77 @@
"2023" : {
"category_available" : 1,
"data" : {
+ "components" : {
+ "negative" : [
+ {
+ "id" : "energy",
+ "points" : 1,
+ "points_max" : 10,
+ "unit" : "kJ",
+ "value" : 558.75
+ },
+ {
+ "id" : "sugars",
+ "points" : 2,
+ "points_max" : 15,
+ "unit" : "g",
+ "value" : 7.26
+ },
+ {
+ "id" : "saturated_fat",
+ "points" : 4,
+ "points_max" : 10,
+ "unit" : "g",
+ "value" : 4.9
+ },
+ {
+ "id" : "salt",
+ "points" : 0,
+ "points_max" : 20,
+ "unit" : "g",
+ "value" : 0.05
+ }
+ ],
+ "positive" : [
+ {
+ "id" : "proteins",
+ "points" : 0,
+ "points_max" : 7,
+ "unit" : "g",
+ "value" : 1.97
+ },
+ {
+ "id" : "fiber",
+ "points" : 0,
+ "points_max" : 5,
+ "unit" : "g",
+ "value" : 0.81
+ },
+ {
+ "id" : "fruits_vegetables_legumes",
+ "points" : 2,
+ "points_max" : 5,
+ "unit" : "%",
+ "value" : 62.5
+ }
+ ]
+ },
"count_proteins" : 1,
"count_proteins_reason" : "negative_points_less_than_11",
- "energy" : 558.75,
- "energy_points" : 1,
- "fiber" : 0.8125,
- "fiber_points" : 0,
- "fruits_vegetables_legumes" : 62.5,
- "fruits_vegetables_legumes_points" : 2,
"is_beverage" : 0,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 0,
"is_red_meat_product" : 0,
"is_water" : 0,
- "negative_nutrients" : [
- "energy",
- "sugars",
- "saturated_fat",
- "salt",
- "non_nutritive_sweeteners"
- ],
"negative_points" : 7,
+ "negative_points_max" : 55,
"positive_nutrients" : [
- "fruits_vegetables_legumes",
+ "proteins",
"fiber",
- "proteins"
+ "fruits_vegetables_legumes"
],
"positive_points" : 2,
- "proteins" : 1.974375,
- "proteins_points" : 0,
- "salt" : 0.0496875,
- "salt_points" : 0,
- "saturated_fat" : 4.903125,
- "saturated_fat_points" : 4,
- "sugars" : 7.2621875,
- "sugars_points" : 2
+ "positive_points_max" : 17
},
"grade" : "c",
"nutrients_available" : 1,
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 394887f26ce12..07ec1d9fde32d 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
@@ -2162,6 +2162,29 @@
"health"
]
},
+ "nutrient_levels" : {
+ "elements" : [
+ {
+ "element_type" : "panel_group",
+ "panel_group_element" : {
+ "panel_group_id" : "nutrient_levels_group",
+ "panel_ids" : []
+ }
+ }
+ ],
+ "evaluation" : "unknown",
+ "expand_for" : "large",
+ "expanded" : false,
+ "level" : "info",
+ "title_element" : {
+ "icon_color_from_evaluation" : true,
+ "icon_url" : "http://static.openfoodfacts.localhost/images/icons/dist/nutrition.svg",
+ "title" : "Nutrient levels"
+ },
+ "topics" : [
+ "health"
+ ]
+ },
"nutriscore" : {
"elements" : [
{
@@ -2181,7 +2204,7 @@
{
"element_type" : "text",
"text_element" : {
- "html" : "\n\n
This product is not considered a beverage for the calculation of the Nutri-Score.
\n\n\n\n\n\n
\n Positive points: 3 \n
\n\n
\n \n - \n Proteins:\n1 / 5\n(value: 1.974375, \n rounded value: 1.97)\n
\n \n - \n Fiber:\n0 / 5\n(value: 0.8125, \n rounded value: 0.81)\n
\n \n - \n Fruits, vegetables, nuts, and colza/walnut/olive oils:\n2 / 5\n(value: 62.5, \n rounded value: 62.5)\n
\n \n
\n\n\n\n
\n Negative points: 6 \n
\n\n
\n \n - \n Energy:\n1 / 10\n(value: 558.75, \n rounded value: 558.8)\n
\n \n - \n Sugars:\n1 / 10\n(value: 7.2621875, \n rounded value: 7.26)\n
\n \n - \n Saturated fat:\n4 / 10\n(value: 4.903125, \n rounded value: 4.9)\n
\n \n - \n Sodium:\n0 / 10\n(value: 19.725, \n rounded value: 19.7)\n
\n \n
\n\n\n\n
The points for proteins are counted because the negative points are less than 11.
\n\n
\n Nutritional score: 3\n (6 - 3)\n
\n
Nutri-Score: C
\n\n"
+ "html" : "\n\n
This product is not considered a beverage for the calculation of the Nutri-Score.
\n\n\n\n\n\n
\n Positive points: 3 \n
\n\n
\n \n - \n Proteins:\n1 / 5\n(value: 1.974375, \n rounded value: 1.97)\n
\n \n - \n Fiber:\n0 / 5\n(value: 0.8125, \n rounded value: 0.81)\n
\n \n - \n Fruits, vegetables, nuts, and colza/walnut/olive oils:\n2 / 5\n(value: 62.5, \n rounded value: 62.5)\n
\n \n
\n\n\n\n
\n Negative points: 6 \n
\n\n
\n \n - \n Energy:\n1 / 10\n(value: 558.75, \n rounded value: 558.8)\n
\n \n - \n Sugars:\n1 / 10\n(value: 7.2621875, \n rounded value: 7.26)\n
\n \n - \n Saturated fat:\n4 / 10\n(value: 4.903125, \n rounded value: 4.9)\n
\n \n - \n Sodium:\n0 / 10\n(value: 19.725, \n rounded value: 19.7)\n
\n \n
\n\n\n\n
The points for proteins are counted because the negative points are less than 11.
\n\n
\n Nutritional score: \n (6 - 3)\n
\n
Nutri-Score:
\n\n"
}
},
{
@@ -2813,41 +2836,77 @@
"2023" : {
"category_available" : 1,
"data" : {
+ "components" : {
+ "negative" : [
+ {
+ "id" : "energy",
+ "points" : 1,
+ "points_max" : 10,
+ "unit" : "kJ",
+ "value" : 558.75
+ },
+ {
+ "id" : "sugars",
+ "points" : 2,
+ "points_max" : 15,
+ "unit" : "g",
+ "value" : 7.26
+ },
+ {
+ "id" : "saturated_fat",
+ "points" : 4,
+ "points_max" : 10,
+ "unit" : "g",
+ "value" : 4.9
+ },
+ {
+ "id" : "salt",
+ "points" : 0,
+ "points_max" : 20,
+ "unit" : "g",
+ "value" : 0.05
+ }
+ ],
+ "positive" : [
+ {
+ "id" : "proteins",
+ "points" : 0,
+ "points_max" : 7,
+ "unit" : "g",
+ "value" : 1.97
+ },
+ {
+ "id" : "fiber",
+ "points" : 0,
+ "points_max" : 5,
+ "unit" : "g",
+ "value" : 0.81
+ },
+ {
+ "id" : "fruits_vegetables_legumes",
+ "points" : 2,
+ "points_max" : 5,
+ "unit" : "%",
+ "value" : 62.5
+ }
+ ]
+ },
"count_proteins" : 1,
"count_proteins_reason" : "negative_points_less_than_11",
- "energy" : 558.75,
- "energy_points" : 1,
- "fiber" : 0.8125,
- "fiber_points" : 0,
- "fruits_vegetables_legumes" : 62.5,
- "fruits_vegetables_legumes_points" : 2,
"is_beverage" : 0,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 0,
"is_red_meat_product" : 0,
"is_water" : 0,
- "negative_nutrients" : [
- "energy",
- "sugars",
- "saturated_fat",
- "salt",
- "non_nutritive_sweeteners"
- ],
"negative_points" : 7,
+ "negative_points_max" : 55,
"positive_nutrients" : [
- "fruits_vegetables_legumes",
+ "proteins",
"fiber",
- "proteins"
+ "fruits_vegetables_legumes"
],
"positive_points" : 2,
- "proteins" : 1.974375,
- "proteins_points" : 0,
- "salt" : 0.0496875,
- "salt_points" : 0,
- "saturated_fat" : 4.903125,
- "saturated_fat_points" : 4,
- "sugars" : 7.2621875,
- "sugars_points" : 2
+ "positive_points_max" : 17
},
"grade" : "c",
"nutrients_available" : 1,
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 d3504cd53522a..04888353c4117 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
@@ -869,41 +869,77 @@
"2023" : {
"category_available" : 1,
"data" : {
+ "components" : {
+ "negative" : [
+ {
+ "id" : "energy",
+ "points" : 1,
+ "points_max" : 10,
+ "unit" : "kJ",
+ "value" : 558.75
+ },
+ {
+ "id" : "sugars",
+ "points" : 2,
+ "points_max" : 15,
+ "unit" : "g",
+ "value" : 7.26
+ },
+ {
+ "id" : "saturated_fat",
+ "points" : 4,
+ "points_max" : 10,
+ "unit" : "g",
+ "value" : 4.9
+ },
+ {
+ "id" : "salt",
+ "points" : 0,
+ "points_max" : 20,
+ "unit" : "g",
+ "value" : 0.05
+ }
+ ],
+ "positive" : [
+ {
+ "id" : "proteins",
+ "points" : 0,
+ "points_max" : 7,
+ "unit" : "g",
+ "value" : 1.97
+ },
+ {
+ "id" : "fiber",
+ "points" : 0,
+ "points_max" : 5,
+ "unit" : "g",
+ "value" : 0.81
+ },
+ {
+ "id" : "fruits_vegetables_legumes",
+ "points" : 2,
+ "points_max" : 5,
+ "unit" : "%",
+ "value" : 62.5
+ }
+ ]
+ },
"count_proteins" : 1,
"count_proteins_reason" : "negative_points_less_than_11",
- "energy" : 558.75,
- "energy_points" : 1,
- "fiber" : 0.8125,
- "fiber_points" : 0,
- "fruits_vegetables_legumes" : 62.5,
- "fruits_vegetables_legumes_points" : 2,
"is_beverage" : 0,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 0,
"is_red_meat_product" : 0,
"is_water" : 0,
- "negative_nutrients" : [
- "energy",
- "sugars",
- "saturated_fat",
- "salt",
- "non_nutritive_sweeteners"
- ],
"negative_points" : 7,
+ "negative_points_max" : 55,
"positive_nutrients" : [
- "fruits_vegetables_legumes",
+ "proteins",
"fiber",
- "proteins"
+ "fruits_vegetables_legumes"
],
"positive_points" : 2,
- "proteins" : 1.974375,
- "proteins_points" : 0,
- "salt" : 0.0496875,
- "salt_points" : 0,
- "saturated_fat" : 4.903125,
- "saturated_fat_points" : 4,
- "sugars" : 7.2621875,
- "sugars_points" : 2
+ "positive_points_max" : 17
},
"grade" : "c",
"nutrients_available" : 1,
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 565595c5ccb78..7a10baf2152d3 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
@@ -822,6 +822,29 @@
"health"
]
},
+ "nutrient_levels" : {
+ "elements" : [
+ {
+ "element_type" : "panel_group",
+ "panel_group_element" : {
+ "panel_group_id" : "nutrient_levels_group",
+ "panel_ids" : []
+ }
+ }
+ ],
+ "evaluation" : "unknown",
+ "expand_for" : "large",
+ "expanded" : false,
+ "level" : "info",
+ "title_element" : {
+ "icon_color_from_evaluation" : true,
+ "icon_url" : "http://static.openfoodfacts.localhost/images/icons/dist/nutrition.svg",
+ "title" : "Repères nutritionnels"
+ },
+ "topics" : [
+ "health"
+ ]
+ },
"nutriscore" : {
"elements" : [
{
@@ -841,7 +864,7 @@
{
"element_type" : "text",
"text_element" : {
- "html" : "\n\n
Ce produit n'est pas considéré comme une boisson pour le calcul du Nutri-Score.
\n\n\n\n\n\n
\n Points positifs : 3 \n
\n\n
\n \n - \n Protéines :\n1 / 5\n(valeur : 1.974375, \n valeur arrondie : 1.97)\n
\n \n - \n Fibre :\n0 / 5\n(valeur : 0.8125, \n valeur arrondie : 0.81)\n
\n \n - \n Fruits, légumes, noix et huiles de colza / noix / olive :\n2 / 5\n(valeur : 62.5, \n valeur arrondie : 62.5)\n
\n \n
\n\n\n\n
\n Points négatifs : 6 \n
\n\n
\n \n - \n Énergie :\n1 / 10\n(valeur : 558.75, \n valeur arrondie : 558.8)\n
\n \n - \n Sucres :\n1 / 10\n(valeur : 7.2621875, \n valeur arrondie : 7.26)\n
\n \n - \n Graisses saturées :\n4 / 10\n(valeur : 4.903125, \n valeur arrondie : 4.9)\n
\n \n - \n Sodium :\n0 / 10\n(valeur : 19.725, \n valeur arrondie : 19.7)\n
\n \n
\n\n\n\n
Les points pour les protéines sont comptés car les points négatifs sont inférieurs à 11.
\n\n
\n Score nutritionnel : 3\n (6 - 3)\n
\n
Nutri-Score : C
\n\n"
+ "html" : "\n\n
Ce produit n'est pas considéré comme une boisson pour le calcul du Nutri-Score.
\n\n\n\n\n\n
\n Points positifs : 3 \n
\n\n
\n \n - \n Protéines :\n1 / 5\n(valeur : 1.974375, \n valeur arrondie : 1.97)\n
\n \n - \n Fibre :\n0 / 5\n(valeur : 0.8125, \n valeur arrondie : 0.81)\n
\n \n - \n Fruits, légumes, noix et huiles de colza / noix / olive :\n2 / 5\n(valeur : 62.5, \n valeur arrondie : 62.5)\n
\n \n
\n\n\n\n
\n Points négatifs : 6 \n
\n\n
\n \n - \n Énergie :\n1 / 10\n(valeur : 558.75, \n valeur arrondie : 558.8)\n
\n \n - \n Sucres :\n1 / 10\n(valeur : 7.2621875, \n valeur arrondie : 7.26)\n
\n \n - \n Graisses saturées :\n4 / 10\n(valeur : 4.903125, \n valeur arrondie : 4.9)\n
\n \n - \n Sodium :\n0 / 10\n(valeur : 19.725, \n valeur arrondie : 19.7)\n
\n \n
\n\n\n\n
Les points pour les protéines sont comptés car les points négatifs sont inférieurs à 11.
\n\n
\n Score nutritionnel : \n (6 - 3)\n
\n
Nutri-Score :
\n\n"
}
},
{
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 e37d18c3855fe..d9d1444b0469d 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
@@ -822,6 +822,29 @@
"health"
]
},
+ "nutrient_levels" : {
+ "elements" : [
+ {
+ "element_type" : "panel_group",
+ "panel_group_element" : {
+ "panel_group_id" : "nutrient_levels_group",
+ "panel_ids" : []
+ }
+ }
+ ],
+ "evaluation" : "unknown",
+ "expand_for" : "large",
+ "expanded" : false,
+ "level" : "info",
+ "title_element" : {
+ "icon_color_from_evaluation" : true,
+ "icon_url" : "http://static.openfoodfacts.localhost/images/icons/dist/nutrition.svg",
+ "title" : "Nutrient levels"
+ },
+ "topics" : [
+ "health"
+ ]
+ },
"nutriscore" : {
"elements" : [
{
@@ -841,7 +864,7 @@
{
"element_type" : "text",
"text_element" : {
- "html" : "\n\n
This product is not considered a beverage for the calculation of the Nutri-Score.
\n\n\n\n\n\n
\n Positive points: 3 \n
\n\n
\n \n - \n Proteins:\n1 / 5\n(value: 1.974375, \n rounded value: 1.97)\n
\n \n - \n Fiber:\n0 / 5\n(value: 0.8125, \n rounded value: 0.81)\n
\n \n - \n Fruits, vegetables, nuts, and colza/walnut/olive oils:\n2 / 5\n(value: 62.5, \n rounded value: 62.5)\n
\n \n
\n\n\n\n
\n Negative points: 6 \n
\n\n
\n \n - \n Energy:\n1 / 10\n(value: 558.75, \n rounded value: 558.8)\n
\n \n - \n Sugars:\n1 / 10\n(value: 7.2621875, \n rounded value: 7.26)\n
\n \n - \n Saturated fat:\n4 / 10\n(value: 4.903125, \n rounded value: 4.9)\n
\n \n - \n Sodium:\n0 / 10\n(value: 19.725, \n rounded value: 19.7)\n
\n \n
\n\n\n\n
The points for proteins are counted because the negative points are less than 11.
\n\n
\n Nutritional score: 3\n (6 - 3)\n
\n
Nutri-Score: C
\n\n"
+ "html" : "\n\n
This product is not considered a beverage for the calculation of the Nutri-Score.
\n\n\n\n\n\n
\n Positive points: 3 \n
\n\n
\n \n - \n Proteins:\n1 / 5\n(value: 1.974375, \n rounded value: 1.97)\n
\n \n - \n Fiber:\n0 / 5\n(value: 0.8125, \n rounded value: 0.81)\n
\n \n - \n Fruits, vegetables, nuts, and colza/walnut/olive oils:\n2 / 5\n(value: 62.5, \n rounded value: 62.5)\n
\n \n
\n\n\n\n
\n Negative points: 6 \n
\n\n
\n \n - \n Energy:\n1 / 10\n(value: 558.75, \n rounded value: 558.8)\n
\n \n - \n Sugars:\n1 / 10\n(value: 7.2621875, \n rounded value: 7.26)\n
\n \n - \n Saturated fat:\n4 / 10\n(value: 4.903125, \n rounded value: 4.9)\n
\n \n - \n Sodium:\n0 / 10\n(value: 19.725, \n rounded value: 19.7)\n
\n \n
\n\n\n\n
The points for proteins are counted because the negative points are less than 11.
\n\n
\n Nutritional score: \n (6 - 3)\n
\n
Nutri-Score:
\n\n"
}
},
{
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 8715d055544c3..fde972ff2f308 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
@@ -403,7 +403,7 @@
"data" : {
"energy" : null,
"fiber" : 0,
- "fruits_vegetables_legumes" : null,
+ "fruits_vegetables_legumes" : 0,
"is_beverage" : 0,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 0,
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 e989ed12d88b3..f9325b254c176 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
@@ -502,6 +502,29 @@
"health"
]
},
+ "nutrient_levels" : {
+ "elements" : [
+ {
+ "element_type" : "panel_group",
+ "panel_group_element" : {
+ "panel_group_id" : "nutrient_levels_group",
+ "panel_ids" : []
+ }
+ }
+ ],
+ "evaluation" : "unknown",
+ "expand_for" : "large",
+ "expanded" : false,
+ "level" : "info",
+ "title_element" : {
+ "icon_color_from_evaluation" : true,
+ "icon_url" : "http://static.openfoodfacts.localhost/images/icons/dist/nutrition.svg",
+ "title" : "Nutrient levels"
+ },
+ "topics" : [
+ "health"
+ ]
+ },
"nutriscore" : {
"elements" : [
{
diff --git a/tests/integration/expected_test_results/convert_and_import_excel_file/carrefour-images/products/3560070167470.json b/tests/integration/expected_test_results/convert_and_import_excel_file/carrefour-images/products/3560070167470.json
index d09f92f85e78c..a56003ba3e1dd 100644
--- a/tests/integration/expected_test_results/convert_and_import_excel_file/carrefour-images/products/3560070167470.json
+++ b/tests/integration/expected_test_results/convert_and_import_excel_file/carrefour-images/products/3560070167470.json
@@ -502,7 +502,7 @@
"data" : {
"energy" : null,
"fiber" : 0,
- "fruits_vegetables_legumes" : null,
+ "fruits_vegetables_legumes" : 0,
"is_beverage" : 0,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 0,
diff --git a/tests/integration/expected_test_results/convert_and_import_excel_file/carrefour-images/products/3560070815746.json b/tests/integration/expected_test_results/convert_and_import_excel_file/carrefour-images/products/3560070815746.json
index 149931c72a113..f91991d750e85 100644
--- a/tests/integration/expected_test_results/convert_and_import_excel_file/carrefour-images/products/3560070815746.json
+++ b/tests/integration/expected_test_results/convert_and_import_excel_file/carrefour-images/products/3560070815746.json
@@ -540,7 +540,7 @@
"data" : {
"energy" : null,
"fiber" : 0,
- "fruits_vegetables_legumes" : null,
+ "fruits_vegetables_legumes" : 0,
"is_beverage" : 0,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 0,
diff --git a/tests/integration/expected_test_results/convert_and_import_excel_file/packagings-mousquetaires/products/3250390017165.json b/tests/integration/expected_test_results/convert_and_import_excel_file/packagings-mousquetaires/products/3250390017165.json
index 7a528b9068f44..4cda461127d51 100644
--- a/tests/integration/expected_test_results/convert_and_import_excel_file/packagings-mousquetaires/products/3250390017165.json
+++ b/tests/integration/expected_test_results/convert_and_import_excel_file/packagings-mousquetaires/products/3250390017165.json
@@ -449,7 +449,7 @@
"data" : {
"energy" : null,
"fiber" : 0,
- "fruits_vegetables_legumes" : null,
+ "fruits_vegetables_legumes" : 0,
"is_beverage" : 0,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 0,
diff --git a/tests/integration/expected_test_results/convert_and_import_excel_file/packagings-mousquetaires/products/3250390020745.json b/tests/integration/expected_test_results/convert_and_import_excel_file/packagings-mousquetaires/products/3250390020745.json
index 0386ca65bb9d7..4c0557be0a5d5 100644
--- a/tests/integration/expected_test_results/convert_and_import_excel_file/packagings-mousquetaires/products/3250390020745.json
+++ b/tests/integration/expected_test_results/convert_and_import_excel_file/packagings-mousquetaires/products/3250390020745.json
@@ -446,7 +446,7 @@
"data" : {
"energy" : null,
"fiber" : 0,
- "fruits_vegetables_legumes" : null,
+ "fruits_vegetables_legumes" : 0,
"is_beverage" : 0,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 0,
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 e4f9974fa2846..34971bc5db255 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
@@ -435,7 +435,7 @@
"data" : {
"energy" : null,
"fiber" : 0,
- "fruits_vegetables_legumes" : null,
+ "fruits_vegetables_legumes" : 0,
"is_beverage" : 0,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 0,
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 2b3df847f91de..9445eca0e4117 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
@@ -449,7 +449,7 @@
"data" : {
"energy" : null,
"fiber" : 0,
- "fruits_vegetables_legumes" : null,
+ "fruits_vegetables_legumes" : 0,
"is_beverage" : 0,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 0,
diff --git a/tests/integration/expected_test_results/convert_and_import_excel_file/packagings-mousquetaires/products/3250390021001.json b/tests/integration/expected_test_results/convert_and_import_excel_file/packagings-mousquetaires/products/3250390021001.json
index df55b0b74a2eb..bfd281c40441a 100644
--- a/tests/integration/expected_test_results/convert_and_import_excel_file/packagings-mousquetaires/products/3250390021001.json
+++ b/tests/integration/expected_test_results/convert_and_import_excel_file/packagings-mousquetaires/products/3250390021001.json
@@ -443,7 +443,7 @@
"data" : {
"energy" : null,
"fiber" : 0,
- "fruits_vegetables_legumes" : null,
+ "fruits_vegetables_legumes" : 0,
"is_beverage" : 0,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 0,
diff --git a/tests/integration/expected_test_results/convert_and_import_excel_file/packagings-mousquetaires/products/3250390021469.json b/tests/integration/expected_test_results/convert_and_import_excel_file/packagings-mousquetaires/products/3250390021469.json
index 44821c3b63158..197bef122887d 100644
--- a/tests/integration/expected_test_results/convert_and_import_excel_file/packagings-mousquetaires/products/3250390021469.json
+++ b/tests/integration/expected_test_results/convert_and_import_excel_file/packagings-mousquetaires/products/3250390021469.json
@@ -440,7 +440,7 @@
"data" : {
"energy" : null,
"fiber" : 0,
- "fruits_vegetables_legumes" : null,
+ "fruits_vegetables_legumes" : 0,
"is_beverage" : 0,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 0,
diff --git a/tests/integration/expected_test_results/convert_and_import_excel_file/packagings-mousquetaires/products/3250390021544.json b/tests/integration/expected_test_results/convert_and_import_excel_file/packagings-mousquetaires/products/3250390021544.json
index cf99f787062d7..52d5915354cd7 100644
--- a/tests/integration/expected_test_results/convert_and_import_excel_file/packagings-mousquetaires/products/3250390021544.json
+++ b/tests/integration/expected_test_results/convert_and_import_excel_file/packagings-mousquetaires/products/3250390021544.json
@@ -443,7 +443,7 @@
"data" : {
"energy" : null,
"fiber" : 0,
- "fruits_vegetables_legumes" : null,
+ "fruits_vegetables_legumes" : 0,
"is_beverage" : 0,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 0,
diff --git a/tests/integration/expected_test_results/convert_and_import_excel_file/packagings-mousquetaires/products/3250390021568.json b/tests/integration/expected_test_results/convert_and_import_excel_file/packagings-mousquetaires/products/3250390021568.json
index 95cfaa1dad22f..f277f1f6975fc 100644
--- a/tests/integration/expected_test_results/convert_and_import_excel_file/packagings-mousquetaires/products/3250390021568.json
+++ b/tests/integration/expected_test_results/convert_and_import_excel_file/packagings-mousquetaires/products/3250390021568.json
@@ -441,7 +441,7 @@
"data" : {
"energy" : null,
"fiber" : 0,
- "fruits_vegetables_legumes" : null,
+ "fruits_vegetables_legumes" : 0,
"is_beverage" : 0,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 0,
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 3062b68dbf556..8bd5f3fad7cf5 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
@@ -433,7 +433,7 @@
"data" : {
"energy" : null,
"fiber" : 0,
- "fruits_vegetables_legumes" : null,
+ "fruits_vegetables_legumes" : 0,
"is_beverage" : 0,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 0,
diff --git a/tests/integration/expected_test_results/convert_and_import_excel_file/packagings-mousquetaires/products/3250390024781.json b/tests/integration/expected_test_results/convert_and_import_excel_file/packagings-mousquetaires/products/3250390024781.json
index 4fd9b87895f02..3561231c8b7ce 100644
--- a/tests/integration/expected_test_results/convert_and_import_excel_file/packagings-mousquetaires/products/3250390024781.json
+++ b/tests/integration/expected_test_results/convert_and_import_excel_file/packagings-mousquetaires/products/3250390024781.json
@@ -468,7 +468,7 @@
"data" : {
"energy" : null,
"fiber" : 0,
- "fruits_vegetables_legumes" : null,
+ "fruits_vegetables_legumes" : 0,
"is_beverage" : 0,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 0,
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 7d87177b81813..69481be3ac0a2 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
@@ -457,7 +457,7 @@
"data" : {
"energy" : null,
"fiber" : 0,
- "fruits_vegetables_legumes" : null,
+ "fruits_vegetables_legumes" : 0,
"is_beverage" : 0,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 0,
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 f315ae1d2011b..6e85a32cee409 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
@@ -458,7 +458,7 @@
"data" : {
"energy" : null,
"fiber" : 0,
- "fruits_vegetables_legumes" : null,
+ "fruits_vegetables_legumes" : 0,
"is_beverage" : 0,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 0,
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 63b84c85bb8ad..6fd75d781b75f 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
@@ -458,7 +458,7 @@
"data" : {
"energy" : null,
"fiber" : 0,
- "fruits_vegetables_legumes" : null,
+ "fruits_vegetables_legumes" : 0,
"is_beverage" : 0,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 0,
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 59e817ca6a28a..c7dccaf0a5992 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
@@ -450,7 +450,7 @@
"data" : {
"energy" : null,
"fiber" : 0,
- "fruits_vegetables_legumes" : null,
+ "fruits_vegetables_legumes" : 0,
"is_beverage" : 0,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 0,
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 a2145fb32c09c..ee1ce8f38111c 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
@@ -432,7 +432,7 @@
"data" : {
"energy" : null,
"fiber" : 0,
- "fruits_vegetables_legumes" : null,
+ "fruits_vegetables_legumes" : 0,
"is_beverage" : 0,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 0,
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 f0b5521ac7715..2a9179785524c 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
@@ -454,7 +454,7 @@
"data" : {
"energy" : null,
"fiber" : 0,
- "fruits_vegetables_legumes" : null,
+ "fruits_vegetables_legumes" : 0,
"is_beverage" : 0,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 0,
diff --git a/tests/integration/expected_test_results/convert_and_import_excel_file/packagings-mousquetaires/products/3250390026648.json b/tests/integration/expected_test_results/convert_and_import_excel_file/packagings-mousquetaires/products/3250390026648.json
index f1fd287b1f34f..85ce702fda54d 100644
--- a/tests/integration/expected_test_results/convert_and_import_excel_file/packagings-mousquetaires/products/3250390026648.json
+++ b/tests/integration/expected_test_results/convert_and_import_excel_file/packagings-mousquetaires/products/3250390026648.json
@@ -469,7 +469,7 @@
"data" : {
"energy" : null,
"fiber" : 0,
- "fruits_vegetables_legumes" : null,
+ "fruits_vegetables_legumes" : 0,
"is_beverage" : 0,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 0,
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 5669e0bd840fd..ff13b8f588600 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
@@ -451,7 +451,7 @@
"data" : {
"energy" : null,
"fiber" : 0,
- "fruits_vegetables_legumes" : null,
+ "fruits_vegetables_legumes" : 0,
"is_beverage" : 0,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 0,
diff --git a/tests/integration/expected_test_results/convert_and_import_excel_file/test/products/7270190128403.json b/tests/integration/expected_test_results/convert_and_import_excel_file/test/products/7270190128403.json
index df4e7587ff3a0..a468445b004a0 100644
--- a/tests/integration/expected_test_results/convert_and_import_excel_file/test/products/7270190128403.json
+++ b/tests/integration/expected_test_results/convert_and_import_excel_file/test/products/7270190128403.json
@@ -420,7 +420,7 @@
"data" : {
"energy" : null,
"fiber" : 0,
- "fruits_vegetables_legumes" : null,
+ "fruits_vegetables_legumes" : 0,
"is_beverage" : 0,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 0,
diff --git a/tests/integration/expected_test_results/data_quality_knowledge_panel/data-quality.json b/tests/integration/expected_test_results/data_quality_knowledge_panel/data-quality.json
index 48ed01d496c89..321e0f3d81437 100644
--- a/tests/integration/expected_test_results/data_quality_knowledge_panel/data-quality.json
+++ b/tests/integration/expected_test_results/data_quality_knowledge_panel/data-quality.json
@@ -272,7 +272,7 @@
"panel_group_id" : "nutrition",
"panel_ids" : [
"nutriscore",
- "nutrient_level_salt"
+ "nutrient_levels"
],
"title" : "Nutrition",
"type" : "subcard"
@@ -576,6 +576,31 @@
"health"
]
},
+ "nutrient_levels" : {
+ "elements" : [
+ {
+ "element_type" : "panel_group",
+ "panel_group_element" : {
+ "panel_group_id" : "nutrient_levels_group",
+ "panel_ids" : [
+ "nutrient_level_salt"
+ ]
+ }
+ }
+ ],
+ "evaluation" : "unknown",
+ "expand_for" : "large",
+ "expanded" : false,
+ "level" : "info",
+ "title_element" : {
+ "icon_color_from_evaluation" : true,
+ "icon_url" : "http://static.openfoodfacts.localhost/images/icons/dist/nutrition.svg",
+ "title" : "Nutrient levels"
+ },
+ "topics" : [
+ "health"
+ ]
+ },
"nutriscore" : {
"elements" : [
{
diff --git a/tests/integration/expected_test_results/data_quality_knowledge_panel/no-data-quality.json b/tests/integration/expected_test_results/data_quality_knowledge_panel/no-data-quality.json
index 0de636c5d4dc5..7a10651184cfe 100644
--- a/tests/integration/expected_test_results/data_quality_knowledge_panel/no-data-quality.json
+++ b/tests/integration/expected_test_results/data_quality_knowledge_panel/no-data-quality.json
@@ -496,6 +496,29 @@
"health"
]
},
+ "nutrient_levels" : {
+ "elements" : [
+ {
+ "element_type" : "panel_group",
+ "panel_group_element" : {
+ "panel_group_id" : "nutrient_levels_group",
+ "panel_ids" : []
+ }
+ }
+ ],
+ "evaluation" : "unknown",
+ "expand_for" : "large",
+ "expanded" : false,
+ "level" : "info",
+ "title_element" : {
+ "icon_color_from_evaluation" : true,
+ "icon_url" : "http://static.openfoodfacts.localhost/images/icons/dist/nutrition.svg",
+ "title" : "Nutrient levels"
+ },
+ "topics" : [
+ "health"
+ ]
+ },
"nutriscore" : {
"elements" : [
{
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 397f06d33f7c3..1355c5ae8931a 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
@@ -620,7 +620,7 @@
"data" : {
"energy" : null,
"fiber" : 0,
- "fruits_vegetables_legumes" : null,
+ "fruits_vegetables_legumes" : 0,
"is_beverage" : 0,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 0,
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 d9969953ef0df..4edb90988f515 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
@@ -433,7 +433,7 @@
"data" : {
"energy" : null,
"fiber" : 0,
- "fruits_vegetables_legumes" : null,
+ "fruits_vegetables_legumes" : 0,
"is_beverage" : 0,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 0,
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 dbcd6ff92a9ec..aea8b174a5d58 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
@@ -428,7 +428,7 @@
"data" : {
"energy" : null,
"fiber" : 0,
- "fruits_vegetables_legumes" : null,
+ "fruits_vegetables_legumes" : 0,
"is_beverage" : 0,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 0,
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 eac4c3a1ea7cf..c000d3463753b 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
@@ -645,7 +645,7 @@
"data" : {
"energy" : null,
"fiber" : 0,
- "fruits_vegetables_legumes" : null,
+ "fruits_vegetables_legumes" : 0,
"is_beverage" : 0,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 0,
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 3017e0278ff0c..d5a76b9c8039a 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
@@ -443,7 +443,7 @@
"data" : {
"energy" : null,
"fiber" : 0,
- "fruits_vegetables_legumes" : null,
+ "fruits_vegetables_legumes" : 0,
"is_beverage" : 0,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 0,
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 4eb5bdfbd0299..68e4a6aba10d6 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
@@ -436,7 +436,7 @@
"data" : {
"energy" : null,
"fiber" : 0,
- "fruits_vegetables_legumes" : null,
+ "fruits_vegetables_legumes" : 0,
"is_beverage" : 0,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 0,
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 bdc966c590a24..4e3e34b1e9150 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
@@ -430,7 +430,7 @@
"data" : {
"energy" : null,
"fiber" : 0,
- "fruits_vegetables_legumes" : null,
+ "fruits_vegetables_legumes" : 0,
"is_beverage" : 0,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 0,
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 a77c2c6b4a760..08a3680a8ba08 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
@@ -614,7 +614,7 @@
"data" : {
"energy" : null,
"fiber" : 0,
- "fruits_vegetables_legumes" : null,
+ "fruits_vegetables_legumes" : 0,
"is_beverage" : 0,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 0,
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 bd844f4271c00..5d7c2e3b93b36 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
@@ -425,7 +425,7 @@
"data" : {
"energy" : null,
"fiber" : 0,
- "fruits_vegetables_legumes" : null,
+ "fruits_vegetables_legumes" : 0,
"is_beverage" : 0,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 0,
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 37e25b8cedc07..df348c8204fb6 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
@@ -428,7 +428,7 @@
"data" : {
"energy" : null,
"fiber" : 0,
- "fruits_vegetables_legumes" : null,
+ "fruits_vegetables_legumes" : 0,
"is_beverage" : 0,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 0,
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 9036c096c5b46..461f981843396 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
@@ -607,7 +607,7 @@
"data" : {
"energy" : null,
"fiber" : 0,
- "fruits_vegetables_legumes" : null,
+ "fruits_vegetables_legumes" : 0,
"is_beverage" : 0,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 0,
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 dd1203ab4ee1b..c3fb6e30e6e8b 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
@@ -435,7 +435,7 @@
"data" : {
"energy" : null,
"fiber" : 0,
- "fruits_vegetables_legumes" : null,
+ "fruits_vegetables_legumes" : 0,
"is_beverage" : 0,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 0,
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 f7318fdd7fb48..eb8344ac5f760 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
@@ -434,7 +434,7 @@
"data" : {
"energy" : null,
"fiber" : 0,
- "fruits_vegetables_legumes" : null,
+ "fruits_vegetables_legumes" : 0,
"is_beverage" : 0,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 0,
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 be2534ebf060a..0ad9c8449f4de 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
@@ -430,7 +430,7 @@
"data" : {
"energy" : null,
"fiber" : 0,
- "fruits_vegetables_legumes" : null,
+ "fruits_vegetables_legumes" : 0,
"is_beverage" : 0,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 0,
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 aa11763cf5b12..2c8a6bdd10577 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
@@ -677,41 +677,77 @@
"2023" : {
"category_available" : 1,
"data" : {
+ "components" : {
+ "negative" : [
+ {
+ "id" : "energy",
+ "points" : 1,
+ "points_max" : 10,
+ "unit" : "kJ",
+ "value" : 558.75
+ },
+ {
+ "id" : "sugars",
+ "points" : 2,
+ "points_max" : 15,
+ "unit" : "g",
+ "value" : 7.26
+ },
+ {
+ "id" : "saturated_fat",
+ "points" : 4,
+ "points_max" : 10,
+ "unit" : "g",
+ "value" : 4.9
+ },
+ {
+ "id" : "salt",
+ "points" : 0,
+ "points_max" : 20,
+ "unit" : "g",
+ "value" : 0.05
+ }
+ ],
+ "positive" : [
+ {
+ "id" : "proteins",
+ "points" : 0,
+ "points_max" : 7,
+ "unit" : "g",
+ "value" : 1.97
+ },
+ {
+ "id" : "fiber",
+ "points" : 0,
+ "points_max" : 5,
+ "unit" : "g",
+ "value" : 0.81
+ },
+ {
+ "id" : "fruits_vegetables_legumes",
+ "points" : 2,
+ "points_max" : 5,
+ "unit" : "%",
+ "value" : 62.5
+ }
+ ]
+ },
"count_proteins" : 1,
"count_proteins_reason" : "negative_points_less_than_11",
- "energy" : 558.75,
- "energy_points" : 1,
- "fiber" : 0.8125,
- "fiber_points" : 0,
- "fruits_vegetables_legumes" : 62.5,
- "fruits_vegetables_legumes_points" : 2,
"is_beverage" : 0,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 0,
"is_red_meat_product" : 0,
"is_water" : 0,
- "negative_nutrients" : [
- "energy",
- "sugars",
- "saturated_fat",
- "salt",
- "non_nutritive_sweeteners"
- ],
"negative_points" : 7,
+ "negative_points_max" : 55,
"positive_nutrients" : [
- "fruits_vegetables_legumes",
+ "proteins",
"fiber",
- "proteins"
+ "fruits_vegetables_legumes"
],
"positive_points" : 2,
- "proteins" : 1.974375,
- "proteins_points" : 0,
- "salt" : 0.0496875,
- "salt_points" : 0,
- "saturated_fat" : 4.903125,
- "saturated_fat_points" : 4,
- "sugars" : 7.2621875,
- "sugars_points" : 2
+ "positive_points_max" : 17
},
"grade" : "c",
"nutrients_available" : 1,
@@ -2130,41 +2166,77 @@
"2023" : {
"category_available" : 1,
"data" : {
+ "components" : {
+ "negative" : [
+ {
+ "id" : "energy",
+ "points" : 0,
+ "points_max" : 10,
+ "unit" : "kJ",
+ "value" : 260
+ },
+ {
+ "id" : "sugars",
+ "points" : 2,
+ "points_max" : 15,
+ "unit" : "g",
+ "value" : 7.6
+ },
+ {
+ "id" : "saturated_fat",
+ "points" : 0,
+ "points_max" : 10,
+ "unit" : "g",
+ "value" : 0.47
+ },
+ {
+ "id" : "salt",
+ "points" : 0,
+ "points_max" : 20,
+ "unit" : "g",
+ "value" : 0.07
+ }
+ ],
+ "positive" : [
+ {
+ "id" : "proteins",
+ "points" : 1,
+ "points_max" : 7,
+ "unit" : "g",
+ "value" : 2.84
+ },
+ {
+ "id" : "fiber",
+ "points" : 0,
+ "points_max" : 5,
+ "unit" : "g",
+ "value" : 0.87
+ },
+ {
+ "id" : "fruits_vegetables_legumes",
+ "points" : 2,
+ "points_max" : 5,
+ "unit" : "%",
+ "value" : 66.7
+ }
+ ]
+ },
"count_proteins" : 1,
"count_proteins_reason" : "negative_points_less_than_11",
- "energy" : 260,
- "energy_points" : 0,
- "fiber" : 0.866666666666667,
- "fiber_points" : 0,
- "fruits_vegetables_legumes" : 66.6666666666667,
- "fruits_vegetables_legumes_points" : 2,
"is_beverage" : 0,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 0,
"is_red_meat_product" : 0,
"is_water" : 0,
- "negative_nutrients" : [
- "energy",
- "sugars",
- "saturated_fat",
- "salt",
- "non_nutritive_sweeteners"
- ],
"negative_points" : 2,
+ "negative_points_max" : 55,
"positive_nutrients" : [
- "fruits_vegetables_legumes",
+ "proteins",
"fiber",
- "proteins"
+ "fruits_vegetables_legumes"
],
"positive_points" : 3,
- "proteins" : 2.84333333333333,
- "proteins_points" : 1,
- "salt" : 0.07,
- "salt_points" : 0,
- "saturated_fat" : 0.472333333333333,
- "saturated_fat_points" : 0,
- "sugars" : 7.6,
- "sugars_points" : 2
+ "positive_points_max" : 17
},
"grade" : "a",
"nutrients_available" : 1,
@@ -2900,40 +2972,69 @@
"2023" : {
"category_available" : 1,
"data" : {
+ "components" : {
+ "negative" : [
+ {
+ "id" : "energy",
+ "points" : 2,
+ "points_max" : 10,
+ "unit" : "kJ",
+ "value" : 754.67
+ },
+ {
+ "id" : "sugars",
+ "points" : 1,
+ "points_max" : 15,
+ "unit" : "g",
+ "value" : 6.73
+ },
+ {
+ "id" : "saturated_fat",
+ "points" : 8,
+ "points_max" : 10,
+ "unit" : "g",
+ "value" : 8.23
+ },
+ {
+ "id" : "salt",
+ "points" : 0,
+ "points_max" : 20,
+ "unit" : "g",
+ "value" : 0
+ }
+ ],
+ "positive" : [
+ {
+ "id" : "fiber",
+ "points" : 0,
+ "points_max" : 5,
+ "unit" : "g",
+ "value" : 0.87
+ },
+ {
+ "id" : "fruits_vegetables_legumes",
+ "points" : 2,
+ "points_max" : 5,
+ "unit" : "%",
+ "value" : 66.7
+ }
+ ]
+ },
"count_proteins" : 0,
- "count_proteins_reason" : "negative_points_more_than_11",
- "energy" : 754.666666666666,
- "energy_points" : 2,
- "fiber" : 0.866666666666667,
- "fiber_points" : 0,
- "fruits_vegetables_legumes" : 66.6666666666667,
- "fruits_vegetables_legumes_points" : 2,
+ "count_proteins_reason" : "negative_points_greater_than_or_equal_to_11",
"is_beverage" : 0,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 0,
"is_red_meat_product" : 0,
"is_water" : 0,
- "negative_nutrients" : [
- "energy",
- "sugars",
- "saturated_fat",
- "salt",
- "non_nutritive_sweeteners"
- ],
"negative_points" : 11,
+ "negative_points_max" : 55,
"positive_nutrients" : [
- "fruits_vegetables_legumes",
- "fiber"
+ "fiber",
+ "fruits_vegetables_legumes"
],
"positive_points" : 2,
- "proteins" : 0.18,
- "proteins_points" : 0,
- "salt" : 0.00126666666666667,
- "salt_points" : 0,
- "saturated_fat" : 8.23066666666666,
- "saturated_fat_points" : 8,
- "sugars" : 6.73333333333333,
- "sugars_points" : 1
+ "positive_points_max" : 10
},
"grade" : "c",
"nutrients_available" : 1,
@@ -3819,41 +3920,77 @@
"2023" : {
"category_available" : 1,
"data" : {
+ "components" : {
+ "negative" : [
+ {
+ "id" : "energy",
+ "points" : 0,
+ "points_max" : 10,
+ "unit" : "kJ",
+ "value" : 155.25
+ },
+ {
+ "id" : "sugars",
+ "points" : 2,
+ "points_max" : 15,
+ "unit" : "g",
+ "value" : 7.58
+ },
+ {
+ "id" : "saturated_fat",
+ "points" : 0,
+ "points_max" : 10,
+ "unit" : "g",
+ "value" : 0.02
+ },
+ {
+ "id" : "salt",
+ "points" : 0,
+ "points_max" : 20,
+ "unit" : "g",
+ "value" : 0
+ }
+ ],
+ "positive" : [
+ {
+ "id" : "proteins",
+ "points" : 0,
+ "points_max" : 7,
+ "unit" : "g",
+ "value" : 0.2
+ },
+ {
+ "id" : "fiber",
+ "points" : 0,
+ "points_max" : 5,
+ "unit" : "g",
+ "value" : 0.97
+ },
+ {
+ "id" : "fruits_vegetables_legumes",
+ "points" : 2,
+ "points_max" : 5,
+ "unit" : "%",
+ "value" : 75
+ }
+ ]
+ },
"count_proteins" : 1,
"count_proteins_reason" : "negative_points_less_than_11",
- "energy" : 155.25,
- "energy_points" : 0,
- "fiber" : 0.975,
- "fiber_points" : 0,
- "fruits_vegetables_legumes" : 75,
- "fruits_vegetables_legumes_points" : 2,
"is_beverage" : 0,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 0,
"is_red_meat_product" : 0,
"is_water" : 0,
- "negative_nutrients" : [
- "energy",
- "sugars",
- "saturated_fat",
- "salt",
- "non_nutritive_sweeteners"
- ],
"negative_points" : 2,
+ "negative_points_max" : 55,
"positive_nutrients" : [
- "fruits_vegetables_legumes",
+ "proteins",
"fiber",
- "proteins"
+ "fruits_vegetables_legumes"
],
"positive_points" : 2,
- "proteins" : 0.2025,
- "proteins_points" : 0,
- "salt" : 0.0019,
- "salt_points" : 0,
- "saturated_fat" : 0.01575,
- "saturated_fat_points" : 0,
- "sugars" : 7.575,
- "sugars_points" : 2
+ "positive_points_max" : 17
},
"grade" : "a",
"nutrients_available" : 1,
@@ -4757,41 +4894,77 @@
"2023" : {
"category_available" : 1,
"data" : {
+ "components" : {
+ "negative" : [
+ {
+ "id" : "energy",
+ "points" : 0,
+ "points_max" : 10,
+ "unit" : "kJ",
+ "value" : 155.25
+ },
+ {
+ "id" : "sugars",
+ "points" : 2,
+ "points_max" : 15,
+ "unit" : "g",
+ "value" : 7.58
+ },
+ {
+ "id" : "saturated_fat",
+ "points" : 0,
+ "points_max" : 10,
+ "unit" : "g",
+ "value" : 0.02
+ },
+ {
+ "id" : "salt",
+ "points" : 0,
+ "points_max" : 20,
+ "unit" : "g",
+ "value" : 0
+ }
+ ],
+ "positive" : [
+ {
+ "id" : "proteins",
+ "points" : 0,
+ "points_max" : 7,
+ "unit" : "g",
+ "value" : 0.2
+ },
+ {
+ "id" : "fiber",
+ "points" : 0,
+ "points_max" : 5,
+ "unit" : "g",
+ "value" : 0.97
+ },
+ {
+ "id" : "fruits_vegetables_legumes",
+ "points" : 2,
+ "points_max" : 5,
+ "unit" : "%",
+ "value" : 75
+ }
+ ]
+ },
"count_proteins" : 1,
"count_proteins_reason" : "negative_points_less_than_11",
- "energy" : 155.25,
- "energy_points" : 0,
- "fiber" : 0.975,
- "fiber_points" : 0,
- "fruits_vegetables_legumes" : 75,
- "fruits_vegetables_legumes_points" : 2,
"is_beverage" : 0,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 0,
"is_red_meat_product" : 0,
"is_water" : 0,
- "negative_nutrients" : [
- "energy",
- "sugars",
- "saturated_fat",
- "salt",
- "non_nutritive_sweeteners"
- ],
"negative_points" : 2,
+ "negative_points_max" : 55,
"positive_nutrients" : [
- "fruits_vegetables_legumes",
+ "proteins",
"fiber",
- "proteins"
+ "fruits_vegetables_legumes"
],
"positive_points" : 2,
- "proteins" : 0.2025,
- "proteins_points" : 0,
- "salt" : 0.0019,
- "salt_points" : 0,
- "saturated_fat" : 0.01575,
- "saturated_fat_points" : 0,
- "sugars" : 7.575,
- "sugars_points" : 2
+ "positive_points_max" : 17
},
"grade" : "a",
"nutrients_available" : 1,
diff --git a/tests/integration/expected_test_results/search_v1/search-tags-categories-without-ingredients-from-palm-oil.json b/tests/integration/expected_test_results/search_v1/search-tags-categories-without-ingredients-from-palm-oil.json
index e454160d329b1..6f723772ea2e3 100644
--- a/tests/integration/expected_test_results/search_v1/search-tags-categories-without-ingredients-from-palm-oil.json
+++ b/tests/integration/expected_test_results/search_v1/search-tags-categories-without-ingredients-from-palm-oil.json
@@ -753,41 +753,77 @@
"2023" : {
"category_available" : 1,
"data" : {
+ "components" : {
+ "negative" : [
+ {
+ "id" : "energy",
+ "points" : 0,
+ "points_max" : 10,
+ "unit" : "kJ",
+ "value" : 155.25
+ },
+ {
+ "id" : "sugars",
+ "points" : 2,
+ "points_max" : 15,
+ "unit" : "g",
+ "value" : 7.58
+ },
+ {
+ "id" : "saturated_fat",
+ "points" : 0,
+ "points_max" : 10,
+ "unit" : "g",
+ "value" : 0.02
+ },
+ {
+ "id" : "salt",
+ "points" : 0,
+ "points_max" : 20,
+ "unit" : "g",
+ "value" : 0
+ }
+ ],
+ "positive" : [
+ {
+ "id" : "proteins",
+ "points" : 0,
+ "points_max" : 7,
+ "unit" : "g",
+ "value" : 0.2
+ },
+ {
+ "id" : "fiber",
+ "points" : 0,
+ "points_max" : 5,
+ "unit" : "g",
+ "value" : 0.97
+ },
+ {
+ "id" : "fruits_vegetables_legumes",
+ "points" : 2,
+ "points_max" : 5,
+ "unit" : "%",
+ "value" : 75
+ }
+ ]
+ },
"count_proteins" : 1,
"count_proteins_reason" : "negative_points_less_than_11",
- "energy" : 155.25,
- "energy_points" : 0,
- "fiber" : 0.975,
- "fiber_points" : 0,
- "fruits_vegetables_legumes" : 75,
- "fruits_vegetables_legumes_points" : 2,
"is_beverage" : 0,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 0,
"is_red_meat_product" : 0,
"is_water" : 0,
- "negative_nutrients" : [
- "energy",
- "sugars",
- "saturated_fat",
- "salt",
- "non_nutritive_sweeteners"
- ],
"negative_points" : 2,
+ "negative_points_max" : 55,
"positive_nutrients" : [
- "fruits_vegetables_legumes",
+ "proteins",
"fiber",
- "proteins"
+ "fruits_vegetables_legumes"
],
"positive_points" : 2,
- "proteins" : 0.2025,
- "proteins_points" : 0,
- "salt" : 0.0019,
- "salt_points" : 0,
- "saturated_fat" : 0.01575,
- "saturated_fat_points" : 0,
- "sugars" : 7.575,
- "sugars_points" : 2
+ "positive_points_max" : 17
},
"grade" : "a",
"nutrients_available" : 1,
@@ -1691,41 +1727,77 @@
"2023" : {
"category_available" : 1,
"data" : {
+ "components" : {
+ "negative" : [
+ {
+ "id" : "energy",
+ "points" : 0,
+ "points_max" : 10,
+ "unit" : "kJ",
+ "value" : 155.25
+ },
+ {
+ "id" : "sugars",
+ "points" : 2,
+ "points_max" : 15,
+ "unit" : "g",
+ "value" : 7.58
+ },
+ {
+ "id" : "saturated_fat",
+ "points" : 0,
+ "points_max" : 10,
+ "unit" : "g",
+ "value" : 0.02
+ },
+ {
+ "id" : "salt",
+ "points" : 0,
+ "points_max" : 20,
+ "unit" : "g",
+ "value" : 0
+ }
+ ],
+ "positive" : [
+ {
+ "id" : "proteins",
+ "points" : 0,
+ "points_max" : 7,
+ "unit" : "g",
+ "value" : 0.2
+ },
+ {
+ "id" : "fiber",
+ "points" : 0,
+ "points_max" : 5,
+ "unit" : "g",
+ "value" : 0.97
+ },
+ {
+ "id" : "fruits_vegetables_legumes",
+ "points" : 2,
+ "points_max" : 5,
+ "unit" : "%",
+ "value" : 75
+ }
+ ]
+ },
"count_proteins" : 1,
"count_proteins_reason" : "negative_points_less_than_11",
- "energy" : 155.25,
- "energy_points" : 0,
- "fiber" : 0.975,
- "fiber_points" : 0,
- "fruits_vegetables_legumes" : 75,
- "fruits_vegetables_legumes_points" : 2,
"is_beverage" : 0,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 0,
"is_red_meat_product" : 0,
"is_water" : 0,
- "negative_nutrients" : [
- "energy",
- "sugars",
- "saturated_fat",
- "salt",
- "non_nutritive_sweeteners"
- ],
"negative_points" : 2,
+ "negative_points_max" : 55,
"positive_nutrients" : [
- "fruits_vegetables_legumes",
+ "proteins",
"fiber",
- "proteins"
+ "fruits_vegetables_legumes"
],
"positive_points" : 2,
- "proteins" : 0.2025,
- "proteins_points" : 0,
- "salt" : 0.0019,
- "salt_points" : 0,
- "saturated_fat" : 0.01575,
- "saturated_fat_points" : 0,
- "sugars" : 7.575,
- "sugars_points" : 2
+ "positive_points_max" : 17
},
"grade" : "a",
"nutrients_available" : 1,
diff --git a/tests/integration/expected_test_results/search_v1/search-without-ingredients-from-palm-oil.json b/tests/integration/expected_test_results/search_v1/search-without-ingredients-from-palm-oil.json
index aa11763cf5b12..2c8a6bdd10577 100644
--- a/tests/integration/expected_test_results/search_v1/search-without-ingredients-from-palm-oil.json
+++ b/tests/integration/expected_test_results/search_v1/search-without-ingredients-from-palm-oil.json
@@ -677,41 +677,77 @@
"2023" : {
"category_available" : 1,
"data" : {
+ "components" : {
+ "negative" : [
+ {
+ "id" : "energy",
+ "points" : 1,
+ "points_max" : 10,
+ "unit" : "kJ",
+ "value" : 558.75
+ },
+ {
+ "id" : "sugars",
+ "points" : 2,
+ "points_max" : 15,
+ "unit" : "g",
+ "value" : 7.26
+ },
+ {
+ "id" : "saturated_fat",
+ "points" : 4,
+ "points_max" : 10,
+ "unit" : "g",
+ "value" : 4.9
+ },
+ {
+ "id" : "salt",
+ "points" : 0,
+ "points_max" : 20,
+ "unit" : "g",
+ "value" : 0.05
+ }
+ ],
+ "positive" : [
+ {
+ "id" : "proteins",
+ "points" : 0,
+ "points_max" : 7,
+ "unit" : "g",
+ "value" : 1.97
+ },
+ {
+ "id" : "fiber",
+ "points" : 0,
+ "points_max" : 5,
+ "unit" : "g",
+ "value" : 0.81
+ },
+ {
+ "id" : "fruits_vegetables_legumes",
+ "points" : 2,
+ "points_max" : 5,
+ "unit" : "%",
+ "value" : 62.5
+ }
+ ]
+ },
"count_proteins" : 1,
"count_proteins_reason" : "negative_points_less_than_11",
- "energy" : 558.75,
- "energy_points" : 1,
- "fiber" : 0.8125,
- "fiber_points" : 0,
- "fruits_vegetables_legumes" : 62.5,
- "fruits_vegetables_legumes_points" : 2,
"is_beverage" : 0,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 0,
"is_red_meat_product" : 0,
"is_water" : 0,
- "negative_nutrients" : [
- "energy",
- "sugars",
- "saturated_fat",
- "salt",
- "non_nutritive_sweeteners"
- ],
"negative_points" : 7,
+ "negative_points_max" : 55,
"positive_nutrients" : [
- "fruits_vegetables_legumes",
+ "proteins",
"fiber",
- "proteins"
+ "fruits_vegetables_legumes"
],
"positive_points" : 2,
- "proteins" : 1.974375,
- "proteins_points" : 0,
- "salt" : 0.0496875,
- "salt_points" : 0,
- "saturated_fat" : 4.903125,
- "saturated_fat_points" : 4,
- "sugars" : 7.2621875,
- "sugars_points" : 2
+ "positive_points_max" : 17
},
"grade" : "c",
"nutrients_available" : 1,
@@ -2130,41 +2166,77 @@
"2023" : {
"category_available" : 1,
"data" : {
+ "components" : {
+ "negative" : [
+ {
+ "id" : "energy",
+ "points" : 0,
+ "points_max" : 10,
+ "unit" : "kJ",
+ "value" : 260
+ },
+ {
+ "id" : "sugars",
+ "points" : 2,
+ "points_max" : 15,
+ "unit" : "g",
+ "value" : 7.6
+ },
+ {
+ "id" : "saturated_fat",
+ "points" : 0,
+ "points_max" : 10,
+ "unit" : "g",
+ "value" : 0.47
+ },
+ {
+ "id" : "salt",
+ "points" : 0,
+ "points_max" : 20,
+ "unit" : "g",
+ "value" : 0.07
+ }
+ ],
+ "positive" : [
+ {
+ "id" : "proteins",
+ "points" : 1,
+ "points_max" : 7,
+ "unit" : "g",
+ "value" : 2.84
+ },
+ {
+ "id" : "fiber",
+ "points" : 0,
+ "points_max" : 5,
+ "unit" : "g",
+ "value" : 0.87
+ },
+ {
+ "id" : "fruits_vegetables_legumes",
+ "points" : 2,
+ "points_max" : 5,
+ "unit" : "%",
+ "value" : 66.7
+ }
+ ]
+ },
"count_proteins" : 1,
"count_proteins_reason" : "negative_points_less_than_11",
- "energy" : 260,
- "energy_points" : 0,
- "fiber" : 0.866666666666667,
- "fiber_points" : 0,
- "fruits_vegetables_legumes" : 66.6666666666667,
- "fruits_vegetables_legumes_points" : 2,
"is_beverage" : 0,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 0,
"is_red_meat_product" : 0,
"is_water" : 0,
- "negative_nutrients" : [
- "energy",
- "sugars",
- "saturated_fat",
- "salt",
- "non_nutritive_sweeteners"
- ],
"negative_points" : 2,
+ "negative_points_max" : 55,
"positive_nutrients" : [
- "fruits_vegetables_legumes",
+ "proteins",
"fiber",
- "proteins"
+ "fruits_vegetables_legumes"
],
"positive_points" : 3,
- "proteins" : 2.84333333333333,
- "proteins_points" : 1,
- "salt" : 0.07,
- "salt_points" : 0,
- "saturated_fat" : 0.472333333333333,
- "saturated_fat_points" : 0,
- "sugars" : 7.6,
- "sugars_points" : 2
+ "positive_points_max" : 17
},
"grade" : "a",
"nutrients_available" : 1,
@@ -2900,40 +2972,69 @@
"2023" : {
"category_available" : 1,
"data" : {
+ "components" : {
+ "negative" : [
+ {
+ "id" : "energy",
+ "points" : 2,
+ "points_max" : 10,
+ "unit" : "kJ",
+ "value" : 754.67
+ },
+ {
+ "id" : "sugars",
+ "points" : 1,
+ "points_max" : 15,
+ "unit" : "g",
+ "value" : 6.73
+ },
+ {
+ "id" : "saturated_fat",
+ "points" : 8,
+ "points_max" : 10,
+ "unit" : "g",
+ "value" : 8.23
+ },
+ {
+ "id" : "salt",
+ "points" : 0,
+ "points_max" : 20,
+ "unit" : "g",
+ "value" : 0
+ }
+ ],
+ "positive" : [
+ {
+ "id" : "fiber",
+ "points" : 0,
+ "points_max" : 5,
+ "unit" : "g",
+ "value" : 0.87
+ },
+ {
+ "id" : "fruits_vegetables_legumes",
+ "points" : 2,
+ "points_max" : 5,
+ "unit" : "%",
+ "value" : 66.7
+ }
+ ]
+ },
"count_proteins" : 0,
- "count_proteins_reason" : "negative_points_more_than_11",
- "energy" : 754.666666666666,
- "energy_points" : 2,
- "fiber" : 0.866666666666667,
- "fiber_points" : 0,
- "fruits_vegetables_legumes" : 66.6666666666667,
- "fruits_vegetables_legumes_points" : 2,
+ "count_proteins_reason" : "negative_points_greater_than_or_equal_to_11",
"is_beverage" : 0,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 0,
"is_red_meat_product" : 0,
"is_water" : 0,
- "negative_nutrients" : [
- "energy",
- "sugars",
- "saturated_fat",
- "salt",
- "non_nutritive_sweeteners"
- ],
"negative_points" : 11,
+ "negative_points_max" : 55,
"positive_nutrients" : [
- "fruits_vegetables_legumes",
- "fiber"
+ "fiber",
+ "fruits_vegetables_legumes"
],
"positive_points" : 2,
- "proteins" : 0.18,
- "proteins_points" : 0,
- "salt" : 0.00126666666666667,
- "salt_points" : 0,
- "saturated_fat" : 8.23066666666666,
- "saturated_fat_points" : 8,
- "sugars" : 6.73333333333333,
- "sugars_points" : 1
+ "positive_points_max" : 10
},
"grade" : "c",
"nutrients_available" : 1,
@@ -3819,41 +3920,77 @@
"2023" : {
"category_available" : 1,
"data" : {
+ "components" : {
+ "negative" : [
+ {
+ "id" : "energy",
+ "points" : 0,
+ "points_max" : 10,
+ "unit" : "kJ",
+ "value" : 155.25
+ },
+ {
+ "id" : "sugars",
+ "points" : 2,
+ "points_max" : 15,
+ "unit" : "g",
+ "value" : 7.58
+ },
+ {
+ "id" : "saturated_fat",
+ "points" : 0,
+ "points_max" : 10,
+ "unit" : "g",
+ "value" : 0.02
+ },
+ {
+ "id" : "salt",
+ "points" : 0,
+ "points_max" : 20,
+ "unit" : "g",
+ "value" : 0
+ }
+ ],
+ "positive" : [
+ {
+ "id" : "proteins",
+ "points" : 0,
+ "points_max" : 7,
+ "unit" : "g",
+ "value" : 0.2
+ },
+ {
+ "id" : "fiber",
+ "points" : 0,
+ "points_max" : 5,
+ "unit" : "g",
+ "value" : 0.97
+ },
+ {
+ "id" : "fruits_vegetables_legumes",
+ "points" : 2,
+ "points_max" : 5,
+ "unit" : "%",
+ "value" : 75
+ }
+ ]
+ },
"count_proteins" : 1,
"count_proteins_reason" : "negative_points_less_than_11",
- "energy" : 155.25,
- "energy_points" : 0,
- "fiber" : 0.975,
- "fiber_points" : 0,
- "fruits_vegetables_legumes" : 75,
- "fruits_vegetables_legumes_points" : 2,
"is_beverage" : 0,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 0,
"is_red_meat_product" : 0,
"is_water" : 0,
- "negative_nutrients" : [
- "energy",
- "sugars",
- "saturated_fat",
- "salt",
- "non_nutritive_sweeteners"
- ],
"negative_points" : 2,
+ "negative_points_max" : 55,
"positive_nutrients" : [
- "fruits_vegetables_legumes",
+ "proteins",
"fiber",
- "proteins"
+ "fruits_vegetables_legumes"
],
"positive_points" : 2,
- "proteins" : 0.2025,
- "proteins_points" : 0,
- "salt" : 0.0019,
- "salt_points" : 0,
- "saturated_fat" : 0.01575,
- "saturated_fat_points" : 0,
- "sugars" : 7.575,
- "sugars_points" : 2
+ "positive_points_max" : 17
},
"grade" : "a",
"nutrients_available" : 1,
@@ -4757,41 +4894,77 @@
"2023" : {
"category_available" : 1,
"data" : {
+ "components" : {
+ "negative" : [
+ {
+ "id" : "energy",
+ "points" : 0,
+ "points_max" : 10,
+ "unit" : "kJ",
+ "value" : 155.25
+ },
+ {
+ "id" : "sugars",
+ "points" : 2,
+ "points_max" : 15,
+ "unit" : "g",
+ "value" : 7.58
+ },
+ {
+ "id" : "saturated_fat",
+ "points" : 0,
+ "points_max" : 10,
+ "unit" : "g",
+ "value" : 0.02
+ },
+ {
+ "id" : "salt",
+ "points" : 0,
+ "points_max" : 20,
+ "unit" : "g",
+ "value" : 0
+ }
+ ],
+ "positive" : [
+ {
+ "id" : "proteins",
+ "points" : 0,
+ "points_max" : 7,
+ "unit" : "g",
+ "value" : 0.2
+ },
+ {
+ "id" : "fiber",
+ "points" : 0,
+ "points_max" : 5,
+ "unit" : "g",
+ "value" : 0.97
+ },
+ {
+ "id" : "fruits_vegetables_legumes",
+ "points" : 2,
+ "points_max" : 5,
+ "unit" : "%",
+ "value" : 75
+ }
+ ]
+ },
"count_proteins" : 1,
"count_proteins_reason" : "negative_points_less_than_11",
- "energy" : 155.25,
- "energy_points" : 0,
- "fiber" : 0.975,
- "fiber_points" : 0,
- "fruits_vegetables_legumes" : 75,
- "fruits_vegetables_legumes_points" : 2,
"is_beverage" : 0,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 0,
"is_red_meat_product" : 0,
"is_water" : 0,
- "negative_nutrients" : [
- "energy",
- "sugars",
- "saturated_fat",
- "salt",
- "non_nutritive_sweeteners"
- ],
"negative_points" : 2,
+ "negative_points_max" : 55,
"positive_nutrients" : [
- "fruits_vegetables_legumes",
+ "proteins",
"fiber",
- "proteins"
+ "fruits_vegetables_legumes"
],
"positive_points" : 2,
- "proteins" : 0.2025,
- "proteins_points" : 0,
- "salt" : 0.0019,
- "salt_points" : 0,
- "saturated_fat" : 0.01575,
- "saturated_fat_points" : 0,
- "sugars" : 7.575,
- "sugars_points" : 2
+ "positive_points_max" : 17
},
"grade" : "a",
"nutrients_available" : 1,
diff --git a/tests/unit/expected_test_results/attributes/en-attributes.json b/tests/unit/expected_test_results/attributes/en-attributes.json
index 656e2230df6c5..cad4e397c1638 100644
--- a/tests/unit/expected_test_results/attributes/en-attributes.json
+++ b/tests/unit/expected_test_results/attributes/en-attributes.json
@@ -1222,40 +1222,69 @@
"2023" : {
"category_available" : 1,
"data" : {
+ "components" : {
+ "negative" : [
+ {
+ "id" : "energy",
+ "points" : 2,
+ "points_max" : 10,
+ "unit" : "kJ",
+ "value" : 800
+ },
+ {
+ "id" : "sugars",
+ "points" : 7,
+ "points_max" : 15,
+ "unit" : "g",
+ "value" : 25
+ },
+ {
+ "id" : "saturated_fat",
+ "points" : 3,
+ "points_max" : 10,
+ "unit" : "g",
+ "value" : 4
+ },
+ {
+ "id" : "salt",
+ "points" : 1,
+ "points_max" : 20,
+ "unit" : "g",
+ "value" : 0.25
+ }
+ ],
+ "positive" : [
+ {
+ "id" : "fiber",
+ "points" : 0,
+ "points_max" : 5,
+ "unit" : "g",
+ "value" : 3
+ },
+ {
+ "id" : "fruits_vegetables_legumes",
+ "points" : 0,
+ "points_max" : 5,
+ "unit" : "%",
+ "value" : 10.2
+ }
+ ]
+ },
"count_proteins" : 0,
- "count_proteins_reason" : "negative_points_more_than_11",
- "energy" : 800,
- "energy_points" : 2,
- "fiber" : 3,
- "fiber_points" : 0,
- "fruits_vegetables_legumes" : 10.2272727272727,
- "fruits_vegetables_legumes_points" : 0,
+ "count_proteins_reason" : "negative_points_greater_than_or_equal_to_11",
"is_beverage" : 0,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 0,
"is_red_meat_product" : 0,
"is_water" : 0,
- "negative_nutrients" : [
- "energy",
- "sugars",
- "saturated_fat",
- "salt",
- "non_nutritive_sweeteners"
- ],
"negative_points" : 13,
+ "negative_points_max" : 55,
"positive_nutrients" : [
- "fruits_vegetables_legumes",
- "fiber"
+ "fiber",
+ "fruits_vegetables_legumes"
],
"positive_points" : 0,
- "proteins" : 2,
- "proteins_points" : 0,
- "salt" : 0.25,
- "salt_points" : 1,
- "saturated_fat" : 4,
- "saturated_fat_points" : 3,
- "sugars" : 25,
- "sugars_points" : 7
+ "positive_points_max" : 10
},
"grade" : "d",
"nutrients_available" : 1,
diff --git a/tests/unit/expected_test_results/attributes/en-ecoscore-score-at-20-threshold.json b/tests/unit/expected_test_results/attributes/en-ecoscore-score-at-20-threshold.json
index b95a740277ec0..fa11493a74754 100644
--- a/tests/unit/expected_test_results/attributes/en-ecoscore-score-at-20-threshold.json
+++ b/tests/unit/expected_test_results/attributes/en-ecoscore-score-at-20-threshold.json
@@ -855,7 +855,7 @@
"data" : {
"energy" : null,
"fiber" : 0,
- "fruits_vegetables_legumes" : null,
+ "fruits_vegetables_legumes" : 0,
"is_beverage" : 0,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 0,
diff --git a/tests/unit/expected_test_results/attributes/en-no-ingredients.json b/tests/unit/expected_test_results/attributes/en-no-ingredients.json
index dca72ed028fc7..707028badb4ff 100644
--- a/tests/unit/expected_test_results/attributes/en-no-ingredients.json
+++ b/tests/unit/expected_test_results/attributes/en-no-ingredients.json
@@ -850,7 +850,7 @@
"data" : {
"energy" : null,
"fiber" : 0,
- "fruits_vegetables_legumes" : null,
+ "fruits_vegetables_legumes" : 0,
"is_beverage" : 0,
"is_cheese" : 1,
"is_fat_oil_nuts_seeds" : 0,
diff --git a/tests/unit/expected_test_results/attributes/en-nutriscore.json b/tests/unit/expected_test_results/attributes/en-nutriscore.json
index 3b9bb456124fc..4d63c031451a2 100644
--- a/tests/unit/expected_test_results/attributes/en-nutriscore.json
+++ b/tests/unit/expected_test_results/attributes/en-nutriscore.json
@@ -947,40 +947,69 @@
"2023" : {
"category_available" : 1,
"data" : {
+ "components" : {
+ "negative" : [
+ {
+ "id" : "energy",
+ "points" : 7,
+ "points_max" : 10,
+ "unit" : "kJ",
+ "value" : 2591
+ },
+ {
+ "id" : "sugars",
+ "points" : 1,
+ "points_max" : 15,
+ "unit" : "g",
+ "value" : 5.1
+ },
+ {
+ "id" : "saturated_fat",
+ "points" : 9,
+ "points_max" : 10,
+ "unit" : "g",
+ "value" : 9.7
+ },
+ {
+ "id" : "salt",
+ "points" : 0,
+ "points_max" : 20,
+ "unit" : "g",
+ "value" : 0
+ }
+ ],
+ "positive" : [
+ {
+ "id" : "fiber",
+ "points" : 3,
+ "points_max" : 5,
+ "unit" : "g",
+ "value" : 5.5
+ },
+ {
+ "id" : "fruits_vegetables_legumes",
+ "points" : 5,
+ "points_max" : 5,
+ "unit" : "%",
+ "value" : 100
+ }
+ ]
+ },
"count_proteins" : 0,
- "count_proteins_reason" : "negative_points_more_than_11",
- "energy" : 2591,
- "energy_points" : 7,
- "fiber" : 5.5,
- "fiber_points" : 3,
- "fruits_vegetables_legumes" : 100,
- "fruits_vegetables_legumes_points" : 5,
+ "count_proteins_reason" : "negative_points_greater_than_or_equal_to_11",
"is_beverage" : 0,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 0,
"is_red_meat_product" : 0,
"is_water" : 0,
- "negative_nutrients" : [
- "energy",
- "sugars",
- "saturated_fat",
- "salt",
- "non_nutritive_sweeteners"
- ],
"negative_points" : 17,
+ "negative_points_max" : 55,
"positive_nutrients" : [
- "fruits_vegetables_legumes",
- "fiber"
+ "fiber",
+ "fruits_vegetables_legumes"
],
"positive_points" : 8,
- "proteins" : 29,
- "proteins_points" : 7,
- "salt" : 0,
- "salt_points" : 0,
- "saturated_fat" : 9.7,
- "saturated_fat_points" : 9,
- "sugars" : 5.1,
- "sugars_points" : 1
+ "positive_points_max" : 10
},
"grade" : "c",
"nutrients_available" : 1,
diff --git a/tests/unit/expected_test_results/nutriscore/beverage-with-80-percent-milk.json b/tests/unit/expected_test_results/nutriscore/beverage-with-80-percent-milk.json
index 36c219dcaed4f..ad90d0abb9999 100644
--- a/tests/unit/expected_test_results/nutriscore/beverage-with-80-percent-milk.json
+++ b/tests/unit/expected_test_results/nutriscore/beverage-with-80-percent-milk.json
@@ -216,42 +216,85 @@
"2023" : {
"category_available" : 1,
"data" : {
+ "components" : {
+ "negative" : [
+ {
+ "id" : "energy",
+ "points" : 10,
+ "points_max" : 10,
+ "unit" : "kJ",
+ "value" : 3378
+ },
+ {
+ "id" : "sugars",
+ "points" : 10,
+ "points_max" : 10,
+ "unit" : "g",
+ "value" : 20
+ },
+ {
+ "id" : "saturated_fat",
+ "points" : 4,
+ "points_max" : 10,
+ "unit" : "g",
+ "value" : 5
+ },
+ {
+ "id" : "salt",
+ "points" : 0,
+ "points_max" : 20,
+ "unit" : "g",
+ "value" : 0
+ },
+ {
+ "id" : "non_nutritive_sweeteners",
+ "points" : 0,
+ "points_max" : null,
+ "unit" : null,
+ "value" : 0
+ }
+ ],
+ "positive" : [
+ {
+ "id" : "proteins",
+ "points" : 7,
+ "points_max" : 7,
+ "unit" : "g",
+ "value" : 5
+ },
+ {
+ "id" : "fiber",
+ "points" : 0,
+ "points_max" : 5,
+ "unit" : "g",
+ "value" : 2
+ },
+ {
+ "id" : "fruits_vegetables_legumes",
+ "points" : 0,
+ "points_max" : 6,
+ "unit" : "%",
+ "value" : 0
+ }
+ ]
+ },
"count_proteins" : 1,
"count_proteins_reason" : "beverage",
- "energy" : 3378,
- "energy_points" : 10,
- "fiber" : 2,
- "fiber_points" : 0,
- "fruits_vegetables_legumes" : 0,
- "fruits_vegetables_legumes_points" : 0,
"is_beverage" : 1,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 0,
"is_red_meat_product" : 0,
"is_water" : 0,
- "negative_nutrients" : [
- "energy",
- "sugars",
- "saturated_fat",
- "salt",
- "non_nutritive_sweeteners"
- ],
"negative_points" : 24,
- "non_nutritive_sweeteners_points" : 0,
+ "negative_points_max" : 50,
+ "non_nutritive_sweeteners_max" : 4,
"positive_nutrients" : [
- "fruits_vegetables_legumes",
+ "proteins",
"fiber",
- "proteins"
+ "fruits_vegetables_legumes"
],
"positive_points" : 7,
- "proteins" : 5,
- "proteins_points" : 7,
- "salt" : 0,
- "salt_points" : 0,
- "saturated_fat" : 5,
- "saturated_fat_points" : 4,
- "sugars" : 20,
- "sugars_points" : 10
+ "positive_points_max" : 18
},
"grade" : "e",
"nutrients_available" : 1,
diff --git a/tests/unit/expected_test_results/nutriscore/breakfast-cereals.json b/tests/unit/expected_test_results/nutriscore/breakfast-cereals.json
index 49111866e2bd1..28af56b0f6b76 100644
--- a/tests/unit/expected_test_results/nutriscore/breakfast-cereals.json
+++ b/tests/unit/expected_test_results/nutriscore/breakfast-cereals.json
@@ -103,39 +103,69 @@
"2023" : {
"category_available" : 1,
"data" : {
+ "components" : {
+ "negative" : [
+ {
+ "id" : "energy",
+ "points" : 7,
+ "points_max" : 10,
+ "unit" : "kJ",
+ "value" : 2450
+ },
+ {
+ "id" : "sugars",
+ "points" : 8,
+ "points_max" : 15,
+ "unit" : "g",
+ "value" : 31
+ },
+ {
+ "id" : "saturated_fat",
+ "points" : 1,
+ "points_max" : 10,
+ "unit" : "g",
+ "value" : 1.03
+ },
+ {
+ "id" : "salt",
+ "points" : 2,
+ "points_max" : 20,
+ "unit" : "g",
+ "value" : 0.55
+ }
+ ],
+ "positive" : [
+ {
+ "id" : "fiber",
+ "points" : 4,
+ "points_max" : 5,
+ "unit" : "g",
+ "value" : 6.9
+ },
+ {
+ "id" : "fruits_vegetables_legumes",
+ "points" : 0,
+ "points_max" : 5,
+ "unit" : "%",
+ "value" : 0
+ }
+ ]
+ },
"count_proteins" : 0,
- "count_proteins_reason" : "negative_points_more_than_11",
- "energy" : 2450,
- "energy_points" : 7,
- "fiber" : 6.9,
- "fiber_points" : 4,
- "fruits_vegetables_legumes" : null,
+ "count_proteins_reason" : "negative_points_greater_than_or_equal_to_11",
"is_beverage" : 0,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 0,
"is_red_meat_product" : 0,
"is_water" : 0,
- "negative_nutrients" : [
- "energy",
- "sugars",
- "saturated_fat",
- "salt",
- "non_nutritive_sweeteners"
- ],
"negative_points" : 18,
+ "negative_points_max" : 55,
"positive_nutrients" : [
- "fruits_vegetables_legumes",
- "fiber"
+ "fiber",
+ "fruits_vegetables_legumes"
],
"positive_points" : 4,
- "proteins" : 10.3,
- "proteins_points" : 4,
- "salt" : 0.5525,
- "salt_points" : 2,
- "saturated_fat" : 1.03,
- "saturated_fat_points" : 1,
- "sugars" : 31,
- "sugars_points" : 8
+ "positive_points_max" : 10
},
"grade" : "d",
"nutrients_available" : 1,
diff --git a/tests/unit/expected_test_results/nutriscore/cocoa-and-chocolate-powders.json b/tests/unit/expected_test_results/nutriscore/cocoa-and-chocolate-powders.json
index 02de0a3b4b652..fa71e5e73f891 100644
--- a/tests/unit/expected_test_results/nutriscore/cocoa-and-chocolate-powders.json
+++ b/tests/unit/expected_test_results/nutriscore/cocoa-and-chocolate-powders.json
@@ -90,40 +90,77 @@
"2023" : {
"category_available" : 1,
"data" : {
+ "components" : {
+ "negative" : [
+ {
+ "id" : "energy",
+ "points" : 0,
+ "points_max" : 10,
+ "unit" : "kJ",
+ "value" : 287
+ },
+ {
+ "id" : "sugars",
+ "points" : 1,
+ "points_max" : 15,
+ "unit" : "g",
+ "value" : 6.3
+ },
+ {
+ "id" : "saturated_fat",
+ "points" : 1,
+ "points_max" : 10,
+ "unit" : "g",
+ "value" : 1.1
+ },
+ {
+ "id" : "salt",
+ "points" : 0,
+ "points_max" : 20,
+ "unit" : "g",
+ "value" : 0.11
+ }
+ ],
+ "positive" : [
+ {
+ "id" : "proteins",
+ "points" : 1,
+ "points_max" : 7,
+ "unit" : "g",
+ "value" : 3.8
+ },
+ {
+ "id" : "fiber",
+ "points" : 0,
+ "points_max" : 5,
+ "unit" : "g",
+ "value" : 1.9
+ },
+ {
+ "id" : "fruits_vegetables_legumes",
+ "points" : 0,
+ "points_max" : 5,
+ "unit" : "%",
+ "value" : 0
+ }
+ ]
+ },
"count_proteins" : 1,
"count_proteins_reason" : "negative_points_less_than_11",
- "energy" : 287,
- "energy_points" : 0,
- "fiber" : 1.9,
- "fiber_points" : 0,
- "fruits_vegetables_legumes" : null,
"is_beverage" : 0,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 0,
"is_red_meat_product" : 0,
"is_water" : 0,
- "negative_nutrients" : [
- "energy",
- "sugars",
- "saturated_fat",
- "salt",
- "non_nutritive_sweeteners"
- ],
"negative_points" : 2,
+ "negative_points_max" : 55,
"positive_nutrients" : [
- "fruits_vegetables_legumes",
+ "proteins",
"fiber",
- "proteins"
+ "fruits_vegetables_legumes"
],
"positive_points" : 1,
- "proteins" : 3.8,
- "proteins_points" : 1,
- "salt" : 0.1125,
- "salt_points" : 0,
- "saturated_fat" : 1.1,
- "saturated_fat_points" : 1,
- "sugars" : 6.3,
- "sugars_points" : 1
+ "positive_points_max" : 17
},
"grade" : "b",
"nutrients_available" : 1,
diff --git a/tests/unit/expected_test_results/nutriscore/colza-oil.json b/tests/unit/expected_test_results/nutriscore/colza-oil.json
index 9b5cb598ebbc8..279a7623e2347 100644
--- a/tests/unit/expected_test_results/nutriscore/colza-oil.json
+++ b/tests/unit/expected_test_results/nutriscore/colza-oil.json
@@ -106,43 +106,77 @@
"2023" : {
"category_available" : 1,
"data" : {
+ "components" : {
+ "negative" : [
+ {
+ "id" : "energy_from_saturated_fat",
+ "points" : 2,
+ "points_max" : 10,
+ "unit" : "kJ",
+ "value" : 259
+ },
+ {
+ "id" : "sugars",
+ "points" : 0,
+ "points_max" : 15,
+ "unit" : "g",
+ "value" : 0
+ },
+ {
+ "id" : "saturated_fat_ratio",
+ "points" : 0,
+ "points_max" : 10,
+ "unit" : "%",
+ "value" : 7
+ },
+ {
+ "id" : "salt",
+ "points" : 0,
+ "points_max" : 20,
+ "unit" : "g",
+ "value" : 0
+ }
+ ],
+ "positive" : [
+ {
+ "id" : "proteins",
+ "points" : 0,
+ "points_max" : 7,
+ "unit" : "g",
+ "value" : 0
+ },
+ {
+ "id" : "fiber",
+ "points" : 0,
+ "points_max" : 5,
+ "unit" : "g",
+ "value" : 0
+ },
+ {
+ "id" : "fruits_vegetables_legumes",
+ "points" : 0,
+ "points_max" : 5,
+ "unit" : "%",
+ "value" : 0
+ }
+ ]
+ },
"count_proteins" : 1,
"count_proteins_reason" : "negative_points_less_than_7",
- "energy" : 3760,
- "energy_from_saturated_fat" : 259,
- "energy_from_saturated_fat_points" : 2,
- "fat" : 100,
- "fiber" : 0,
- "fiber_points" : 0,
- "fruits_vegetables_legumes" : null,
"is_beverage" : 0,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 1,
"is_red_meat_product" : 0,
"is_water" : 0,
- "negative_nutrients" : [
- "energy_from_saturated_fat",
- "sugars",
- "saturated_fat_ratio",
- "salt",
- "non_nutritive_sweeteners"
- ],
"negative_points" : 2,
+ "negative_points_max" : 55,
"positive_nutrients" : [
- "fruits_vegetables_legumes",
+ "proteins",
"fiber",
- "proteins"
+ "fruits_vegetables_legumes"
],
"positive_points" : 0,
- "proteins" : 0,
- "proteins_points" : 0,
- "salt" : 0,
- "salt_points" : 0,
- "saturated_fat" : 7,
- "saturated_fat_ratio" : 7,
- "saturated_fat_ratio_points" : 0,
- "sugars" : 0,
- "sugars_points" : 0
+ "positive_points_max" : 17
},
"grade" : "b",
"nutrients_available" : 1,
diff --git a/tests/unit/expected_test_results/nutriscore/cookies.json b/tests/unit/expected_test_results/nutriscore/cookies.json
index 67f58ca6967cf..b0919736acfd5 100644
--- a/tests/unit/expected_test_results/nutriscore/cookies.json
+++ b/tests/unit/expected_test_results/nutriscore/cookies.json
@@ -96,39 +96,69 @@
"2023" : {
"category_available" : 1,
"data" : {
+ "components" : {
+ "negative" : [
+ {
+ "id" : "energy",
+ "points" : 10,
+ "points_max" : 10,
+ "unit" : "kJ",
+ "value" : 3460
+ },
+ {
+ "id" : "sugars",
+ "points" : 0,
+ "points_max" : 15,
+ "unit" : "g",
+ "value" : 0
+ },
+ {
+ "id" : "saturated_fat",
+ "points" : 10,
+ "points_max" : 10,
+ "unit" : "g",
+ "value" : 15
+ },
+ {
+ "id" : "salt",
+ "points" : 0,
+ "points_max" : 20,
+ "unit" : "g",
+ "value" : 0
+ }
+ ],
+ "positive" : [
+ {
+ "id" : "fiber",
+ "points" : 0,
+ "points_max" : 5,
+ "unit" : "g",
+ "value" : 0
+ },
+ {
+ "id" : "fruits_vegetables_legumes",
+ "points" : 0,
+ "points_max" : 5,
+ "unit" : "%",
+ "value" : 0
+ }
+ ]
+ },
"count_proteins" : 0,
- "count_proteins_reason" : "negative_points_more_than_11",
- "energy" : 3460,
- "energy_points" : 10,
- "fiber" : 0,
- "fiber_points" : 0,
- "fruits_vegetables_legumes" : null,
+ "count_proteins_reason" : "negative_points_greater_than_or_equal_to_11",
"is_beverage" : 0,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 0,
"is_red_meat_product" : 0,
"is_water" : 0,
- "negative_nutrients" : [
- "energy",
- "sugars",
- "saturated_fat",
- "salt",
- "non_nutritive_sweeteners"
- ],
"negative_points" : 20,
+ "negative_points_max" : 55,
"positive_nutrients" : [
- "fruits_vegetables_legumes",
- "fiber"
+ "fiber",
+ "fruits_vegetables_legumes"
],
"positive_points" : 0,
- "proteins" : 0,
- "proteins_points" : 0,
- "salt" : 0,
- "salt_points" : 0,
- "saturated_fat" : 15,
- "saturated_fat_points" : 10,
- "sugars" : 0,
- "sugars_points" : 0
+ "positive_points_max" : 10
},
"grade" : "e",
"nutrients_available" : 1,
diff --git a/tests/unit/expected_test_results/nutriscore/dairy-drink-with-80-percent-milk.json b/tests/unit/expected_test_results/nutriscore/dairy-drink-with-80-percent-milk.json
index 79cfbe91a422e..2c05ccb9aa8e4 100644
--- a/tests/unit/expected_test_results/nutriscore/dairy-drink-with-80-percent-milk.json
+++ b/tests/unit/expected_test_results/nutriscore/dairy-drink-with-80-percent-milk.json
@@ -224,42 +224,85 @@
"2023" : {
"category_available" : 1,
"data" : {
+ "components" : {
+ "negative" : [
+ {
+ "id" : "energy",
+ "points" : 10,
+ "points_max" : 10,
+ "unit" : "kJ",
+ "value" : 3378
+ },
+ {
+ "id" : "sugars",
+ "points" : 8,
+ "points_max" : 10,
+ "unit" : "g",
+ "value" : 10
+ },
+ {
+ "id" : "saturated_fat",
+ "points" : 4,
+ "points_max" : 10,
+ "unit" : "g",
+ "value" : 5
+ },
+ {
+ "id" : "salt",
+ "points" : 0,
+ "points_max" : 20,
+ "unit" : "g",
+ "value" : 0
+ },
+ {
+ "id" : "non_nutritive_sweeteners",
+ "points" : 0,
+ "points_max" : null,
+ "unit" : null,
+ "value" : 0
+ }
+ ],
+ "positive" : [
+ {
+ "id" : "proteins",
+ "points" : 7,
+ "points_max" : 7,
+ "unit" : "g",
+ "value" : 5
+ },
+ {
+ "id" : "fiber",
+ "points" : 0,
+ "points_max" : 5,
+ "unit" : "g",
+ "value" : 2
+ },
+ {
+ "id" : "fruits_vegetables_legumes",
+ "points" : 0,
+ "points_max" : 6,
+ "unit" : "%",
+ "value" : 0
+ }
+ ]
+ },
"count_proteins" : 1,
"count_proteins_reason" : "beverage",
- "energy" : 3378,
- "energy_points" : 10,
- "fiber" : 2,
- "fiber_points" : 0,
- "fruits_vegetables_legumes" : 0,
- "fruits_vegetables_legumes_points" : 0,
"is_beverage" : 1,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 0,
"is_red_meat_product" : 0,
"is_water" : 0,
- "negative_nutrients" : [
- "energy",
- "sugars",
- "saturated_fat",
- "salt",
- "non_nutritive_sweeteners"
- ],
"negative_points" : 22,
- "non_nutritive_sweeteners_points" : 0,
+ "negative_points_max" : 50,
+ "non_nutritive_sweeteners_max" : 4,
"positive_nutrients" : [
- "fruits_vegetables_legumes",
+ "proteins",
"fiber",
- "proteins"
+ "fruits_vegetables_legumes"
],
"positive_points" : 7,
- "proteins" : 5,
- "proteins_points" : 7,
- "salt" : 0,
- "salt_points" : 0,
- "saturated_fat" : 5,
- "saturated_fat_points" : 4,
- "sugars" : 10,
- "sugars_points" : 8
+ "positive_points_max" : 18
},
"grade" : "e",
"nutrients_available" : 1,
diff --git a/tests/unit/expected_test_results/nutriscore/dairy-drink-with-less-than-80-percent-milk.json b/tests/unit/expected_test_results/nutriscore/dairy-drink-with-less-than-80-percent-milk.json
index 1a75ef6f628f2..5d0121f0c46af 100644
--- a/tests/unit/expected_test_results/nutriscore/dairy-drink-with-less-than-80-percent-milk.json
+++ b/tests/unit/expected_test_results/nutriscore/dairy-drink-with-less-than-80-percent-milk.json
@@ -220,42 +220,85 @@
"2023" : {
"category_available" : 1,
"data" : {
+ "components" : {
+ "negative" : [
+ {
+ "id" : "energy",
+ "points" : 10,
+ "points_max" : 10,
+ "unit" : "kJ",
+ "value" : 3378
+ },
+ {
+ "id" : "sugars",
+ "points" : 10,
+ "points_max" : 10,
+ "unit" : "g",
+ "value" : 20
+ },
+ {
+ "id" : "saturated_fat",
+ "points" : 4,
+ "points_max" : 10,
+ "unit" : "g",
+ "value" : 5
+ },
+ {
+ "id" : "salt",
+ "points" : 0,
+ "points_max" : 20,
+ "unit" : "g",
+ "value" : 0
+ },
+ {
+ "id" : "non_nutritive_sweeteners",
+ "points" : 0,
+ "points_max" : null,
+ "unit" : null,
+ "value" : 0
+ }
+ ],
+ "positive" : [
+ {
+ "id" : "proteins",
+ "points" : 7,
+ "points_max" : 7,
+ "unit" : "g",
+ "value" : 5
+ },
+ {
+ "id" : "fiber",
+ "points" : 0,
+ "points_max" : 5,
+ "unit" : "g",
+ "value" : 2
+ },
+ {
+ "id" : "fruits_vegetables_legumes",
+ "points" : 0,
+ "points_max" : 6,
+ "unit" : "%",
+ "value" : 0
+ }
+ ]
+ },
"count_proteins" : 1,
"count_proteins_reason" : "beverage",
- "energy" : 3378,
- "energy_points" : 10,
- "fiber" : 2,
- "fiber_points" : 0,
- "fruits_vegetables_legumes" : 0,
- "fruits_vegetables_legumes_points" : 0,
"is_beverage" : 1,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 0,
"is_red_meat_product" : 0,
"is_water" : 0,
- "negative_nutrients" : [
- "energy",
- "sugars",
- "saturated_fat",
- "salt",
- "non_nutritive_sweeteners"
- ],
"negative_points" : 24,
- "non_nutritive_sweeteners_points" : 0,
+ "negative_points_max" : 50,
+ "non_nutritive_sweeteners_max" : 4,
"positive_nutrients" : [
- "fruits_vegetables_legumes",
+ "proteins",
"fiber",
- "proteins"
+ "fruits_vegetables_legumes"
],
"positive_points" : 7,
- "proteins" : 5,
- "proteins_points" : 7,
- "salt" : 0,
- "salt_points" : 0,
- "saturated_fat" : 5,
- "saturated_fat_points" : 4,
- "sugars" : 20,
- "sugars_points" : 10
+ "positive_points_max" : 18
},
"grade" : "e",
"nutrients_available" : 1,
diff --git a/tests/unit/expected_test_results/nutriscore/dairy-drinks-without-milk.json b/tests/unit/expected_test_results/nutriscore/dairy-drinks-without-milk.json
index 2347fbfe93bac..34d02aa6b9103 100644
--- a/tests/unit/expected_test_results/nutriscore/dairy-drinks-without-milk.json
+++ b/tests/unit/expected_test_results/nutriscore/dairy-drinks-without-milk.json
@@ -213,42 +213,85 @@
"2023" : {
"category_available" : 1,
"data" : {
+ "components" : {
+ "negative" : [
+ {
+ "id" : "energy",
+ "points" : 10,
+ "points_max" : 10,
+ "unit" : "kJ",
+ "value" : 3378
+ },
+ {
+ "id" : "sugars",
+ "points" : 8,
+ "points_max" : 10,
+ "unit" : "g",
+ "value" : 10
+ },
+ {
+ "id" : "saturated_fat",
+ "points" : 4,
+ "points_max" : 10,
+ "unit" : "g",
+ "value" : 5
+ },
+ {
+ "id" : "salt",
+ "points" : 0,
+ "points_max" : 20,
+ "unit" : "g",
+ "value" : 0
+ },
+ {
+ "id" : "non_nutritive_sweeteners",
+ "points" : 0,
+ "points_max" : null,
+ "unit" : null,
+ "value" : 0
+ }
+ ],
+ "positive" : [
+ {
+ "id" : "proteins",
+ "points" : 7,
+ "points_max" : 7,
+ "unit" : "g",
+ "value" : 5
+ },
+ {
+ "id" : "fiber",
+ "points" : 0,
+ "points_max" : 5,
+ "unit" : "g",
+ "value" : 2
+ },
+ {
+ "id" : "fruits_vegetables_legumes",
+ "points" : 0,
+ "points_max" : 6,
+ "unit" : "%",
+ "value" : 0
+ }
+ ]
+ },
"count_proteins" : 1,
"count_proteins_reason" : "beverage",
- "energy" : 3378,
- "energy_points" : 10,
- "fiber" : 2,
- "fiber_points" : 0,
- "fruits_vegetables_legumes" : 0,
- "fruits_vegetables_legumes_points" : 0,
"is_beverage" : 1,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 0,
"is_red_meat_product" : 0,
"is_water" : 0,
- "negative_nutrients" : [
- "energy",
- "sugars",
- "saturated_fat",
- "salt",
- "non_nutritive_sweeteners"
- ],
"negative_points" : 22,
- "non_nutritive_sweeteners_points" : 0,
+ "negative_points_max" : 50,
+ "non_nutritive_sweeteners_max" : 4,
"positive_nutrients" : [
- "fruits_vegetables_legumes",
+ "proteins",
"fiber",
- "proteins"
+ "fruits_vegetables_legumes"
],
"positive_points" : 7,
- "proteins" : 5,
- "proteins_points" : 7,
- "salt" : 0,
- "salt_points" : 0,
- "saturated_fat" : 5,
- "saturated_fat_points" : 4,
- "sugars" : 10,
- "sugars_points" : 8
+ "positive_points_max" : 18
},
"grade" : "e",
"nutrients_available" : 1,
diff --git a/tests/unit/expected_test_results/nutriscore/en-apple-estimated-nutrients.json b/tests/unit/expected_test_results/nutriscore/en-apple-estimated-nutrients.json
index f9f9dee217e11..af814a16084aa 100644
--- a/tests/unit/expected_test_results/nutriscore/en-apple-estimated-nutrients.json
+++ b/tests/unit/expected_test_results/nutriscore/en-apple-estimated-nutrients.json
@@ -208,41 +208,77 @@
"2023" : {
"category_available" : 1,
"data" : {
+ "components" : {
+ "negative" : [
+ {
+ "id" : "energy",
+ "points" : 0,
+ "points_max" : 10,
+ "unit" : "kJ",
+ "value" : 207
+ },
+ {
+ "id" : "sugars",
+ "points" : 3,
+ "points_max" : 15,
+ "unit" : "g",
+ "value" : 10.1
+ },
+ {
+ "id" : "saturated_fat",
+ "points" : 0,
+ "points_max" : 10,
+ "unit" : "g",
+ "value" : 0.02
+ },
+ {
+ "id" : "salt",
+ "points" : 0,
+ "points_max" : 20,
+ "unit" : "g",
+ "value" : 0
+ }
+ ],
+ "positive" : [
+ {
+ "id" : "proteins",
+ "points" : 0,
+ "points_max" : 7,
+ "unit" : "g",
+ "value" : 0.27
+ },
+ {
+ "id" : "fiber",
+ "points" : 0,
+ "points_max" : 5,
+ "unit" : "g",
+ "value" : 1.3
+ },
+ {
+ "id" : "fruits_vegetables_legumes",
+ "points" : 5,
+ "points_max" : 5,
+ "unit" : "%",
+ "value" : 100
+ }
+ ]
+ },
"count_proteins" : 1,
"count_proteins_reason" : "negative_points_less_than_11",
- "energy" : 207,
- "energy_points" : 0,
- "fiber" : 1.3,
- "fiber_points" : 0,
- "fruits_vegetables_legumes" : 100,
- "fruits_vegetables_legumes_points" : 5,
"is_beverage" : 0,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 0,
"is_red_meat_product" : 0,
"is_water" : 0,
- "negative_nutrients" : [
- "energy",
- "sugars",
- "saturated_fat",
- "salt",
- "non_nutritive_sweeteners"
- ],
"negative_points" : 3,
+ "negative_points_max" : 55,
"positive_nutrients" : [
- "fruits_vegetables_legumes",
+ "proteins",
"fiber",
- "proteins"
+ "fruits_vegetables_legumes"
],
"positive_points" : 5,
- "proteins" : 0.27,
- "proteins_points" : 0,
- "salt" : 0,
- "salt_points" : 0,
- "saturated_fat" : 0.021,
- "saturated_fat_points" : 0,
- "sugars" : 10.1,
- "sugars_points" : 3
+ "positive_points_max" : 17
},
"grade" : "a",
"nutrients_available" : 1,
diff --git a/tests/unit/expected_test_results/nutriscore/en-avocado-oil.json b/tests/unit/expected_test_results/nutriscore/en-avocado-oil.json
index 9726b066ea2dd..2713b01ebda96 100644
--- a/tests/unit/expected_test_results/nutriscore/en-avocado-oil.json
+++ b/tests/unit/expected_test_results/nutriscore/en-avocado-oil.json
@@ -172,43 +172,69 @@
"2023" : {
"category_available" : 1,
"data" : {
+ "components" : {
+ "negative" : [
+ {
+ "id" : "energy_from_saturated_fat",
+ "points" : 5,
+ "points_max" : 10,
+ "unit" : "kJ",
+ "value" : 606.8
+ },
+ {
+ "id" : "sugars",
+ "points" : 0,
+ "points_max" : 15,
+ "unit" : "g",
+ "value" : 0
+ },
+ {
+ "id" : "saturated_fat_ratio",
+ "points" : 2,
+ "points_max" : 10,
+ "unit" : "%",
+ "value" : 17.9
+ },
+ {
+ "id" : "salt",
+ "points" : 0,
+ "points_max" : 20,
+ "unit" : "g",
+ "value" : 0
+ }
+ ],
+ "positive" : [
+ {
+ "id" : "fiber",
+ "points" : 0,
+ "points_max" : 5,
+ "unit" : "g",
+ "value" : 0
+ },
+ {
+ "id" : "fruits_vegetables_legumes",
+ "points" : 5,
+ "points_max" : 5,
+ "unit" : "%",
+ "value" : 100
+ }
+ ]
+ },
"count_proteins" : 0,
- "count_proteins_reason" : "negative_points_more_than_7",
- "energy" : 3448,
- "energy_from_saturated_fat" : 606.8,
- "energy_from_saturated_fat_points" : 5,
- "fat" : 91.6,
- "fiber" : 0,
- "fiber_points" : 0,
- "fruits_vegetables_legumes" : 100,
- "fruits_vegetables_legumes_points" : 5,
+ "count_proteins_reason" : "negative_points_greater_than_or_equal_to_7",
"is_beverage" : 0,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 1,
"is_red_meat_product" : 0,
"is_water" : 0,
- "negative_nutrients" : [
- "energy_from_saturated_fat",
- "sugars",
- "saturated_fat_ratio",
- "salt",
- "non_nutritive_sweeteners"
- ],
"negative_points" : 7,
+ "negative_points_max" : 55,
"positive_nutrients" : [
- "fruits_vegetables_legumes",
- "fiber"
+ "fiber",
+ "fruits_vegetables_legumes"
],
"positive_points" : 5,
- "proteins" : 0,
- "proteins_points" : 0,
- "salt" : 0,
- "salt_points" : 0,
- "saturated_fat" : 16.4,
- "saturated_fat_ratio" : 17.9039301310044,
- "saturated_fat_ratio_points" : 2,
- "sugars" : 0,
- "sugars_points" : 0
+ "positive_points_max" : 10
},
"grade" : "b",
"nutrients_available" : 1,
diff --git a/tests/unit/expected_test_results/nutriscore/en-beers-category.json b/tests/unit/expected_test_results/nutriscore/en-beers-category.json
index 48802e2fdceea..60c16548b6a38 100644
--- a/tests/unit/expected_test_results/nutriscore/en-beers-category.json
+++ b/tests/unit/expected_test_results/nutriscore/en-beers-category.json
@@ -76,7 +76,7 @@
"data" : {
"energy" : 182,
"fiber" : 0.5,
- "fruits_vegetables_legumes" : null,
+ "fruits_vegetables_legumes" : 0,
"is_beverage" : 1,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 0,
diff --git a/tests/unit/expected_test_results/nutriscore/en-cherry-tomatoes.json b/tests/unit/expected_test_results/nutriscore/en-cherry-tomatoes.json
index 6acc1d1cbf553..4ae0430fee62e 100644
--- a/tests/unit/expected_test_results/nutriscore/en-cherry-tomatoes.json
+++ b/tests/unit/expected_test_results/nutriscore/en-cherry-tomatoes.json
@@ -218,41 +218,77 @@
"2023" : {
"category_available" : 1,
"data" : {
+ "components" : {
+ "negative" : [
+ {
+ "id" : "energy",
+ "points" : 0,
+ "points_max" : 10,
+ "unit" : "kJ",
+ "value" : 81
+ },
+ {
+ "id" : "sugars",
+ "points" : 0,
+ "points_max" : 15,
+ "unit" : "g",
+ "value" : 2.48
+ },
+ {
+ "id" : "saturated_fat",
+ "points" : 0,
+ "points_max" : 10,
+ "unit" : "g",
+ "value" : 0.06
+ },
+ {
+ "id" : "salt",
+ "points" : 0,
+ "points_max" : 20,
+ "unit" : "g",
+ "value" : 0
+ }
+ ],
+ "positive" : [
+ {
+ "id" : "proteins",
+ "points" : 0,
+ "points_max" : 7,
+ "unit" : "g",
+ "value" : 0.86
+ },
+ {
+ "id" : "fiber",
+ "points" : 0,
+ "points_max" : 5,
+ "unit" : "g",
+ "value" : 1.2
+ },
+ {
+ "id" : "fruits_vegetables_legumes",
+ "points" : 5,
+ "points_max" : 5,
+ "unit" : "%",
+ "value" : 100
+ }
+ ]
+ },
"count_proteins" : 1,
"count_proteins_reason" : "negative_points_less_than_11",
- "energy" : 81,
- "energy_points" : 0,
- "fiber" : 1.2,
- "fiber_points" : 0,
- "fruits_vegetables_legumes" : 100,
- "fruits_vegetables_legumes_points" : 5,
"is_beverage" : 0,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 0,
"is_red_meat_product" : 0,
"is_water" : 0,
- "negative_nutrients" : [
- "energy",
- "sugars",
- "saturated_fat",
- "salt",
- "non_nutritive_sweeteners"
- ],
"negative_points" : 0,
+ "negative_points_max" : 55,
"positive_nutrients" : [
- "fruits_vegetables_legumes",
+ "proteins",
"fiber",
- "proteins"
+ "fruits_vegetables_legumes"
],
"positive_points" : 5,
- "proteins" : 0.86,
- "proteins_points" : 0,
- "salt" : 0,
- "salt_points" : 0,
- "saturated_fat" : 0.056,
- "saturated_fat_points" : 0,
- "sugars" : 2.48,
- "sugars_points" : 0
+ "positive_points_max" : 17
},
"grade" : "a",
"nutrients_available" : 1,
diff --git a/tests/unit/expected_test_results/nutriscore/en-milk.json b/tests/unit/expected_test_results/nutriscore/en-milk.json
index 2ba2a7d3df8b4..999986e5aca08 100644
--- a/tests/unit/expected_test_results/nutriscore/en-milk.json
+++ b/tests/unit/expected_test_results/nutriscore/en-milk.json
@@ -93,41 +93,85 @@
"2023" : {
"category_available" : 1,
"data" : {
+ "components" : {
+ "negative" : [
+ {
+ "id" : "energy",
+ "points" : 3,
+ "points_max" : 10,
+ "unit" : "kJ",
+ "value" : 195
+ },
+ {
+ "id" : "sugars",
+ "points" : 3,
+ "points_max" : 10,
+ "unit" : "g",
+ "value" : 4.8
+ },
+ {
+ "id" : "saturated_fat",
+ "points" : 0,
+ "points_max" : 10,
+ "unit" : "g",
+ "value" : 1
+ },
+ {
+ "id" : "salt",
+ "points" : 0,
+ "points_max" : 20,
+ "unit" : "g",
+ "value" : 0.1
+ },
+ {
+ "id" : "non_nutritive_sweeteners",
+ "points" : 0,
+ "points_max" : null,
+ "unit" : null,
+ "value" : 0
+ }
+ ],
+ "positive" : [
+ {
+ "id" : "proteins",
+ "points" : 7,
+ "points_max" : 7,
+ "unit" : "g",
+ "value" : 3.3
+ },
+ {
+ "id" : "fiber",
+ "points" : 0,
+ "points_max" : 5,
+ "unit" : "g",
+ "value" : 0
+ },
+ {
+ "id" : "fruits_vegetables_legumes",
+ "points" : 0,
+ "points_max" : 6,
+ "unit" : "%",
+ "value" : 0
+ }
+ ]
+ },
"count_proteins" : 1,
"count_proteins_reason" : "beverage",
- "energy" : 195,
- "energy_points" : 3,
- "fiber" : 0,
- "fiber_points" : 0,
- "fruits_vegetables_legumes" : null,
"is_beverage" : 1,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 0,
"is_red_meat_product" : 0,
"is_water" : 0,
- "negative_nutrients" : [
- "energy",
- "sugars",
- "saturated_fat",
- "salt",
- "non_nutritive_sweeteners"
- ],
"negative_points" : 6,
- "non_nutritive_sweeteners_points" : 0,
+ "negative_points_max" : 50,
+ "non_nutritive_sweeteners_max" : 4,
"positive_nutrients" : [
- "fruits_vegetables_legumes",
+ "proteins",
"fiber",
- "proteins"
+ "fruits_vegetables_legumes"
],
"positive_points" : 7,
- "proteins" : 3.3,
- "proteins_points" : 7,
- "salt" : 0.1,
- "salt_points" : 0,
- "saturated_fat" : 1,
- "saturated_fat_points" : 0,
- "sugars" : 4.8,
- "sugars_points" : 3
+ "positive_points_max" : 18
},
"grade" : "b",
"nutrients_available" : 1,
diff --git a/tests/unit/expected_test_results/nutriscore/en-olive-oil-no-ingredients.json b/tests/unit/expected_test_results/nutriscore/en-olive-oil-no-ingredients.json
index 0595d5199f356..1943eba21b550 100644
--- a/tests/unit/expected_test_results/nutriscore/en-olive-oil-no-ingredients.json
+++ b/tests/unit/expected_test_results/nutriscore/en-olive-oil-no-ingredients.json
@@ -109,43 +109,69 @@
"2023" : {
"category_available" : 1,
"data" : {
+ "components" : {
+ "negative" : [
+ {
+ "id" : "energy_from_saturated_fat",
+ "points" : 5,
+ "points_max" : 10,
+ "unit" : "kJ",
+ "value" : 629
+ },
+ {
+ "id" : "sugars",
+ "points" : 0,
+ "points_max" : 15,
+ "unit" : "g",
+ "value" : 0
+ },
+ {
+ "id" : "saturated_fat_ratio",
+ "points" : 2,
+ "points_max" : 10,
+ "unit" : "%",
+ "value" : 18.7
+ },
+ {
+ "id" : "salt",
+ "points" : 0,
+ "points_max" : 20,
+ "unit" : "g",
+ "value" : 0
+ }
+ ],
+ "positive" : [
+ {
+ "id" : "fiber",
+ "points" : 0,
+ "points_max" : 5,
+ "unit" : "g",
+ "value" : 0
+ },
+ {
+ "id" : "fruits_vegetables_legumes",
+ "points" : 5,
+ "points_max" : 5,
+ "unit" : "%",
+ "value" : 100
+ }
+ ]
+ },
"count_proteins" : 0,
- "count_proteins_reason" : "negative_points_more_than_7",
- "energy" : 3367,
- "energy_from_saturated_fat" : 629,
- "energy_from_saturated_fat_points" : 5,
- "fat" : 91,
- "fiber" : 0,
- "fiber_points" : 0,
- "fruits_vegetables_legumes" : 100,
- "fruits_vegetables_legumes_points" : 5,
+ "count_proteins_reason" : "negative_points_greater_than_or_equal_to_7",
"is_beverage" : 0,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 1,
"is_red_meat_product" : 0,
"is_water" : 0,
- "negative_nutrients" : [
- "energy_from_saturated_fat",
- "sugars",
- "saturated_fat_ratio",
- "salt",
- "non_nutritive_sweeteners"
- ],
"negative_points" : 7,
+ "negative_points_max" : 55,
"positive_nutrients" : [
- "fruits_vegetables_legumes",
- "fiber"
+ "fiber",
+ "fruits_vegetables_legumes"
],
"positive_points" : 5,
- "proteins" : 0,
- "proteins_points" : 0,
- "salt" : 0,
- "salt_points" : 0,
- "saturated_fat" : 17,
- "saturated_fat_ratio" : 18.6813186813187,
- "saturated_fat_ratio_points" : 2,
- "sugars" : 0,
- "sugars_points" : 0
+ "positive_points_max" : 10
},
"grade" : "b",
"nutrients_available" : 1,
diff --git a/tests/unit/expected_test_results/nutriscore/en-olive-oil-unrecognized-ingredients.json b/tests/unit/expected_test_results/nutriscore/en-olive-oil-unrecognized-ingredients.json
index 08c40a23e6614..7c2aa519ffc30 100644
--- a/tests/unit/expected_test_results/nutriscore/en-olive-oil-unrecognized-ingredients.json
+++ b/tests/unit/expected_test_results/nutriscore/en-olive-oil-unrecognized-ingredients.json
@@ -176,43 +176,69 @@
"2023" : {
"category_available" : 1,
"data" : {
+ "components" : {
+ "negative" : [
+ {
+ "id" : "energy_from_saturated_fat",
+ "points" : 5,
+ "points_max" : 10,
+ "unit" : "kJ",
+ "value" : 629
+ },
+ {
+ "id" : "sugars",
+ "points" : 0,
+ "points_max" : 15,
+ "unit" : "g",
+ "value" : 0
+ },
+ {
+ "id" : "saturated_fat_ratio",
+ "points" : 2,
+ "points_max" : 10,
+ "unit" : "%",
+ "value" : 18.7
+ },
+ {
+ "id" : "salt",
+ "points" : 0,
+ "points_max" : 20,
+ "unit" : "g",
+ "value" : 0
+ }
+ ],
+ "positive" : [
+ {
+ "id" : "fiber",
+ "points" : 0,
+ "points_max" : 5,
+ "unit" : "g",
+ "value" : 0
+ },
+ {
+ "id" : "fruits_vegetables_legumes",
+ "points" : 5,
+ "points_max" : 5,
+ "unit" : "%",
+ "value" : 100
+ }
+ ]
+ },
"count_proteins" : 0,
- "count_proteins_reason" : "negative_points_more_than_7",
- "energy" : 3367,
- "energy_from_saturated_fat" : 629,
- "energy_from_saturated_fat_points" : 5,
- "fat" : 91,
- "fiber" : 0,
- "fiber_points" : 0,
- "fruits_vegetables_legumes" : 100,
- "fruits_vegetables_legumes_points" : 5,
+ "count_proteins_reason" : "negative_points_greater_than_or_equal_to_7",
"is_beverage" : 0,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 1,
"is_red_meat_product" : 0,
"is_water" : 0,
- "negative_nutrients" : [
- "energy_from_saturated_fat",
- "sugars",
- "saturated_fat_ratio",
- "salt",
- "non_nutritive_sweeteners"
- ],
"negative_points" : 7,
+ "negative_points_max" : 55,
"positive_nutrients" : [
- "fruits_vegetables_legumes",
- "fiber"
+ "fiber",
+ "fruits_vegetables_legumes"
],
"positive_points" : 5,
- "proteins" : 0,
- "proteins_points" : 0,
- "salt" : 0,
- "salt_points" : 0,
- "saturated_fat" : 17,
- "saturated_fat_ratio" : 18.6813186813187,
- "saturated_fat_ratio_points" : 2,
- "sugars" : 0,
- "sugars_points" : 0
+ "positive_points_max" : 10
},
"grade" : "b",
"nutrients_available" : 1,
diff --git a/tests/unit/expected_test_results/nutriscore/en-olive-oil.json b/tests/unit/expected_test_results/nutriscore/en-olive-oil.json
index e87a6a35403d0..94d428af2bef9 100644
--- a/tests/unit/expected_test_results/nutriscore/en-olive-oil.json
+++ b/tests/unit/expected_test_results/nutriscore/en-olive-oil.json
@@ -221,43 +221,69 @@
"2023" : {
"category_available" : 1,
"data" : {
+ "components" : {
+ "negative" : [
+ {
+ "id" : "energy_from_saturated_fat",
+ "points" : 5,
+ "points_max" : 10,
+ "unit" : "kJ",
+ "value" : 629
+ },
+ {
+ "id" : "sugars",
+ "points" : 0,
+ "points_max" : 15,
+ "unit" : "g",
+ "value" : 0
+ },
+ {
+ "id" : "saturated_fat_ratio",
+ "points" : 2,
+ "points_max" : 10,
+ "unit" : "%",
+ "value" : 18.7
+ },
+ {
+ "id" : "salt",
+ "points" : 0,
+ "points_max" : 20,
+ "unit" : "g",
+ "value" : 0
+ }
+ ],
+ "positive" : [
+ {
+ "id" : "fiber",
+ "points" : 0,
+ "points_max" : 5,
+ "unit" : "g",
+ "value" : 0
+ },
+ {
+ "id" : "fruits_vegetables_legumes",
+ "points" : 5,
+ "points_max" : 5,
+ "unit" : "%",
+ "value" : 100
+ }
+ ]
+ },
"count_proteins" : 0,
- "count_proteins_reason" : "negative_points_more_than_7",
- "energy" : 3367,
- "energy_from_saturated_fat" : 629,
- "energy_from_saturated_fat_points" : 5,
- "fat" : 91,
- "fiber" : 0,
- "fiber_points" : 0,
- "fruits_vegetables_legumes" : 100,
- "fruits_vegetables_legumes_points" : 5,
+ "count_proteins_reason" : "negative_points_greater_than_or_equal_to_7",
"is_beverage" : 0,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 1,
"is_red_meat_product" : 0,
"is_water" : 0,
- "negative_nutrients" : [
- "energy_from_saturated_fat",
- "sugars",
- "saturated_fat_ratio",
- "salt",
- "non_nutritive_sweeteners"
- ],
"negative_points" : 7,
+ "negative_points_max" : 55,
"positive_nutrients" : [
- "fruits_vegetables_legumes",
- "fiber"
+ "fiber",
+ "fruits_vegetables_legumes"
],
"positive_points" : 5,
- "proteins" : 0,
- "proteins_points" : 0,
- "salt" : 0,
- "salt_points" : 0,
- "saturated_fat" : 17,
- "saturated_fat_ratio" : 18.6813186813187,
- "saturated_fat_ratio_points" : 2,
- "sugars" : 0,
- "sugars_points" : 0
+ "positive_points_max" : 10
},
"grade" : "b",
"nutrients_available" : 1,
diff --git a/tests/unit/expected_test_results/nutriscore/en-orange-juice-category-and-ingredients.json b/tests/unit/expected_test_results/nutriscore/en-orange-juice-category-and-ingredients.json
index 98fe0dc014227..75435384d671e 100644
--- a/tests/unit/expected_test_results/nutriscore/en-orange-juice-category-and-ingredients.json
+++ b/tests/unit/expected_test_results/nutriscore/en-orange-juice-category-and-ingredients.json
@@ -252,42 +252,85 @@
"2023" : {
"category_available" : 1,
"data" : {
+ "components" : {
+ "negative" : [
+ {
+ "id" : "energy",
+ "points" : 3,
+ "points_max" : 10,
+ "unit" : "kJ",
+ "value" : 182
+ },
+ {
+ "id" : "sugars",
+ "points" : 7,
+ "points_max" : 10,
+ "unit" : "g",
+ "value" : 8.9
+ },
+ {
+ "id" : "saturated_fat",
+ "points" : 0,
+ "points_max" : 10,
+ "unit" : "g",
+ "value" : 0
+ },
+ {
+ "id" : "salt",
+ "points" : 2,
+ "points_max" : 20,
+ "unit" : "g",
+ "value" : 0.5
+ },
+ {
+ "id" : "non_nutritive_sweeteners",
+ "points" : 0,
+ "points_max" : null,
+ "unit" : null,
+ "value" : 0
+ }
+ ],
+ "positive" : [
+ {
+ "id" : "proteins",
+ "points" : 0,
+ "points_max" : 7,
+ "unit" : "g",
+ "value" : 0.2
+ },
+ {
+ "id" : "fiber",
+ "points" : 0,
+ "points_max" : 5,
+ "unit" : "g",
+ "value" : 0.5
+ },
+ {
+ "id" : "fruits_vegetables_legumes",
+ "points" : 2,
+ "points_max" : 6,
+ "unit" : "%",
+ "value" : 50
+ }
+ ]
+ },
"count_proteins" : 1,
"count_proteins_reason" : "beverage",
- "energy" : 182,
- "energy_points" : 3,
- "fiber" : 0.5,
- "fiber_points" : 0,
- "fruits_vegetables_legumes" : 50,
- "fruits_vegetables_legumes_points" : 2,
"is_beverage" : 1,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 0,
"is_red_meat_product" : 0,
"is_water" : 0,
- "negative_nutrients" : [
- "energy",
- "sugars",
- "saturated_fat",
- "salt",
- "non_nutritive_sweeteners"
- ],
"negative_points" : 12,
- "non_nutritive_sweeteners_points" : 0,
+ "negative_points_max" : 50,
+ "non_nutritive_sweeteners_max" : 4,
"positive_nutrients" : [
- "fruits_vegetables_legumes",
+ "proteins",
"fiber",
- "proteins"
+ "fruits_vegetables_legumes"
],
"positive_points" : 2,
- "proteins" : 0.2,
- "proteins_points" : 0,
- "salt" : 0.5,
- "salt_points" : 2,
- "saturated_fat" : 0,
- "saturated_fat_points" : 0,
- "sugars" : 8.9,
- "sugars_points" : 7
+ "positive_points_max" : 18
},
"grade" : "e",
"nutrients_available" : 1,
diff --git a/tests/unit/expected_test_results/nutriscore/en-orange-juice-category.json b/tests/unit/expected_test_results/nutriscore/en-orange-juice-category.json
index 66b443bf518cf..1a7b6d1b2580d 100644
--- a/tests/unit/expected_test_results/nutriscore/en-orange-juice-category.json
+++ b/tests/unit/expected_test_results/nutriscore/en-orange-juice-category.json
@@ -107,42 +107,85 @@
"2023" : {
"category_available" : 1,
"data" : {
+ "components" : {
+ "negative" : [
+ {
+ "id" : "energy",
+ "points" : 3,
+ "points_max" : 10,
+ "unit" : "kJ",
+ "value" : 182
+ },
+ {
+ "id" : "sugars",
+ "points" : 7,
+ "points_max" : 10,
+ "unit" : "g",
+ "value" : 8.9
+ },
+ {
+ "id" : "saturated_fat",
+ "points" : 0,
+ "points_max" : 10,
+ "unit" : "g",
+ "value" : 0
+ },
+ {
+ "id" : "salt",
+ "points" : 2,
+ "points_max" : 20,
+ "unit" : "g",
+ "value" : 0.5
+ },
+ {
+ "id" : "non_nutritive_sweeteners",
+ "points" : 0,
+ "points_max" : null,
+ "unit" : null,
+ "value" : 0
+ }
+ ],
+ "positive" : [
+ {
+ "id" : "proteins",
+ "points" : 0,
+ "points_max" : 7,
+ "unit" : "g",
+ "value" : 0.2
+ },
+ {
+ "id" : "fiber",
+ "points" : 0,
+ "points_max" : 5,
+ "unit" : "g",
+ "value" : 0.5
+ },
+ {
+ "id" : "fruits_vegetables_legumes",
+ "points" : 6,
+ "points_max" : 6,
+ "unit" : "%",
+ "value" : 100
+ }
+ ]
+ },
"count_proteins" : 1,
"count_proteins_reason" : "beverage",
- "energy" : 182,
- "energy_points" : 3,
- "fiber" : 0.5,
- "fiber_points" : 0,
- "fruits_vegetables_legumes" : 100,
- "fruits_vegetables_legumes_points" : 6,
"is_beverage" : 1,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 0,
"is_red_meat_product" : 0,
"is_water" : 0,
- "negative_nutrients" : [
- "energy",
- "sugars",
- "saturated_fat",
- "salt",
- "non_nutritive_sweeteners"
- ],
"negative_points" : 12,
- "non_nutritive_sweeteners_points" : 0,
+ "negative_points_max" : 50,
+ "non_nutritive_sweeteners_max" : 4,
"positive_nutrients" : [
- "fruits_vegetables_legumes",
+ "proteins",
"fiber",
- "proteins"
+ "fruits_vegetables_legumes"
],
"positive_points" : 6,
- "proteins" : 0.2,
- "proteins_points" : 0,
- "salt" : 0.5,
- "salt_points" : 2,
- "saturated_fat" : 0,
- "saturated_fat_points" : 0,
- "sugars" : 8.9,
- "sugars_points" : 7
+ "positive_points_max" : 18
},
"grade" : "c",
"nutrients_available" : 1,
diff --git a/tests/unit/expected_test_results/nutriscore/en-potatoes-category.json b/tests/unit/expected_test_results/nutriscore/en-potatoes-category.json
index 90a4e342243d2..315dfcd9e88ac 100644
--- a/tests/unit/expected_test_results/nutriscore/en-potatoes-category.json
+++ b/tests/unit/expected_test_results/nutriscore/en-potatoes-category.json
@@ -105,41 +105,77 @@
"2023" : {
"category_available" : 1,
"data" : {
+ "components" : {
+ "negative" : [
+ {
+ "id" : "energy",
+ "points" : 0,
+ "points_max" : 10,
+ "unit" : "kJ",
+ "value" : 182
+ },
+ {
+ "id" : "sugars",
+ "points" : 2,
+ "points_max" : 15,
+ "unit" : "g",
+ "value" : 8.9
+ },
+ {
+ "id" : "saturated_fat",
+ "points" : 0,
+ "points_max" : 10,
+ "unit" : "g",
+ "value" : 0
+ },
+ {
+ "id" : "salt",
+ "points" : 2,
+ "points_max" : 20,
+ "unit" : "g",
+ "value" : 0.5
+ }
+ ],
+ "positive" : [
+ {
+ "id" : "proteins",
+ "points" : 0,
+ "points_max" : 7,
+ "unit" : "g",
+ "value" : 0.2
+ },
+ {
+ "id" : "fiber",
+ "points" : 0,
+ "points_max" : 5,
+ "unit" : "g",
+ "value" : 0.5
+ },
+ {
+ "id" : "fruits_vegetables_legumes",
+ "points" : 0,
+ "points_max" : 5,
+ "unit" : "%",
+ "value" : 0
+ }
+ ]
+ },
"count_proteins" : 1,
"count_proteins_reason" : "negative_points_less_than_11",
- "energy" : 182,
- "energy_points" : 0,
- "fiber" : 0.5,
- "fiber_points" : 0,
- "fruits_vegetables_legumes" : 0,
- "fruits_vegetables_legumes_points" : 0,
"is_beverage" : 0,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 0,
"is_red_meat_product" : 0,
"is_water" : 0,
- "negative_nutrients" : [
- "energy",
- "sugars",
- "saturated_fat",
- "salt",
- "non_nutritive_sweeteners"
- ],
"negative_points" : 4,
+ "negative_points_max" : 55,
"positive_nutrients" : [
- "fruits_vegetables_legumes",
+ "proteins",
"fiber",
- "proteins"
+ "fruits_vegetables_legumes"
],
"positive_points" : 0,
- "proteins" : 0.2,
- "proteins_points" : 0,
- "salt" : 0.5,
- "salt_points" : 2,
- "saturated_fat" : 0,
- "saturated_fat_points" : 0,
- "sugars" : 8.9,
- "sugars_points" : 2
+ "positive_points_max" : 17
},
"grade" : "c",
"nutrients_available" : 1,
diff --git a/tests/unit/expected_test_results/nutriscore/en-red-meat-ambiguous-category-ingredients-with-lots-of-meat.json b/tests/unit/expected_test_results/nutriscore/en-red-meat-ambiguous-category-ingredients-with-lots-of-meat.json
index 1e087fb72460f..e5bb881903d1c 100644
--- a/tests/unit/expected_test_results/nutriscore/en-red-meat-ambiguous-category-ingredients-with-lots-of-meat.json
+++ b/tests/unit/expected_test_results/nutriscore/en-red-meat-ambiguous-category-ingredients-with-lots-of-meat.json
@@ -265,42 +265,78 @@
"2023" : {
"category_available" : 1,
"data" : {
+ "components" : {
+ "negative" : [
+ {
+ "id" : "energy",
+ "points" : 0,
+ "points_max" : 10,
+ "unit" : "kJ",
+ "value" : 82
+ },
+ {
+ "id" : "sugars",
+ "points" : 0,
+ "points_max" : 15,
+ "unit" : "g",
+ "value" : 0
+ },
+ {
+ "id" : "saturated_fat",
+ "points" : 9,
+ "points_max" : 10,
+ "unit" : "g",
+ "value" : 10
+ },
+ {
+ "id" : "salt",
+ "points" : 0,
+ "points_max" : 20,
+ "unit" : "g",
+ "value" : 0
+ }
+ ],
+ "positive" : [
+ {
+ "id" : "proteins",
+ "points" : 2,
+ "points_max" : 7,
+ "unit" : "g",
+ "value" : 50
+ },
+ {
+ "id" : "fiber",
+ "points" : 0,
+ "points_max" : 5,
+ "unit" : "g",
+ "value" : 0
+ },
+ {
+ "id" : "fruits_vegetables_legumes",
+ "points" : 0,
+ "points_max" : 5,
+ "unit" : "%",
+ "value" : 0
+ }
+ ]
+ },
"count_proteins" : 1,
"count_proteins_reason" : "negative_points_less_than_11",
- "energy" : 82,
- "energy_points" : 0,
- "fiber" : 0,
- "fiber_points" : 0,
- "fruits_vegetables_legumes" : 0,
- "fruits_vegetables_legumes_points" : 0,
"is_beverage" : 0,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 0,
"is_red_meat_product" : 1,
"is_water" : 0,
- "negative_nutrients" : [
- "energy",
- "sugars",
- "saturated_fat",
- "salt",
- "non_nutritive_sweeteners"
- ],
"negative_points" : 9,
+ "negative_points_max" : 55,
"positive_nutrients" : [
- "fruits_vegetables_legumes",
+ "proteins",
"fiber",
- "proteins"
+ "fruits_vegetables_legumes"
],
"positive_points" : 2,
- "proteins" : 50,
- "proteins_points" : 2,
- "proteins_points_limited_reason" : "red_meat_product",
- "salt" : 0,
- "salt_points" : 0,
- "saturated_fat" : 10,
- "saturated_fat_points" : 9,
- "sugars" : 0,
- "sugars_points" : 0
+ "positive_points_max" : 17,
+ "proteins_points_limited_reason" : "red_meat_product"
},
"grade" : "c",
"nutrients_available" : 1,
diff --git a/tests/unit/expected_test_results/nutriscore/en-red-meat-ambiguous-category-ingredients-with-no-meat.json b/tests/unit/expected_test_results/nutriscore/en-red-meat-ambiguous-category-ingredients-with-no-meat.json
index 6b642ddc0299d..8e46cea9a9e93 100644
--- a/tests/unit/expected_test_results/nutriscore/en-red-meat-ambiguous-category-ingredients-with-no-meat.json
+++ b/tests/unit/expected_test_results/nutriscore/en-red-meat-ambiguous-category-ingredients-with-no-meat.json
@@ -247,41 +247,77 @@
"2023" : {
"category_available" : 1,
"data" : {
+ "components" : {
+ "negative" : [
+ {
+ "id" : "energy",
+ "points" : 0,
+ "points_max" : 10,
+ "unit" : "kJ",
+ "value" : 82
+ },
+ {
+ "id" : "sugars",
+ "points" : 0,
+ "points_max" : 15,
+ "unit" : "g",
+ "value" : 0
+ },
+ {
+ "id" : "saturated_fat",
+ "points" : 9,
+ "points_max" : 10,
+ "unit" : "g",
+ "value" : 10
+ },
+ {
+ "id" : "salt",
+ "points" : 0,
+ "points_max" : 20,
+ "unit" : "g",
+ "value" : 0
+ }
+ ],
+ "positive" : [
+ {
+ "id" : "proteins",
+ "points" : 7,
+ "points_max" : 7,
+ "unit" : "g",
+ "value" : 50
+ },
+ {
+ "id" : "fiber",
+ "points" : 0,
+ "points_max" : 5,
+ "unit" : "g",
+ "value" : 0
+ },
+ {
+ "id" : "fruits_vegetables_legumes",
+ "points" : 0,
+ "points_max" : 5,
+ "unit" : "%",
+ "value" : 0
+ }
+ ]
+ },
"count_proteins" : 1,
"count_proteins_reason" : "negative_points_less_than_11",
- "energy" : 82,
- "energy_points" : 0,
- "fiber" : 0,
- "fiber_points" : 0,
- "fruits_vegetables_legumes" : 0,
- "fruits_vegetables_legumes_points" : 0,
"is_beverage" : 0,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 0,
"is_red_meat_product" : 0,
"is_water" : 0,
- "negative_nutrients" : [
- "energy",
- "sugars",
- "saturated_fat",
- "salt",
- "non_nutritive_sweeteners"
- ],
"negative_points" : 9,
+ "negative_points_max" : 55,
"positive_nutrients" : [
- "fruits_vegetables_legumes",
+ "proteins",
"fiber",
- "proteins"
+ "fruits_vegetables_legumes"
],
"positive_points" : 7,
- "proteins" : 50,
- "proteins_points" : 7,
- "salt" : 0,
- "salt_points" : 0,
- "saturated_fat" : 10,
- "saturated_fat_points" : 9,
- "sugars" : 0,
- "sugars_points" : 0
+ "positive_points_max" : 17
},
"grade" : "b",
"nutrients_available" : 1,
diff --git a/tests/unit/expected_test_results/nutriscore/en-red-meat-ambiguous-category-ingredients-with-very-little-meat.json b/tests/unit/expected_test_results/nutriscore/en-red-meat-ambiguous-category-ingredients-with-very-little-meat.json
index 2b4c368f75a47..9cef2ba1b2bbc 100644
--- a/tests/unit/expected_test_results/nutriscore/en-red-meat-ambiguous-category-ingredients-with-very-little-meat.json
+++ b/tests/unit/expected_test_results/nutriscore/en-red-meat-ambiguous-category-ingredients-with-very-little-meat.json
@@ -291,41 +291,77 @@
"2023" : {
"category_available" : 1,
"data" : {
+ "components" : {
+ "negative" : [
+ {
+ "id" : "energy",
+ "points" : 0,
+ "points_max" : 10,
+ "unit" : "kJ",
+ "value" : 82
+ },
+ {
+ "id" : "sugars",
+ "points" : 0,
+ "points_max" : 15,
+ "unit" : "g",
+ "value" : 0
+ },
+ {
+ "id" : "saturated_fat",
+ "points" : 9,
+ "points_max" : 10,
+ "unit" : "g",
+ "value" : 10
+ },
+ {
+ "id" : "salt",
+ "points" : 0,
+ "points_max" : 20,
+ "unit" : "g",
+ "value" : 0
+ }
+ ],
+ "positive" : [
+ {
+ "id" : "proteins",
+ "points" : 7,
+ "points_max" : 7,
+ "unit" : "g",
+ "value" : 50
+ },
+ {
+ "id" : "fiber",
+ "points" : 0,
+ "points_max" : 5,
+ "unit" : "g",
+ "value" : 0
+ },
+ {
+ "id" : "fruits_vegetables_legumes",
+ "points" : 0,
+ "points_max" : 5,
+ "unit" : "%",
+ "value" : 0
+ }
+ ]
+ },
"count_proteins" : 1,
"count_proteins_reason" : "negative_points_less_than_11",
- "energy" : 82,
- "energy_points" : 0,
- "fiber" : 0,
- "fiber_points" : 0,
- "fruits_vegetables_legumes" : 0,
- "fruits_vegetables_legumes_points" : 0,
"is_beverage" : 0,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 0,
"is_red_meat_product" : 0,
"is_water" : 0,
- "negative_nutrients" : [
- "energy",
- "sugars",
- "saturated_fat",
- "salt",
- "non_nutritive_sweeteners"
- ],
"negative_points" : 9,
+ "negative_points_max" : 55,
"positive_nutrients" : [
- "fruits_vegetables_legumes",
+ "proteins",
"fiber",
- "proteins"
+ "fruits_vegetables_legumes"
],
"positive_points" : 7,
- "proteins" : 50,
- "proteins_points" : 7,
- "salt" : 0,
- "salt_points" : 0,
- "saturated_fat" : 10,
- "saturated_fat_points" : 9,
- "sugars" : 0,
- "sugars_points" : 0
+ "positive_points_max" : 17
},
"grade" : "b",
"nutrients_available" : 1,
diff --git a/tests/unit/expected_test_results/nutriscore/en-red-meat-ambiguous-category-no-ingredients.json b/tests/unit/expected_test_results/nutriscore/en-red-meat-ambiguous-category-no-ingredients.json
index 622e92d564f69..79dd39025de82 100644
--- a/tests/unit/expected_test_results/nutriscore/en-red-meat-ambiguous-category-no-ingredients.json
+++ b/tests/unit/expected_test_results/nutriscore/en-red-meat-ambiguous-category-no-ingredients.json
@@ -94,40 +94,77 @@
"2023" : {
"category_available" : 1,
"data" : {
+ "components" : {
+ "negative" : [
+ {
+ "id" : "energy",
+ "points" : 0,
+ "points_max" : 10,
+ "unit" : "kJ",
+ "value" : 82
+ },
+ {
+ "id" : "sugars",
+ "points" : 0,
+ "points_max" : 15,
+ "unit" : "g",
+ "value" : 0
+ },
+ {
+ "id" : "saturated_fat",
+ "points" : 9,
+ "points_max" : 10,
+ "unit" : "g",
+ "value" : 10
+ },
+ {
+ "id" : "salt",
+ "points" : 0,
+ "points_max" : 20,
+ "unit" : "g",
+ "value" : 0
+ }
+ ],
+ "positive" : [
+ {
+ "id" : "proteins",
+ "points" : 7,
+ "points_max" : 7,
+ "unit" : "g",
+ "value" : 50
+ },
+ {
+ "id" : "fiber",
+ "points" : 0,
+ "points_max" : 5,
+ "unit" : "g",
+ "value" : 0
+ },
+ {
+ "id" : "fruits_vegetables_legumes",
+ "points" : 0,
+ "points_max" : 5,
+ "unit" : "%",
+ "value" : 0
+ }
+ ]
+ },
"count_proteins" : 1,
"count_proteins_reason" : "negative_points_less_than_11",
- "energy" : 82,
- "energy_points" : 0,
- "fiber" : 0,
- "fiber_points" : 0,
- "fruits_vegetables_legumes" : null,
"is_beverage" : 0,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 0,
"is_red_meat_product" : 0,
"is_water" : 0,
- "negative_nutrients" : [
- "energy",
- "sugars",
- "saturated_fat",
- "salt",
- "non_nutritive_sweeteners"
- ],
"negative_points" : 9,
+ "negative_points_max" : 55,
"positive_nutrients" : [
- "fruits_vegetables_legumes",
+ "proteins",
"fiber",
- "proteins"
+ "fruits_vegetables_legumes"
],
"positive_points" : 7,
- "proteins" : 50,
- "proteins_points" : 7,
- "salt" : 0,
- "salt_points" : 0,
- "saturated_fat" : 10,
- "saturated_fat_points" : 9,
- "sugars" : 0,
- "sugars_points" : 0
+ "positive_points_max" : 17
},
"grade" : "b",
"nutrients_available" : 1,
diff --git a/tests/unit/expected_test_results/nutriscore/en-red-meat-category-no-ingredients.json b/tests/unit/expected_test_results/nutriscore/en-red-meat-category-no-ingredients.json
index ac3c564bcb858..7304fc4335a11 100644
--- a/tests/unit/expected_test_results/nutriscore/en-red-meat-category-no-ingredients.json
+++ b/tests/unit/expected_test_results/nutriscore/en-red-meat-category-no-ingredients.json
@@ -103,41 +103,78 @@
"2023" : {
"category_available" : 1,
"data" : {
+ "components" : {
+ "negative" : [
+ {
+ "id" : "energy",
+ "points" : 0,
+ "points_max" : 10,
+ "unit" : "kJ",
+ "value" : 82
+ },
+ {
+ "id" : "sugars",
+ "points" : 0,
+ "points_max" : 15,
+ "unit" : "g",
+ "value" : 0
+ },
+ {
+ "id" : "saturated_fat",
+ "points" : 9,
+ "points_max" : 10,
+ "unit" : "g",
+ "value" : 10
+ },
+ {
+ "id" : "salt",
+ "points" : 0,
+ "points_max" : 20,
+ "unit" : "g",
+ "value" : 0
+ }
+ ],
+ "positive" : [
+ {
+ "id" : "proteins",
+ "points" : 2,
+ "points_max" : 7,
+ "unit" : "g",
+ "value" : 50
+ },
+ {
+ "id" : "fiber",
+ "points" : 0,
+ "points_max" : 5,
+ "unit" : "g",
+ "value" : 0
+ },
+ {
+ "id" : "fruits_vegetables_legumes",
+ "points" : 0,
+ "points_max" : 5,
+ "unit" : "%",
+ "value" : 0
+ }
+ ]
+ },
"count_proteins" : 1,
"count_proteins_reason" : "negative_points_less_than_11",
- "energy" : 82,
- "energy_points" : 0,
- "fiber" : 0,
- "fiber_points" : 0,
- "fruits_vegetables_legumes" : null,
"is_beverage" : 0,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 0,
"is_red_meat_product" : 1,
"is_water" : 0,
- "negative_nutrients" : [
- "energy",
- "sugars",
- "saturated_fat",
- "salt",
- "non_nutritive_sweeteners"
- ],
"negative_points" : 9,
+ "negative_points_max" : 55,
"positive_nutrients" : [
- "fruits_vegetables_legumes",
+ "proteins",
"fiber",
- "proteins"
+ "fruits_vegetables_legumes"
],
"positive_points" : 2,
- "proteins" : 50,
- "proteins_points" : 2,
- "proteins_points_limited_reason" : "red_meat_product",
- "salt" : 0,
- "salt_points" : 0,
- "saturated_fat" : 10,
- "saturated_fat_points" : 9,
- "sugars" : 0,
- "sugars_points" : 0
+ "positive_points_max" : 17,
+ "proteins_points_limited_reason" : "red_meat_product"
},
"grade" : "c",
"nutrients_available" : 1,
diff --git a/tests/unit/expected_test_results/nutriscore/en-soy-beans-processed-and-unprocessed.json b/tests/unit/expected_test_results/nutriscore/en-soy-beans-processed-and-unprocessed.json
index d52f2753cfce5..f08d830ea29fa 100644
--- a/tests/unit/expected_test_results/nutriscore/en-soy-beans-processed-and-unprocessed.json
+++ b/tests/unit/expected_test_results/nutriscore/en-soy-beans-processed-and-unprocessed.json
@@ -241,41 +241,77 @@
"2023" : {
"category_available" : 1,
"data" : {
+ "components" : {
+ "negative" : [
+ {
+ "id" : "energy",
+ "points" : 0,
+ "points_max" : 10,
+ "unit" : "kJ",
+ "value" : 82
+ },
+ {
+ "id" : "sugars",
+ "points" : 0,
+ "points_max" : 15,
+ "unit" : "g",
+ "value" : 1.5
+ },
+ {
+ "id" : "saturated_fat",
+ "points" : 0,
+ "points_max" : 10,
+ "unit" : "g",
+ "value" : 0
+ },
+ {
+ "id" : "salt",
+ "points" : 0,
+ "points_max" : 20,
+ "unit" : "g",
+ "value" : 0.03
+ }
+ ],
+ "positive" : [
+ {
+ "id" : "proteins",
+ "points" : 7,
+ "points_max" : 7,
+ "unit" : "g",
+ "value" : 20
+ },
+ {
+ "id" : "fiber",
+ "points" : 0,
+ "points_max" : 5,
+ "unit" : "g",
+ "value" : 0
+ },
+ {
+ "id" : "fruits_vegetables_legumes",
+ "points" : 1,
+ "points_max" : 5,
+ "unit" : "%",
+ "value" : 55
+ }
+ ]
+ },
"count_proteins" : 1,
"count_proteins_reason" : "negative_points_less_than_11",
- "energy" : 82,
- "energy_points" : 0,
- "fiber" : 0,
- "fiber_points" : 0,
- "fruits_vegetables_legumes" : 55,
- "fruits_vegetables_legumes_points" : 1,
"is_beverage" : 0,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 0,
"is_red_meat_product" : 0,
"is_water" : 0,
- "negative_nutrients" : [
- "energy",
- "sugars",
- "saturated_fat",
- "salt",
- "non_nutritive_sweeteners"
- ],
"negative_points" : 0,
+ "negative_points_max" : 55,
"positive_nutrients" : [
- "fruits_vegetables_legumes",
+ "proteins",
"fiber",
- "proteins"
+ "fruits_vegetables_legumes"
],
"positive_points" : 8,
- "proteins" : 20,
- "proteins_points" : 7,
- "salt" : 0.025,
- "salt_points" : 0,
- "saturated_fat" : 0,
- "saturated_fat_points" : 0,
- "sugars" : 1.5,
- "sugars_points" : 0
+ "positive_points_max" : 17
},
"grade" : "a",
"nutrients_available" : 1,
diff --git a/tests/unit/expected_test_results/nutriscore/en-sugar-estimated-nutrients.json b/tests/unit/expected_test_results/nutriscore/en-sugar-estimated-nutrients.json
index 7d2d18e605f94..cfe51d49eb1e9 100644
--- a/tests/unit/expected_test_results/nutriscore/en-sugar-estimated-nutrients.json
+++ b/tests/unit/expected_test_results/nutriscore/en-sugar-estimated-nutrients.json
@@ -201,40 +201,69 @@
"2023" : {
"category_available" : 1,
"data" : {
+ "components" : {
+ "negative" : [
+ {
+ "id" : "energy",
+ "points" : 5,
+ "points_max" : 10,
+ "unit" : "kJ",
+ "value" : 1700
+ },
+ {
+ "id" : "sugars",
+ "points" : 15,
+ "points_max" : 15,
+ "unit" : "g",
+ "value" : 99.8
+ },
+ {
+ "id" : "saturated_fat",
+ "points" : 0,
+ "points_max" : 10,
+ "unit" : "g",
+ "value" : 0
+ },
+ {
+ "id" : "salt",
+ "points" : 0,
+ "points_max" : 20,
+ "unit" : "g",
+ "value" : 0.01
+ }
+ ],
+ "positive" : [
+ {
+ "id" : "fiber",
+ "points" : 0,
+ "points_max" : 5,
+ "unit" : "g",
+ "value" : 0
+ },
+ {
+ "id" : "fruits_vegetables_legumes",
+ "points" : 0,
+ "points_max" : 5,
+ "unit" : "%",
+ "value" : 0
+ }
+ ]
+ },
"count_proteins" : 0,
- "count_proteins_reason" : "negative_points_more_than_11",
- "energy" : 1700,
- "energy_points" : 5,
- "fiber" : 0,
- "fiber_points" : 0,
- "fruits_vegetables_legumes" : 0,
- "fruits_vegetables_legumes_points" : 0,
+ "count_proteins_reason" : "negative_points_greater_than_or_equal_to_11",
"is_beverage" : 0,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 0,
"is_red_meat_product" : 0,
"is_water" : 0,
- "negative_nutrients" : [
- "energy",
- "sugars",
- "saturated_fat",
- "salt",
- "non_nutritive_sweeteners"
- ],
"negative_points" : 20,
+ "negative_points_max" : 55,
"positive_nutrients" : [
- "fruits_vegetables_legumes",
- "fiber"
+ "fiber",
+ "fruits_vegetables_legumes"
],
"positive_points" : 0,
- "proteins" : 0,
- "proteins_points" : 0,
- "salt" : 0.0054,
- "salt_points" : 0,
- "saturated_fat" : 0,
- "saturated_fat_points" : 0,
- "sugars" : 99.8,
- "sugars_points" : 15
+ "positive_points_max" : 10
},
"grade" : "e",
"nutrients_available" : 1,
diff --git a/tests/unit/expected_test_results/nutriscore/en-sweeteners-erythritol.json b/tests/unit/expected_test_results/nutriscore/en-sweeteners-erythritol.json
index 6cc8802ef4ab1..47381d3383f6e 100644
--- a/tests/unit/expected_test_results/nutriscore/en-sweeteners-erythritol.json
+++ b/tests/unit/expected_test_results/nutriscore/en-sweeteners-erythritol.json
@@ -213,42 +213,85 @@
"2023" : {
"category_available" : 1,
"data" : {
+ "components" : {
+ "negative" : [
+ {
+ "id" : "energy",
+ "points" : 1,
+ "points_max" : 10,
+ "unit" : "kJ",
+ "value" : 82
+ },
+ {
+ "id" : "sugars",
+ "points" : 3,
+ "points_max" : 10,
+ "unit" : "g",
+ "value" : 4.5
+ },
+ {
+ "id" : "saturated_fat",
+ "points" : 0,
+ "points_max" : 10,
+ "unit" : "g",
+ "value" : 0
+ },
+ {
+ "id" : "salt",
+ "points" : 0,
+ "points_max" : 20,
+ "unit" : "g",
+ "value" : 0.03
+ },
+ {
+ "id" : "non_nutritive_sweeteners",
+ "points" : 0,
+ "points_max" : null,
+ "unit" : null,
+ "value" : 0
+ }
+ ],
+ "positive" : [
+ {
+ "id" : "proteins",
+ "points" : 0,
+ "points_max" : 7,
+ "unit" : "g",
+ "value" : 0
+ },
+ {
+ "id" : "fiber",
+ "points" : 0,
+ "points_max" : 5,
+ "unit" : "g",
+ "value" : 0
+ },
+ {
+ "id" : "fruits_vegetables_legumes",
+ "points" : 4,
+ "points_max" : 6,
+ "unit" : "%",
+ "value" : 70.5
+ }
+ ]
+ },
"count_proteins" : 1,
"count_proteins_reason" : "beverage",
- "energy" : 82,
- "energy_points" : 1,
- "fiber" : 0,
- "fiber_points" : 0,
- "fruits_vegetables_legumes" : 70.5,
- "fruits_vegetables_legumes_points" : 4,
"is_beverage" : 1,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 0,
"is_red_meat_product" : 0,
"is_water" : 0,
- "negative_nutrients" : [
- "energy",
- "sugars",
- "saturated_fat",
- "salt",
- "non_nutritive_sweeteners"
- ],
"negative_points" : 4,
- "non_nutritive_sweeteners_points" : 0,
+ "negative_points_max" : 50,
+ "non_nutritive_sweeteners_max" : 4,
"positive_nutrients" : [
- "fruits_vegetables_legumes",
+ "proteins",
"fiber",
- "proteins"
+ "fruits_vegetables_legumes"
],
"positive_points" : 4,
- "proteins" : 0,
- "proteins_points" : 0,
- "salt" : 0.025,
- "salt_points" : 0,
- "saturated_fat" : 0,
- "saturated_fat_points" : 0,
- "sugars" : 4.5,
- "sugars_points" : 3
+ "positive_points_max" : 18
},
"grade" : "b",
"nutrients_available" : 1,
diff --git a/tests/unit/expected_test_results/nutriscore/en-sweeteners.json b/tests/unit/expected_test_results/nutriscore/en-sweeteners.json
index 60d8e386c8820..3e81b943b67a7 100644
--- a/tests/unit/expected_test_results/nutriscore/en-sweeteners.json
+++ b/tests/unit/expected_test_results/nutriscore/en-sweeteners.json
@@ -212,42 +212,85 @@
"2023" : {
"category_available" : 1,
"data" : {
+ "components" : {
+ "negative" : [
+ {
+ "id" : "energy",
+ "points" : 1,
+ "points_max" : 10,
+ "unit" : "kJ",
+ "value" : 82
+ },
+ {
+ "id" : "sugars",
+ "points" : 3,
+ "points_max" : 10,
+ "unit" : "g",
+ "value" : 4.5
+ },
+ {
+ "id" : "saturated_fat",
+ "points" : 0,
+ "points_max" : 10,
+ "unit" : "g",
+ "value" : 0
+ },
+ {
+ "id" : "salt",
+ "points" : 0,
+ "points_max" : 20,
+ "unit" : "g",
+ "value" : 0.03
+ },
+ {
+ "id" : "non_nutritive_sweeteners",
+ "points" : 4,
+ "points_max" : null,
+ "unit" : null,
+ "value" : 0
+ }
+ ],
+ "positive" : [
+ {
+ "id" : "proteins",
+ "points" : 0,
+ "points_max" : 7,
+ "unit" : "g",
+ "value" : 0
+ },
+ {
+ "id" : "fiber",
+ "points" : 0,
+ "points_max" : 5,
+ "unit" : "g",
+ "value" : 0
+ },
+ {
+ "id" : "fruits_vegetables_legumes",
+ "points" : 4,
+ "points_max" : 6,
+ "unit" : "%",
+ "value" : 70.5
+ }
+ ]
+ },
"count_proteins" : 1,
"count_proteins_reason" : "beverage",
- "energy" : 82,
- "energy_points" : 1,
- "fiber" : 0,
- "fiber_points" : 0,
- "fruits_vegetables_legumes" : 70.5,
- "fruits_vegetables_legumes_points" : 4,
"is_beverage" : 1,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 0,
"is_red_meat_product" : 0,
"is_water" : 0,
- "negative_nutrients" : [
- "energy",
- "sugars",
- "saturated_fat",
- "salt",
- "non_nutritive_sweeteners"
- ],
"negative_points" : 8,
- "non_nutritive_sweeteners_points" : 4,
+ "negative_points_max" : 50,
+ "non_nutritive_sweeteners_max" : 4,
"positive_nutrients" : [
- "fruits_vegetables_legumes",
+ "proteins",
"fiber",
- "proteins"
+ "fruits_vegetables_legumes"
],
"positive_points" : 4,
- "proteins" : 0,
- "proteins_points" : 0,
- "salt" : 0.025,
- "salt_points" : 0,
- "saturated_fat" : 0,
- "saturated_fat_points" : 0,
- "sugars" : 4.5,
- "sugars_points" : 3,
+ "positive_points_max" : 18,
"with_non_nutritive_sweeteners" : 1
},
"grade" : "c",
diff --git a/tests/unit/expected_test_results/nutriscore/en-tofu.json b/tests/unit/expected_test_results/nutriscore/en-tofu.json
index a4829a88be86f..c6b61fa15d00d 100644
--- a/tests/unit/expected_test_results/nutriscore/en-tofu.json
+++ b/tests/unit/expected_test_results/nutriscore/en-tofu.json
@@ -246,41 +246,77 @@
"2023" : {
"category_available" : 1,
"data" : {
+ "components" : {
+ "negative" : [
+ {
+ "id" : "energy",
+ "points" : 0,
+ "points_max" : 10,
+ "unit" : "kJ",
+ "value" : 82
+ },
+ {
+ "id" : "sugars",
+ "points" : 0,
+ "points_max" : 15,
+ "unit" : "g",
+ "value" : 1.5
+ },
+ {
+ "id" : "saturated_fat",
+ "points" : 0,
+ "points_max" : 10,
+ "unit" : "g",
+ "value" : 0
+ },
+ {
+ "id" : "salt",
+ "points" : 0,
+ "points_max" : 20,
+ "unit" : "g",
+ "value" : 0.03
+ }
+ ],
+ "positive" : [
+ {
+ "id" : "proteins",
+ "points" : 7,
+ "points_max" : 7,
+ "unit" : "g",
+ "value" : 20
+ },
+ {
+ "id" : "fiber",
+ "points" : 0,
+ "points_max" : 5,
+ "unit" : "g",
+ "value" : 0
+ },
+ {
+ "id" : "fruits_vegetables_legumes",
+ "points" : 0,
+ "points_max" : 5,
+ "unit" : "%",
+ "value" : 0
+ }
+ ]
+ },
"count_proteins" : 1,
"count_proteins_reason" : "negative_points_less_than_11",
- "energy" : 82,
- "energy_points" : 0,
- "fiber" : 0,
- "fiber_points" : 0,
- "fruits_vegetables_legumes" : 0,
- "fruits_vegetables_legumes_points" : 0,
"is_beverage" : 0,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 0,
"is_red_meat_product" : 0,
"is_water" : 0,
- "negative_nutrients" : [
- "energy",
- "sugars",
- "saturated_fat",
- "salt",
- "non_nutritive_sweeteners"
- ],
"negative_points" : 0,
+ "negative_points_max" : 55,
"positive_nutrients" : [
- "fruits_vegetables_legumes",
+ "proteins",
"fiber",
- "proteins"
+ "fruits_vegetables_legumes"
],
"positive_points" : 7,
- "proteins" : 20,
- "proteins_points" : 7,
- "salt" : 0.025,
- "salt_points" : 0,
- "saturated_fat" : 0,
- "saturated_fat_points" : 0,
- "sugars" : 1.5,
- "sugars_points" : 0
+ "positive_points_max" : 17
},
"grade" : "a",
"nutrients_available" : 1,
diff --git a/tests/unit/expected_test_results/nutriscore/en-vegetable-crisps.json b/tests/unit/expected_test_results/nutriscore/en-vegetable-crisps.json
index dbaf415e2c581..7f57216664ccb 100644
--- a/tests/unit/expected_test_results/nutriscore/en-vegetable-crisps.json
+++ b/tests/unit/expected_test_results/nutriscore/en-vegetable-crisps.json
@@ -228,41 +228,77 @@
"2023" : {
"category_available" : 1,
"data" : {
+ "components" : {
+ "negative" : [
+ {
+ "id" : "energy",
+ "points" : 0,
+ "points_max" : 10,
+ "unit" : "kJ",
+ "value" : 82
+ },
+ {
+ "id" : "sugars",
+ "points" : 0,
+ "points_max" : 15,
+ "unit" : "g",
+ "value" : 1.5
+ },
+ {
+ "id" : "saturated_fat",
+ "points" : 0,
+ "points_max" : 10,
+ "unit" : "g",
+ "value" : 0
+ },
+ {
+ "id" : "salt",
+ "points" : 0,
+ "points_max" : 20,
+ "unit" : "g",
+ "value" : 0.03
+ }
+ ],
+ "positive" : [
+ {
+ "id" : "proteins",
+ "points" : 7,
+ "points_max" : 7,
+ "unit" : "g",
+ "value" : 20
+ },
+ {
+ "id" : "fiber",
+ "points" : 0,
+ "points_max" : 5,
+ "unit" : "g",
+ "value" : 0
+ },
+ {
+ "id" : "fruits_vegetables_legumes",
+ "points" : 0,
+ "points_max" : 5,
+ "unit" : "%",
+ "value" : 0
+ }
+ ]
+ },
"count_proteins" : 1,
"count_proteins_reason" : "negative_points_less_than_11",
- "energy" : 82,
- "energy_points" : 0,
- "fiber" : 0,
- "fiber_points" : 0,
- "fruits_vegetables_legumes" : 0,
- "fruits_vegetables_legumes_points" : 0,
"is_beverage" : 0,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 0,
"is_red_meat_product" : 0,
"is_water" : 0,
- "negative_nutrients" : [
- "energy",
- "sugars",
- "saturated_fat",
- "salt",
- "non_nutritive_sweeteners"
- ],
"negative_points" : 0,
+ "negative_points_max" : 55,
"positive_nutrients" : [
- "fruits_vegetables_legumes",
+ "proteins",
"fiber",
- "proteins"
+ "fruits_vegetables_legumes"
],
"positive_points" : 7,
- "proteins" : 20,
- "proteins_points" : 7,
- "salt" : 0.025,
- "salt_points" : 0,
- "saturated_fat" : 0,
- "saturated_fat_points" : 0,
- "sugars" : 1.5,
- "sugars_points" : 0
+ "positive_points_max" : 17
},
"grade" : "a",
"nutrients_available" : 1,
diff --git a/tests/unit/expected_test_results/nutriscore/flavored-spring-water-no-nutrition.json b/tests/unit/expected_test_results/nutriscore/flavored-spring-water-no-nutrition.json
index d1246dddd271e..30dab9840d54e 100644
--- a/tests/unit/expected_test_results/nutriscore/flavored-spring-water-no-nutrition.json
+++ b/tests/unit/expected_test_results/nutriscore/flavored-spring-water-no-nutrition.json
@@ -75,7 +75,7 @@
"data" : {
"energy" : null,
"fiber" : 0,
- "fruits_vegetables_legumes" : null,
+ "fruits_vegetables_legumes" : 0,
"is_beverage" : 1,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 0,
diff --git a/tests/unit/expected_test_results/nutriscore/flavored-spring-with-nutrition.json b/tests/unit/expected_test_results/nutriscore/flavored-spring-with-nutrition.json
index 38cfd02ab2e1d..ee006bbe3129a 100644
--- a/tests/unit/expected_test_results/nutriscore/flavored-spring-with-nutrition.json
+++ b/tests/unit/expected_test_results/nutriscore/flavored-spring-with-nutrition.json
@@ -98,41 +98,85 @@
"2023" : {
"category_available" : 1,
"data" : {
+ "components" : {
+ "negative" : [
+ {
+ "id" : "energy",
+ "points" : 9,
+ "points_max" : 10,
+ "unit" : "kJ",
+ "value" : 378
+ },
+ {
+ "id" : "sugars",
+ "points" : 2,
+ "points_max" : 10,
+ "unit" : "g",
+ "value" : 3
+ },
+ {
+ "id" : "saturated_fat",
+ "points" : 0,
+ "points_max" : 10,
+ "unit" : "g",
+ "value" : 0
+ },
+ {
+ "id" : "salt",
+ "points" : 0,
+ "points_max" : 20,
+ "unit" : "g",
+ "value" : 0
+ },
+ {
+ "id" : "non_nutritive_sweeteners",
+ "points" : 0,
+ "points_max" : null,
+ "unit" : null,
+ "value" : 0
+ }
+ ],
+ "positive" : [
+ {
+ "id" : "proteins",
+ "points" : 0,
+ "points_max" : 7,
+ "unit" : "g",
+ "value" : 0
+ },
+ {
+ "id" : "fiber",
+ "points" : 0,
+ "points_max" : 5,
+ "unit" : "g",
+ "value" : 0
+ },
+ {
+ "id" : "fruits_vegetables_legumes",
+ "points" : 0,
+ "points_max" : 6,
+ "unit" : "%",
+ "value" : 0
+ }
+ ]
+ },
"count_proteins" : 1,
"count_proteins_reason" : "beverage",
- "energy" : 378,
- "energy_points" : 9,
- "fiber" : 0,
- "fiber_points" : 0,
- "fruits_vegetables_legumes" : null,
"is_beverage" : 1,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 0,
"is_red_meat_product" : 0,
"is_water" : 0,
- "negative_nutrients" : [
- "energy",
- "sugars",
- "saturated_fat",
- "salt",
- "non_nutritive_sweeteners"
- ],
"negative_points" : 11,
- "non_nutritive_sweeteners_points" : 0,
+ "negative_points_max" : 50,
+ "non_nutritive_sweeteners_max" : 4,
"positive_nutrients" : [
- "fruits_vegetables_legumes",
+ "proteins",
"fiber",
- "proteins"
+ "fruits_vegetables_legumes"
],
"positive_points" : 0,
- "proteins" : 0,
- "proteins_points" : 0,
- "salt" : 0,
- "salt_points" : 0,
- "saturated_fat" : 0,
- "saturated_fat_points" : 0,
- "sugars" : 3,
- "sugars_points" : 2
+ "positive_points_max" : 18
},
"grade" : "e",
"nutrients_available" : 1,
diff --git a/tests/unit/expected_test_results/nutriscore/fr-canned-green-beans.json b/tests/unit/expected_test_results/nutriscore/fr-canned-green-beans.json
index 15a1292ffc523..392acf5523d88 100644
--- a/tests/unit/expected_test_results/nutriscore/fr-canned-green-beans.json
+++ b/tests/unit/expected_test_results/nutriscore/fr-canned-green-beans.json
@@ -263,41 +263,77 @@
"2023" : {
"category_available" : 1,
"data" : {
+ "components" : {
+ "negative" : [
+ {
+ "id" : "energy",
+ "points" : 0,
+ "points_max" : 10,
+ "unit" : "kJ",
+ "value" : 315
+ },
+ {
+ "id" : "sugars",
+ "points" : 1,
+ "points_max" : 15,
+ "unit" : "g",
+ "value" : 3.6
+ },
+ {
+ "id" : "saturated_fat",
+ "points" : 0,
+ "points_max" : 10,
+ "unit" : "g",
+ "value" : 0.1
+ },
+ {
+ "id" : "salt",
+ "points" : 5,
+ "points_max" : 20,
+ "unit" : "g",
+ "value" : 1.2
+ }
+ ],
+ "positive" : [
+ {
+ "id" : "proteins",
+ "points" : 2,
+ "points_max" : 7,
+ "unit" : "g",
+ "value" : 5
+ },
+ {
+ "id" : "fiber",
+ "points" : 3,
+ "points_max" : 5,
+ "unit" : "g",
+ "value" : 5.3
+ },
+ {
+ "id" : "fruits_vegetables_legumes",
+ "points" : 1,
+ "points_max" : 5,
+ "unit" : "%",
+ "value" : 50
+ }
+ ]
+ },
"count_proteins" : 1,
"count_proteins_reason" : "negative_points_less_than_11",
- "energy" : 315,
- "energy_points" : 0,
- "fiber" : 5.3,
- "fiber_points" : 3,
- "fruits_vegetables_legumes" : 50,
- "fruits_vegetables_legumes_points" : 1,
"is_beverage" : 0,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 0,
"is_red_meat_product" : 0,
"is_water" : 0,
- "negative_nutrients" : [
- "energy",
- "sugars",
- "saturated_fat",
- "salt",
- "non_nutritive_sweeteners"
- ],
"negative_points" : 6,
+ "negative_points_max" : 55,
"positive_nutrients" : [
- "fruits_vegetables_legumes",
+ "proteins",
"fiber",
- "proteins"
+ "fruits_vegetables_legumes"
],
"positive_points" : 6,
- "proteins" : 5,
- "proteins_points" : 2,
- "salt" : 1.2,
- "salt_points" : 5,
- "saturated_fat" : 0.1,
- "saturated_fat_points" : 0,
- "sugars" : 3.6,
- "sugars_points" : 1
+ "positive_points_max" : 17
},
"grade" : "a",
"nutrients_available" : 1,
diff --git a/tests/unit/expected_test_results/nutriscore/fr-canned-pineapple.json b/tests/unit/expected_test_results/nutriscore/fr-canned-pineapple.json
index 276fe8ddbdf29..118ee9bb731c2 100644
--- a/tests/unit/expected_test_results/nutriscore/fr-canned-pineapple.json
+++ b/tests/unit/expected_test_results/nutriscore/fr-canned-pineapple.json
@@ -190,41 +190,77 @@
"2023" : {
"category_available" : 1,
"data" : {
+ "components" : {
+ "negative" : [
+ {
+ "id" : "energy",
+ "points" : 0,
+ "points_max" : 10,
+ "unit" : "kJ",
+ "value" : 315
+ },
+ {
+ "id" : "sugars",
+ "points" : 1,
+ "points_max" : 15,
+ "unit" : "g",
+ "value" : 3.6
+ },
+ {
+ "id" : "saturated_fat",
+ "points" : 0,
+ "points_max" : 10,
+ "unit" : "g",
+ "value" : 0.1
+ },
+ {
+ "id" : "salt",
+ "points" : 5,
+ "points_max" : 20,
+ "unit" : "g",
+ "value" : 1.2
+ }
+ ],
+ "positive" : [
+ {
+ "id" : "proteins",
+ "points" : 2,
+ "points_max" : 7,
+ "unit" : "g",
+ "value" : 5
+ },
+ {
+ "id" : "fiber",
+ "points" : 3,
+ "points_max" : 5,
+ "unit" : "g",
+ "value" : 5.3
+ },
+ {
+ "id" : "fruits_vegetables_legumes",
+ "points" : 0,
+ "points_max" : 5,
+ "unit" : "%",
+ "value" : 10
+ }
+ ]
+ },
"count_proteins" : 1,
"count_proteins_reason" : "negative_points_less_than_11",
- "energy" : 315,
- "energy_points" : 0,
- "fiber" : 5.3,
- "fiber_points" : 3,
- "fruits_vegetables_legumes" : 10,
- "fruits_vegetables_legumes_points" : 0,
"is_beverage" : 0,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 0,
"is_red_meat_product" : 0,
"is_water" : 0,
- "negative_nutrients" : [
- "energy",
- "sugars",
- "saturated_fat",
- "salt",
- "non_nutritive_sweeteners"
- ],
"negative_points" : 6,
+ "negative_points_max" : 55,
"positive_nutrients" : [
- "fruits_vegetables_legumes",
+ "proteins",
"fiber",
- "proteins"
+ "fruits_vegetables_legumes"
],
"positive_points" : 5,
- "proteins" : 5,
- "proteins_points" : 2,
- "salt" : 1.2,
- "salt_points" : 5,
- "saturated_fat" : 0.1,
- "saturated_fat_points" : 0,
- "sugars" : 3.6,
- "sugars_points" : 1
+ "positive_points_max" : 17
},
"grade" : "b",
"nutrients_available" : 1,
diff --git a/tests/unit/expected_test_results/nutriscore/fr-coconut-milk.json b/tests/unit/expected_test_results/nutriscore/fr-coconut-milk.json
index 16f5620a16e30..eec7b532d155e 100644
--- a/tests/unit/expected_test_results/nutriscore/fr-coconut-milk.json
+++ b/tests/unit/expected_test_results/nutriscore/fr-coconut-milk.json
@@ -219,41 +219,77 @@
"2023" : {
"category_available" : 1,
"data" : {
+ "components" : {
+ "negative" : [
+ {
+ "id" : "energy",
+ "points" : 0,
+ "points_max" : 10,
+ "unit" : "kJ",
+ "value" : 178
+ },
+ {
+ "id" : "sugars",
+ "points" : 0,
+ "points_max" : 15,
+ "unit" : "g",
+ "value" : 0.5
+ },
+ {
+ "id" : "saturated_fat",
+ "points" : 0,
+ "points_max" : 10,
+ "unit" : "g",
+ "value" : 0.6
+ },
+ {
+ "id" : "salt",
+ "points" : 0,
+ "points_max" : 20,
+ "unit" : "g",
+ "value" : 0.03
+ }
+ ],
+ "positive" : [
+ {
+ "id" : "proteins",
+ "points" : 1,
+ "points_max" : 7,
+ "unit" : "g",
+ "value" : 3.9
+ },
+ {
+ "id" : "fiber",
+ "points" : 0,
+ "points_max" : 5,
+ "unit" : "g",
+ "value" : 0.5
+ },
+ {
+ "id" : "fruits_vegetables_legumes",
+ "points" : 1,
+ "points_max" : 5,
+ "unit" : "%",
+ "value" : 60
+ }
+ ]
+ },
"count_proteins" : 1,
"count_proteins_reason" : "negative_points_less_than_11",
- "energy" : 178,
- "energy_points" : 0,
- "fiber" : 0.5,
- "fiber_points" : 0,
- "fruits_vegetables_legumes" : 60,
- "fruits_vegetables_legumes_points" : 1,
"is_beverage" : 0,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 0,
"is_red_meat_product" : 0,
"is_water" : 0,
- "negative_nutrients" : [
- "energy",
- "sugars",
- "saturated_fat",
- "salt",
- "non_nutritive_sweeteners"
- ],
"negative_points" : 0,
+ "negative_points_max" : 55,
"positive_nutrients" : [
- "fruits_vegetables_legumes",
+ "proteins",
"fiber",
- "proteins"
+ "fruits_vegetables_legumes"
],
"positive_points" : 2,
- "proteins" : 3.9,
- "proteins_points" : 1,
- "salt" : 0.03,
- "salt_points" : 0,
- "saturated_fat" : 0.6,
- "saturated_fat_points" : 0,
- "sugars" : 0.5,
- "sugars_points" : 0
+ "positive_points_max" : 17
},
"grade" : "a",
"nutrients_available" : 1,
diff --git a/tests/unit/expected_test_results/nutriscore/fr-gaspacho.json b/tests/unit/expected_test_results/nutriscore/fr-gaspacho.json
index 48d8f9266c3d3..4f4e4ed83f99c 100644
--- a/tests/unit/expected_test_results/nutriscore/fr-gaspacho.json
+++ b/tests/unit/expected_test_results/nutriscore/fr-gaspacho.json
@@ -335,41 +335,77 @@
"2023" : {
"category_available" : 1,
"data" : {
+ "components" : {
+ "negative" : [
+ {
+ "id" : "energy",
+ "points" : 0,
+ "points_max" : 10,
+ "unit" : "kJ",
+ "value" : 148
+ },
+ {
+ "id" : "sugars",
+ "points" : 0,
+ "points_max" : 15,
+ "unit" : "g",
+ "value" : 3
+ },
+ {
+ "id" : "saturated_fat",
+ "points" : 0,
+ "points_max" : 10,
+ "unit" : "g",
+ "value" : 0.2
+ },
+ {
+ "id" : "salt",
+ "points" : 2,
+ "points_max" : 20,
+ "unit" : "g",
+ "value" : 0.5
+ }
+ ],
+ "positive" : [
+ {
+ "id" : "proteins",
+ "points" : 0,
+ "points_max" : 7,
+ "unit" : "g",
+ "value" : 0.9
+ },
+ {
+ "id" : "fiber",
+ "points" : 0,
+ "points_max" : 5,
+ "unit" : "g",
+ "value" : 1.1
+ },
+ {
+ "id" : "fruits_vegetables_legumes",
+ "points" : 5,
+ "points_max" : 5,
+ "unit" : "%",
+ "value" : 95
+ }
+ ]
+ },
"count_proteins" : 1,
"count_proteins_reason" : "negative_points_less_than_11",
- "energy" : 148,
- "energy_points" : 0,
- "fiber" : 1.1,
- "fiber_points" : 0,
- "fruits_vegetables_legumes" : 94.9997159090909,
- "fruits_vegetables_legumes_points" : 5,
"is_beverage" : 0,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 0,
"is_red_meat_product" : 0,
"is_water" : 0,
- "negative_nutrients" : [
- "energy",
- "sugars",
- "saturated_fat",
- "salt",
- "non_nutritive_sweeteners"
- ],
"negative_points" : 2,
+ "negative_points_max" : 55,
"positive_nutrients" : [
- "fruits_vegetables_legumes",
+ "proteins",
"fiber",
- "proteins"
+ "fruits_vegetables_legumes"
],
"positive_points" : 5,
- "proteins" : 0.9,
- "proteins_points" : 0,
- "salt" : 0.5,
- "salt_points" : 2,
- "saturated_fat" : 0.2,
- "saturated_fat_points" : 0,
- "sugars" : 3,
- "sugars_points" : 0
+ "positive_points_max" : 17
},
"grade" : "a",
"nutrients_available" : 1,
diff --git a/tests/unit/expected_test_results/nutriscore/fr-green-beans-beverage.json b/tests/unit/expected_test_results/nutriscore/fr-green-beans-beverage.json
index c7730a77fa179..6ce963889d5e6 100644
--- a/tests/unit/expected_test_results/nutriscore/fr-green-beans-beverage.json
+++ b/tests/unit/expected_test_results/nutriscore/fr-green-beans-beverage.json
@@ -233,41 +233,77 @@
"2023" : {
"category_available" : 1,
"data" : {
+ "components" : {
+ "negative" : [
+ {
+ "id" : "energy",
+ "points" : 0,
+ "points_max" : 10,
+ "unit" : "kJ",
+ "value" : 315
+ },
+ {
+ "id" : "sugars",
+ "points" : 1,
+ "points_max" : 15,
+ "unit" : "g",
+ "value" : 3.6
+ },
+ {
+ "id" : "saturated_fat",
+ "points" : 0,
+ "points_max" : 10,
+ "unit" : "g",
+ "value" : 0.1
+ },
+ {
+ "id" : "salt",
+ "points" : 3,
+ "points_max" : 20,
+ "unit" : "g",
+ "value" : 0.8
+ }
+ ],
+ "positive" : [
+ {
+ "id" : "proteins",
+ "points" : 2,
+ "points_max" : 7,
+ "unit" : "g",
+ "value" : 5
+ },
+ {
+ "id" : "fiber",
+ "points" : 3,
+ "points_max" : 5,
+ "unit" : "g",
+ "value" : 5.3
+ },
+ {
+ "id" : "fruits_vegetables_legumes",
+ "points" : 0,
+ "points_max" : 5,
+ "unit" : "%",
+ "value" : 10
+ }
+ ]
+ },
"count_proteins" : 1,
"count_proteins_reason" : "negative_points_less_than_11",
- "energy" : 315,
- "energy_points" : 0,
- "fiber" : 5.3,
- "fiber_points" : 3,
- "fruits_vegetables_legumes" : 10,
- "fruits_vegetables_legumes_points" : 0,
"is_beverage" : 0,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 0,
"is_red_meat_product" : 0,
"is_water" : 0,
- "negative_nutrients" : [
- "energy",
- "sugars",
- "saturated_fat",
- "salt",
- "non_nutritive_sweeteners"
- ],
"negative_points" : 4,
+ "negative_points_max" : 55,
"positive_nutrients" : [
- "fruits_vegetables_legumes",
+ "proteins",
"fiber",
- "proteins"
+ "fruits_vegetables_legumes"
],
"positive_points" : 5,
- "proteins" : 5,
- "proteins_points" : 2,
- "salt" : 0.8,
- "salt_points" : 3,
- "saturated_fat" : 0.1,
- "saturated_fat_points" : 0,
- "sugars" : 3.6,
- "sugars_points" : 1
+ "positive_points_max" : 17
},
"grade" : "a",
"nutrients_available" : 1,
diff --git a/tests/unit/expected_test_results/nutriscore/fr-ice-tea-with-sweetener.json b/tests/unit/expected_test_results/nutriscore/fr-ice-tea-with-sweetener.json
index b79664bfebcc7..3e83251508d67 100644
--- a/tests/unit/expected_test_results/nutriscore/fr-ice-tea-with-sweetener.json
+++ b/tests/unit/expected_test_results/nutriscore/fr-ice-tea-with-sweetener.json
@@ -451,42 +451,85 @@
"2023" : {
"category_available" : 1,
"data" : {
+ "components" : {
+ "negative" : [
+ {
+ "id" : "energy",
+ "points" : 1,
+ "points_max" : 10,
+ "unit" : "kJ",
+ "value" : 82
+ },
+ {
+ "id" : "sugars",
+ "points" : 3,
+ "points_max" : 10,
+ "unit" : "g",
+ "value" : 4.5
+ },
+ {
+ "id" : "saturated_fat",
+ "points" : 0,
+ "points_max" : 10,
+ "unit" : "g",
+ "value" : 0
+ },
+ {
+ "id" : "salt",
+ "points" : 0,
+ "points_max" : 20,
+ "unit" : "g",
+ "value" : 0.03
+ },
+ {
+ "id" : "non_nutritive_sweeteners",
+ "points" : 4,
+ "points_max" : null,
+ "unit" : null,
+ "value" : 0
+ }
+ ],
+ "positive" : [
+ {
+ "id" : "proteins",
+ "points" : 0,
+ "points_max" : 7,
+ "unit" : "g",
+ "value" : 0
+ },
+ {
+ "id" : "fiber",
+ "points" : 0,
+ "points_max" : 5,
+ "unit" : "g",
+ "value" : 0
+ },
+ {
+ "id" : "fruits_vegetables_legumes",
+ "points" : 0,
+ "points_max" : 6,
+ "unit" : "%",
+ "value" : 0.1
+ }
+ ]
+ },
"count_proteins" : 1,
"count_proteins_reason" : "beverage",
- "energy" : 82,
- "energy_points" : 1,
- "fiber" : 0,
- "fiber_points" : 0,
- "fruits_vegetables_legumes" : 0.1,
- "fruits_vegetables_legumes_points" : 0,
"is_beverage" : 1,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 0,
"is_red_meat_product" : 0,
"is_water" : 0,
- "negative_nutrients" : [
- "energy",
- "sugars",
- "saturated_fat",
- "salt",
- "non_nutritive_sweeteners"
- ],
"negative_points" : 8,
- "non_nutritive_sweeteners_points" : 4,
+ "negative_points_max" : 50,
+ "non_nutritive_sweeteners_max" : 4,
"positive_nutrients" : [
- "fruits_vegetables_legumes",
+ "proteins",
"fiber",
- "proteins"
+ "fruits_vegetables_legumes"
],
"positive_points" : 0,
- "proteins" : 0,
- "proteins_points" : 0,
- "salt" : 0.025,
- "salt_points" : 0,
- "saturated_fat" : 0,
- "saturated_fat_points" : 0,
- "sugars" : 4.5,
- "sugars_points" : 3,
+ "positive_points_max" : 18,
"with_non_nutritive_sweeteners" : 1
},
"grade" : "d",
diff --git a/tests/unit/expected_test_results/nutriscore/fr-mixed-oils-with-olive-oil.json b/tests/unit/expected_test_results/nutriscore/fr-mixed-oils-with-olive-oil.json
index 767a49a09e31a..5a08dfe722c47 100644
--- a/tests/unit/expected_test_results/nutriscore/fr-mixed-oils-with-olive-oil.json
+++ b/tests/unit/expected_test_results/nutriscore/fr-mixed-oils-with-olive-oil.json
@@ -284,44 +284,77 @@
"2023" : {
"category_available" : 1,
"data" : {
+ "components" : {
+ "negative" : [
+ {
+ "id" : "energy_from_saturated_fat",
+ "points" : 3,
+ "points_max" : 10,
+ "unit" : "kJ",
+ "value" : 362.6
+ },
+ {
+ "id" : "sugars",
+ "points" : 0,
+ "points_max" : 15,
+ "unit" : "g",
+ "value" : 0
+ },
+ {
+ "id" : "saturated_fat_ratio",
+ "points" : 0,
+ "points_max" : 10,
+ "unit" : "%",
+ "value" : 9.8
+ },
+ {
+ "id" : "salt",
+ "points" : 0,
+ "points_max" : 20,
+ "unit" : "g",
+ "value" : 0
+ }
+ ],
+ "positive" : [
+ {
+ "id" : "proteins",
+ "points" : 0,
+ "points_max" : 7,
+ "unit" : "g",
+ "value" : 0
+ },
+ {
+ "id" : "fiber",
+ "points" : 0,
+ "points_max" : 5,
+ "unit" : "g",
+ "value" : 0
+ },
+ {
+ "id" : "fruits_vegetables_legumes",
+ "points" : 0,
+ "points_max" : 5,
+ "unit" : "%",
+ "value" : 0
+ }
+ ]
+ },
"count_proteins" : 1,
"count_proteins_reason" : "negative_points_less_than_7",
- "energy" : 3700,
- "energy_from_saturated_fat" : 362.6,
- "energy_from_saturated_fat_points" : 3,
- "fat" : 100,
- "fiber" : 0,
- "fiber_points" : 0,
- "fruits_vegetables_legumes" : 0,
- "fruits_vegetables_legumes_points" : 0,
"is_beverage" : 0,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 1,
"is_red_meat_product" : 0,
"is_water" : 0,
- "negative_nutrients" : [
- "energy_from_saturated_fat",
- "sugars",
- "saturated_fat_ratio",
- "salt",
- "non_nutritive_sweeteners"
- ],
"negative_points" : 3,
+ "negative_points_max" : 55,
"positive_nutrients" : [
- "fruits_vegetables_legumes",
+ "proteins",
"fiber",
- "proteins"
+ "fruits_vegetables_legumes"
],
"positive_points" : 0,
- "proteins" : 0,
- "proteins_points" : 0,
- "salt" : 0,
- "salt_points" : 0,
- "saturated_fat" : 9.8,
- "saturated_fat_ratio" : 9.8,
- "saturated_fat_ratio_points" : 0,
- "sugars" : 0,
- "sugars_points" : 0
+ "positive_points_max" : 17
},
"grade" : "c",
"nutrients_available" : 1,
diff --git a/tests/unit/expected_test_results/nutriscore/fr-orange-nectar-0-fat.json b/tests/unit/expected_test_results/nutriscore/fr-orange-nectar-0-fat.json
index bcf334e7f001d..8243779d8e64f 100644
--- a/tests/unit/expected_test_results/nutriscore/fr-orange-nectar-0-fat.json
+++ b/tests/unit/expected_test_results/nutriscore/fr-orange-nectar-0-fat.json
@@ -262,43 +262,85 @@
"2023" : {
"category_available" : 1,
"data" : {
+ "components" : {
+ "negative" : [
+ {
+ "id" : "energy",
+ "points" : 5,
+ "points_max" : 10,
+ "unit" : "kJ",
+ "value" : 250
+ },
+ {
+ "id" : "sugars",
+ "points" : 10,
+ "points_max" : 10,
+ "unit" : "g",
+ "value" : 12
+ },
+ {
+ "id" : "saturated_fat",
+ "points" : 0,
+ "points_max" : 10,
+ "unit" : "g",
+ "value" : 0
+ },
+ {
+ "id" : "salt",
+ "points" : 2,
+ "points_max" : 20,
+ "unit" : "g",
+ "value" : 0.5
+ },
+ {
+ "id" : "non_nutritive_sweeteners",
+ "points" : 0,
+ "points_max" : null,
+ "unit" : null,
+ "value" : 0
+ }
+ ],
+ "positive" : [
+ {
+ "id" : "proteins",
+ "points" : 0,
+ "points_max" : 7,
+ "unit" : "g",
+ "value" : 0.5
+ },
+ {
+ "id" : "fiber",
+ "points" : 0,
+ "points_max" : 5,
+ "unit" : "g",
+ "value" : 0
+ },
+ {
+ "id" : "fruits_vegetables_legumes",
+ "points" : 2,
+ "points_max" : 6,
+ "unit" : "%",
+ "value" : 57
+ }
+ ]
+ },
"count_proteins" : 1,
"count_proteins_reason" : "beverage",
- "energy" : 250,
- "energy_points" : 5,
- "fiber" : 0,
- "fiber_points" : 0,
- "fruits_vegetables_legumes" : 57,
- "fruits_vegetables_legumes_points" : 2,
"is_beverage" : 1,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 0,
"is_red_meat_product" : 0,
"is_water" : 0,
- "negative_nutrients" : [
- "energy",
- "sugars",
- "saturated_fat",
- "salt",
- "non_nutritive_sweeteners"
- ],
"negative_points" : 17,
- "non_nutritive_sweeteners_points" : 0,
+ "negative_points_max" : 50,
+ "non_nutritive_sweeteners_max" : 4,
"positive_nutrients" : [
- "fruits_vegetables_legumes",
+ "proteins",
"fiber",
- "proteins"
+ "fruits_vegetables_legumes"
],
"positive_points" : 2,
- "proteins" : 0.5,
- "proteins_points" : 0,
- "salt" : 0.5,
- "salt_points" : 2,
- "saturated_fat" : 0,
- "saturated_fat_points" : 0,
- "saturated_fat_ratio" : 0,
- "sugars" : 12,
- "sugars_points" : 10
+ "positive_points_max" : 18
},
"grade" : "e",
"nutrients_available" : 1,
diff --git a/tests/unit/expected_test_results/nutriscore/fr-plant-beverages-soy-milk.json b/tests/unit/expected_test_results/nutriscore/fr-plant-beverages-soy-milk.json
index 12804a510d742..04b594ad72c06 100644
--- a/tests/unit/expected_test_results/nutriscore/fr-plant-beverages-soy-milk.json
+++ b/tests/unit/expected_test_results/nutriscore/fr-plant-beverages-soy-milk.json
@@ -240,42 +240,85 @@
"2023" : {
"category_available" : 1,
"data" : {
+ "components" : {
+ "negative" : [
+ {
+ "id" : "energy",
+ "points" : 3,
+ "points_max" : 10,
+ "unit" : "kJ",
+ "value" : 178
+ },
+ {
+ "id" : "sugars",
+ "points" : 0,
+ "points_max" : 10,
+ "unit" : "g",
+ "value" : 0.5
+ },
+ {
+ "id" : "saturated_fat",
+ "points" : 0,
+ "points_max" : 10,
+ "unit" : "g",
+ "value" : 0.6
+ },
+ {
+ "id" : "salt",
+ "points" : 0,
+ "points_max" : 20,
+ "unit" : "g",
+ "value" : 0.03
+ },
+ {
+ "id" : "non_nutritive_sweeteners",
+ "points" : 0,
+ "points_max" : null,
+ "unit" : null,
+ "value" : 0
+ }
+ ],
+ "positive" : [
+ {
+ "id" : "proteins",
+ "points" : 7,
+ "points_max" : 7,
+ "unit" : "g",
+ "value" : 3.9
+ },
+ {
+ "id" : "fiber",
+ "points" : 0,
+ "points_max" : 5,
+ "unit" : "g",
+ "value" : 0.5
+ },
+ {
+ "id" : "fruits_vegetables_legumes",
+ "points" : 0,
+ "points_max" : 6,
+ "unit" : "%",
+ "value" : 8
+ }
+ ]
+ },
"count_proteins" : 1,
"count_proteins_reason" : "beverage",
- "energy" : 178,
- "energy_points" : 3,
- "fiber" : 0.5,
- "fiber_points" : 0,
- "fruits_vegetables_legumes" : 8,
- "fruits_vegetables_legumes_points" : 0,
"is_beverage" : 1,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 0,
"is_red_meat_product" : 0,
"is_water" : 0,
- "negative_nutrients" : [
- "energy",
- "sugars",
- "saturated_fat",
- "salt",
- "non_nutritive_sweeteners"
- ],
"negative_points" : 3,
- "non_nutritive_sweeteners_points" : 0,
+ "negative_points_max" : 50,
+ "non_nutritive_sweeteners_max" : 4,
"positive_nutrients" : [
- "fruits_vegetables_legumes",
+ "proteins",
"fiber",
- "proteins"
+ "fruits_vegetables_legumes"
],
"positive_points" : 7,
- "proteins" : 3.9,
- "proteins_points" : 7,
- "salt" : 0.03,
- "salt_points" : 0,
- "saturated_fat" : 0.6,
- "saturated_fat_points" : 0,
- "sugars" : 0.5,
- "sugars_points" : 0
+ "positive_points_max" : 18
},
"grade" : "b",
"nutrients_available" : 1,
diff --git a/tests/unit/expected_test_results/nutriscore/fr-rapeseed-oil.json b/tests/unit/expected_test_results/nutriscore/fr-rapeseed-oil.json
index e9f13a93122da..1414d3a043d3e 100644
--- a/tests/unit/expected_test_results/nutriscore/fr-rapeseed-oil.json
+++ b/tests/unit/expected_test_results/nutriscore/fr-rapeseed-oil.json
@@ -218,44 +218,77 @@
"2023" : {
"category_available" : 1,
"data" : {
+ "components" : {
+ "negative" : [
+ {
+ "id" : "energy_from_saturated_fat",
+ "points" : 2,
+ "points_max" : 10,
+ "unit" : "kJ",
+ "value" : 270.1
+ },
+ {
+ "id" : "sugars",
+ "points" : 0,
+ "points_max" : 15,
+ "unit" : "g",
+ "value" : 0
+ },
+ {
+ "id" : "saturated_fat_ratio",
+ "points" : 0,
+ "points_max" : 10,
+ "unit" : "%",
+ "value" : 7.9
+ },
+ {
+ "id" : "salt",
+ "points" : 0,
+ "points_max" : 20,
+ "unit" : "g",
+ "value" : 0
+ }
+ ],
+ "positive" : [
+ {
+ "id" : "proteins",
+ "points" : 0,
+ "points_max" : 7,
+ "unit" : "g",
+ "value" : 0
+ },
+ {
+ "id" : "fiber",
+ "points" : 0,
+ "points_max" : 5,
+ "unit" : "g",
+ "value" : 0
+ },
+ {
+ "id" : "fruits_vegetables_legumes",
+ "points" : 0,
+ "points_max" : 5,
+ "unit" : "%",
+ "value" : 0
+ }
+ ]
+ },
"count_proteins" : 1,
"count_proteins_reason" : "negative_points_less_than_7",
- "energy" : 3400,
- "energy_from_saturated_fat" : 270.1,
- "energy_from_saturated_fat_points" : 2,
- "fat" : 92,
- "fiber" : 0,
- "fiber_points" : 0,
- "fruits_vegetables_legumes" : 0,
- "fruits_vegetables_legumes_points" : 0,
"is_beverage" : 0,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 1,
"is_red_meat_product" : 0,
"is_water" : 0,
- "negative_nutrients" : [
- "energy_from_saturated_fat",
- "sugars",
- "saturated_fat_ratio",
- "salt",
- "non_nutritive_sweeteners"
- ],
"negative_points" : 2,
+ "negative_points_max" : 55,
"positive_nutrients" : [
- "fruits_vegetables_legumes",
+ "proteins",
"fiber",
- "proteins"
+ "fruits_vegetables_legumes"
],
"positive_points" : 0,
- "proteins" : 0,
- "proteins_points" : 0,
- "salt" : 0,
- "salt_points" : 0,
- "saturated_fat" : 7.3,
- "saturated_fat_ratio" : 7.93478260869565,
- "saturated_fat_ratio_points" : 0,
- "sugars" : 0,
- "sugars_points" : 0
+ "positive_points_max" : 17
},
"grade" : "b",
"nutrients_available" : 1,
diff --git a/tests/unit/expected_test_results/nutriscore/milk.json b/tests/unit/expected_test_results/nutriscore/milk.json
index eee2bd12c39ad..6103f75ba0f5a 100644
--- a/tests/unit/expected_test_results/nutriscore/milk.json
+++ b/tests/unit/expected_test_results/nutriscore/milk.json
@@ -205,42 +205,85 @@
"2023" : {
"category_available" : 1,
"data" : {
+ "components" : {
+ "negative" : [
+ {
+ "id" : "energy",
+ "points" : 10,
+ "points_max" : 10,
+ "unit" : "kJ",
+ "value" : 3378
+ },
+ {
+ "id" : "sugars",
+ "points" : 8,
+ "points_max" : 10,
+ "unit" : "g",
+ "value" : 10
+ },
+ {
+ "id" : "saturated_fat",
+ "points" : 4,
+ "points_max" : 10,
+ "unit" : "g",
+ "value" : 5
+ },
+ {
+ "id" : "salt",
+ "points" : 0,
+ "points_max" : 20,
+ "unit" : "g",
+ "value" : 0
+ },
+ {
+ "id" : "non_nutritive_sweeteners",
+ "points" : 0,
+ "points_max" : null,
+ "unit" : null,
+ "value" : 0
+ }
+ ],
+ "positive" : [
+ {
+ "id" : "proteins",
+ "points" : 7,
+ "points_max" : 7,
+ "unit" : "g",
+ "value" : 5
+ },
+ {
+ "id" : "fiber",
+ "points" : 0,
+ "points_max" : 5,
+ "unit" : "g",
+ "value" : 2
+ },
+ {
+ "id" : "fruits_vegetables_legumes",
+ "points" : 0,
+ "points_max" : 6,
+ "unit" : "%",
+ "value" : 0
+ }
+ ]
+ },
"count_proteins" : 1,
"count_proteins_reason" : "beverage",
- "energy" : 3378,
- "energy_points" : 10,
- "fiber" : 2,
- "fiber_points" : 0,
- "fruits_vegetables_legumes" : 0,
- "fruits_vegetables_legumes_points" : 0,
"is_beverage" : 1,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 0,
"is_red_meat_product" : 0,
"is_water" : 0,
- "negative_nutrients" : [
- "energy",
- "sugars",
- "saturated_fat",
- "salt",
- "non_nutritive_sweeteners"
- ],
"negative_points" : 22,
- "non_nutritive_sweeteners_points" : 0,
+ "negative_points_max" : 50,
+ "non_nutritive_sweeteners_max" : 4,
"positive_nutrients" : [
- "fruits_vegetables_legumes",
+ "proteins",
"fiber",
- "proteins"
+ "fruits_vegetables_legumes"
],
"positive_points" : 7,
- "proteins" : 5,
- "proteins_points" : 7,
- "salt" : 0,
- "salt_points" : 0,
- "saturated_fat" : 5,
- "saturated_fat_points" : 4,
- "sugars" : 10,
- "sugars_points" : 8
+ "positive_points_max" : 18
},
"grade" : "e",
"nutrients_available" : 1,
diff --git a/tests/unit/expected_test_results/nutriscore/mushrooms.json b/tests/unit/expected_test_results/nutriscore/mushrooms.json
index d076cc62eb5b0..2c2770a5b2e94 100644
--- a/tests/unit/expected_test_results/nutriscore/mushrooms.json
+++ b/tests/unit/expected_test_results/nutriscore/mushrooms.json
@@ -174,41 +174,77 @@
"2023" : {
"category_available" : 1,
"data" : {
+ "components" : {
+ "negative" : [
+ {
+ "id" : "energy",
+ "points" : 1,
+ "points_max" : 10,
+ "unit" : "kJ",
+ "value" : 667
+ },
+ {
+ "id" : "sugars",
+ "points" : 0,
+ "points_max" : 15,
+ "unit" : "g",
+ "value" : 1.1
+ },
+ {
+ "id" : "saturated_fat",
+ "points" : 1,
+ "points_max" : 10,
+ "unit" : "g",
+ "value" : 1.2
+ },
+ {
+ "id" : "salt",
+ "points" : 4,
+ "points_max" : 20,
+ "unit" : "g",
+ "value" : 1
+ }
+ ],
+ "positive" : [
+ {
+ "id" : "proteins",
+ "points" : 0,
+ "points_max" : 7,
+ "unit" : "g",
+ "value" : 2.4
+ },
+ {
+ "id" : "fiber",
+ "points" : 5,
+ "points_max" : 5,
+ "unit" : "g",
+ "value" : 10.9
+ },
+ {
+ "id" : "fruits_vegetables_legumes",
+ "points" : 2,
+ "points_max" : 5,
+ "unit" : "%",
+ "value" : 69
+ }
+ ]
+ },
"count_proteins" : 1,
"count_proteins_reason" : "negative_points_less_than_11",
- "energy" : 667,
- "energy_points" : 1,
- "fiber" : 10.9,
- "fiber_points" : 5,
- "fruits_vegetables_legumes" : 69,
- "fruits_vegetables_legumes_points" : 2,
"is_beverage" : 0,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 0,
"is_red_meat_product" : 0,
"is_water" : 0,
- "negative_nutrients" : [
- "energy",
- "sugars",
- "saturated_fat",
- "salt",
- "non_nutritive_sweeteners"
- ],
"negative_points" : 6,
+ "negative_points_max" : 55,
"positive_nutrients" : [
- "fruits_vegetables_legumes",
+ "proteins",
"fiber",
- "proteins"
+ "fruits_vegetables_legumes"
],
"positive_points" : 7,
- "proteins" : 2.4,
- "proteins_points" : 0,
- "salt" : 1,
- "salt_points" : 4,
- "saturated_fat" : 1.2,
- "saturated_fat_points" : 1,
- "sugars" : 1.1,
- "sugars_points" : 0
+ "positive_points_max" : 17
},
"grade" : "a",
"nutrients_available" : 1,
diff --git a/tests/unit/expected_test_results/nutriscore/olive-oil.json b/tests/unit/expected_test_results/nutriscore/olive-oil.json
index 4dd99bb38c820..49add1281252f 100644
--- a/tests/unit/expected_test_results/nutriscore/olive-oil.json
+++ b/tests/unit/expected_test_results/nutriscore/olive-oil.json
@@ -109,44 +109,77 @@
"2023" : {
"category_available" : 1,
"data" : {
+ "components" : {
+ "negative" : [
+ {
+ "id" : "energy_from_saturated_fat",
+ "points" : 4,
+ "points_max" : 10,
+ "unit" : "kJ",
+ "value" : 518
+ },
+ {
+ "id" : "sugars",
+ "points" : 0,
+ "points_max" : 15,
+ "unit" : "g",
+ "value" : 0
+ },
+ {
+ "id" : "saturated_fat_ratio",
+ "points" : 1,
+ "points_max" : 10,
+ "unit" : "%",
+ "value" : 15.2
+ },
+ {
+ "id" : "salt",
+ "points" : 0,
+ "points_max" : 20,
+ "unit" : "g",
+ "value" : 0
+ }
+ ],
+ "positive" : [
+ {
+ "id" : "proteins",
+ "points" : 0,
+ "points_max" : 7,
+ "unit" : "g",
+ "value" : 0
+ },
+ {
+ "id" : "fiber",
+ "points" : 0,
+ "points_max" : 5,
+ "unit" : "g",
+ "value" : 0
+ },
+ {
+ "id" : "fruits_vegetables_legumes",
+ "points" : 5,
+ "points_max" : 5,
+ "unit" : "%",
+ "value" : 100
+ }
+ ]
+ },
"count_proteins" : 1,
"count_proteins_reason" : "negative_points_less_than_7",
- "energy" : 3460,
- "energy_from_saturated_fat" : 518,
- "energy_from_saturated_fat_points" : 4,
- "fat" : 92,
- "fiber" : 0,
- "fiber_points" : 0,
- "fruits_vegetables_legumes" : 100,
- "fruits_vegetables_legumes_points" : 5,
"is_beverage" : 0,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 1,
"is_red_meat_product" : 0,
"is_water" : 0,
- "negative_nutrients" : [
- "energy_from_saturated_fat",
- "sugars",
- "saturated_fat_ratio",
- "salt",
- "non_nutritive_sweeteners"
- ],
"negative_points" : 5,
+ "negative_points_max" : 55,
"positive_nutrients" : [
- "fruits_vegetables_legumes",
+ "proteins",
"fiber",
- "proteins"
+ "fruits_vegetables_legumes"
],
"positive_points" : 5,
- "proteins" : 0,
- "proteins_points" : 0,
- "salt" : 0,
- "salt_points" : 0,
- "saturated_fat" : 14,
- "saturated_fat_ratio" : 15.2173913043478,
- "saturated_fat_ratio_points" : 1,
- "sugars" : 0,
- "sugars_points" : 0
+ "positive_points_max" : 17
},
"grade" : "b",
"nutrients_available" : 1,
diff --git a/tests/unit/expected_test_results/nutriscore/spring-water-no-nutrition.json b/tests/unit/expected_test_results/nutriscore/spring-water-no-nutrition.json
index 44a063e72220a..60a2389f02da1 100644
--- a/tests/unit/expected_test_results/nutriscore/spring-water-no-nutrition.json
+++ b/tests/unit/expected_test_results/nutriscore/spring-water-no-nutrition.json
@@ -84,36 +84,85 @@
"2023" : {
"category_available" : 1,
"data" : {
+ "components" : {
+ "negative" : [
+ {
+ "id" : "energy",
+ "points" : 0,
+ "points_max" : null,
+ "unit" : "kJ",
+ "value" : 0
+ },
+ {
+ "id" : "sugars",
+ "points" : 0,
+ "points_max" : null,
+ "unit" : "g",
+ "value" : 0
+ },
+ {
+ "id" : "saturated_fat",
+ "points" : 0,
+ "points_max" : null,
+ "unit" : "g",
+ "value" : 0
+ },
+ {
+ "id" : "salt",
+ "points" : 0,
+ "points_max" : null,
+ "unit" : "g",
+ "value" : 0
+ },
+ {
+ "id" : "non_nutritive_sweeteners",
+ "points" : 0,
+ "points_max" : null,
+ "unit" : null,
+ "value" : 0
+ }
+ ],
+ "positive" : [
+ {
+ "id" : "proteins",
+ "points" : 0,
+ "points_max" : null,
+ "unit" : "g",
+ "value" : 0
+ },
+ {
+ "id" : "fiber",
+ "points" : 0,
+ "points_max" : 5,
+ "unit" : "g",
+ "value" : 0
+ },
+ {
+ "id" : "fruits_vegetables_legumes",
+ "points" : 0,
+ "points_max" : 6,
+ "unit" : "%",
+ "value" : 0
+ }
+ ]
+ },
"count_proteins" : 1,
"count_proteins_reason" : "beverage",
- "energy" : null,
- "fiber" : 0,
- "fiber_points" : 0,
- "fruits_vegetables_legumes" : null,
"is_beverage" : 1,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 0,
"is_red_meat_product" : 0,
"is_water" : "1",
- "negative_nutrients" : [
- "energy",
- "sugars",
- "saturated_fat",
- "salt",
- "non_nutritive_sweeteners"
- ],
"negative_points" : 0,
- "non_nutritive_sweeteners_points" : 0,
+ "negative_points_max" : 0,
+ "non_nutritive_sweeteners_max" : 4,
"positive_nutrients" : [
- "fruits_vegetables_legumes",
+ "proteins",
"fiber",
- "proteins"
+ "fruits_vegetables_legumes"
],
"positive_points" : 0,
- "proteins" : null,
- "salt" : null,
- "saturated_fat" : null,
- "sugars" : null
+ "positive_points_max" : 11
},
"grade" : "a",
"nutrients_available" : 1,
diff --git a/tests/unit/expected_test_results/nutriscore/sunflower-oil-no-sugar-no-sat-fat.json b/tests/unit/expected_test_results/nutriscore/sunflower-oil-no-sugar-no-sat-fat.json
index 38d90bb4f681c..725e04ec91610 100644
--- a/tests/unit/expected_test_results/nutriscore/sunflower-oil-no-sugar-no-sat-fat.json
+++ b/tests/unit/expected_test_results/nutriscore/sunflower-oil-no-sugar-no-sat-fat.json
@@ -90,7 +90,7 @@
"energy" : 3378,
"fat" : 100,
"fiber" : 0,
- "fruits_vegetables_legumes" : null,
+ "fruits_vegetables_legumes" : 0,
"is_beverage" : 0,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 1,
diff --git a/tests/unit/expected_test_results/nutriscore/sunflower-oil-no-sugar.json b/tests/unit/expected_test_results/nutriscore/sunflower-oil-no-sugar.json
index 3b1eab1326cf8..3715b3d2a7e6e 100644
--- a/tests/unit/expected_test_results/nutriscore/sunflower-oil-no-sugar.json
+++ b/tests/unit/expected_test_results/nutriscore/sunflower-oil-no-sugar.json
@@ -107,43 +107,77 @@
"2023" : {
"category_available" : 1,
"data" : {
+ "components" : {
+ "negative" : [
+ {
+ "id" : "energy_from_saturated_fat",
+ "points" : 3,
+ "points_max" : 10,
+ "unit" : "kJ",
+ "value" : 370
+ },
+ {
+ "id" : "sugars",
+ "points" : 0,
+ "points_max" : 15,
+ "unit" : "g",
+ "value" : 0
+ },
+ {
+ "id" : "saturated_fat_ratio",
+ "points" : 1,
+ "points_max" : 10,
+ "unit" : "%",
+ "value" : 10
+ },
+ {
+ "id" : "salt",
+ "points" : 0,
+ "points_max" : 20,
+ "unit" : "g",
+ "value" : 0
+ }
+ ],
+ "positive" : [
+ {
+ "id" : "proteins",
+ "points" : 0,
+ "points_max" : 7,
+ "unit" : "g",
+ "value" : 0
+ },
+ {
+ "id" : "fiber",
+ "points" : 0,
+ "points_max" : 5,
+ "unit" : "g",
+ "value" : 0
+ },
+ {
+ "id" : "fruits_vegetables_legumes",
+ "points" : 0,
+ "points_max" : 5,
+ "unit" : "%",
+ "value" : 0
+ }
+ ]
+ },
"count_proteins" : 1,
"count_proteins_reason" : "negative_points_less_than_7",
- "energy" : 3378,
- "energy_from_saturated_fat" : 370,
- "energy_from_saturated_fat_points" : 3,
- "fat" : 100,
- "fiber" : 0,
- "fiber_points" : 0,
- "fruits_vegetables_legumes" : null,
"is_beverage" : 0,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 1,
"is_red_meat_product" : 0,
"is_water" : 0,
- "negative_nutrients" : [
- "energy_from_saturated_fat",
- "sugars",
- "saturated_fat_ratio",
- "salt",
- "non_nutritive_sweeteners"
- ],
"negative_points" : 4,
+ "negative_points_max" : 55,
"positive_nutrients" : [
- "fruits_vegetables_legumes",
+ "proteins",
"fiber",
- "proteins"
+ "fruits_vegetables_legumes"
],
"positive_points" : 0,
- "proteins" : 0,
- "proteins_points" : 0,
- "salt" : 0,
- "salt_points" : 0,
- "saturated_fat" : 10,
- "saturated_fat_ratio" : 10,
- "saturated_fat_ratio_points" : 1,
- "sugars" : 0,
- "sugars_points" : 0
+ "positive_points_max" : 17
},
"grade" : "c",
"nutrients_available" : 1,
diff --git a/tests/unit/expected_test_results/nutriscore/sunflower-oil.json b/tests/unit/expected_test_results/nutriscore/sunflower-oil.json
index f9cb1da68f198..cdfb257a4260e 100644
--- a/tests/unit/expected_test_results/nutriscore/sunflower-oil.json
+++ b/tests/unit/expected_test_results/nutriscore/sunflower-oil.json
@@ -107,43 +107,77 @@
"2023" : {
"category_available" : 1,
"data" : {
+ "components" : {
+ "negative" : [
+ {
+ "id" : "energy_from_saturated_fat",
+ "points" : 3,
+ "points_max" : 10,
+ "unit" : "kJ",
+ "value" : 370
+ },
+ {
+ "id" : "sugars",
+ "points" : 0,
+ "points_max" : 15,
+ "unit" : "g",
+ "value" : 0
+ },
+ {
+ "id" : "saturated_fat_ratio",
+ "points" : 1,
+ "points_max" : 10,
+ "unit" : "%",
+ "value" : 10
+ },
+ {
+ "id" : "salt",
+ "points" : 0,
+ "points_max" : 20,
+ "unit" : "g",
+ "value" : 0
+ }
+ ],
+ "positive" : [
+ {
+ "id" : "proteins",
+ "points" : 0,
+ "points_max" : 7,
+ "unit" : "g",
+ "value" : 0
+ },
+ {
+ "id" : "fiber",
+ "points" : 0,
+ "points_max" : 5,
+ "unit" : "g",
+ "value" : 0
+ },
+ {
+ "id" : "fruits_vegetables_legumes",
+ "points" : 0,
+ "points_max" : 5,
+ "unit" : "%",
+ "value" : 0
+ }
+ ]
+ },
"count_proteins" : 1,
"count_proteins_reason" : "negative_points_less_than_7",
- "energy" : 3378,
- "energy_from_saturated_fat" : 370,
- "energy_from_saturated_fat_points" : 3,
- "fat" : 100,
- "fiber" : 0,
- "fiber_points" : 0,
- "fruits_vegetables_legumes" : null,
"is_beverage" : 0,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 1,
"is_red_meat_product" : 0,
"is_water" : 0,
- "negative_nutrients" : [
- "energy_from_saturated_fat",
- "sugars",
- "saturated_fat_ratio",
- "salt",
- "non_nutritive_sweeteners"
- ],
"negative_points" : 4,
+ "negative_points_max" : 55,
"positive_nutrients" : [
- "fruits_vegetables_legumes",
+ "proteins",
"fiber",
- "proteins"
+ "fruits_vegetables_legumes"
],
"positive_points" : 0,
- "proteins" : 0,
- "proteins_points" : 0,
- "salt" : 0,
- "salt_points" : 0,
- "saturated_fat" : 10,
- "saturated_fat_ratio" : 10,
- "saturated_fat_ratio_points" : 1,
- "sugars" : 0,
- "sugars_points" : 0
+ "positive_points_max" : 17
},
"grade" : "c",
"nutrients_available" : 1,
diff --git a/tests/unit/expected_test_results/nutriscore/walnut-oil.json b/tests/unit/expected_test_results/nutriscore/walnut-oil.json
index d90752b1264c7..28d3b853630c6 100644
--- a/tests/unit/expected_test_results/nutriscore/walnut-oil.json
+++ b/tests/unit/expected_test_results/nutriscore/walnut-oil.json
@@ -109,43 +109,77 @@
"2023" : {
"category_available" : 1,
"data" : {
+ "components" : {
+ "negative" : [
+ {
+ "id" : "energy_from_saturated_fat",
+ "points" : 3,
+ "points_max" : 10,
+ "unit" : "kJ",
+ "value" : 370
+ },
+ {
+ "id" : "sugars",
+ "points" : 0,
+ "points_max" : 15,
+ "unit" : "g",
+ "value" : 0
+ },
+ {
+ "id" : "saturated_fat_ratio",
+ "points" : 1,
+ "points_max" : 10,
+ "unit" : "%",
+ "value" : 10
+ },
+ {
+ "id" : "salt",
+ "points" : 0,
+ "points_max" : 20,
+ "unit" : "g",
+ "value" : 0
+ }
+ ],
+ "positive" : [
+ {
+ "id" : "proteins",
+ "points" : 0,
+ "points_max" : 7,
+ "unit" : "g",
+ "value" : 0
+ },
+ {
+ "id" : "fiber",
+ "points" : 0,
+ "points_max" : 5,
+ "unit" : "g",
+ "value" : 0
+ },
+ {
+ "id" : "fruits_vegetables_legumes",
+ "points" : 0,
+ "points_max" : 5,
+ "unit" : "%",
+ "value" : 0
+ }
+ ]
+ },
"count_proteins" : 1,
"count_proteins_reason" : "negative_points_less_than_7",
- "energy" : 3378,
- "energy_from_saturated_fat" : 370,
- "energy_from_saturated_fat_points" : 3,
- "fat" : 100,
- "fiber" : 0,
- "fiber_points" : 0,
- "fruits_vegetables_legumes" : null,
"is_beverage" : 0,
"is_cheese" : 0,
"is_fat_oil_nuts_seeds" : 1,
"is_red_meat_product" : 0,
"is_water" : 0,
- "negative_nutrients" : [
- "energy_from_saturated_fat",
- "sugars",
- "saturated_fat_ratio",
- "salt",
- "non_nutritive_sweeteners"
- ],
"negative_points" : 4,
+ "negative_points_max" : 55,
"positive_nutrients" : [
- "fruits_vegetables_legumes",
+ "proteins",
"fiber",
- "proteins"
+ "fruits_vegetables_legumes"
],
"positive_points" : 0,
- "proteins" : 0,
- "proteins_points" : 0,
- "salt" : 0,
- "salt_points" : 0,
- "saturated_fat" : 10,
- "saturated_fat_ratio" : 10,
- "saturated_fat_ratio_points" : 1,
- "sugars" : 0,
- "sugars_points" : 0
+ "positive_points_max" : 17
},
"grade" : "c",
"nutrients_available" : 1,