Repository navigation
Add the Business bank account countries selector to workspace Payments - #105589
Conversation
…ries Co-authored-by: Nguyen Van Duc <dukenv0307@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. |
🦜 Polyglot Parrot! 🦜Squawk! Looks like you added some shiny new English strings. Allow me to parrot them back to you in other tongues: View the translation diffdiff --git a/src/languages/de.ts b/src/languages/de.ts
index c75f9063..84ede44e 100644
--- a/src/languages/de.ts
+++ b/src/languages/de.ts
@@ -3286,7 +3286,7 @@ ${amount} für ${merchant} – ${date}`,
collectEmployeeBankDetailsDescription: 'Erfassen Sie die Bankdaten Ihrer Mitarbeitenden, damit Sie ihnen Auslagen außerhalb von Expensify erstatten können.',
businessBankAccountCountries: 'Länder für Geschäftskonten',
businessBankAccountCountriesDescription: 'Mitarbeitende in diesen Ländern geben lokale Überweisungsdaten an. Alle anderen geben internationale Überweisungsdaten an.',
- businessBankAccountCountriesError: 'Die Aktualisierung deiner Erstattungsländer ist fehlgeschlagen. Bitte versuche es erneut.',
+ businessBankAccountCountriesError: 'Die Aktualisierung Ihrer Erstattungsländer ist fehlgeschlagen. Bitte versuchen Sie es erneut.',
customApprovalWorkflowEnabled:
'<muted-text-label>Für diesen Workspace ist ein benutzerdefinierter Genehmigungsworkflow aktiviert. Um diesen Workflow zu überprüfen oder zu ändern, wende dich bitte an deine:n <account-manager-link>Account Manager</account-manager-link> oder an <concierge-link>Concierge</concierge-link>.</muted-text-label>',
customApprovalWorkflowEnabledConciergeOnly:
diff --git a/src/languages/el.ts b/src/languages/el.ts
index 72ffa6e8..1b617cb9 100644
--- a/src/languages/el.ts
+++ b/src/languages/el.ts
@@ -3343,7 +3343,7 @@ ${amount} για ${merchant} - ${date}`,
collectEmployeeBankDetailsDescription: 'Συλλέξτε τα τραπεζικά στοιχεία των υπαλλήλων, ώστε να μπορείτε να τους αποζημιώνετε εκτός Expensify.',
businessBankAccountCountries: 'Χώρες επαγγελματικών τραπεζικών λογαριασμών',
businessBankAccountCountriesDescription: 'Οι υπάλληλοι σε αυτές τις χώρες δίνουν στοιχεία για τοπική μεταφορά. Όλοι οι υπόλοιποι δίνουν στοιχεία για διεθνές έμβασμα.',
- businessBankAccountCountriesError: 'Η ενημέρωση των χωρών αποζημίωσης απέτυχε. Δοκιμάστε ξανά.',
+ businessBankAccountCountriesError: 'Η ενημέρωση των χωρών αποζημίωσής σας απέτυχε. Δοκιμάστε ξανά.',
customApprovalWorkflowEnabled:
'<muted-text-label>Μια προσαρμοσμένη ροή έγκρισης είναι ενεργοποιημένη σε αυτόν τον χώρο εργασίας. Για να ελέγξετε ή να αλλάξετε αυτήν τη ροή, επικοινωνήστε με τον/την <account-manager-link>Account Manager</account-manager-link> σας ή το <concierge-link>Concierge</concierge-link>.</muted-text-label>',
customApprovalWorkflowEnabledConciergeOnly:
diff --git a/src/languages/es.ts b/src/languages/es.ts
index 51a37121..17be1fe8 100644
--- a/src/languages/es.ts
+++ b/src/languages/es.ts
@@ -3181,7 +3181,7 @@ ${amount} para ${merchant} - ${date}`,
businessBankAccountCountries: 'Países con cuenta bancaria de empresa',
businessBankAccountCountriesDescription:
'Los empleados de estos países proporcionan datos de transferencia local. Todos los demás proporcionan datos de transferencia bancaria internacional.',
- businessBankAccountCountriesError: 'No se pudieron actualizar tus países de reembolso. Inténtalo de nuevo.',
+ businessBankAccountCountriesError: 'La actualización de tus países de reembolso ha fallado. Por favor, inténtalo de nuevo.',
customApprovalWorkflowEnabled:
'<muted-text-label>Este espacio de trabajo tiene habilitado un flujo de aprobación personalizado. Para revisar o cambiar este flujo de trabajo, comunícate con tu <account-manager-link>Administrador de cuenta</account-manager-link> o <concierge-link>Concierge</concierge-link>.</muted-text-label>',
customApprovalWorkflowEnabledConciergeOnly:
diff --git a/src/languages/it.ts b/src/languages/it.ts
index dd383d75..a76461f8 100644
--- a/src/languages/it.ts
+++ b/src/languages/it.ts
@@ -3272,7 +3272,7 @@ ${amount} per ${merchant} - ${date}`,
collectEmployeeBankDetailsDescription: 'Raccogli i dati bancari dei dipendenti per poterli rimborsare al di fuori di Expensify.',
businessBankAccountCountries: 'Paesi del conto bancario aziendale',
businessBankAccountCountriesDescription: 'I dipendenti in questi paesi forniscono i dati per i bonifici locali. Tutti gli altri forniscono i dati per i bonifici internazionali.',
- businessBankAccountCountriesError: 'L’aggiornamento dei paesi di rimborso non è riuscito. Riprova.',
+ businessBankAccountCountriesError: 'L’aggiornamento dei tuoi paesi di rimborso non è riuscito. Riprova.',
customApprovalWorkflowEnabled:
'<muted-text-label>In questo spazio di lavoro è attivato un processo di approvazione personalizzato. Per rivedere o modificare questo processo, contatta il tuo <account-manager-link>Account Manager</account-manager-link> o <concierge-link>Concierge</concierge-link>.</muted-text-label>',
customApprovalWorkflowEnabledConciergeOnly:
diff --git a/src/languages/ja.ts b/src/languages/ja.ts
index f8dd5edf..57a1b977 100644
--- a/src/languages/ja.ts
+++ b/src/languages/ja.ts
@@ -3247,7 +3247,7 @@ ${date} の ${merchant} への ${amount}`,
collectEmployeeBankDetailsDescription: '従業員の銀行口座情報を収集して、Expensify以外で精算できるようにします。',
businessBankAccountCountries: 'ビジネス銀行口座の国',
businessBankAccountCountriesDescription: 'これらの国の従業員は現地送金の詳細を入力します。それ以外の方は国際電信送金の詳細を入力します。',
- businessBankAccountCountriesError: '精算対象国の更新に失敗しました。もう一度お試しください。',
+ businessBankAccountCountriesError: '精算対象の国の更新に失敗しました。もう一度お試しください。',
customApprovalWorkflowEnabled:
'<muted-text-label>このワークスペースではカスタム承認ワークフローが有効になっています。このワークフローを確認または変更するには、<account-manager-link>アカウントマネージャー</account-manager-link>または<concierge-link>Concierge</concierge-link>までご連絡ください。</muted-text-label>',
customApprovalWorkflowEnabledConciergeOnly:
@@ -7455,7 +7455,6 @@ _詳しい手順については、[ヘルプサイトをご覧ください](${CO
title: 'メンバーをコピー',
prompt: ({count, targetWorkspaceName}: {count: number; targetWorkspaceName: string}) => ({
one: `${targetWorkspaceName}のメンバーをこのワークスペースのメンバーで置き換えてもよろしいですか?`,
- // Japanese has no "one" plural category, so handle the single-workspace case here
other:
count === 1
? `${targetWorkspaceName}のメンバーをこのワークスペースのメンバーで置き換えてもよろしいですか?`
diff --git a/src/languages/nl.ts b/src/languages/nl.ts
index 8dd6d414..728e18e1 100644
--- a/src/languages/nl.ts
+++ b/src/languages/nl.ts
@@ -3275,7 +3275,7 @@ ${amount} voor ${merchant} - ${date}`,
collectEmployeeBankDetailsDescription: 'Verzamel de bankgegevens van medewerkers, zodat je ze buiten Expensify kunt terugbetalen.',
businessBankAccountCountries: 'Landen met zakelijke bankrekeningen',
businessBankAccountCountriesDescription: 'Werknemers in deze landen geven lokale overboekingsgegevens op. Iedereen daarbuiten geeft internationale overschrijvingsgegevens op.',
- businessBankAccountCountriesError: 'Het bijwerken van je terugbetalingslanden is mislukt. Probeer het opnieuw.',
+ businessBankAccountCountriesError: 'Je terugbetalingslanden bijwerken is mislukt. Probeer het opnieuw.',
customApprovalWorkflowEnabled:
'<muted-text-label>Er is een aangepaste goedkeuringsworkflow ingeschakeld voor deze workspace. Neem contact op met je <account-manager-link>Accountmanager</account-manager-link> of <concierge-link>Concierge</concierge-link> om deze workflow te bekijken of te wijzigen.</muted-text-label>',
customApprovalWorkflowEnabledConciergeOnly:
diff --git a/src/languages/pl.ts b/src/languages/pl.ts
index 06dfd7f2..5526f54f 100644
--- a/src/languages/pl.ts
+++ b/src/languages/pl.ts
@@ -3308,7 +3308,7 @@ ${amount} dla ${merchant} - ${date}`,
collectEmployeeBankDetailsDescription: 'Zbieraj dane bankowe pracowników, aby móc zwracać im wydatki poza Expensify.',
businessBankAccountCountries: 'Kraje firmowych kont bankowych',
businessBankAccountCountriesDescription: 'Pracownicy w tych krajach podają dane do lokalnego przelewu. Wszyscy pozostali podają dane do międzynarodowego przelewu bankowego.',
- businessBankAccountCountriesError: 'Nie udało się zaktualizować krajów zwrotu kosztów. Spróbuj ponownie.',
+ businessBankAccountCountriesError: 'Aktualizacja krajów zwrotu kosztów nie powiodła się. Spróbuj ponownie.',
customApprovalWorkflowEnabled:
'<muted-text-label>W tym obszarze roboczym jest włączony niestandardowy proces zatwierdzania. Aby przejrzeć lub zmienić ten proces, skontaktuj się ze swoim <account-manager-link>opiekunem klienta</account-manager-link> lub z <concierge-link>Concierge</concierge-link>.</muted-text-label>',
customApprovalWorkflowEnabledConciergeOnly:
diff --git a/src/languages/pt-BR.ts b/src/languages/pt-BR.ts
index 41827bd4..bc55417e 100644
--- a/src/languages/pt-BR.ts
+++ b/src/languages/pt-BR.ts
@@ -3274,7 +3274,7 @@ ${amount} para ${merchant} - ${date}`,
businessBankAccountCountries: 'Países de contas bancárias empresariais',
businessBankAccountCountriesDescription:
'Funcionários nesses países fornecem dados para transferência local. Todos os demais fornecem dados para transferência internacional via wire.',
- businessBankAccountCountriesError: 'Não foi possível atualizar seus países de reembolso. Tente novamente.',
+ businessBankAccountCountriesError: 'A atualização dos seus países de reembolso falhou. Tente novamente.',
customApprovalWorkflowEnabled:
'<muted-text-label>Um fluxo de aprovação personalizado está ativado neste workspace. Para revisar ou alterar esse fluxo de trabalho, entre em contato com o(a) seu(sua) <account-manager-link>Gerente de Conta</account-manager-link> ou com o <concierge-link>Concierge</concierge-link>.</muted-text-label>',
customApprovalWorkflowEnabledConciergeOnly:
diff --git a/src/languages/zh-hans.ts b/src/languages/zh-hans.ts
index c9dcdb15..74fa378e 100644
--- a/src/languages/zh-hans.ts
+++ b/src/languages/zh-hans.ts
@@ -3172,7 +3172,7 @@ ${amount},商户:${merchant} - 日期:${date}`,
collectEmployeeBankDetailsDescription: '收集员工的银行账户信息,以便在 Expensify 之外向他们报销。',
businessBankAccountCountries: '企业银行账户国家',
businessBankAccountCountriesDescription: '这些国家的员工需提供本地转账信息,其他员工需提供国际电汇信息。',
- businessBankAccountCountriesError: '报销国家更新失败,请重试。',
+ businessBankAccountCountriesError: '更新报销国家失败。请重试。',
customApprovalWorkflowEnabled:
'<muted-text-label>此工作区已启用自定义审批流程。若要查看或更改此流程,请联系您的<account-manager-link>客户经理</account-manager-link>或<concierge-link>Concierge</concierge-link>。</muted-text-label>',
customApprovalWorkflowEnabledConciergeOnly:
@@ -7284,7 +7284,6 @@ _如需更详细的说明,请[访问我们的帮助网站](${CONST.NETSUITE_IM
title: '复制成员',
prompt: ({count, targetWorkspaceName}: {count: number; targetWorkspaceName: string}) => ({
one: `确定要用此工作区的成员替换 ${targetWorkspaceName} 的成员吗?`,
- // Chinese has no "one" plural category, so handle the single-workspace case here
other: count === 1 ? `确定要用此工作区的成员替换 ${targetWorkspaceName} 的成员吗?` : `确定要用此工作区的成员替换 ${count} 个工作区的成员吗?`,
}),
},
Note You can apply these changes to your branch by copying the patch to your clipboard, then running |
Codecov Report❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.
|
|
🤖 Android test steps verification results: On standalone Android NewDot, the new toggles, the country selector, the offline pending styling, and the RBR path all work as described. 10 of 12 steps passed. Connecting a bank account was blocked by an emailed magic code, so the locked-country check (step 6) could not be verified.
|
|
@MelvinBot Currently we can't deselect the payment account country, so we should use the correct cursor |
Co-authored-by: Nguyen Van Duc <dukenv0307@users.noreply.github.com>
|
Fixed in c4bbc06. The locked bank account country no longer shows a pointer cursor.
Why the old setup showed a pointerThe page set Typecheck and the React Compiler check pass. I didn't test this in a browser, because the test account can't connect a bank account (it needs an emailed magic code), so no country is locked. |
Screen.Recording.2026-11-02.at.11.08.08.movScreen.Recording.2026-11-02.at.11.27.55.mov
|
|
No fix is needed. All code checks now pass on the latest commit, including Jest, TypeScript, ESLint, and Reassure. The only failing check is |
|
@MelvinBot Do #105589 (comment). I mean complete the checkist in the PR body |
|
@bernhardoj 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] |
|
I updated the PR and marked it ready for review.
The |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
This is already done. I checked the PR body just now, and it has:
I made no further changes. The |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c4bbc06b25
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
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".
| } | ||
|
|
||
| // Legacy US accounts can omit the country | ||
| return achBankAccount.accountData?.additionalData?.country ?? CONST.COUNTRY.US; |
There was a problem hiding this comment.
Read the bank account's top-level country
When a non-US bank-account-list entry supplies its country through the documented bankCountry field but omits the optional nested accountData.additionalData.country, this fallback misclassifies it as US. The selector consequently adds and locks US for a workspace whose withdrawal account is actually in another country, and saving can send that spurious country to SetReimbursementCountries; use bankCountry as a fallback before assuming a legacy US account.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Valid finding, fixed in 2c84f2f.
bankCountry is a top-level required field on BankAccount, and getEligibleBankAccountsForUkEuCard already reads it. getPolicyBankAccountCountry now checks the nested accountData.additionalData.country, then bankCountry, and only then assumes US. A non-US account with only bankCountry no longer adds and locks US.
I added a test for a GB account that has only bankCountry. The getReimbursementAccountCountries tests, typecheck, and lint pass.
Co-authored-by: Nguyen Van Duc <dukenv0307@users.noreply.github.com>
Co-authored-by: Nguyen Van Duc <dukenv0307@users.noreply.github.com>
|
Looks good to me now. @MelvinBot let's use this video in Screen.Recording.2026-11-07.at.11.02.07.mov |
|
Replaced the two previous videos in the PR’s MacOS: Chrome / Safari section with your new video. |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / SafariKapture.2026-11-07.at.13.27.04.mp4 |
|
@MelvinBot Why are the tests failing? |
|
These are different failures from the fixture/formatting errors already fixed:
Oxfmt and React Compiler checks pass. The next step is to rerun the failed checks on healthy runners, then investigate any type errors that persist. No code changes made. |
| sharees?: string[]; | ||
| }; | ||
|
|
||
| /** A country a policy collects employee deposit accounts for */ |
There was a problem hiding this comment.
| /** A country a policy collects employee deposit accounts for */ | |
| /** Reimbursement info for a specific country in a policy */ |
| }; | ||
|
|
||
| /** A country a policy collects employee deposit accounts for */ | ||
| type ReimbursementCountry = OnyxCommon.OnyxValueWithOfflineFeedback<{ |
There was a problem hiding this comment.
| type ReimbursementCountry = OnyxCommon.OnyxValueWithOfflineFeedback<{ | |
| type ReimbursementCountryInfo = OnyxCommon.OnyxValueWithOfflineFeedback<{ |
|
@MelvinBot Fix: #105589 (comment) and #105589 (comment). Then merge main |
Co-authored-by: Nguyen Van Duc <dukenv0307@users.noreply.github.com>
Co-authored-by: Nguyen Van Duc <dukenv0307@users.noreply.github.com>
|
🤖 Web test steps verification results: ❌ fail Applied both requested suggestions—updated the documentation and renamed the type to
|
|
🚧 arosiclair 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/arosiclair in version: 9.5.36-0 🚀
|
|
Created FullStory tracking recommendations, labeled Recommendations cover Save, country selection, opening the selector, search, and the automatically tracked page view. Only Save needs a new identifier; the other elements can reuse existing identifiers. |
|
Deploy Blocker #106634 was identified to be related to this PR |
|
Deploy Blocker #106635 was identified to be related to this PR |
|
🚀 Deployed to production by https://github.com/yuwenmemon in version: 9.5.36-0 🚀
Bundle Size Analysis (Sentry): |
































Explanation of Change
Pressing Business bank account countries under Workspaces > {workspace} > Workflows > Payments now opens a country selector in the RHP. Saving calls the new
SetReimbursementCountriesAPI. This is the last part of the linked issue. The toggle and the countries row are already merged. TheSetReimbursementCountriescommand is already live on the backend.Selector page (
WorkspaceReimbursementCountrySelectorPage): a searchable multi-select list ofCONST.ALL_COUNTRIESwith Save. It is gated on thecollectDepositAccountsbeta and Payments write access.Locked countries: the server never removes a country where the workspace has a withdrawal account. These countries show as selected and disabled, so the UI matches the server.
getReimbursementAccountCountriesfinds them from:reimbursement.countries.<ISO>.bankAccountIDpolicy.achAccount. It comes from the admin's bank account list. Legacy accounts with no country count as US. If the admin doesn't own the account, a USD workspace falls back to US.setReimbursementCountriesaction: sends the full list ascountryISOList.pendingAction: addordeleteper country.{}.Row: while offline, a pending country shows in muted text, and a pending delete is also struck through. Saved countries remain normal. While online, pending deletes are hidden and the remaining countries have no pending styling. A failure shows a dismissible error under the row and a red dot (RBR) on the row.
RBR path: the error is stored at
policy.errorFields.reimbursementCountries, not atpolicy.reimbursement.countries.errorsas the issue suggested. Reasons:shouldShowPolicyErrorcheck already raises the RBR on the Workspaces button (usePolicyIndicatorChecks) and the workspace list rowerrorskey mixed into the ISO-keyed countries map would need special handling everywhere the map is readI also added the error to the Workflows item on the workspace page.
Added the error copy, "Your reimbursement countries update failed. Please try again.", to all locales. I translated it myself, so it still needs copy review.
AI checks run:
npm run typecheck,npm run lint-changed,npm run fmt,npm run spell-changedand the React Compiler check on both components all pass. Jest: 3 newsetReimbursementCountriestests intests/actions/PolicyTest.tsand 3 new tests intests/unit/PolicyUtilsTest.ts. Both files pass in full (1,020 tests). I didn't test this in a browser.AI Tests
November 10 review update:
ReimbursementCountryInfo, updating its reference. No runtime behavior changed.CI fixture/formatting fix:
Main merge update:
Latest styling update:
prettiernpm script.Fixed Issues
$ #96084
PROPOSAL:
Tests
Precondition:
Enable collectDepositAccounts beta.
Offline tests
QA Steps
Same as tests
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, I verified the components usingAvatarare working as expected)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.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
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
Screen.Recording.2026-11-07.at.11.02.07.mov