fix(tinvest): чистка отменённых операций, цена бумаги от брокера, логотипы эмитентов

Отменённые и незавершённые операции удаляются из event по raw_tinvest_operation, а не только из текущего окна синка. Бумага, которую MOEX не котирует (структурные ноты, внебиржевые облигации), получает цену из портфеля брокера. Логотип и цвет бренда копируются в instrument (миграция e8b21f6a90c3).
This commit is contained in:
Dmitry
2026-09-19 21:54:47 +03:00
parent 4236993106
commit 4552efbf5d
6 changed files with 464 additions and 3 deletions
@@ -68,6 +68,10 @@ class Instrument(TimestampMixin, Base):
sector: Mapped[str | None] = mapped_column(String(64))
country: Mapped[str | None] = mapped_column(String(2))
is_active: Mapped[bool] = mapped_column(Boolean, default=True)
logo_name: Mapped[str | None] = mapped_column(String(64))
"""The issuer's logo file as the broker names it (`sber.png`); see `branding.py`."""
logo_color: Mapped[str | None] = mapped_column(String(9))
"""The brand's own colour, `#RRGGBB`: the backdrop of a fallback icon."""
meta: Mapped[dict[str, Any] | None]