IMPORVE ONBOARDING STEPS
This commit is contained in:
@@ -1062,9 +1062,12 @@ class InventoryService:
|
||||
|
||||
async def _validate_ingredient_data(self, ingredient_data: IngredientCreate, tenant_id: UUID):
|
||||
"""Validate ingredient data for business rules"""
|
||||
# Add business validation logic here
|
||||
if ingredient_data.reorder_point <= ingredient_data.low_stock_threshold:
|
||||
raise ValueError("Reorder point must be greater than low stock threshold")
|
||||
# Only validate reorder_point if both values are provided
|
||||
# During onboarding, these fields may be None, which is valid
|
||||
if (ingredient_data.reorder_point is not None and
|
||||
ingredient_data.low_stock_threshold is not None):
|
||||
if ingredient_data.reorder_point <= ingredient_data.low_stock_threshold:
|
||||
raise ValueError("Reorder point must be greater than low stock threshold")
|
||||
|
||||
# Storage requirements validation moved to stock level (not ingredient level)
|
||||
# This is now handled in stock creation/update validation
|
||||
|
||||
Reference in New Issue
Block a user