Skip to content

Add bank account filter to Search#90791

Merged
JS00001 merged 146 commits into
Expensify:mainfrom
allgandalf:add-bank-account-search-filter
Jun 29, 2026
Merged

Add bank account filter to Search#90791
JS00001 merged 146 commits into
Expensify:mainfrom
allgandalf:add-bank-account-search-filter

Conversation

@allgandalf

@allgandalf allgandalf commented May 15, 2026

Copy link
Copy Markdown
Contributor

Explanation of Change

Adds a new bankAccount filter on the expense Search advanced filters page so users with multiple settlement bank accounts can scope results to a single bank. Picker source is the user's bankAccountList, multi-select, displayed as ${bankName} xx${last4} to match the existing "Bank account" column on withdrawalID grouping. Filter row is gated to expense type and only renders when the user has at least one bank account. Backend half lands in Expensify/Auth#21649.

Fixed Issues

$ #88385
PROPOSAL: #88385 (comment)

Tests

Preconditions (one-time setup):

  • A workspace with ACH reimbursement enabled
  • Two validated withdrawal bank accounts on the workspace, created via ./script/clitools.sh generator:bankaccount (choose Withdrawal, validated, upgraded). Run twice
  • An employee on the policy with a validated deposit bank account so reimbursements can actually settle to them

Seed data:

  1. In workspace settings, set the policy's preferred reimbursement to bank A
  2. Generate reports paid via bank A: ./script/clitools.sh generator:report (answer Y to submit and approve)
  3. Switch the policy's preferred reimbursement to bank B in workspace settings
  4. Generate reports paid via bank B: ./script/clitools.sh generator:report
  5. For each generated report, open the report in NewDot and click Pay via bank account in the report header so the reimbursement actually settles. without this step the filter has no row to match

Filter checks:

  1. Sign in as the admin
  2. Go to Search and confirm the type is Expenses
  3. Tap the Filters button and confirm a new "Bank account" row appears in the advanced filters list
  4. Open the row, confirm each bank account is shown as ${bankName} xx${last4} with the bank icon
  5. Select bank A, save, confirm only the bank-A-paid expenses are returned and the filter chip renders on the search header with the same label
  6. Open the filter again, multi-select bank A and bank B, save, confirm both sets are returned and the chip shows both labels comma-separated
  7. Confirm the URL query has bankAccount:<id> (or <id1>,<id2>) and reloading the page rehydrates the selection
  8. Type bank-account: in the autocomplete bar and confirm the user-friendly suggestions for each bank account appear, alphabetically sorted
  9. Switch the Search type to Chat or Trip and confirm the "Bank account" row no longer shows in advanced filters
  10. Sign in with an account that has no bank accounts and confirm the row does not show even on expense type
  • Verify that no errors appear in the JS console

Offline tests

The filter UI reads from Onyx bankAccountList so the picker, chip rendering, and autocomplete substitution all work offline once the data has been cached. Saving the filter queues a Search request that will be sent on reconnect. Steps:

  1. Go offline before opening the picker, confirm the bank account list still renders
  2. Save a filter selection while offline, confirm the chip renders and the query is queued
  3. Reconnect, confirm the Search request fires with the queued bankAccount filter

QA Steps

Preconditions:

  • A workspace with ACH reimbursement enabled
  • Two validated withdrawal bank accounts on the workspace (admin)
  • An employee on the policy with a validated deposit bank account so reimbursements can settle to them, otherwise the filter has nothing to match
  • At least one expense report submitted, approved, and paid via bank A and another paid via bank B. Use the Pay via bank account button on the report header to actually settle each reimbursement

