shop product refactoring
This commit is contained in:
@@ -18,10 +18,10 @@ class Stock(Base, TimestampMixin):
|
||||
location = Column(String, nullable=False, index=True)
|
||||
quantity = Column(Integer, nullable=False, default=0)
|
||||
reserved_quantity = Column(Integer, default=0) # For orders being processed
|
||||
shop_id = Column(Integer, ForeignKey("shops.id")) # Optional: shop-specific stock
|
||||
vendor_id = Column(Integer, ForeignKey("vendors.id")) # Optional: vendor -specific stock
|
||||
|
||||
# Relationships
|
||||
shop = relationship("Shop")
|
||||
vendor = relationship("Shop")
|
||||
|
||||
# Composite unique constraint to prevent duplicate GTIN-location combinations
|
||||
__table_args__ = (
|
||||
|
||||
Reference in New Issue
Block a user