From 16973bbb64f700c27aa179753f4192203ad09355 Mon Sep 17 00:00:00 2001 From: Redsandyg Date: Thu, 12 Jun 2025 16:03:03 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D1=8B=20=D0=BC=D0=BE=D0=B4=D0=B5=D0=BB=D0=B8=20Sale,=20A?= =?UTF-8?q?gentTransaction=20=D0=B8=20PartnerTransaction:=20=D0=B4=D0=BE?= =?UTF-8?q?=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=D0=BE=20=D1=83=D0=BD=D0=B8?= =?UTF-8?q?=D0=BA=D0=B0=D0=BB=D1=8C=D0=BD=D0=BE=D0=B5=20=D0=BE=D0=B3=D1=80?= =?UTF-8?q?=D0=B0=D0=BD=D0=B8=D1=87=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=B4=D0=BB?= =?UTF-8?q?=D1=8F=20=D0=BF=D0=BE=D0=BB=D1=8F=20transaction=5Fgroup=20?= =?UTF-8?q?=D0=B2=20AgentTransaction,=20=D0=B0=20=D1=82=D0=B0=D0=BA=D0=B6?= =?UTF-8?q?=D0=B5=20=D0=B8=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD?= =?UTF-8?q?=D1=8B=20=D0=BF=D1=80=D0=BE=D0=B1=D0=B5=D0=BB=D1=8B=20=D0=B2=20?= =?UTF-8?q?=D0=BE=D0=BF=D1=80=D0=B5=D0=B4=D0=B5=D0=BB=D0=B5=D0=BD=D0=B8?= =?UTF-8?q?=D1=8F=D1=85=20=D0=BF=D0=BE=D0=BB=D0=B5=D0=B9=20sale=5Fid=20?= =?UTF-8?q?=D0=B8=20transaction=5Fgroup.=20=D0=A3=D0=BB=D1=83=D1=87=D1=88?= =?UTF-8?q?=D0=B5=D0=BD=D0=B0=20=D1=87=D0=B8=D1=82=D0=B0=D0=B5=D0=BC=D0=BE?= =?UTF-8?q?=D1=81=D1=82=D1=8C=20=D0=BA=D0=BE=D0=B4=D0=B0.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sql_models.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sql_models.py b/sql_models.py index 4c871c2..7cfbaeb 100644 --- a/sql_models.py +++ b/sql_models.py @@ -41,7 +41,7 @@ class Sale(SQLModel, table=True): cost: float crediting: float # сколько начислено за продажу ref: int = Field(foreign_key="ref.id") - sale_id: str + sale_id: str company_id: int = Field(foreign_key="company.id") sale_dttm: datetime = Field(default_factory=datetime.utcnow) create_dttm: datetime = Field(default_factory=datetime.utcnow) @@ -53,7 +53,7 @@ class AgentTransaction(SQLModel, table=True): tg_agent_id: int = Field(foreign_key="tgagent.id") amount: float status: str - transaction_group: uuid.UUID = Field(default_factory=uuid.uuid4) + transaction_group: uuid.UUID = Field(default_factory=uuid.uuid4, unique=True) create_dttm: datetime = Field(default_factory=datetime.utcnow) update_dttm: datetime = Field(default_factory=datetime.utcnow) @@ -64,7 +64,7 @@ class PartnerTransaction(SQLModel, table=True): type: str amount: float status: str - transaction_group: uuid.UUID + transaction_group: uuid.UUID agent_transaction_id: Optional[int] = Field(default=None, foreign_key="agent_transactions.id") create_dttm: datetime = Field(default_factory=datetime.utcnow) update_dttm: datetime = Field(default_factory=datetime.utcnow)