Steps:

  1. Sign in as the admin
  2. Go to Search and pick the Expenses type
  3. Tap Filters and confirm a "Bank account" row is shown in the advanced filters list
  4. Open the row, confirm each bank account is shown as ${bankName} xx${last4} with the bank icon
  5. Select bank A, save, confirm only the bank-A-paid expenses are returned
  6. Open the filter, multi-select bank A and bank B, save, confirm both sets are returned and the chip shows both labels comma-separated
  7. Type bank-account: in the autocomplete bar and confirm the user-friendly suggestions appear, alphabetically sorted
  8. Switch the Search type to Chat or Trip and confirm the "Bank account" row no longer shows
  9. As an account with no bank accounts visible, confirm the row does not show even on expense type
  • Verify that no errors appear in the JS console

PR Author Checklist

  • I linked the correct issue in the ### Fixed Issues section above
  • I wrote clear testing steps that cover the changes made in this PR
    • I added steps for local testing in the Tests section
    • I added steps for the expected offline behavior in the Offline steps section
    • I added steps for Staging and/or Production testing in the QA steps section
    • I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
    • I tested this PR with a High Traffic account against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).
  • I included screenshots or videos for tests on all platforms
  • I ran the tests on all platforms & verified they passed on:
    • Android: Native
    • Android: mWeb Chrome
    • iOS: Native
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
  • I followed proper code patterns (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick)
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text shown in the product is localized by adding it to src/languages/* files and using the translation method
      • If any non-english text was added/modified, I used JaimeGPT to get English > Spanish translation. I then posted it in #expensify-open-source and it was approved by an internal Expensify engineer. Link to Slack message:
    • I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
    • I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
    • I verified the JSDocs style guidelines (in STYLE.md) were followed
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I followed the guidelines as stated in the Review Guidelines
  • I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected)
  • I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
  • I verified any variables that can be defined as constants (ie. in CONST.ts or at the top of the file that uses the constant) are defined as such
  • I verified that if a function's arguments changed that all usages have also been updated correctly
  • If any new file was added I verified that:
    • The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))
  • If new assets were added or existing ones were modified, I verified that:
    • The assets are optimized and compressed (for SVG files, run npm run compress-svg)
    • The assets load correctly across all supported platforms.
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • If a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
  • I added unit tests for any new feature or bug fix in this PR to help automatically prevent regressions in this user flow.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.
Screen.Recording.2026-05-23.at.3.31.33.PM.mov

allgandalf added 30 commits May 15, 2026 20:55
@allgandalf
allgandalf requested a review from Eskalifer1 June 26, 2026 13:57
@JS00001

JS00001 commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

@allgandalf conflicts

@JS00001

JS00001 commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

@Eskalifer1 back to you

@Eskalifer1

Eskalifer1 commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Hi @JS00001!

I have checked, and already approved it!

@JS00001

JS00001 commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

@allgandalf is this one ready to merge then?

@allgandalf

Copy link
Copy Markdown
Contributor Author

yessss!

@JS00001

JS00001 commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

nice, reviewing!

@JS00001
JS00001 merged commit be8bebb into Expensify:main Jun 29, 2026
35 checks passed
@OSBotify

Copy link
Copy Markdown
Contributor

✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

@github-actions

Copy link
Copy Markdown
Contributor

🚧 JS00001 has triggered a test Expensify/App build. You can view the workflow run here.

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to staging by https://github.com/JS00001 in version: 9.4.25-0 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

@jponikarchuk

Copy link
Copy Markdown

Deploy Blocker #94967 was identified to be related to this PR.

@kavimuru

Copy link
Copy Markdown

@allgandalf @heyjennahay We don't see an option to add 2nd withdrawal account on a workspace. How should we add that

Two validated withdrawal bank accounts on the workspace (admin)

image

@allgandalf

Copy link
Copy Markdown
Contributor Author

@allgandalf @heyjennahay We don't see an option to add 2nd withdrawal account on a workspace. How should we add that

Please add it on another workspace

@jponikarchuk

Copy link
Copy Markdown

Deploy Blocker #95053 was identified to be related to this PR.

@OSBotify

OSBotify commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/cristipaval in version: 9.4.25-2 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

Bundle Size Analysis (Sentry):

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.

8 participants