Add invalidate not yet with tests
All checks were successful
Backend CI / unit-test (push) Successful in 27s

This commit is contained in:
2025-09-17 16:36:56 +02:00
parent a0898fa29e
commit d1f1b3e66c
3 changed files with 59 additions and 0 deletions

View File

@@ -94,6 +94,14 @@ class Trades(SQLModel, table=True):
gross_cash_flow_cents: int = Field(sa_column=Column(Integer, nullable=False))
commission_cents: int = Field(sa_column=Column(Integer, nullable=False))
net_cash_flow_cents: int = Field(sa_column=Column(Integer, nullable=False))
is_invalidated: bool = Field(default=False, nullable=False)
invalidated_at: datetime | None = Field(
default=None, sa_column=Column(DateTime(timezone=True), nullable=True)
)
replaced_by_trade_id: int | None = Field(
default=None, foreign_key="trades.id", nullable=True
)
notes: str | None = Field(default=None, sa_column=Column(Text, nullable=True))
cycle_id: int | None = Field(
default=None, foreign_key="cycles.id", nullable=True, index=True
)