feat(bank): opt-in automatic bank-sync confirmation cards#97
Open
alex-mextner wants to merge 1 commit into
Open
feat(bank): opt-in automatic bank-sync confirmation cards#97alex-mextner wants to merge 1 commit into
alex-mextner wants to merge 1 commit into
Conversation
Bank sync previously pushed a transaction confirmation card to the group on every cycle. Make all automatic cards opt-in per group. Decided defaults: - Off by default (migration 050 adds groups.bank_cards_enabled INTEGER NOT NULL DEFAULT 0). - Per-group (shared across members), toggled like default_currency — not per-user. - Prefill (Anthropic spend) is skipped when off — no point paying for prefill nobody sees. - No retroactive flood on enable: notifyOldTransactions only fires for tx inserted in the current cycle, so flipping the toggle on later never dumps backlog. When bank_cards_enabled is falsy, sync becomes balance/history-only: Phase 1 still inserts every transaction (debit -> pending, credit -> skipped_reversal), but all three automated push paths are gated off as a single block: 1. Phase 2 — preFillTransactions (AI prefill) 2. Phase 3 — per-transaction confirmation cards for today 3. notifyOldTransactions — old-tx summary card OTP prompts, the "Принято" ack, the 3-consecutive-failures alert, panel updates, and the user-initiated bank_show_old / bank_confirm / bank_edit callbacks are NOT gated — they stay operational. Settings UI: /settings now shows the bank-cards state (вкл/выкл) with an inline toggle button (callback_data "settings:bankcards"); the callback flips the flag via the repository and re-renders in place. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
🤖 Stage bot deployed! Test it: https://t.me/ExpenseSyncStageBot Branch: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Что
Автоматические карточки подтверждения банк-синка теперь выключены по умолчанию с per-group тумблером для включения. Когда выключено — синк работает в режиме «только балансы/история»: транзакции пишутся в БД, но непрошеные карточки не шлются и AI-prefill не тратится.
Изменения
Миграция 050:
groups.bank_cards_enabled INTEGER NOT NULL DEFAULT 0(идемпотентная, существующие миграции не тронуты).Groupтип + репозиторий: чтение и записьbank_cards_enabled.sync-service.ts: три автоматических пути отправки обёрнуты вif (group.bank_cards_enabled):preFillTransactions(трата на Anthropic) — скипается целикомnotifyOldTransactions— сводка по старым транзакциям («Показать для подтверждения?»)Phase 1 (вставка транзакций) и все операционные/user-initiated пути (OTP, ack, алерт о 3 ошибках, обновление панели, колбэки
bank_show_old/confirm/edit) остаются живыми./settings: тумблер «Карточки банковских транзакций: вкл/выкл» с ре-рендером на месте черезctx.editText; колбэкsettings:bankcards(18 байт).Решённые дефолты
Off по умолчанию, per-group, prefill скипается при off, все три пути загейчены, без ретроактивного флуда (
notifyOldTransactionsшлёт только то, что вставлено в текущем цикле).Тесты
TDD: off-путь (транзакции вставлены, prefill НЕ вызван, карточки НЕ отправлены, notifyOldTransactions НЕ вызван) + on-путь (поведение как было) + миграция/репозиторий + тумблер в settings.
Полный сьют: 3417/3417 зелёные, tsc чисто.
Вне скоупа
Тумблер виден только в
/settings— в панели/bankи/helpне упомянут (по решению, можно добавить отдельно).🤖 Generated with Claude Code