This commit is contained in:
2024-04-11 07:57:08 +03:00
parent 93eb6ae6b7
commit 7f302acdb5
8 changed files with 267 additions and 26 deletions

View File

@@ -13,3 +13,15 @@ class DealService(BaseModel):
service = relationship('Service')
quantity = Column(Integer, nullable=False, comment='Кол-во услуги')
class DealProduct(BaseModel):
__tablename__ = 'deal_products'
deal_id = Column(Integer, ForeignKey('deals.id'), nullable=False, comment='ID Сделки', primary_key=True)
deal = relationship('Deal', back_populates='products')
product_id = Column(Integer, ForeignKey('products.id'), nullable=False, comment='ID Продукта', primary_key=True)
product = relationship('Product')
quantity = Column(Integer, nullable=False, comment='Кол-во продукта')