Skip to content

feat(bank-accounts): self-serve add/edit/delete/default + cashout account picker - #729

Merged
islandbitcoin merged 2 commits into
mainfrom
feat/bank-accounts-self-serve
Sep 23, 2026
Merged

islandbitcoin merged 2 commits into
mainfrom
feat/bank-accounts-self-serve

Conversation

@islandbitcoin

Copy link
Copy Markdown
Contributor

What

Customers manage their withdrawal bank accounts from Settings > Bank Accounts: add, edit, delete and set default, for Jamaican (ERPNext) accounts and Bridge external US accounts. Cashout then respects the choice.

Depends on lnflash/flash#513 (new bankAccountAdd / bankAccountUpdate / bankAccountSetDefault / bankAccountDelete mutations), which depends on lnflash/frappe-flash-admin#78. Ship in that order.

Bank Accounts screen

  • "Add Jamaican bank account" opens a new add form. Shown when the user has the bankPayout capability or already has a local account. The Plaid button is now labelled "Add US bank account".
  • Account actions: Set as default, Edit details (Jamaican accounts only; Bridge has no edit API, remove and re-add), Remove with a destructive confirm. Row spinner while an action runs, toasts on success and failure.
  • Accounts are grouped by rail (local bank, Bridge), one default per group. The default comes from the server (isDefault) for both rails. The AsyncStorage default store is deleted.
  • The Settings row no longer disappears when the Bridge flag is off.
  • The Android action sheet is split so Cancel is never dropped (RN Android keeps only three Alert buttons).

Add / edit form

Bank from the SupportedBanks picker, branch, account type, digits-only account number, currency shown locked (JMD on add), "Set as default" on add. Edit saves instantly through bankAccountUpdate; the review-request copy and the deprecated bankAccountUpdateRequest document are gone. Backend error codes map to plain messages, and BANK_ACCOUNT_UPGRADE_REQUIRED offers the account upgrade screen. Bank-list membership is only enforced once the list has loaded.

Cashout

  • "Withdraw to" is now a picker (scrollable inline sheet, coverScreen={false} to stay out of the Fabric Android modal freeze class) with a "Manage bank accounts" link. The pick is sent as bankAccountId on requestCashout, or as the external account id on the Bridge path, and shown on the confirmation screen.
  • CashoutWithdrawTo no longer reads cache-only. The card and the sheet share one lookup hook (use-cashout-accounts.ts) and one selection function.
  • Behavior change: with no explicit pick, cashout uses the server default in any currency. Before, a JMD account always won, which ignored a customer's USD default.

Schema and generated files

app/graphql/public-schema.graphql is copied from the backend branch SDL (also brings in additive, unrelated upgrade-evidence types). Codegen output and i18n types regenerated. 23 locale JSONs are backfilled with English for the new keys so check:translation-drift passes.

Not verified

Nothing has run on a device or against a live backend. Before merge, open the cashout picker once on an Android build: sheet sits at the bottom, backdrop tap closes it, hardware back closes it, "Manage bank accounts" navigates after the sheet hides. Also unconfirmed: whether bridgeDeleteExternalAccount returns a payload on success.

Tests

New specs for the hook, the add/edit screen, error mapping, the cashout accounts hook and the picker, plus the updated cashout-estimate.spec.ts. yarn check-code (tsc, translations, codegen, graphql-check) passes, full yarn test passes, eslint is clean on changed files. Repo-wide yarn eslint:check has existing failures unrelated to this change and is not run in CI.

🤖 Generated with Claude Code

Dread and others added 2 commits September 20, 2026 21:08
…ount picker

Settings → Bank accounts now manages withdrawal accounts end to end for both
rails, instantly:

- ERPNext (Jamaican) accounts: add (bankAccountAdd), edit (bankAccountUpdate,
  replaces the review-gated bankAccountUpdateRequest), set default, delete.
- Bridge external (US) accounts: set default and delete (no edit API).
- The server owns the default on both rails; the AsyncStorage default store
  is removed.
- The Settings row and the "Add Jamaican bank account" CTA no longer depend
  on the Bridge flag; Bridge sections stay gated inside the hub.
- Cashout: one selection function (selected → server default → first JMD →
  first) shared by the details screen, the JMD preview and the "Withdraw to"
  card, which is now a picker whose choice flows into requestCashout /
  bridgeRequestWithdrawal and the confirmation screen.
- public-schema.graphql refreshed from the backend SDL; codegen and i18n
  regenerated, translation files backfilled with the English source.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
- cashout: split the account sheet out of the "Withdraw to" card into
  CashoutAccountPicker, rendered at the CashoutDetails screen root with
  coverScreen={false} (Fabric/Android bottom-sheet freeze, #545). Visibility is
  lifted to the screen; "Manage bank accounts" navigates from onModalHide.
- cashout: the account list scrolls (max 60% of the window) with the manage
  link outside the scroller.
- hub: action sheet is at most Edit / Remove / Cancel and cancelable, so
  Android's three-button Alert can never drop Cancel. Set as default is the
  radio tap.
- hub: group withdrawal accounts by rail (one server default each) instead of
  by currency, and show the currency on the row.
- hub: accounts without the bankPayout capability (and no local account on
  file) are offered the upgrade before the add form, not after submitting it.
- edit: only judge "bank not in the list" against a supported-banks list that
  loaded; submit waits while it loads and a failed load shows a retryable error.
- i18n: usBankAccounts, localBankAccounts, banksLoadError, banksLoadRetry.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
@islandbitcoin
islandbitcoin merged commit 9e6e161 into main Sep 23, 2026
11 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant