Improve the frontend 3
This commit is contained in:
@@ -60,7 +60,11 @@ class IngredientCreate(InventoryBaseSchema):
|
||||
# Properties
|
||||
is_perishable: bool = Field(False, description="Is perishable")
|
||||
allergen_info: Optional[Dict[str, Any]] = Field(None, description="Allergen information")
|
||||
|
||||
|
||||
# NEW: Local production support
|
||||
produced_locally: bool = Field(False, description="If true, ingredient is produced in-house")
|
||||
recipe_id: Optional[str] = Field(None, description="Recipe ID for BOM explosion (if produced locally)")
|
||||
|
||||
@validator('reorder_point')
|
||||
def validate_reorder_point(cls, v, values):
|
||||
if 'low_stock_threshold' in values and v <= values['low_stock_threshold']:
|
||||
@@ -99,6 +103,10 @@ class IngredientUpdate(InventoryBaseSchema):
|
||||
is_perishable: Optional[bool] = Field(None, description="Is perishable")
|
||||
allergen_info: Optional[Dict[str, Any]] = Field(None, description="Allergen information")
|
||||
|
||||
# NEW: Local production support
|
||||
produced_locally: Optional[bool] = Field(None, description="If true, ingredient is produced in-house")
|
||||
recipe_id: Optional[str] = Field(None, description="Recipe ID for BOM explosion (if produced locally)")
|
||||
|
||||
|
||||
class IngredientResponse(InventoryBaseSchema):
|
||||
"""Schema for ingredient and finished product API responses"""
|
||||
@@ -125,6 +133,11 @@ class IngredientResponse(InventoryBaseSchema):
|
||||
is_active: bool
|
||||
is_perishable: bool
|
||||
allergen_info: Optional[Dict[str, Any]]
|
||||
|
||||
# NEW: Local production support
|
||||
produced_locally: bool = False
|
||||
recipe_id: Optional[str] = None
|
||||
|
||||
created_at: datetime
|
||||
updated_at: datetime
|
||||
created_by: Optional[str]
|
||||
|
||||
Reference in New Issue
Block a user