- funding_rate table and "Фондирование" page: rate from date, history, rate on date (D27)
- positions by issue: BUY - SELL per portfolio, "Остатки" page (D29)
- quotes are loaded only for securities with an open position (D10)
- business calendar from xmlcalendar.ru: yearly file upload, report date
and update job use previous working day (D30)
- xlsx download for positions, quotes and funding rate history
- manual operation type as radio buttons
- QUIK instruments with purchase marks ("МТС 2Р-18_1") match the issue,
file name kept in operation.instrument (D17)
- migrations d3a6f8b1c254, e7b2c9d4a813, f1c4a7e9b352
- project.md: decisions and questions after customer meetings
57 lines
1.6 KiB
Python
57 lines
1.6 KiB
Python
"""производственный календарь
|
|
|
|
Revision ID: e7b2c9d4a813
|
|
Revises: d3a6f8b1c254
|
|
Create Date: 2026-10-26 00:00:00
|
|
|
|
non_working_day (D30).
|
|
"""
|
|
|
|
from typing import Sequence, Union
|
|
|
|
import sqlalchemy as sa
|
|
|
|
from alembic import op
|
|
from app.core.config import settings
|
|
|
|
# revision identifiers, used by Alembic.
|
|
revision: str = "e7b2c9d4a813"
|
|
down_revision: Union[str, None] = "d3a6f8b1c254"
|
|
branch_labels: Union[str, Sequence[str], None] = None
|
|
depends_on: Union[str, Sequence[str], None] = None
|
|
|
|
_schema = settings.DATABASE_SCHEMA or None
|
|
|
|
# Типы зафиксированы в ревизии, как и в начальной миграции.
|
|
_BIGINT_PK = sa.BigInteger().with_variant(sa.Integer(), "sqlite")
|
|
|
|
|
|
def upgrade() -> None:
|
|
"""Upgrade schema."""
|
|
op.create_table(
|
|
"non_working_day",
|
|
sa.Column("id", _BIGINT_PK, sa.Identity(), primary_key=True),
|
|
sa.Column("day", sa.Date(), nullable=False),
|
|
sa.Column(
|
|
"created_at",
|
|
sa.DateTime(timezone=True),
|
|
server_default=sa.func.now(),
|
|
nullable=False,
|
|
),
|
|
sa.Column("created_by", sa.String(255), nullable=False),
|
|
sa.Column(
|
|
"updated_at",
|
|
sa.DateTime(timezone=True),
|
|
server_default=sa.func.now(),
|
|
nullable=False,
|
|
),
|
|
sa.Column("updated_by", sa.String(255), nullable=False),
|
|
sa.UniqueConstraint("day", name="uq_non_working_day_day"),
|
|
schema=_schema,
|
|
)
|
|
|
|
|
|
def downgrade() -> None:
|
|
"""Downgrade schema."""
|
|
op.drop_table("non_working_day", schema=_schema)
|