marketplace refactoring
This commit is contained in:
@@ -6,9 +6,9 @@ from sqlalchemy.orm import relationship
|
||||
|
||||
# Import Base from the central database module instead of creating a new one
|
||||
from app.core.database import Base
|
||||
from models.database.base import TimestampMixin
|
||||
|
||||
|
||||
class Stock(Base):
|
||||
class Stock(Base, TimestampMixin):
|
||||
__tablename__ = "stock"
|
||||
|
||||
id = Column(Integer, primary_key=True, index=True)
|
||||
@@ -20,11 +20,6 @@ class Stock(Base):
|
||||
reserved_quantity = Column(Integer, default=0) # For orders being processed
|
||||
shop_id = Column(Integer, ForeignKey("shops.id")) # Optional: shop-specific stock
|
||||
|
||||
created_at = Column(DateTime, default=datetime.utcnow, nullable=False)
|
||||
updated_at = Column(
|
||||
DateTime, default=datetime.utcnow, onupdate=datetime.utcnow, nullable=False
|
||||
)
|
||||
|
||||
# Relationships
|
||||
shop = relationship("Shop")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user