Public Access
feat(backend): implement unit conversion for cost calculation
- Add UnitConverter (normalization, within-family, density tables) - Update cost.py to convert recipe qty to grocery price unit - Update generate.py _load_match_index to fetch ingredient name + unit - Fix orchestrator email/shopping-list cost loops to use conversion - Fix missing Ingredient import in generate.py - Add 19 unit tests
This commit is contained in:
@@ -15,10 +15,12 @@ def _match(grocery_id, name, current, regular, is_on_sale, confidence=0.9):
|
||||
return {
|
||||
"grocery_item_id": grocery_id,
|
||||
"grocery_item_name": name,
|
||||
"ingredient_name": name.lower(),
|
||||
"current_price": Decimal(str(current)),
|
||||
"regular_price": Decimal(str(regular)),
|
||||
"is_on_sale": is_on_sale,
|
||||
"confidence": Decimal(str(confidence)),
|
||||
"grocery_unit": None,
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user