feat(receipt-import): add rule-based category suggestion logic for items
feat(migrations): add new categories for lactose-free products and allergy options
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
-- Ensure L3 "Matfett" exists under:
|
||||
-- Mejeri, ost & ägg > Allergi mejeri
|
||||
|
||||
INSERT INTO `Category` (`name`, `parentId`)
|
||||
SELECT 'Matfett', c2.id
|
||||
FROM `Category` c1
|
||||
JOIN `Category` c2
|
||||
ON c2.parentId = c1.id
|
||||
AND c2.name = 'Allergi mejeri'
|
||||
LEFT JOIN `Category` c3
|
||||
ON c3.parentId = c2.id
|
||||
AND c3.name = 'Matfett'
|
||||
WHERE c1.name = 'Mejeri, ost & ägg'
|
||||
AND c1.parentId IS NULL
|
||||
AND c3.id IS NULL;
|
||||
Reference in New Issue
Block a user