vendor refactoring
This commit is contained in:
@@ -15,15 +15,15 @@ class Product(Base, TimestampMixin):
|
||||
vendor_id = Column(Integer, ForeignKey("vendors.id"), nullable=False)
|
||||
marketplace_product_id = Column(Integer, ForeignKey("marketplace_products.id"), nullable=False)
|
||||
|
||||
# Shop-specific overrides (can override the main product data)
|
||||
product_id = Column(String) # Shop's internal product ID
|
||||
# Vendor-specific overrides (can override the main product data)
|
||||
product_id = Column(String) # Vendor's internal product ID
|
||||
price = Column(Float) # Override main product price
|
||||
sale_price = Column(Float)
|
||||
currency = Column(String)
|
||||
availability = Column(String) # Override availability
|
||||
condition = Column(String)
|
||||
|
||||
# Shop-specific metadata
|
||||
# Vendor-specific metadata
|
||||
is_featured = Column(Boolean, default=False)
|
||||
is_active = Column(Boolean, default=True)
|
||||
display_order = Column(Integer, default=0)
|
||||
|
||||
@@ -21,7 +21,7 @@ class Stock(Base, TimestampMixin):
|
||||
vendor_id = Column(Integer, ForeignKey("vendors.id")) # Optional: vendor -specific stock
|
||||
|
||||
# Relationships
|
||||
vendor = relationship("Shop")
|
||||
vendor = relationship("Vendor")
|
||||
|
||||
# Composite unique constraint to prevent duplicate GTIN-location combinations
|
||||
__table_args__ = (
|
||||
|
||||
Reference in New Issue
Block a user