From 85090ecc9f75c4de3e5f8b46fa300e1d1fca774c Mon Sep 17 00:00:00 2001 From: dadaloop82 Date: Mon, 11 May 2026 17:07:59 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20generic=20'latte'=20opened=20shelf=20lif?= =?UTF-8?q?e=204=E2=86=927=20days=20(UHT=20default)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fresh milk is explicitly matched by 'latte fresco/intero/parzial/scremato' (3 days). Generic 'Latte' without qualifier is almost always UHT in Italian households — 7 days. --- api/database.php | 2 +- assets/js/app.js | 2 +- index.html | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/api/database.php b/api/database.php index e9e87d7..66e1068 100644 --- a/api/database.php +++ b/api/database.php @@ -365,7 +365,7 @@ function estimateOpenedExpiryDaysPHP(string $name, string $category, string $loc if (preg_match('/latte\s+(uht|a\s+lunga)/', $n)) return 7; // Long-life mountain/brand milks stored in pantry before use (UHT) if (preg_match('/latte.*(montagna|alta\s+qual|parmalat|granarolo|esselunga|conservaz|microfiltrat)/i', $n)) return 7; - if (preg_match('/\blatte\b/', $n)) return 4; + if (preg_match('/\blatte\b/', $n)) return 7; // generic: default to UHT (most common in IT households) if (preg_match('/\b(yogurt|yaourt|yoghurt)\b/', $n)) return 5; if (preg_match('/mozzarella|burrata|stracciatella/', $n)) return 3; if (preg_match('/philadelphia|spalmabile/', $n)) return 7; diff --git a/assets/js/app.js b/assets/js/app.js index 3c2b2ca..8b95bb9 100644 --- a/assets/js/app.js +++ b/assets/js/app.js @@ -1669,7 +1669,7 @@ function estimateOpenedExpiryDays(product, location) { if (/latte\s+(uht|a\s+lunga)/.test(name)) return 7; // Long-life mountain/brand milks stored in pantry before use (UHT) if (/latte.*(montagna|alta\s+qual|parmalat|granarolo|esselunga|conservaz|microfiltrat)/i.test(name)) return 7; - if (/\blatte\b/.test(name)) return 4; + if (/\blatte\b/.test(name)) return 7; // generic: default to UHT (most common in IT households) if (/\b(yogurt|yaourt|yoghurt)\b/.test(name)) return 5; if (/mozzarella|burrata|stracciatella/.test(name)) return 3; if (/philadelphia|spalmabile/.test(name)) return 7; diff --git a/index.html b/index.html index de8ce76..322a21e 100644 --- a/index.html +++ b/index.html @@ -11,7 +11,7 @@ EverShelf - + @@ -1469,6 +1469,6 @@ - +