Filter partially set up bank accounts from card settlement account list#84373
Conversation
…account list Bank accounts in SETUP, VERIFYING, or PENDING states now excluded from getEligibleBankAccountsForCard and getEligibleBankAccountsForUkEuCard using the existing isBankAccountPartiallySetup utility. Co-authored-by: DylanDylann <DylanDylann@users.noreply.github.com>
|
I created this PR from an upstream branch since I don't have push access to your fork. To take ownership of this branch and be able to push updates, run: Then you can close this PR and open a new one from your fork. |
Co-authored-by: DylanDylann <DylanDylann@users.noreply.github.com>
|
Fixed the failing Prettier check. The formatting issues were in both |
|
@MelvinBot Mark this PR as ready |
|
PR has been marked as ready for review ✅ |
|
@DylanDylann Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
|
@codex review |
Reviewer Checklist
Screenshots/Videos |
|
Codex Review: Didn't find any major issues. 🚀 ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
|
We did not find an internal engineer to review this PR, trying to assign a random engineer to #82912 as well as to this PR... Please reach out for help on Slack if no one gets assigned! |
|
🚧 @chuckdries has triggered a test Expensify/App build. You can view the workflow run here. |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/chuckdries in version: 9.3.33-0 🚀
|





Explanation of Change
getEligibleBankAccountsForCard()andgetEligibleBankAccountsForUkEuCard()inCardUtils.tsonly filtered bank accounts bytype === BUSINESSandallowDebit === true, without checking the account'sstate. This allowed partially set up bank accounts (in SETUP, VERIFYING, or PENDING states) to appear in the Expensify Card settlement account selector.This change adds a
!isBankAccountPartiallySetup(bankAccount?.accountData?.state)check to both functions, using the existing utility fromBankAccountUtils.ts. This is consistent with how other bank account filters in the codebase already handle this (e.g.,usePaymentOptions.ts,useBulkPayOptions.ts,WorkflowUtils.ts).Fixed Issues
$ #82912
Tests
Unit tests added:
getEligibleBankAccountsForCard— verifies OPEN accounts are included, and SETUP/VERIFYING/PENDING accounts are excludedgetEligibleBankAccountsForUkEuCard— verifies partially set up accounts are excludedVerify that no errors appear in the JS console
Offline tests
N/A — this change only affects which bank accounts are displayed in a list. No network requests are modified.
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
N/A — no UI changes, only filtering logic
Android: mWeb Chrome
N/A — no UI changes, only filtering logic
iOS: Native
N/A — no UI changes, only filtering logic
iOS: mWeb Safari
N/A — no UI changes, only filtering logic
MacOS: Chrome / Safari
N/A — no UI changes, only filtering logic