Improve the frontend 3

This commit is contained in:
Urtzi Alfaro
2025-10-30 21:08:07 +01:00
parent 36217a2729
commit 63f5c6d512
184 changed files with 21512 additions and 7442 deletions

View File

@@ -137,7 +137,11 @@ class Ingredient(Base):
is_perishable = Column(Boolean, default=False)
allergen_info = Column(JSONB, nullable=True) # JSON array of allergens
nutritional_info = Column(JSONB, nullable=True) # Nutritional information for finished products
# NEW: Local production support (for procurement service integration)
produced_locally = Column(Boolean, default=False, nullable=False) # If true, ingredient is produced in-house
recipe_id = Column(UUID(as_uuid=True), nullable=True) # Links to recipe for BOM explosion
# Audit fields
created_at = Column(DateTime(timezone=True), default=lambda: datetime.now(timezone.utc))
updated_at = Column(DateTime(timezone=True),
@@ -213,6 +217,9 @@ class Ingredient(Base):
'is_perishable': self.is_perishable if self.is_perishable is not None else False,
'allergen_info': self.allergen_info,
'nutritional_info': self.nutritional_info,
# NEW: Local production support
'produced_locally': self.produced_locally if self.produced_locally is not None else False,
'recipe_id': str(self.recipe_id) if self.recipe_id else None,
'created_at': self.created_at.isoformat() if self.created_at else None,
'updated_at': self.updated_at.isoformat() if self.updated_at else datetime.now(timezone.utc).isoformat(),
'created_by': str(self.created_by) if self.created_by else None,