Add traslations
This commit is contained in:
@@ -171,6 +171,30 @@ class IngredientResponse(InventoryBaseSchema):
|
||||
return None
|
||||
|
||||
|
||||
# ===== BULK INGREDIENT SCHEMAS =====
|
||||
|
||||
class BulkIngredientCreate(InventoryBaseSchema):
|
||||
"""Schema for bulk creating ingredients"""
|
||||
ingredients: List[IngredientCreate] = Field(..., description="List of ingredients to create")
|
||||
|
||||
|
||||
class BulkIngredientResult(InventoryBaseSchema):
|
||||
"""Schema for individual result in bulk operation"""
|
||||
index: int = Field(..., description="Index of the ingredient in the original request")
|
||||
success: bool = Field(..., description="Whether the creation succeeded")
|
||||
ingredient: Optional[IngredientResponse] = Field(None, description="Created ingredient (if successful)")
|
||||
error: Optional[str] = Field(None, description="Error message (if failed)")
|
||||
|
||||
|
||||
class BulkIngredientResponse(InventoryBaseSchema):
|
||||
"""Schema for bulk ingredient creation response"""
|
||||
total_requested: int = Field(..., description="Total number of ingredients requested")
|
||||
total_created: int = Field(..., description="Number of ingredients successfully created")
|
||||
total_failed: int = Field(..., description="Number of ingredients that failed")
|
||||
results: List[BulkIngredientResult] = Field(..., description="Detailed results for each ingredient")
|
||||
transaction_id: str = Field(..., description="Transaction ID for audit trail")
|
||||
|
||||
|
||||
# ===== STOCK SCHEMAS =====
|
||||
|
||||
class StockCreate(InventoryBaseSchema):
|
||||
|
||||
Reference in New Issue
Block a user