diff --git a/html/images/attributes/src/nutriscore-a-new-formula-en.svg b/html/images/attributes/src/nutriscore-a-new-formula-en.svg new file mode 100644 index 0000000000000..5b2d4cedb6d01 --- /dev/null +++ b/html/images/attributes/src/nutriscore-a-new-formula-en.svg @@ -0,0 +1,142 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/html/images/attributes/src/nutriscore-a-new-formula-fr.svg b/html/images/attributes/src/nutriscore-a-new-formula-fr.svg new file mode 100644 index 0000000000000..98eadef0fd020 --- /dev/null +++ b/html/images/attributes/src/nutriscore-a-new-formula-fr.svg @@ -0,0 +1,150 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/html/images/attributes/src/nutriscore-b-new-formula-en.svg b/html/images/attributes/src/nutriscore-b-new-formula-en.svg new file mode 100644 index 0000000000000..6c8e2ef18e4e1 --- /dev/null +++ b/html/images/attributes/src/nutriscore-b-new-formula-en.svg @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/html/images/attributes/src/nutriscore-b-new-formula-fr.svg b/html/images/attributes/src/nutriscore-b-new-formula-fr.svg new file mode 100644 index 0000000000000..b69eecab2e61f --- /dev/null +++ b/html/images/attributes/src/nutriscore-b-new-formula-fr.svg @@ -0,0 +1,85 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/html/images/attributes/src/nutriscore-c-new-formula-en.svg b/html/images/attributes/src/nutriscore-c-new-formula-en.svg new file mode 100644 index 0000000000000..70fbe53119490 --- /dev/null +++ b/html/images/attributes/src/nutriscore-c-new-formula-en.svg @@ -0,0 +1,213 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/html/images/attributes/src/nutriscore-c-new-formula-fr.svg b/html/images/attributes/src/nutriscore-c-new-formula-fr.svg new file mode 100644 index 0000000000000..71587caf79964 --- /dev/null +++ b/html/images/attributes/src/nutriscore-c-new-formula-fr.svg @@ -0,0 +1,221 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/html/images/attributes/src/nutriscore-d-new-formula-en.svg b/html/images/attributes/src/nutriscore-d-new-formula-en.svg new file mode 100644 index 0000000000000..f5310bd9632f9 --- /dev/null +++ b/html/images/attributes/src/nutriscore-d-new-formula-en.svg @@ -0,0 +1,81 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/html/images/attributes/src/nutriscore-d-new-formula-fr.svg b/html/images/attributes/src/nutriscore-d-new-formula-fr.svg new file mode 100644 index 0000000000000..cbf15b2395d7b --- /dev/null +++ b/html/images/attributes/src/nutriscore-d-new-formula-fr.svg @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/html/images/attributes/src/nutriscore-e-new-formula-en.svg b/html/images/attributes/src/nutriscore-e-new-formula-en.svg new file mode 100644 index 0000000000000..e02b91a1e010a --- /dev/null +++ b/html/images/attributes/src/nutriscore-e-new-formula-en.svg @@ -0,0 +1,279 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/html/images/attributes/src/nutriscore-e-new-formula-fr.svg b/html/images/attributes/src/nutriscore-e-new-formula-fr.svg new file mode 100644 index 0000000000000..6d0dcc74a0024 --- /dev/null +++ b/html/images/attributes/src/nutriscore-e-new-formula-fr.svg @@ -0,0 +1,287 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/html/images/attributes/src/nutriscore-not-applicable-new-formula-en.svg b/html/images/attributes/src/nutriscore-not-applicable-new-formula-en.svg new file mode 100644 index 0000000000000..871c7e26a87c0 --- /dev/null +++ b/html/images/attributes/src/nutriscore-not-applicable-new-formula-en.svg @@ -0,0 +1,324 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/html/images/attributes/src/nutriscore-not-applicable-new-formula-fr.svg b/html/images/attributes/src/nutriscore-not-applicable-new-formula-fr.svg new file mode 100644 index 0000000000000..871c7e26a87c0 --- /dev/null +++ b/html/images/attributes/src/nutriscore-not-applicable-new-formula-fr.svg @@ -0,0 +1,324 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/html/images/attributes/src/nutriscore-unknown-new-formula-en.svg b/html/images/attributes/src/nutriscore-unknown-new-formula-en.svg new file mode 100644 index 0000000000000..4b8e472d650d3 --- /dev/null +++ b/html/images/attributes/src/nutriscore-unknown-new-formula-en.svg @@ -0,0 +1,325 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/html/images/attributes/src/nutriscore-unknown-new-formula-fr.svg b/html/images/attributes/src/nutriscore-unknown-new-formula-fr.svg new file mode 100644 index 0000000000000..4b8e472d650d3 --- /dev/null +++ b/html/images/attributes/src/nutriscore-unknown-new-formula-fr.svg @@ -0,0 +1,325 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/html/images/attributes/src/points-negative-0-10.svg b/html/images/attributes/src/points-negative-0-10.svg new file mode 100644 index 0000000000000..2e41f1e3111b6 --- /dev/null +++ b/html/images/attributes/src/points-negative-0-10.svg @@ -0,0 +1,17 @@ + + + \ No newline at end of file diff --git a/html/images/attributes/src/points-negative-0-15.svg b/html/images/attributes/src/points-negative-0-15.svg new file mode 100644 index 0000000000000..0087ae052c4f6 --- /dev/null +++ b/html/images/attributes/src/points-negative-0-15.svg @@ -0,0 +1,17 @@ + + + \ No newline at end of file diff --git a/html/images/attributes/src/points-negative-0-20.svg b/html/images/attributes/src/points-negative-0-20.svg new file mode 100644 index 0000000000000..1b1a19deeed3c --- /dev/null +++ b/html/images/attributes/src/points-negative-0-20.svg @@ -0,0 +1,17 @@ + + + \ No newline at end of file diff --git a/html/images/attributes/src/points-negative-0-4.svg b/html/images/attributes/src/points-negative-0-4.svg new file mode 100644 index 0000000000000..2bee428b6e885 --- /dev/null +++ b/html/images/attributes/src/points-negative-0-4.svg @@ -0,0 +1,17 @@ + + + \ No newline at end of file diff --git a/html/images/attributes/src/points-negative-1-10.svg b/html/images/attributes/src/points-negative-1-10.svg new file mode 100644 index 0000000000000..b5b8facb08882 --- /dev/null +++ b/html/images/attributes/src/points-negative-1-10.svg @@ -0,0 +1,17 @@ + + + \ No newline at end of file diff --git a/html/images/attributes/src/points-negative-1-15.svg b/html/images/attributes/src/points-negative-1-15.svg new file mode 100644 index 0000000000000..7217f6eca41d4 --- /dev/null +++ b/html/images/attributes/src/points-negative-1-15.svg @@ -0,0 +1,17 @@ + + + \ No newline at end of file diff --git a/html/images/attributes/src/points-negative-1-20.svg b/html/images/attributes/src/points-negative-1-20.svg new file mode 100644 index 0000000000000..e23b0c5ab35a3 --- /dev/null +++ b/html/images/attributes/src/points-negative-1-20.svg @@ -0,0 +1,17 @@ + + + \ No newline at end of file diff --git a/html/images/attributes/src/points-negative-1-4.svg b/html/images/attributes/src/points-negative-1-4.svg new file mode 100644 index 0000000000000..3fdc3ccc3e25b --- /dev/null +++ b/html/images/attributes/src/points-negative-1-4.svg @@ -0,0 +1,17 @@ + + + \ No newline at end of file diff --git a/html/images/attributes/src/points-negative-10-10.svg b/html/images/attributes/src/points-negative-10-10.svg new file mode 100644 index 0000000000000..eae6bf54c86f2 --- /dev/null +++ b/html/images/attributes/src/points-negative-10-10.svg @@ -0,0 +1,17 @@ + + + \ No newline at end of file diff --git a/html/images/attributes/src/points-negative-10-15.svg b/html/images/attributes/src/points-negative-10-15.svg new file mode 100644 index 0000000000000..4967c57563522 --- /dev/null +++ b/html/images/attributes/src/points-negative-10-15.svg @@ -0,0 +1,17 @@ + + + \ No newline at end of file diff --git a/html/images/attributes/src/points-negative-10-20.svg b/html/images/attributes/src/points-negative-10-20.svg new file mode 100644 index 0000000000000..0f113ccb8e1fc --- /dev/null +++ b/html/images/attributes/src/points-negative-10-20.svg @@ -0,0 +1,17 @@ + + + \ No newline at end of file diff --git a/html/images/attributes/src/points-negative-11-15.svg b/html/images/attributes/src/points-negative-11-15.svg new file mode 100644 index 0000000000000..bf17dbbd26854 --- /dev/null +++ b/html/images/attributes/src/points-negative-11-15.svg @@ -0,0 +1,17 @@ + + + \ No newline at end of file diff --git a/html/images/attributes/src/points-negative-11-20.svg b/html/images/attributes/src/points-negative-11-20.svg new file mode 100644 index 0000000000000..5e2cd2817b357 --- /dev/null +++ b/html/images/attributes/src/points-negative-11-20.svg @@ -0,0 +1,17 @@ + + + \ No newline at end of file diff --git a/html/images/attributes/src/points-negative-12-15.svg b/html/images/attributes/src/points-negative-12-15.svg new file mode 100644 index 0000000000000..ddd15263dd1b0 --- /dev/null +++ b/html/images/attributes/src/points-negative-12-15.svg @@ -0,0 +1,17 @@ + + + \ No newline at end of file diff --git a/html/images/attributes/src/points-negative-12-20.svg b/html/images/attributes/src/points-negative-12-20.svg new file mode 100644 index 0000000000000..9ec107ea1b95b --- /dev/null +++ b/html/images/attributes/src/points-negative-12-20.svg @@ -0,0 +1,17 @@ + + + \ No newline at end of file diff --git a/html/images/attributes/src/points-negative-13-15.svg b/html/images/attributes/src/points-negative-13-15.svg new file mode 100644 index 0000000000000..0e78cae7bbe35 --- /dev/null +++ b/html/images/attributes/src/points-negative-13-15.svg @@ -0,0 +1,17 @@ + + + \ No newline at end of file diff --git a/html/images/attributes/src/points-negative-13-20.svg b/html/images/attributes/src/points-negative-13-20.svg new file mode 100644 index 0000000000000..7a8b77db14ece --- /dev/null +++ b/html/images/attributes/src/points-negative-13-20.svg @@ -0,0 +1,17 @@ + + + \ No newline at end of file diff --git a/html/images/attributes/src/points-negative-14-15.svg b/html/images/attributes/src/points-negative-14-15.svg new file mode 100644 index 0000000000000..7bb8d90e15907 --- /dev/null +++ b/html/images/attributes/src/points-negative-14-15.svg @@ -0,0 +1,17 @@ + + + \ No newline at end of file diff --git a/html/images/attributes/src/points-negative-14-20.svg b/html/images/attributes/src/points-negative-14-20.svg new file mode 100644 index 0000000000000..9eb5c161edf71 --- /dev/null +++ b/html/images/attributes/src/points-negative-14-20.svg @@ -0,0 +1,17 @@ + + + \ No newline at end of file diff --git a/html/images/attributes/src/points-negative-15-15.svg b/html/images/attributes/src/points-negative-15-15.svg new file mode 100644 index 0000000000000..309884324ff3d --- /dev/null +++ b/html/images/attributes/src/points-negative-15-15.svg @@ -0,0 +1,17 @@ + + + \ No newline at end of file diff --git a/html/images/attributes/src/points-negative-15-20.svg b/html/images/attributes/src/points-negative-15-20.svg new file mode 100644 index 0000000000000..05cd305c969bf --- /dev/null +++ b/html/images/attributes/src/points-negative-15-20.svg @@ -0,0 +1,17 @@ + + + \ No newline at end of file diff --git a/html/images/attributes/src/points-negative-16-20.svg b/html/images/attributes/src/points-negative-16-20.svg new file mode 100644 index 0000000000000..c36c36cf4d615 --- /dev/null +++ b/html/images/attributes/src/points-negative-16-20.svg @@ -0,0 +1,17 @@ + + + \ No newline at end of file diff --git a/html/images/attributes/src/points-negative-17-20.svg b/html/images/attributes/src/points-negative-17-20.svg new file mode 100644 index 0000000000000..eb8e37c0c97a3 --- /dev/null +++ b/html/images/attributes/src/points-negative-17-20.svg @@ -0,0 +1,17 @@ + + + \ No newline at end of file diff --git a/html/images/attributes/src/points-negative-18-20.svg b/html/images/attributes/src/points-negative-18-20.svg new file mode 100644 index 0000000000000..bef639d406973 --- /dev/null +++ b/html/images/attributes/src/points-negative-18-20.svg @@ -0,0 +1,17 @@ + + + \ No newline at end of file diff --git a/html/images/attributes/src/points-negative-19-20.svg b/html/images/attributes/src/points-negative-19-20.svg new file mode 100644 index 0000000000000..abe737b00a60f --- /dev/null +++ b/html/images/attributes/src/points-negative-19-20.svg @@ -0,0 +1,17 @@ + + + \ No newline at end of file diff --git a/html/images/attributes/src/points-negative-2-10.svg b/html/images/attributes/src/points-negative-2-10.svg new file mode 100644 index 0000000000000..15645198809b5 --- /dev/null +++ b/html/images/attributes/src/points-negative-2-10.svg @@ -0,0 +1,17 @@ + + + \ No newline at end of file diff --git a/html/images/attributes/src/points-negative-2-15.svg b/html/images/attributes/src/points-negative-2-15.svg new file mode 100644 index 0000000000000..a2302db67f90f --- /dev/null +++ b/html/images/attributes/src/points-negative-2-15.svg @@ -0,0 +1,17 @@ + + + \ No newline at end of file diff --git a/html/images/attributes/src/points-negative-2-20.svg b/html/images/attributes/src/points-negative-2-20.svg new file mode 100644 index 0000000000000..f58aa71d6b019 --- /dev/null +++ b/html/images/attributes/src/points-negative-2-20.svg @@ -0,0 +1,17 @@ + + + \ No newline at end of file diff --git a/html/images/attributes/src/points-negative-2-4.svg b/html/images/attributes/src/points-negative-2-4.svg new file mode 100644 index 0000000000000..4594a1aff2d21 --- /dev/null +++ b/html/images/attributes/src/points-negative-2-4.svg @@ -0,0 +1,17 @@ + + + \ No newline at end of file diff --git a/html/images/attributes/src/points-negative-20-20.svg b/html/images/attributes/src/points-negative-20-20.svg new file mode 100644 index 0000000000000..a3badc673a461 --- /dev/null +++ b/html/images/attributes/src/points-negative-20-20.svg @@ -0,0 +1,17 @@ + + + \ No newline at end of file diff --git a/html/images/attributes/src/points-negative-3-10.svg b/html/images/attributes/src/points-negative-3-10.svg new file mode 100644 index 0000000000000..01f7b4ae031d6 --- /dev/null +++ b/html/images/attributes/src/points-negative-3-10.svg @@ -0,0 +1,17 @@ + + + \ No newline at end of file diff --git a/html/images/attributes/src/points-negative-3-15.svg b/html/images/attributes/src/points-negative-3-15.svg new file mode 100644 index 0000000000000..508c579c806e8 --- /dev/null +++ b/html/images/attributes/src/points-negative-3-15.svg @@ -0,0 +1,17 @@ + + + \ No newline at end of file diff --git a/html/images/attributes/src/points-negative-3-20.svg b/html/images/attributes/src/points-negative-3-20.svg new file mode 100644 index 0000000000000..bb7cf1fcf884e --- /dev/null +++ b/html/images/attributes/src/points-negative-3-20.svg @@ -0,0 +1,17 @@ + + + \ No newline at end of file diff --git a/html/images/attributes/src/points-negative-3-4.svg b/html/images/attributes/src/points-negative-3-4.svg new file mode 100644 index 0000000000000..a704ec9875061 --- /dev/null +++ b/html/images/attributes/src/points-negative-3-4.svg @@ -0,0 +1,17 @@ + + + \ No newline at end of file diff --git a/html/images/attributes/src/points-negative-4-10.svg b/html/images/attributes/src/points-negative-4-10.svg new file mode 100644 index 0000000000000..365e2bea45601 --- /dev/null +++ b/html/images/attributes/src/points-negative-4-10.svg @@ -0,0 +1,17 @@ + + + \ No newline at end of file diff --git a/html/images/attributes/src/points-negative-4-15.svg b/html/images/attributes/src/points-negative-4-15.svg new file mode 100644 index 0000000000000..a44d1192547d4 --- /dev/null +++ b/html/images/attributes/src/points-negative-4-15.svg @@ -0,0 +1,17 @@ + + + \ No newline at end of file diff --git a/html/images/attributes/src/points-negative-4-20.svg b/html/images/attributes/src/points-negative-4-20.svg new file mode 100644 index 0000000000000..426644bf384f7 --- /dev/null +++ b/html/images/attributes/src/points-negative-4-20.svg @@ -0,0 +1,17 @@ + + + \ No newline at end of file diff --git a/html/images/attributes/src/points-negative-4-4.svg b/html/images/attributes/src/points-negative-4-4.svg new file mode 100644 index 0000000000000..7b1da491be5df --- /dev/null +++ b/html/images/attributes/src/points-negative-4-4.svg @@ -0,0 +1,17 @@ + + + \ No newline at end of file diff --git a/html/images/attributes/src/points-negative-5-10.svg b/html/images/attributes/src/points-negative-5-10.svg new file mode 100644 index 0000000000000..aa1856bad3380 --- /dev/null +++ b/html/images/attributes/src/points-negative-5-10.svg @@ -0,0 +1,17 @@ + + + \ No newline at end of file diff --git a/html/images/attributes/src/points-negative-5-15.svg b/html/images/attributes/src/points-negative-5-15.svg new file mode 100644 index 0000000000000..c1de5699a678e --- /dev/null +++ b/html/images/attributes/src/points-negative-5-15.svg @@ -0,0 +1,17 @@ + + + \ No newline at end of file diff --git a/html/images/attributes/src/points-negative-5-20.svg b/html/images/attributes/src/points-negative-5-20.svg new file mode 100644 index 0000000000000..301cd3befce93 --- /dev/null +++ b/html/images/attributes/src/points-negative-5-20.svg @@ -0,0 +1,17 @@ + + + \ No newline at end of file diff --git a/html/images/attributes/src/points-negative-6-10.svg b/html/images/attributes/src/points-negative-6-10.svg new file mode 100644 index 0000000000000..6cd9e0e26ca10 --- /dev/null +++ b/html/images/attributes/src/points-negative-6-10.svg @@ -0,0 +1,17 @@ + + + \ No newline at end of file diff --git a/html/images/attributes/src/points-negative-6-15.svg b/html/images/attributes/src/points-negative-6-15.svg new file mode 100644 index 0000000000000..cf432838ed6b3 --- /dev/null +++ b/html/images/attributes/src/points-negative-6-15.svg @@ -0,0 +1,17 @@ + + + \ No newline at end of file diff --git a/html/images/attributes/src/points-negative-6-20.svg b/html/images/attributes/src/points-negative-6-20.svg new file mode 100644 index 0000000000000..4e723be36b262 --- /dev/null +++ b/html/images/attributes/src/points-negative-6-20.svg @@ -0,0 +1,17 @@ + + + \ No newline at end of file diff --git a/html/images/attributes/src/points-negative-7-10.svg b/html/images/attributes/src/points-negative-7-10.svg new file mode 100644 index 0000000000000..a30a376ec927c --- /dev/null +++ b/html/images/attributes/src/points-negative-7-10.svg @@ -0,0 +1,17 @@ + + + \ No newline at end of file diff --git a/html/images/attributes/src/points-negative-7-15.svg b/html/images/attributes/src/points-negative-7-15.svg new file mode 100644 index 0000000000000..eeef92340a27d --- /dev/null +++ b/html/images/attributes/src/points-negative-7-15.svg @@ -0,0 +1,17 @@ + + + \ No newline at end of file diff --git a/html/images/attributes/src/points-negative-7-20.svg b/html/images/attributes/src/points-negative-7-20.svg new file mode 100644 index 0000000000000..761524436645c --- /dev/null +++ b/html/images/attributes/src/points-negative-7-20.svg @@ -0,0 +1,17 @@ + + + \ No newline at end of file diff --git a/html/images/attributes/src/points-negative-8-10.svg b/html/images/attributes/src/points-negative-8-10.svg new file mode 100644 index 0000000000000..974e4bebc5e7e --- /dev/null +++ b/html/images/attributes/src/points-negative-8-10.svg @@ -0,0 +1,17 @@ + + + \ No newline at end of file diff --git a/html/images/attributes/src/points-negative-8-15.svg b/html/images/attributes/src/points-negative-8-15.svg new file mode 100644 index 0000000000000..0a73c260d77bb --- /dev/null +++ b/html/images/attributes/src/points-negative-8-15.svg @@ -0,0 +1,17 @@ + + + \ No newline at end of file diff --git a/html/images/attributes/src/points-negative-8-20.svg b/html/images/attributes/src/points-negative-8-20.svg new file mode 100644 index 0000000000000..aca40e1769f91 --- /dev/null +++ b/html/images/attributes/src/points-negative-8-20.svg @@ -0,0 +1,17 @@ + + + \ No newline at end of file diff --git a/html/images/attributes/src/points-negative-9-10.svg b/html/images/attributes/src/points-negative-9-10.svg new file mode 100644 index 0000000000000..97af0f992026c --- /dev/null +++ b/html/images/attributes/src/points-negative-9-10.svg @@ -0,0 +1,17 @@ + + + \ No newline at end of file diff --git a/html/images/attributes/src/points-negative-9-15.svg b/html/images/attributes/src/points-negative-9-15.svg new file mode 100644 index 0000000000000..197d08cf1ff81 --- /dev/null +++ b/html/images/attributes/src/points-negative-9-15.svg @@ -0,0 +1,17 @@ + + + \ No newline at end of file diff --git a/html/images/attributes/src/points-negative-9-20.svg b/html/images/attributes/src/points-negative-9-20.svg new file mode 100644 index 0000000000000..854035d3de9ed --- /dev/null +++ b/html/images/attributes/src/points-negative-9-20.svg @@ -0,0 +1,17 @@ + + + \ No newline at end of file diff --git a/html/images/attributes/src/points-positive-0-5.svg b/html/images/attributes/src/points-positive-0-5.svg new file mode 100644 index 0000000000000..380728052addd --- /dev/null +++ b/html/images/attributes/src/points-positive-0-5.svg @@ -0,0 +1,17 @@ + + + \ No newline at end of file diff --git a/html/images/attributes/src/points-positive-0-6.svg b/html/images/attributes/src/points-positive-0-6.svg new file mode 100644 index 0000000000000..3bafaa7095ec7 --- /dev/null +++ b/html/images/attributes/src/points-positive-0-6.svg @@ -0,0 +1,17 @@ + + + \ No newline at end of file diff --git a/html/images/attributes/src/points-positive-0-7.svg b/html/images/attributes/src/points-positive-0-7.svg new file mode 100644 index 0000000000000..e329fded0a130 --- /dev/null +++ b/html/images/attributes/src/points-positive-0-7.svg @@ -0,0 +1,17 @@ + + + \ No newline at end of file diff --git a/html/images/attributes/src/points-positive-1-5.svg b/html/images/attributes/src/points-positive-1-5.svg new file mode 100644 index 0000000000000..f6a4e4d0a2f3c --- /dev/null +++ b/html/images/attributes/src/points-positive-1-5.svg @@ -0,0 +1,17 @@ + + + \ No newline at end of file diff --git a/html/images/attributes/src/points-positive-1-6.svg b/html/images/attributes/src/points-positive-1-6.svg new file mode 100644 index 0000000000000..2e2cb6eac7cf8 --- /dev/null +++ b/html/images/attributes/src/points-positive-1-6.svg @@ -0,0 +1,17 @@ + + + \ No newline at end of file diff --git a/html/images/attributes/src/points-positive-1-7.svg b/html/images/attributes/src/points-positive-1-7.svg new file mode 100644 index 0000000000000..f09e6e619e58d --- /dev/null +++ b/html/images/attributes/src/points-positive-1-7.svg @@ -0,0 +1,17 @@ + + + \ No newline at end of file diff --git a/html/images/attributes/src/points-positive-2-5.svg b/html/images/attributes/src/points-positive-2-5.svg new file mode 100644 index 0000000000000..50977fa77703b --- /dev/null +++ b/html/images/attributes/src/points-positive-2-5.svg @@ -0,0 +1,17 @@ + + + \ No newline at end of file diff --git a/html/images/attributes/src/points-positive-2-6.svg b/html/images/attributes/src/points-positive-2-6.svg new file mode 100644 index 0000000000000..6373d99bb826a --- /dev/null +++ b/html/images/attributes/src/points-positive-2-6.svg @@ -0,0 +1,17 @@ + + + \ No newline at end of file diff --git a/html/images/attributes/src/points-positive-2-7.svg b/html/images/attributes/src/points-positive-2-7.svg new file mode 100644 index 0000000000000..12fd429b6cfa2 --- /dev/null +++ b/html/images/attributes/src/points-positive-2-7.svg @@ -0,0 +1,17 @@ + + + \ No newline at end of file diff --git a/html/images/attributes/src/points-positive-3-5.svg b/html/images/attributes/src/points-positive-3-5.svg new file mode 100644 index 0000000000000..dd9bc5b735f36 --- /dev/null +++ b/html/images/attributes/src/points-positive-3-5.svg @@ -0,0 +1,17 @@ + + + \ No newline at end of file diff --git a/html/images/attributes/src/points-positive-3-6.svg b/html/images/attributes/src/points-positive-3-6.svg new file mode 100644 index 0000000000000..b087911e544f1 --- /dev/null +++ b/html/images/attributes/src/points-positive-3-6.svg @@ -0,0 +1,17 @@ + + + \ No newline at end of file diff --git a/html/images/attributes/src/points-positive-3-7.svg b/html/images/attributes/src/points-positive-3-7.svg new file mode 100644 index 0000000000000..1c7cb815e4051 --- /dev/null +++ b/html/images/attributes/src/points-positive-3-7.svg @@ -0,0 +1,17 @@ + + + \ No newline at end of file diff --git a/html/images/attributes/src/points-positive-4-5.svg b/html/images/attributes/src/points-positive-4-5.svg new file mode 100644 index 0000000000000..6a0cb62f1dbdf --- /dev/null +++ b/html/images/attributes/src/points-positive-4-5.svg @@ -0,0 +1,17 @@ + + + \ No newline at end of file diff --git a/html/images/attributes/src/points-positive-4-6.svg b/html/images/attributes/src/points-positive-4-6.svg new file mode 100644 index 0000000000000..01c27fd4407d3 --- /dev/null +++ b/html/images/attributes/src/points-positive-4-6.svg @@ -0,0 +1,17 @@ + + + \ No newline at end of file diff --git a/html/images/attributes/src/points-positive-4-7.svg b/html/images/attributes/src/points-positive-4-7.svg new file mode 100644 index 0000000000000..960af36636ab4 --- /dev/null +++ b/html/images/attributes/src/points-positive-4-7.svg @@ -0,0 +1,17 @@ + + + \ No newline at end of file diff --git a/html/images/attributes/src/points-positive-5-5.svg b/html/images/attributes/src/points-positive-5-5.svg new file mode 100644 index 0000000000000..617aef390a50d --- /dev/null +++ b/html/images/attributes/src/points-positive-5-5.svg @@ -0,0 +1,17 @@ + + + \ No newline at end of file diff --git a/html/images/attributes/src/points-positive-5-6.svg b/html/images/attributes/src/points-positive-5-6.svg new file mode 100644 index 0000000000000..bb306461d2a70 --- /dev/null +++ b/html/images/attributes/src/points-positive-5-6.svg @@ -0,0 +1,17 @@ + + + \ No newline at end of file diff --git a/html/images/attributes/src/points-positive-5-7.svg b/html/images/attributes/src/points-positive-5-7.svg new file mode 100644 index 0000000000000..81e52162d0424 --- /dev/null +++ b/html/images/attributes/src/points-positive-5-7.svg @@ -0,0 +1,17 @@ + + + \ No newline at end of file diff --git a/html/images/attributes/src/points-positive-6-6.svg b/html/images/attributes/src/points-positive-6-6.svg new file mode 100644 index 0000000000000..b37c45f0ff9ef --- /dev/null +++ b/html/images/attributes/src/points-positive-6-6.svg @@ -0,0 +1,17 @@ + + + \ No newline at end of file diff --git a/html/images/attributes/src/points-positive-6-7.svg b/html/images/attributes/src/points-positive-6-7.svg new file mode 100644 index 0000000000000..6525f0bc5abdb --- /dev/null +++ b/html/images/attributes/src/points-positive-6-7.svg @@ -0,0 +1,17 @@ + + + \ No newline at end of file diff --git a/html/images/attributes/src/points-positive-7-7.svg b/html/images/attributes/src/points-positive-7-7.svg new file mode 100644 index 0000000000000..0038af5c62efa --- /dev/null +++ b/html/images/attributes/src/points-positive-7-7.svg @@ -0,0 +1,17 @@ + + + \ No newline at end of file diff --git a/icons/circle-minus.svg b/icons/circle-minus.svg new file mode 100644 index 0000000000000..23f891427bb95 --- /dev/null +++ b/icons/circle-minus.svg @@ -0,0 +1,39 @@ + + + + + + diff --git a/icons/circle-plus.svg b/icons/circle-plus.svg new file mode 120000 index 0000000000000..06dbe2b627a5a --- /dev/null +++ b/icons/circle-plus.svg @@ -0,0 +1 @@ +material/add_circle.svg \ No newline at end of file diff --git a/icons/material/add_circle.svg b/icons/material/add_circle.svg new file mode 100644 index 0000000000000..238dd1c252c6a --- /dev/null +++ b/icons/material/add_circle.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/icons/material/nutrition.svg b/icons/material/nutrition.svg new file mode 100644 index 0000000000000..4ef7d26172df9 --- /dev/null +++ b/icons/material/nutrition.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/icons/nutrition.svg b/icons/nutrition.svg new file mode 120000 index 0000000000000..25da3e06af0d7 --- /dev/null +++ b/icons/nutrition.svg @@ -0,0 +1 @@ +material/nutrition.svg \ No newline at end of file diff --git a/lib/ProductOpener/Display.pm b/lib/ProductOpener/Display.pm index db209060cf439..e20d3a5da93ed 100644 --- a/lib/ProductOpener/Display.pm +++ b/lib/ProductOpener/Display.pm @@ -921,6 +921,16 @@ CSS }; } + if ($request_ref->{admin}) { + $knowledge_panels_options_ref->{admin} = 1; + } + if ($User{moderator}) { + $knowledge_panels_options_ref->{moderator} = 1; + } + if ($server_options{producers_platform}) { + $knowledge_panels_options_ref->{producers_platform} = 1; + } + $log->debug( "owner, org and user", { @@ -8874,7 +8884,7 @@ HTML return; } -=head2 display_nutriscore_calculation_details( $nutriscore_data_ref ) +=head2 display_nutriscore_calculation_details( $nutriscore_data_ref, $version = "2021" ) Generates HTML code with information on how the Nutri-Score was computed for a particular product. @@ -8883,7 +8893,7 @@ the rounded value according to the Nutri-Score rules, and the corresponding poin =cut -sub display_nutriscore_calculation_details ($nutriscore_data_ref) { +sub display_nutriscore_calculation_details ($nutriscore_data_ref, $version = "2021") { my $beverage_view; @@ -9070,7 +9080,7 @@ sub data_to_display_nutrient_levels ($product_ref) { return $result_data_ref; } -=head2 data_to_display_nutriscore ( $product_ref ) +=head2 data_to_display_nutriscore ($nutriscore_data_ref, $version = "2021" ) Generates a data structure to display the Nutri-Score. @@ -9086,9 +9096,7 @@ Reference to a data structure with needed data to display. =cut -sub data_to_display_nutriscore($) { - - my $product_ref = shift; +sub data_to_display_nutriscore ($product_ref, $version = "2021") { my $result_data_ref = {}; @@ -9096,9 +9104,17 @@ sub data_to_display_nutriscore($) { my @nutriscore_warnings = (); - if ((defined $product_ref->{nutrition_grade_fr}) and ($product_ref->{nutrition_grade_fr} =~ /^[abcde]$/)) { + my $nutriscore_grade = deep_get($product_ref, "nutriscore", $version, "grade"); + my $nutriscore_data_ref = deep_get($product_ref, "nutriscore", $version, "data"); + # On old product revisions, nutriscore grade was in nutrition_grade_fr + if ((not defined $nutriscore_grade) and ($version eq "2021")) { + $nutriscore_grade = $product_ref->{"nutrition_grade_fr"}; + $nutriscore_data_ref = $product_ref->{nutriscore_data}; + } + + if ((defined $nutriscore_grade) and ($nutriscore_grade =~ /^[abcde]$/)) { - $result_data_ref->{nutriscore_grade} = $product_ref->{"nutrition_grade_fr"}; + $result_data_ref->{nutriscore_grade} = $nutriscore_grade; # Do not display a warning for water if (not(has_tag($product_ref, "categories", "en:spring-waters"))) { @@ -9213,8 +9229,7 @@ sub data_to_display_nutriscore($) { # Display the details of the computation of the Nutri-Score if we computed one if ((defined $product_ref->{nutriscore_grade}) and ($product_ref->{nutriscore_grade} =~ /^[a-e]$/)) { - $result_data_ref->{nutriscore_details} - = display_nutriscore_calculation_details($product_ref->{nutriscore_data}); + $result_data_ref->{nutriscore_details} = display_nutriscore_calculation_details($nutriscore_data_ref, $version); } return $result_data_ref; diff --git a/lib/ProductOpener/Food.pm b/lib/ProductOpener/Food.pm index f7e526be62c49..45cff8e0d794e 100644 --- a/lib/ProductOpener/Food.pm +++ b/lib/ProductOpener/Food.pm @@ -1581,7 +1581,9 @@ sub compute_nutriscore_data ($product_ref, $prepared, $nutriments_field, $versio } else { # fruits, vegetables, legumes - 2023 - my $fruits_vegetables_legumes = compute_nutriscore_2023_fruits_vegetables_legumes($product_ref, $prepared); + my $fruits_vegetables_legumes + = round_to_max_decimal_places(compute_nutriscore_2023_fruits_vegetables_legumes($product_ref, $prepared), + 1); my $is_fat_oil_nuts_seeds = is_fat_oil_nuts_seeds_for_nutrition_score($product_ref); my $is_beverage = is_beverage_for_nutrition_score_2023($product_ref); @@ -1610,7 +1612,8 @@ sub compute_nutriscore_data ($product_ref, $prepared, $nutriments_field, $versio if ($is_fat_oil_nuts_seeds) { # Add the fat and saturated fat / fat ratio $nutriscore_data_ref->{fat} = $nutriments_ref->{"fat" . $prepared . "_100g"}; - $nutriscore_data_ref->{saturated_fat_ratio} = saturated_fat_ratio($nutriments_ref, $prepared); + $nutriscore_data_ref->{saturated_fat_ratio} + = round_to_max_decimal_places(saturated_fat_ratio($nutriments_ref, $prepared), 1); # Compute the energy from saturates if (defined $nutriscore_data_ref->{saturated_fat}) { $nutriscore_data_ref->{energy_from_saturated_fat} = $nutriscore_data_ref->{saturated_fat} * 37; diff --git a/lib/ProductOpener/KnowledgePanels.pm b/lib/ProductOpener/KnowledgePanels.pm index a17354ab553b1..66285776c00b9 100644 --- a/lib/ProductOpener/KnowledgePanels.pm +++ b/lib/ProductOpener/KnowledgePanels.pm @@ -357,7 +357,9 @@ sub create_panel_from_json_template ($panel_id, $panel_template, $panel_data_ref # Save the JSON file so that it can be more easily debugged, and that we can monitor issues my $target_dir = "$BASE_DIRS{PUBLIC_FILES}/debug/knowledge_panels/"; - my $target_file = "$target_dir/$panel_id." . $product_ref->{code} . ".json"; + my $filename = $panel_id . $product_ref->{code} . ".json"; + my $target_file = "$target_dir/" . $filename; + my $url = "/files/debug/knowledge_panels/" . $filename; ensure_dir_created_or_die($target_dir); open(my $out, ">:encoding(UTF-8)", $target_file) or die "cannot open $target_file"; print $out $panel_json; @@ -367,7 +369,7 @@ sub create_panel_from_json_template ($panel_id, $panel_template, $panel_data_ref "template" => $panel_template, "json_error" => $json_decode_error, "json" => $panel_json, - "json_debug_url" => $static_subdomain . $target_file + "json_debug_url" => $static_subdomain . $url }; } } @@ -810,6 +812,9 @@ sub create_health_card_panel ($product_ref, $target_lc, $target_cc, $options_ref $log->debug("create health card panel", {code => $product_ref->{code}}) if $log->is_debug(); create_nutriscore_panel($product_ref, $target_lc, $target_cc, $options_ref); + if ($options_ref->{admin} || $options_ref->{moderator} || $options_ref->{producers_platform}) { + create_nutriscore_2023_panel($product_ref, $target_lc, $target_cc, $options_ref); + } create_nutrient_levels_panels($product_ref, $target_lc, $target_cc, $options_ref); @@ -882,6 +887,67 @@ sub create_nutriscore_panel ($product_ref, $target_lc, $target_cc, $options_ref) return; } +sub create_nutriscore_2023_panel ($product_ref, $target_lc, $target_cc, $options_ref) { + + my $version = "2023"; + + $log->debug("create nutriscore_2023 panel", + {code => $product_ref->{code}, nutriscore_data => deep_get($product_ref, qw/nutriscore 2023 data/)}) + if $log->is_debug(); + + my $panel_data_ref = data_to_display_nutriscore($product_ref, $version); + + # Nutri-Score panel + my $grade = deep_get($product_ref, "nutriscore", $version, "grade"); + + if ($grade eq "not-applicable") { + $panel_data_ref->{title} = lang_in_other_lc($target_lc, "attribute_nutriscore_not_applicable_title"); + } + else { + $panel_data_ref->{title} + = sprintf(lang_in_other_lc($target_lc, "attribute_nutriscore_grade_title"), uc($grade)); + if ($panel_data_ref->{nutriscore_unknown_reason_short}) { + $panel_data_ref->{subtitle} = $panel_data_ref->{nutriscore_unknown_reason_short}; + } + else { + $panel_data_ref->{subtitle} = lang_in_other_lc($target_lc, + "attribute_nutriscore_" . $panel_data_ref->{nutriscore_grade} . "_description_short"); + } + } + + # Nutri-Score sub-panels for each positive or negative component + foreach my $type (qw/positive negative/) { + my $components_ref = deep_get($product_ref, "nutriscore", $version, "data", "components", $type) // []; + foreach my $component_ref (@$components_ref) { + + my $component_panel_data_ref = { + "type" => $type, + "id" => $component_ref->{id}, + "value" => $component_ref->{value}, + "unit" => $component_ref->{unit}, + "points" => $component_ref->{points}, + "points_max" => $component_ref->{points_max}, + }; + create_panel_from_json_template( + "nutriscore_component_" . $component_ref->{id}, + "api/knowledge-panels/health/nutriscore/nutriscore_component.tt.json", + $component_panel_data_ref, $product_ref, $target_lc, $target_cc, $options_ref + ); + } + } + + # Nutri-Score panel: score + create_panel_from_json_template("nutriscore_2023", "api/knowledge-panels/health/nutriscore/nutriscore_2023.tt.json", + $panel_data_ref, $product_ref, $target_lc, $target_cc, $options_ref); + create_panel_from_json_template("nutriscore_description", + "api/knowledge-panels/health/nutriscore/nutriscore_description.tt.json", + $panel_data_ref, $product_ref, $target_lc, $target_cc, $options_ref); + create_panel_from_json_template("nutriscore_details", + "api/knowledge-panels/health/nutriscore/nutriscore_details.tt.json", + $panel_data_ref, $product_ref, $target_lc, $target_cc, $options_ref); + return; +} + =head2 create_nutrient_levels_panels ( $product_ref, $target_lc, $target_cc, $options_ref ) Creates knowledge panels for nutrient levels for fat, saturated fat, sugars and salt. @@ -919,6 +985,10 @@ sub create_nutrient_levels_panels ($product_ref, $target_lc, $target_cc, $option $nutrient_level_ref, $product_ref, $target_lc, $target_cc, $options_ref ); } + + create_panel_from_json_template("nutrient_levels", + "api/knowledge-panels/health/nutrition/nutrient_levels.tt.json", + {}, $product_ref, $target_lc, $target_cc, $options_ref); } return; } diff --git a/lib/ProductOpener/Numbers.pm b/lib/ProductOpener/Numbers.pm index c30d6ce211605..6ff18945256b9 100644 --- a/lib/ProductOpener/Numbers.pm +++ b/lib/ProductOpener/Numbers.pm @@ -41,6 +41,7 @@ BEGIN { &remove_insignificant_digits &convert_string_to_number $number_regexp + &round_to_max_decimal_places ); # symbols to export on request %EXPORT_TAGS = (all => [@EXPORT_OK]); @@ -153,5 +154,19 @@ sub convert_string_to_number ($value) { return $value; } +=head2 round_to_max_decimal_places($value, $max_decimal_places) + +Round a number to a maximum number of decimal places. + +=cut + +sub round_to_max_decimal_places ($value, $max_decimal_places) { + + # Round to the maximum number of decimal places + my $rounded_value = sprintf("%.${max_decimal_places}f", $value); + + return $rounded_value + 0; +} + 1; diff --git a/lib/ProductOpener/Nutriscore.pm b/lib/ProductOpener/Nutriscore.pm index b394204345a41..095fa2e77e289 100644 --- a/lib/ProductOpener/Nutriscore.pm +++ b/lib/ProductOpener/Nutriscore.pm @@ -98,6 +98,8 @@ BEGIN { use vars @EXPORT_OK; +use ProductOpener::Numbers qw/:all/; + =head1 FUNCTIONS Note: a significantly different Nutri-Score algorithm has been published in 2022 and 2023 @@ -170,8 +172,8 @@ Returned values: - [nutrient]_value -> rounded values for each nutrient according to the Nutri-Score rules - [nutrient]_points -> points for each nutrient -- negative_points -> sum of unfavorable nutrients points -- positive_points -> sum of favorable nutrients points +- negative_points -> sum of negative nutrients points +- positive_points -> sum of positive nutrients points The nutrients that are counted for the negative and positive points depend on the product type (if it is a beverage, cheese or fat) and on the values for some of the nutrients. @@ -392,7 +394,7 @@ sub compute_nutriscore_score_2021 ($nutriscore_data_ref) { } } - # Negative points + # negative points $nutriscore_data_ref->{negative_points} = 0; foreach my $nutrient ("energy", "sugars", $saturated_fat, "sodium") { @@ -516,9 +518,9 @@ Returned values: - [nutrient]_value -> rounded values for each nutrient according to the Nutri-Score rules - [nutrient]_points -> points for each nutrient - negative_nutrients -> list of nutrients that are counted in negative points -- negative_points -> sum of unfavorable nutrients points +- negative_points -> sum of negative nutrients points - positive_nutrients -> list of nutrients that are counted in positive points -- positive_points -> sum of favorable nutrients points +- positive_points -> sum of positive nutrients points - count_proteins -> indicates if proteins are counted in the positive points - count_proteins_reason -> indicates why proteins are counted @@ -563,8 +565,7 @@ my %points_thresholds_2023 = ( sugars => [3.4, 6.8, 10, 14, 17, 20, 24, 27, 31, 34, 37, 41, 44, 48, 51], # g / 100g sugars_beverages => [0.5, 2, 3.5, 5, 6, 7, 8, 9, 10, 11], # g / 100g or 100ml saturated_fat => [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], # g / 100g - salt => [0.2, 0.4, 0.6, 0.8, 1, 1.2, 1.4, 1.6, 1.8, 2, 2.2, 2.4, 2.6, 2.8, 3, 3.2, 3.2, 3.4, 3.6, 3.8, 4] - , # g / 100g + salt => [0.2, 0.4, 0.6, 0.8, 1, 1.2, 1.4, 1.6, 1.8, 2, 2.2, 2.4, 2.6, 2.8, 3, 3.2, 3.4, 3.6, 3.8, 4], # g / 100g # for fats energy_from_saturated_fat => [120, 240, 360, 480, 600, 720, 840, 960, 1080, 1200], # g / 100g @@ -659,6 +660,37 @@ sub get_value_with_one_more_positive_point_2023 ($nutriscore_data_ref, $nutrient return $return_value; } +sub add_units_to_positive_and_negative_nutriscore_components ($nutriscore_data_ref) { + + foreach my $type (qw/positive negative/) { + my $components_ref = $nutriscore_data_ref->{components}{$type}; + + foreach my $component_ref (@$components_ref) { + # Compute the unit. + my $unit; + if ($component_ref->{id} eq 'non_nutritive_sweeteners') { + $unit = undef; + } + elsif (($component_ref->{id} eq 'fruits_vegetables_legumes') + or ($component_ref->{id} eq 'saturated_fat_ratio')) + { + $unit = '%'; + } + else { + if ($component_ref->{id} =~ /^energy/) { + $unit = 'kJ'; + } + else { + $unit = 'g'; + } + } + $component_ref->{unit} = $unit; + } + } + + return; +} + sub compute_nutriscore_score_2023 ($nutriscore_data_ref) { # The values must be rounded with one more digit than the thresholds. @@ -707,6 +739,9 @@ sub compute_nutriscore_score_2023 ($nutriscore_data_ref) { $nutriscore_data_ref->{$nutrient . "_points"}++; } } + + # max number of squares in the gauge we will display to user for this nutrient + $nutriscore_data_ref->{$nutrient . "_points_max"} = scalar @{$points_thresholds_2023{$nutrient_threshold_id}}; } # For red meat products, the number of maximum protein points is set at 2 points @@ -718,31 +753,55 @@ sub compute_nutriscore_score_2023 ($nutriscore_data_ref) { $nutriscore_data_ref->{proteins_points_limited_reason} = "red_meat_product"; } + # Store the lists of negative and positive components retained for the Nutri-Score of the product + + $nutriscore_data_ref->{components} = { + negative => [], + positive => [], + }; + + # negative points + # We need to compute negative points first, as proteins may not be counted in the positive points + # depending on the total of negative points + + my $negative_components = [$energy, "sugars", $saturated_fat, "salt"]; + # Beverages with non-nutritive sweeteners have 4 extra negative points if ($nutriscore_data_ref->{is_beverage}) { + push @$negative_components, "non_nutritive_sweeteners"; + $nutriscore_data_ref->{non_nutritive_sweeteners_max} = 4; if ($nutriscore_data_ref->{with_non_nutritive_sweeteners}) { - $nutriscore_data_ref->{"non_nutritive_sweeteners_points"} = 4; + $nutriscore_data_ref->{non_nutritive_sweeteners_points} = 4; + $nutriscore_data_ref->{non_nutritive_sweeteners} = "presence"; } else { - $nutriscore_data_ref->{"non_nutritive_sweeteners_points"} = 0; + $nutriscore_data_ref->{non_nutritive_sweeteners_points} = 0; + $nutriscore_data_ref->{non_nutritive_sweeteners} = "absence"; } } - # Negative points - - $nutriscore_data_ref->{negative_nutrients} - = [$energy, "sugars", $saturated_fat, "salt", "non_nutritive_sweeteners"]; $nutriscore_data_ref->{negative_points} = 0; - foreach my $nutrient (@{$nutriscore_data_ref->{negative_nutrients}}) { - $nutriscore_data_ref->{negative_points} += ($nutriscore_data_ref->{$nutrient . "_points"} || 0); + + foreach my $nutrient (@$negative_components) { + my $points = ($nutriscore_data_ref->{$nutrient . "_points"} || 0); + my $points_max = $nutriscore_data_ref->{$nutrient . "_points_max"}; + push @{$nutriscore_data_ref->{components}{negative}}, + { + id => $nutrient, + value => round_to_max_decimal_places($nutriscore_data_ref->{$nutrient}, 2), + points => $points, + points_max => $points_max, + }; + $nutriscore_data_ref->{negative_points} += $points; + $nutriscore_data_ref->{negative_points_max} += $points_max; } - # Positive points + # positive points $nutriscore_data_ref->{positive_points} = 0; - $nutriscore_data_ref->{positive_nutrients} = ["fruits_vegetables_legumes", "fiber"]; + $nutriscore_data_ref->{positive_nutrients} = ["fiber", "fruits_vegetables_legumes"]; - # Positive points for proteins are counted in the following 3 cases: + # positive points for proteins are counted in the following 3 cases: # - the product is a beverage # - the product is not in the fats, oils, nuts and seeds category # and the negative points are less than 11 or the product is a cheese @@ -765,7 +824,7 @@ sub compute_nutriscore_score_2023 ($nutriscore_data_ref) { $nutriscore_data_ref->{count_proteins_reason} = "negative_points_less_than_7"; } else { - $nutriscore_data_ref->{count_proteins_reason} = "negative_points_more_than_7"; + $nutriscore_data_ref->{count_proteins_reason} = "negative_points_greater_than_or_equal_to_7"; } } else { @@ -774,17 +833,44 @@ sub compute_nutriscore_score_2023 ($nutriscore_data_ref) { $nutriscore_data_ref->{count_proteins_reason} = "negative_points_less_than_11"; } else { - $nutriscore_data_ref->{count_proteins_reason} = "negative_points_more_than_11"; + $nutriscore_data_ref->{count_proteins_reason} = "negative_points_greater_than_or_equal_to_11"; } } } if ($nutriscore_data_ref->{count_proteins}) { - push @{$nutriscore_data_ref->{positive_nutrients}}, "proteins"; + unshift @{$nutriscore_data_ref->{positive_nutrients}}, "proteins"; } foreach my $nutrient (@{$nutriscore_data_ref->{positive_nutrients}}) { - $nutriscore_data_ref->{positive_points} += ($nutriscore_data_ref->{$nutrient . "_points"} || 0); + my $points = ($nutriscore_data_ref->{$nutrient . "_points"} || 0); + my $points_max = $nutriscore_data_ref->{$nutrient . "_points_max"}; + push @{$nutriscore_data_ref->{components}{positive}}, + { + id => $nutrient, + value => round_to_max_decimal_places($nutriscore_data_ref->{$nutrient}, 2), + points => $points, + points_max => $points_max, + }; + $nutriscore_data_ref->{positive_points} += $points; + $nutriscore_data_ref->{positive_points_max} += $points_max; + } + + # Add units for the retained positive and negative components + # We add the units directly in the data instead of computing them at runtime when needed + # in order to make the data more easily understood by itself + add_units_to_positive_and_negative_nutriscore_components($nutriscore_data_ref); + + # Delete input nutrient values, keep only values inside the retained positive and negative components + foreach my $key (keys %$nutriscore_data_ref) { + if ($key + =~ /^(energy|energy_from_saturated_fat|sugars|fat|saturated_fat|saturated_fat_ratio|salt|non_nutritive_sweeteners|fruits_vegetables_legumes|fiber|proteins)$/ + ) + { + delete $nutriscore_data_ref->{$key}; + delete $nutriscore_data_ref->{$key . "_points"}; + delete $nutriscore_data_ref->{$key . "_points_max"}; + } } my $score = $nutriscore_data_ref->{negative_points} - $nutriscore_data_ref->{positive_points}; diff --git a/po/common/common.pot b/po/common/common.pot index 50ed7c3979350..f8f452382fade 100644 --- a/po/common/common.pot +++ b/po/common/common.pot @@ -6652,3 +6652,149 @@ msgstr "Weight per 100g of product" msgctxt "weight_percent" msgid "Weight percent" msgstr "Weight percent" + +msgctxt "nutriscore_component_energy" +msgid "Energy" +msgstr "" + +msgctxt "nutriscore_component_energy_from_saturated_fat" +msgid "Energy from saturated fat" +msgstr "" + +msgctxt "nutriscore_component_sugars" +msgid "Sugars" +msgstr "" + +msgctxt "nutriscore_component_saturated_fat" +msgid "Saturated fat" +msgstr "" + +msgctxt "nutriscore_component_saturated_fat_ratio" +msgid "Saturated fat / fat" +msgstr "" + +msgctxt "nutriscore_component_salt" +msgid "Salt" +msgstr "" + +msgctxt "nutriscore_component_non_nutritive_sweeteners" +msgid "Non-nutritive sweeteners" +msgstr "" + +msgctxt "nutriscore_component_fruits_vegetables_legumes" +msgid "Fruits, vegetables and legumes" +msgstr "" + +msgctxt "nutriscore_component_fiber" +msgid "Fiber" +msgstr "" + +msgctxt "nutriscore_component_proteins" +msgid "Proteins" +msgstr "" + +msgctxt "presence" +msgid "Presence" +msgstr "" + +msgctxt "absence" +msgid "Absence" +msgstr "" + +msgctxt "nutriscore_is_water" +msgid "This product is considered to be water for the calculation of the Nutri-Score." +msgstr "" + +msgctxt "nutriscore_is_fat_oil_nuts_seeds" +msgid "This product is considered to be fat, oil, nuts or seeds for the calculation of the Nutri-Score." +msgstr "" + +msgctxt "nutriscore_is_cheese" +msgid "This product is considered to be cheese for the calculation of the Nutri-Score." +msgstr "" + +msgctxt "nutriscore_is_red_meat_product" +msgid "This product is considered to be a red meat product for the calculation of the Nutri-Score." +msgstr "" + +msgctxt "nutriscore_count_proteins_reason_beverage" +msgid "Points for proteins are counted because the product is considered to be a beverage." +msgstr "" + +msgctxt "nutriscore_count_proteins_reason_cheese" +msgid "Points for proteins are counted because the product is considered to be cheese." +msgstr "" + +msgctxt "nutriscore_count_proteins_reason_negative_points_less_than_7" +msgid "Points for proteins are counted because the negative points are less than 7." +msgstr "" + +msgctxt "nutriscore_count_proteins_reason_negative_points_less_than_11" +msgid "Points for proteins are counted because the negative points are less than 11." +msgstr "" + +msgctxt "nutriscore_count_proteins_reason_negative_points_greater_than_or_equal_to_7" +msgid "Points for proteins are not counted because the negative points greater than or equal to 7." +msgstr "" + +msgctxt "nutriscore_count_proteins_reason_negative_points_greater_than_or_equal_to_11" +msgid "Points for proteins are not counted because the negative points greater than or equal to 11." +msgstr "" + +msgctxt "nutriscore_explanation_what_it_is" +msgid "The Nutri-Score is a logo on the overall nutritional quality of products." +msgstr "The Nutri-Score is a logo on the overall nutritional quality of products." + +msgctxt "nutriscore_explanation_what_it_takes_into_account" +msgid "The score from A to E is calculated based on nutrients and foods to favor (proteins, fiber, fruits, vegetables and legumes ...) and nutrients to limit (calories, saturated fat, sugars, salt)." +msgstr "The score from A to E is calculated based on nutrients and foods to favor (proteins, fiber, fruits, vegetables and legumes ...) and nutrients to limit (calories, saturated fat, sugars, salt)." + +msgctxt "nutriscore_explanation_where_the_data_comes_from" +msgid "The score is calculated from the data of the nutrition facts table and the composition data (fruits, vegetables and legumes)." +msgstr "The score is calculated from the data of the nutrition facts table and the composition data (fruits, vegetables and legumes)." + +msgctxt "nutriscore_explanation_recommended_by_public_health_authorities" +msgid "The display of this logo is recommended by public health authorities without obligation for companies." +msgstr "The display of this logo is recommended by public health authorities without obligation for companies." + +msgctxt "nutriscore_explanation_title" +msgid "What is the Nutri-Score?" +msgstr "" + +# For benefits and risks of Nutri-Score components, see the "rationale" sections in the different Nutri-Score algorithms documents + +msgctxt "nutrient_info_energy_risk" +msgid "Energy intakes above energy requirements are associated with increased risks of weight gain, overweight, obesity, and consequently risk of diet-related chronic diseases." +msgstr "Energy intakes above energy requirements are associated with increased risks of weight gain, overweight, obesity, and consequently risk of diet-related chronic diseases." + +msgctxt "nutrient_info_saturated_fat_risk" +msgid "A high consumption of fat, especially saturated fats, can raise cholesterol, which increases the risk of heart diseases." +msgstr "A high consumption of fat, especially saturated fats, can raise cholesterol, which increases the risk of heart diseases." + +msgctxt "nutrient_info_saturated_fat_ratio_risk" +msgid "A high consumption of fat, especially saturated fats, can raise cholesterol, which increases the risk of heart diseases." +msgstr "A high consumption of fat, especially saturated fats, can raise cholesterol, which increases the risk of heart diseases." + +msgctxt "nutrient_info_energy_from_saturated_fat_risk" +msgid "A high consumption of fat, especially saturated fats, can raise cholesterol, which increases the risk of heart diseases." +msgstr "A high consumption of fat, especially saturated fats, can raise cholesterol, which increases the risk of heart diseases." + +# https://www.who.int/news/item/15-05-2023-who-advises-not-to-use-non-sugar-sweeteners-for-weight-control-in-newly-released-guideline + +msgctxt "nutrient_info_non_nutritive_sweeteners_risk" +msgid "Non-nutritive sweeteners may not confer any long-term benefit in reducing body fat in adults or children. There may be potential undesirable effects from long-term use of non-nutritive sweeteners, such as an increased risk of type 2 diabetes and cardiovascular diseases in adults." +msgstr "Non-nutritive sweeteners may not confer any long-term benefit in reducing body fat in adults or children. There may be potential undesirable effects from long-term use of non-nutritive sweeteners, such as an increased risk of type 2 diabetes and cardiovascular diseases in adults." + +msgctxt "nutrient_info_fiber_benefit" +msgid "Consuming foods rich in fiber (especially whole grain foods) reduces the risks of aerodigestive cancers, cardiovascular diseases, obesity and diabetes." +msgstr "Consuming foods rich in fiber (especially whole grain foods) reduces the risks of aerodigestive cancers, cardiovascular diseases, obesity and diabetes." + +msgctxt "nutrient_info_fruits_vegetables_legumes_benefit" +msgid "Consuming foods rich in fruits, vegetables and legumes reduces the risks of aerodigestive cancers, cardiovascular diseases, obesity and diabetes." +msgstr "Consuming foods rich in fruits, vegetables and legumes reduces the risks of aerodigestive cancers, cardiovascular diseases, obesity and diabetes." + +# Proteins are included in the Nutri-Score because they are a proxy for calcium and iron (there is no added benefit from consuming more proteins) + +msgctxt "nutrient_info_proteins_benefit" +msgid "Foods that are rich in proteins are usually rich in calcium or iron which are essential minerals with numerous health benefits." +msgstr "Foods that are rich in proteins are usually rich in calcium or iron which are essential minerals with numerous health benefits." \ No newline at end of file diff --git a/po/common/en.po b/po/common/en.po index 274fecf80abbd..624624a5b148b 100644 --- a/po/common/en.po +++ b/po/common/en.po @@ -6677,3 +6677,144 @@ msgctxt "weight_percent" msgid "Weight percent" msgstr "Weight percent" +msgctxt "nutriscore_component_energy" +msgid "Energy" +msgstr "Energy" + +msgctxt "nutriscore_component_energy_from_saturated_fat" +msgid "Energy from saturated fat" +msgstr "Energy from saturated fat" + +msgctxt "nutriscore_component_sugars" +msgid "Sugars" +msgstr "Sugars" + +msgctxt "nutriscore_component_saturated_fat" +msgid "Saturated fat" +msgstr "Saturated fat" + +msgctxt "nutriscore_component_saturated_fat_ratio" +msgid "Saturated fat / fat" +msgstr "Saturated fat / fat" + +msgctxt "nutriscore_component_salt" +msgid "Salt" +msgstr "Salt" + +msgctxt "nutriscore_component_non_nutritive_sweeteners" +msgid "Non-nutritive sweeteners" +msgstr "Non-nutritive sweeteners" + +msgctxt "nutriscore_component_fruits_vegetables_legumes" +msgid "Fruits, vegetables and legumes" +msgstr "Fruits, vegetables and legumes" + +msgctxt "nutriscore_component_fiber" +msgid "Fiber" +msgstr "Fiber" + +msgctxt "nutriscore_component_proteins" +msgid "Proteins" +msgstr "Proteins" + +msgctxt "presence" +msgid "Presence" +msgstr "Presence" + +msgctxt "absence" +msgid "Absence" +msgstr "Absence" + +msgctxt "nutriscore_is_water" +msgid "This product is considered to be water for the calculation of the Nutri-Score." +msgstr "This product is considered to be water for the calculation of the Nutri-Score." + +msgctxt "nutriscore_is_fat_oil_nuts_seeds" +msgid "This product is considered to be fat, oil, nuts or seeds for the calculation of the Nutri-Score." +msgstr "This product is considered to be fat, oil, nuts or seeds for the calculation of the Nutri-Score." + +msgctxt "nutriscore_is_cheese" +msgid "This product is considered to be cheese for the calculation of the Nutri-Score." +msgstr "This product is considered to be cheese for the calculation of the Nutri-Score." + +msgctxt "nutriscore_is_red_meat_product" +msgid "This product is considered to be a red meat product for the calculation of the Nutri-Score." +msgstr "This product is considered to be a red meat product for the calculation of the Nutri-Score." + +msgctxt "nutriscore_count_proteins_reason_beverage" +msgid "Points for proteins are counted because the product is considered to be a beverage." +msgstr "Points for proteins are counted because the product is considered to be a beverage." + +msgctxt "nutriscore_count_proteins_reason_cheese" +msgid "Points for proteins are counted because the product is considered to be cheese." +msgstr "Points for proteins are counted because the product is considered to be cheese." + +msgctxt "nutriscore_count_proteins_reason_negative_points_less_than_7" +msgid "Points for proteins are counted because the negative points are less than 7." +msgstr "Points for proteins are counted because the negative points are less than 7." + +msgctxt "nutriscore_count_proteins_reason_negative_points_less_than_11" +msgid "Points for proteins are counted because the negative points are less than 11." +msgstr "Points for proteins are counted because the negative points are less than 11." + +msgctxt "nutriscore_count_proteins_reason_negative_points_greater_than_or_equal_to_7" +msgid "Points for proteins are not counted because the negative points greater than or equal to 7." +msgstr "Points for proteins are not counted because the negative points greater than or equal to 7." + +msgctxt "nutriscore_count_proteins_reason_negative_points_greater_than_or_equal_to_11" +msgid "Points for proteins are not counted because the negative points greater than or equal to 11." +msgstr "Points for proteins are not counted because the negative points greater than or equal to 11." + +msgctxt "nutriscore_explanation_what_it_is" +msgid "The Nutri-Score is a logo on the overall nutritional quality of products." +msgstr "The Nutri-Score is a logo on the overall nutritional quality of products." + +msgctxt "nutriscore_explanation_what_it_takes_into_account" +msgid "The score from A to E is calculated based on nutrients and foods to favor (proteins, fiber, fruits, vegetables and legumes ...) and nutrients to limit (calories, saturated fat, sugars, salt)." +msgstr "The score from A to E is calculated based on nutrients and foods to favor (proteins, fiber, fruits, vegetables and legumes ...) and nutrients to limit (calories, saturated fat, sugars, salt)." + +msgctxt "nutriscore_explanation_where_the_data_comes_from" +msgid "The score is calculated from the data of the nutrition facts table and the composition data (fruits, vegetables and legumes)." +msgstr "The score is calculated from the data of the nutrition facts table and the composition data (fruits, vegetables and legumes)." + +msgctxt "nutriscore_explanation_recommended_by_public_health_authorities" +msgid "The display of this logo is recommended by public health authorities without obligation for companies." +msgstr "The display of this logo is recommended by public health authorities without obligation for companies." + +msgctxt "nutriscore_explanation_title" +msgid "What is the Nutri-Score?" +msgstr "What is the Nutri-Score?" + +msgctxt "nutrient_info_energy_risk" +msgid "Energy intakes above energy requirements are associated with increased risks of weight gain, overweight, obesity, and consequently risk of diet-related chronic diseases." +msgstr "Energy intakes above energy requirements are associated with increased risks of weight gain, overweight, obesity, and consequently risk of diet-related chronic diseases." + +msgctxt "nutrient_info_saturated_fat_risk" +msgid "A high consumption of fat, especially saturated fats, can raise cholesterol, which increases the risk of heart diseases." +msgstr "A high consumption of fat, especially saturated fats, can raise cholesterol, which increases the risk of heart diseases." + +msgctxt "nutrient_info_saturated_fat_ratio_risk" +msgid "A high consumption of fat, especially saturated fats, can raise cholesterol, which increases the risk of heart diseases." +msgstr "A high consumption of fat, especially saturated fats, can raise cholesterol, which increases the risk of heart diseases." + +msgctxt "nutrient_info_energy_from_saturated_fat_risk" +msgid "A high consumption of fat, especially saturated fats, can raise cholesterol, which increases the risk of heart diseases." +msgstr "A high consumption of fat, especially saturated fats, can raise cholesterol, which increases the risk of heart diseases." + +# https://www.who.int/news/item/15-05-2023-who-advises-not-to-use-non-sugar-sweeteners-for-weight-control-in-newly-released-guideline + +msgctxt "nutrient_info_non_nutritive_sweeteners_risk" +msgid "Non-nutritive sweeteners may not confer any long-term benefit in reducing body fat in adults or children. There may be potential undesirable effects from long-term use of non-nutritive sweeteners, such as an increased risk of type 2 diabetes and cardiovascular diseases in adults." +msgstr "Non-nutritive sweeteners may not confer any long-term benefit in reducing body fat in adults or children. There may be potential undesirable effects from long-term use of non-nutritive sweeteners, such as an increased risk of type 2 diabetes and cardiovascular diseases in adults." + +msgctxt "nutrient_info_fiber_benefit" +msgid "Consuming foods rich in fiber (especially whole grain foods) reduces the risks of aerodigestive cancers, cardiovascular diseases, obesity and diabetes." +msgstr "Consuming foods rich in fiber (especially whole grain foods) reduces the risks of aerodigestive cancers, cardiovascular diseases, obesity and diabetes." + +msgctxt "nutrient_info_fruits_vegetables_legumes_benefit" +msgid "Consuming foods rich in fruits, vegetables and legumes reduces the risks of aerodigestive cancers, cardiovascular diseases, obesity and diabetes." +msgstr "Consuming foods rich in fruits, vegetables and legumes reduces the risks of aerodigestive cancers, cardiovascular diseases, obesity and diabetes." + +msgctxt "nutrient_info_proteins_benefit" +msgid "Foods that are rich in proteins are usually rich in calcium or iron which are essential minerals with numerous health benefits." +msgstr "Foods that are rich in proteins are usually rich in calcium or iron which are essential minerals with numerous health benefits." diff --git a/po/common/fr.po b/po/common/fr.po index 63b304064ab6f..a9b5731c915ab 100644 --- a/po/common/fr.po +++ b/po/common/fr.po @@ -6671,3 +6671,110 @@ msgctxt "weight_percent" msgid "Weight percent" msgstr "Pourcentage du poids" +msgctxt "nutriscore_component_energy" +msgid "Energy" +msgstr "Energie" + +msgctxt "nutriscore_component_energy_from_saturated_fat" +msgid "Energy from saturated fat" +msgstr "Energie provenant des graisses saturées" + +msgctxt "nutriscore_component_sugars" +msgid "Sugars" +msgstr "Sucres" + +msgctxt "nutriscore_component_saturated_fat" +msgid "Saturated fat" +msgstr "Matières grasses saturées" + +msgctxt "nutriscore_component_saturated_fat_ratio" +msgid "Saturated fat / fat" +msgstr "Matières grasses saturées / matières grasses" + +msgctxt "nutriscore_component_salt" +msgid "Salt" +msgstr "Sel" + +msgctxt "nutriscore_component_non_nutritive_sweeteners" +msgid "Non-nutritive sweeteners" +msgstr "Edulcorants non-nutritifs" + +msgctxt "nutriscore_component_fruits_vegetables_legumes" +msgid "Fruits, vegetables and legumes" +msgstr "Fruits, légumes et légumineuses" + +msgctxt "nutriscore_component_fiber" +msgid "Fiber" +msgstr "Fibre" + +msgctxt "nutriscore_component_proteins" +msgid "Proteins" +msgstr "Protéines" + +msgctxt "presence" +msgid "Presence" +msgstr "Présence" + +msgctxt "absence" +msgid "Absence" +msgstr "Absence" + +msgctxt "nutriscore_is_water" +msgid "This product is considered to be water for the calculation of the Nutri-Score." +msgstr "Ce produit est considéré comme étant de l'eau pour le calcul du Nutri-Score." + +msgctxt "nutriscore_is_fat_oil_nuts_seeds" +msgid "This product is considered to be fat, oil, nuts or seeds for the calculation of the Nutri-Score." +msgstr "Ce produit est considéré comme étant une matière grasse, de l'huile, des noix ou des graines pour le calcul du Nutri-Score." + +msgctxt "nutriscore_is_cheese" +msgid "This product is considered to be cheese for the calculation of the Nutri-Score." +msgstr "Ce produit est considéré comme étant du fromage pour le calcul du Nutri-Score." + +msgctxt "nutriscore_is_red_meat_product" +msgid "This product is considered to be a red meat product for the calculation of the Nutri-Score." +msgstr "Ce produit est considéré comme étant un produit à base de viande rouge pour le calcul du Nutri-Score." + +msgctxt "nutriscore_count_proteins_reason_beverage" +msgid "Points for proteins are counted because the product is considered to be a beverage." +msgstr "Les points pour les protéines sont comptés car le produit est considéré comme étant une boisson." + +msgctxt "nutriscore_count_proteins_reason_cheese" +msgid "Points for proteins are counted because the product is considered to be cheese." +msgstr "Les points pour les protéines sont comptés car le produit est considéré comme étant du fromage." + +msgctxt "nutriscore_count_proteins_reason_negative_points_less_than_7" +msgid "Points for proteins are counted because the negative points are less than 7." +msgstr "Les points pour les protéines sont comptés car les points négatifs sont inférieurs à 7." + +msgctxt "nutriscore_count_proteins_reason_negative_points_less_than_11" +msgid "Points for proteins are counted because the negative points are less than 11." +msgstr "Les points pour les protéines sont comptés car les points négatifs sont inférieurs à 11." + +msgctxt "nutriscore_count_proteins_reason_negative_points_greater_than_or_equal_to_7" +msgid "Points for proteins are not counted because the negative points greater than or equal to 7." +msgstr "Les points pour les protéines ne sont pas comptés car les points négatifs sont supérieurs ou égaux à 7." + +msgctxt "nutriscore_count_proteins_reason_negative_points_greater_than_or_equal_to_11" +msgid "Points for proteins are not counted because the negative points greater than or equal to 11." +msgstr "Les points pour les protéines ne sont pas comptés car les points négatifs sont supérieurs ou égaux à 11." + +msgctxt "nutriscore_explanation_what_it_is" +msgid "The Nutri-Score is a logo on the overall nutritional quality of products." +msgstr "Le Nutri-Score est un logo sur la qualité nutritionnelle globale des produits." + +msgctxt "nutriscore_explanation_what_it_takes_into_account" +msgid "The score from A to E is calculated based on nutrients and foods to favor (proteins, fiber, fruits, vegetables and legumes ...) and nutrients to limit (calories, saturated fat, sugars, salt)." +msgstr "Le score de A à E est calculé en fonction des nutriments et aliments à favoriser (protéines, fibres, fruits et légumes, légumes secs…) et des nutriments à limiter (calories, matières grasses saturées, sucres, sel)." + +msgctxt "nutriscore_explanation_where_the_data_comes_from" +msgid "The score is calculated from the data of the nutrition facts table and the composition data (fruits, vegetables and legumes)." +msgstr "Le score est calculé à partir des données du tableau de la déclaration nutritionnelle et des données de composition (fruits, légumes et légumes secs)." + +msgctxt "nutriscore_explanation_recommended_by_public_health_authorities" +msgid "The display of this logo is recommended by public health authorities without obligation for companies." +msgstr "L'affichage de ce logo est recommandé par les pouvoirs publics sans obligation pour les entreprises." + +msgctxt "nutriscore_explanation_title" +msgid "What is the Nutri-Score?" +msgstr "Qu'est ce que le Nutri-Score ?" diff --git a/scripts/images/gen_svg_images_for_nutriscore_new_formula.pl b/scripts/images/gen_svg_images_for_nutriscore_new_formula.pl new file mode 100755 index 0000000000000..9f88a0e6968ee --- /dev/null +++ b/scripts/images/gen_svg_images_for_nutriscore_new_formula.pl @@ -0,0 +1,195 @@ +#!/usr/bin/perl -w + +# This file is part of Product Opener. +# +# Product Opener +# Copyright (C) 2011-2024 Association Open Food Facts +# Contact: contact@openfoodfacts.org +# Address: 21 rue des Iles, 94100 Saint-Maur des Fossés, France +# +# Product Opener is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + +=head1 NAME + +gen_svg_images_for_nutriscore_new_formula.pl - Add a "New formula" banner to Nutri-Score logos. + +=head1 DESCRIPTION + + + +=cut + +use ProductOpener::PerlStandards; +use ProductOpener::Config qw/:all/; + +# We will add a white rectangle below the Nutri-Score logo, and a blue banner with the "New formula" text +# We can have a different text for several languages + +my $new_formula_below = < +SVG + ; + +my $new_formula_banner = < +SVG + ; + +my %new_formula_text = ( + en => < + +SVG + , + fr => < +SVG + , +); + +# Read the Nutri-Score SVG images in the html/images/attributes/src directory +# and add a "New formula" banner to the Nutri-Score logos. + +my $dir = "$www_root/images/attributes/src"; + +my @files = glob "$dir/nutriscore-*.svg"; + +foreach my $lc ("en", "fr") { + + foreach my $file (@files) { + + # skip the Nutri-Score logo with the new formula banner + next if ($file =~ /new-formula/); + + my $new_file = $file; + $new_file =~ s/\.svg$/-new-formula-$lc.svg/; + + open(my $fh, "<", $file) or die "Could not open file $file: $!\n"; + open(my $fh2, ">", $new_file) or die "Could not open file $new_file: $!\n"; + + while (my $line = <$fh>) { + + if ($line =~ / + $line =~ s/height="130"/height="162"/; + $line =~ s/viewBox="0 0 240 130"/viewBox="0 0 240 162"/; + print $fh2 $line; + print $fh2 $new_formula_below; + } + elsif ($line =~ /<\/svg>/) { + # No banner for not-applicable / unknown + if ($file !~ /unknown|not-applicable/) { + print $fh2 $new_formula_banner; + print $fh2 $new_formula_text{$lc}; + } + print $fh2 $line; + } + else { + print $fh2 $line; + } + } + + close $fh; + close $fh2; + } +} + +exit(0); diff --git a/scripts/images/gen_svg_images_for_points.pl b/scripts/images/gen_svg_images_for_points.pl new file mode 100755 index 0000000000000..c00dd4dadfceb --- /dev/null +++ b/scripts/images/gen_svg_images_for_points.pl @@ -0,0 +1,124 @@ +#!/usr/bin/perl -w + +# This file is part of Product Opener. +# +# Product Opener +# Copyright (C) 2011-2024 Association Open Food Facts +# Contact: contact@openfoodfacts.org +# Address: 21 rue des Iles, 94100 Saint-Maur des Fossés, France +# +# Product Opener is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + +=head1 NAME + +gen_svg_images_for_points.pl - Generates SVG images for positive or negative points for Nutri-Score components + +=head1 DESCRIPTION + +Each image has a number of squares corresponding to the maximum number of points for the component. +The number of squares filled in green or red (for positive or negative points) corresponds to the number of points for the product. +The remaining squares are filled in grey. + +=cut + +use ProductOpener::PerlStandards; + +# Each square is 6x6 pixels, squares are separated by 1 pixel +# Squares are displayed in one or two rows, with at most 10 squares per row +# The rows are centered vertically in the image +# There is extra padding on top and bottom, so that the image is high enough + +sub generate_image ($dir, $type, $points, $max) { + + my $image = < + +SVG + ; + my $x = 0; + my $y = 11; + # If there is only one row, center it vertically + if ($max <= 10) { + $y += 3; + } + my $row = 0; + + for (my $i = 0; $i < $max; $i++) { + + my $color = "#BDBDBD"; + if ($i < $points) { + if ($type eq "positive") { + $color = "#219653"; + } + elsif ($type eq "negative") { + $color = "#EB5757"; + } + } + + $image .= ""; + + $x += 7; + if ($x >= 69) { + $x = 0; + $y += 7; + $row++; + } + } + + $image .= ""; + + my $filename = "$dir/points-$type-$points-$max.svg"; + open(my $file, ">:encoding(UTF-8)", $filename); + print $file $image; + close($file); + + return; +} + +# Different maximum points used for Nutri-Score components +my @max_negative_points = (4, 10, 15, 20); +my @max_positive_points = (5, 6, 7,); + +# Usage: gen_svg_images_for_points.pl [path to directory to save the images] +my $dir = shift @ARGV; + +# Generate images for negative points +foreach my $max (@max_negative_points) { + for (my $points = 0; $points <= $max; $points++) { + generate_image($dir, "negative", $points, $max); + } +} + +# Generate images for positive points +foreach my $max (@max_positive_points) { + for (my $points = 0; $points <= $max; $points++) { + generate_image($dir, "positive", $points, $max); + } +} + +exit(0); diff --git a/scripts/images/nutriscore-new-formula-source.svg b/scripts/images/nutriscore-new-formula-source.svg new file mode 100644 index 0000000000000..6e8013a614a09 --- /dev/null +++ b/scripts/images/nutriscore-new-formula-source.svg @@ -0,0 +1,212 @@ + +NEW FORMULA diff --git a/stop_words.txt b/stop_words.txt index e2c33370d098d..a2e6d44a0f0e8 100644 --- a/stop_words.txt +++ b/stop_words.txt @@ -109,6 +109,7 @@ gif glycérol gnumeric greated +grey GSDN gtin hardcoded @@ -242,6 +243,7 @@ subfield submodule submodules sucre +SVG tagid TAGID tagtype diff --git a/templates/api/knowledge-panels/health/nutriscore/nutriscore_2023.tt.json b/templates/api/knowledge-panels/health/nutriscore/nutriscore_2023.tt.json new file mode 100644 index 0000000000000..3f5d06bfaf086 --- /dev/null +++ b/templates/api/knowledge-panels/health/nutriscore/nutriscore_2023.tt.json @@ -0,0 +1,79 @@ +{ + "level": "info", + "topics": [ + "health" + ], + "title_element": { + "icon_url": "[% static_subdomain %]/images/attributes/dist/nutriscore-[% panel.nutriscore_grade %]-new-formula-[% IF lc == "fr" %][% lc %][% ELSE %]en[% END %].svg", + "title": "[% panel.title %]", + "subtitle": "[% panel.subtitle %]", + "type": "grade", + "grade": "[% panel.nutriscore_grade %]", + }, + "elements": [ + // Explanation of Nutri-Score + { + "element_type": "panel", + "panel_element": { + "panel_id": "nutriscore_description", + }, + }, + // Display actions if we are missing data to compute the Nutri-Score + [% IF panel.nutriscore_unknown_reason %] + { + "element_type": "action", + "action_element": { + "html": `[% lang("actions_to_compute_nutriscore") %]`, + "actions": [ + [% IF panel.nutriscore_unknown_reason == "missing_category" %] + "add_categories" + [% ELSIF panel.nutriscore_unknown_reason == "missing_nutrition_data" %] + "add_nutrition_facts" + [% ELSIF panel.nutriscore_unknown_reason == "missing_category_and_nutrition_data" %] + "add_categories", + "add_nutrition_facts" + [% END %] + ] + } + }, + [% END %] + // Start with negative points first, as the positive points depend on negative points + { + "element_type": "panel_group", + "panel_group_element": { + "title": "[% lang('nutriscore_negative_points') %][% sep %]: [% product.nutriscore.2023.data.negative_points %]/[% product.nutriscore.2023.data.negative_points_max %]", + "evaluation": "bad", + "icon_url": "[% static_subdomain %]/images/icons/dist/circle-minus.svg", + "icon_size": "small", + "icon_color_from_evaluation": true, + "panel_ids": [ + [% FOREACH component IN product.nutriscore.2023.data.components.negative %] + "nutriscore_component_[% component.id %]", + [% END %] + ], + }, + }, + { + "element_type": "panel_group", + "panel_group_element": { + "title": "[% lang('nutriscore_positive_points') %][% sep %]: [% product.nutriscore.2023.data.positive_points %]/[% product.nutriscore.2023.data.positive_points_max %]", + "evaluation": "good", + "icon_url": "[% static_subdomain %]/images/icons/dist/circle-plus.svg", + "icon_size": "small", + "icon_color_from_evaluation": true, + "panel_ids": [ + [% FOREACH component IN product.nutriscore.2023.data.components.positive %] + "nutriscore_component_[% component.id %]", + [% END %] + ], + }, + }, + // Details of the computation of the Nutri-Score + { + "element_type": "panel", + "panel_element": { + "panel_id": "nutriscore_details", + }, + }, + ] +} diff --git a/templates/api/knowledge-panels/health/nutriscore/nutriscore_component.tt.json b/templates/api/knowledge-panels/health/nutriscore/nutriscore_component.tt.json new file mode 100644 index 0000000000000..4b33521da5f22 --- /dev/null +++ b/templates/api/knowledge-panels/health/nutriscore/nutriscore_component.tt.json @@ -0,0 +1,26 @@ +{ + "level": "info", + "topics": [ + "health" + ], + "size": "small", + "title_element": { + "icon_url": "[% static_subdomain %]/images/attributes/dist/points-[% panel.type %]-[% panel.points %]-[% panel.points_max %].svg", + "title": "[% lang("nutriscore_component_" _ panel.id) %]", + "subtitle": "[% panel.points %]/[% panel.points_max %] points ([% panel.value %][% panel.unit %])", + }, + "elements": [ + + { + "element_type": "text", + "text_element": { + "html": ` +

+ [% 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_is") %]

+

+[% 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_explanation_recommended_by_public_health_authorities") %]

+[% END %] + `, + } + }, + { + "element_type": "text", + "text_element": { + "html": ` +

[% lang('nutriscore_learn_more') %]

+` + }, + }, + ] +} diff --git a/templates/api/knowledge-panels/health/nutriscore/nutriscore_details.tt.json b/templates/api/knowledge-panels/health/nutriscore/nutriscore_details.tt.json new file mode 100644 index 0000000000000..f0363e87a188e --- /dev/null +++ b/templates/api/knowledge-panels/health/nutriscore/nutriscore_details.tt.json @@ -0,0 +1,58 @@ +{ + "level": "info", + "topics": [ + "health" + ], + "title_element": { + "icon_url": "[% static_subdomain %]/images/icons/dist/info.svg", + "icon_size": "small", + "title": "[% lang("nutriscore_calculation_details") %]", + "type": "info", + }, + "elements": [ + // Display warnings + [% IF panel.nutriscore_warnings %] + [% FOREACH warning IN panel.nutriscore_warnings %] + { + "element_type": "text", + "text_element": { + "type": "warning", + "html": `[% warning %] + `, + } + }, + [% END %] + [% END %] + { + "element_type": "text", + "text_element": { + "html": ` +[% IF product.nutriscore.2023.data.is_beverage %] +

[% lang('nutriscore_is_beverage') %]

+[% ELSE %] +

[% lang('nutriscore_is_not_beverage') %]

+[% END %] +[% IF product.nutriscore.2023.data.is_water %] +

[% lang('nutriscore_is_water') %]

+[% END %] +[% IF product.nutriscore.2023.data.is_fat_oil_nuts_seeds %] +

[% lang('nutriscore_is_fat_oil_nuts_seeds') %]

+[% END %] +[% IF product.nutriscore.2023.data.is_cheese %] +

[% lang('nutriscore_is_cheese') %]

+[% END %] +[% IF product.nutriscore.2023.data.is_red_meat_product %] +

[% lang('nutriscore_is_red_meat_product') %]

+[% END %] +

[% lang("nutriscore_count_proteins_reason_" _ product.nutriscore.2023.data.count_proteins_reason )%]

+ +

+ [% lang('nutriscore_score') %][% sep %]: [% product.nutriscore.2023.score %] + ([% product.nutriscore.2023.data.negative_points %] - [% product.nutriscore.2023.data.positive_points %]) +

+

[% lang('nutriscore_grade') %][% sep %]: [% product.nutriscore.2023.grade FILTER ucfirst %]

+ `, + } + }, + ] +} diff --git a/templates/api/knowledge-panels/health/nutrition/nutrient_levels.tt.json b/templates/api/knowledge-panels/health/nutrition/nutrient_levels.tt.json new file mode 100644 index 0000000000000..37973a3e573b4 --- /dev/null +++ b/templates/api/knowledge-panels/health/nutrition/nutrient_levels.tt.json @@ -0,0 +1,36 @@ +{ + "level": "info", + "topics": [ + "health" + ], + "expanded": false, + "expand_for": "large", + "evaluation": "unknown", + "title_element": { + "icon_url": "[% static_subdomain %]/images/icons/dist/nutrition.svg", + "title": "[% lang('nutrient_levels_p') FILTER ucfirst %]", + "icon_color_from_evaluation": true, + }, + "elements": [ + { + "element_type": "panel_group", + "panel_group_element": { + "panel_group_id": "nutrient_levels_group", + "panel_ids": [ + [% IF panels.nutrient_level_fat.defined %] + "nutrient_level_fat", + [% END %] + [% IF panels.${'nutrient_level_saturated-fat'}.defined %] + "nutrient_level_saturated-fat", + [% END %] + [% IF panels.nutrient_level_sugars.defined %] + "nutrient_level_sugars", + [% END %] + [% IF panels.nutrient_level_salt.defined %] + "nutrient_level_salt", + [% END %] + ] + } + } + ] +} \ No newline at end of file diff --git a/templates/api/knowledge-panels/health/nutrition_panels.tt.json b/templates/api/knowledge-panels/health/nutrition_panels.tt.json index f625dd8c2bec9..d095eabe127b8 100644 --- a/templates/api/knowledge-panels/health/nutrition_panels.tt.json +++ b/templates/api/knowledge-panels/health/nutrition_panels.tt.json @@ -11,18 +11,12 @@ [% IF panels.nutriscore.defined %] "nutriscore", [% END %] - [% IF panels.nutrient_level_fat.defined %] - "nutrient_level_fat", - [% END %] - [% IF panels.${'nutrient_level_saturated-fat'}.defined %] - "nutrient_level_saturated-fat", - [% END %] - [% IF panels.nutrient_level_sugars.defined %] - "nutrient_level_sugars", - [% END %] - [% IF panels.nutrient_level_salt.defined %] - "nutrient_level_salt", - [% END %] + [% IF panels.nutriscore_2023.defined %] + "nutriscore_2023", + [% END %] + [% IF panels.nutrient_level_fat.defined || panels.${'nutrient_level_saturated-fat'}.defined || panels.nutrient_level_sugars.defined || panels.nutrient_level_salt.defined %] + "nutrient_levels", + [% END %] ], }, }, diff --git a/templates/web/panels/panel.tt.html b/templates/web/panels/panel.tt.html index 0fa37eb53f8a5..a12c7176248a8 100644 --- a/templates/web/panels/panel.tt.html +++ b/templates/web/panels/panel.tt.html @@ -33,7 +33,7 @@

[% panel.title_element.title %]

> [% IF panel.title_element.icon_url.defined %] [% IF panel.title_element.icon_alt.defined %][% panel.title_element.icon_alt %][% ELSE %]icon[% END %][% panel.title_element.title %] [% panel.title_element.title %] [% IF panel.title_element.subtitle.defined %] -
[% panel.title_element.subtitle %]
+ [% panel.title_element.subtitle %] [% END %]
@@ -106,8 +106,30 @@
[% panel.title_element.subtitle %]
[% END %] + [% IF panel_group_element.icon_url.defined %] + [% IF panel_group_element.icon_alt.defined %][% panel_group_element.icon_alt %][% ELSE %]icon[% END %] + [% 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\n

\n Negative points: 6 \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\n

\n Negative points: 6 \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\n

\n Negative points: 6 \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\n

\n Negative points: 6 \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\n

\n Points négatifs : 6 \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\n

\n Points négatifs : 6 \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\n

\n Negative points: 6 \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\n

\n Negative points: 6 \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\n

\n Negative points: 6 \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\n

\n Negative points: 6 \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\n

\n Negative points: 6 \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\n

\n Negative points: 6 \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\n

\n Points négatifs : 6 \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\n

\n Points négatifs : 6 \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\n

\n Negative points: 6 \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\n

\n Negative points: 6 \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,