refactor: balance handling and upload processing

This commit is contained in:
2026-07-24 16:48:32 +05:00
parent 8bd5c80693
commit 9009147b52
9 changed files with 341 additions and 122 deletions
+4 -1
View File
@@ -19,7 +19,10 @@ class User(Base):
first_name: Mapped[str | None] = mapped_column(String(255), nullable=True)
last_name: Mapped[str | None] = mapped_column(String(255), nullable=True)
is_admin: Mapped[bool] = mapped_column(Boolean, default=False)
balance_credits: Mapped[int] = mapped_column(BigInteger, default=0, nullable=False)
# Имя столбца сохраняется для совместимости с существующей базой данных.
balance_rubles: Mapped[int] = mapped_column(
"balance_credits", BigInteger, default=0, nullable=False
)
created_at: Mapped[datetime] = mapped_column(DateTime(timezone=True), default=utc_now)
updated_at: Mapped[datetime] = mapped_column(
DateTime(timezone=True),