Repository navigation
feat(bank-accounts): self-serve add/edit/delete/default + cashout account picker - #729
Merged
Merged
Conversation
…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]>
10 tasks
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.
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/bankAccountDeletemutations), which depends on lnflash/frappe-flash-admin#78. Ship in that order.Bank Accounts screen
bankPayoutcapability or already has a local account. The Plaid button is now labelled "Add US bank account".isDefault) for both rails. The AsyncStorage default store is deleted.Add / edit form
Bank from the
SupportedBankspicker, branch, account type, digits-only account number, currency shown locked (JMD on add), "Set as default" on add. Edit saves instantly throughbankAccountUpdate; the review-request copy and the deprecatedbankAccountUpdateRequestdocument are gone. Backend error codes map to plain messages, andBANK_ACCOUNT_UPGRADE_REQUIREDoffers the account upgrade screen. Bank-list membership is only enforced once the list has loaded.Cashout
coverScreen={false}to stay out of the Fabric Android modal freeze class) with a "Manage bank accounts" link. The pick is sent asbankAccountIdonrequestCashout, or as the external account id on the Bridge path, and shown on the confirmation screen.CashoutWithdrawTono longer readscache-only. The card and the sheet share one lookup hook (use-cashout-accounts.ts) and one selection function.Schema and generated files
app/graphql/public-schema.graphqlis 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 socheck:translation-driftpasses.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
bridgeDeleteExternalAccountreturns 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, fullyarn testpasses, eslint is clean on changed files. Repo-wideyarn eslint:checkhas existing failures unrelated to this change and is not run in CI.🤖 Generated with Claude Code