Add POI feature and imporve the overall backend implementation

This commit is contained in:
Urtzi Alfaro
2025-11-12 15:34:10 +01:00
parent e8096cd979
commit 5783c7ed05
173 changed files with 16862 additions and 9078 deletions

View File

@@ -115,8 +115,14 @@ class InventoryService:
response = IngredientResponse(**ingredient_dict)
response.current_stock = stock_totals['total_available']
response.is_low_stock = stock_totals['total_available'] <= ingredient.low_stock_threshold
response.needs_reorder = stock_totals['total_available'] <= ingredient.reorder_point
response.is_low_stock = (
stock_totals['total_available'] <= ingredient.low_stock_threshold
if ingredient.low_stock_threshold is not None else False
)
response.needs_reorder = (
stock_totals['total_available'] <= ingredient.reorder_point
if ingredient.reorder_point is not None else False
)
return response
@@ -171,8 +177,14 @@ class InventoryService:
response = IngredientResponse(**ingredient_dict)
response.current_stock = stock_totals['total_available']
response.is_low_stock = stock_totals['total_available'] <= updated_ingredient.low_stock_threshold
response.needs_reorder = stock_totals['total_available'] <= updated_ingredient.reorder_point
response.is_low_stock = (
stock_totals['total_available'] <= updated_ingredient.low_stock_threshold
if updated_ingredient.low_stock_threshold is not None else False
)
response.needs_reorder = (
stock_totals['total_available'] <= updated_ingredient.reorder_point
if updated_ingredient.reorder_point is not None else False
)
return response
@@ -214,8 +226,14 @@ class InventoryService:
response = IngredientResponse(**ingredient_dict)
response.current_stock = stock_totals['total_available']
response.is_low_stock = stock_totals['total_available'] <= ingredient.low_stock_threshold
response.needs_reorder = stock_totals['total_available'] <= ingredient.reorder_point
response.is_low_stock = (
stock_totals['total_available'] <= ingredient.low_stock_threshold
if ingredient.low_stock_threshold is not None else False
)
response.needs_reorder = (
stock_totals['total_available'] <= ingredient.reorder_point
if ingredient.reorder_point is not None else False
)
responses.append(response)