feat(пополнение): тревога, когда платёжка трижды подряд не создала платёж

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
anor
2026-10-28 15:00:55 +10:00
co-authored by Claude Opus 5.5
parent 6444b71057
commit 8ad94c8dad
3 changed files with 36 additions and 0 deletions
+7
View File
@@ -1170,6 +1170,13 @@ def get_topup_by_provider(provider: str, provider_id: str) -> dict | None:
return dict(row) if row else None
def recent_topup_statuses(limit: int) -> list[str]:
"""Статусы последних платежей, новые первыми — сторожу серии отказов платёжки."""
with _conn() as conn:
return [r[0] for r in conn.execute(
"SELECT status FROM topups ORDER BY id DESC LIMIT ?", (limit,)).fetchall()]
def count_open_topups_since(username: str, since_ts: float) -> int:
with _conn() as conn:
return int(conn.execute(