from sqlalchemy import Column, String, Integer, Boolean, DateTime, Float, Text from sqlalchemy.dialects.postgresql import UUID from sqlalchemy.sql import func from core.database import Base import uuid class Food(Base): __tablename__ = "foods" id = Column(UUID(as_uuid=True), primary_key=True, default=uuid.uuid4) name = Column(String, nullable=False, index=True) description = Column(Text, nullable=True) price = Column(Float, nullable=False) category = Column(String, nullable=False, index=True) is_available = Column(Boolean, default=True) calories = Column(Integer, nullable=True) ingredients = Column(Text, nullable=True) image_url = Column(String, nullable=True) created_at = Column(DateTime, default=func.now()) updated_at = Column(DateTime, default=func.now(), onupdate=func.now())