Part of the project
Main issue: https://github.com/Expensify/Expensify/issues/594776
Doc section: https://docs.google.com/document/d/1qmjliYT6Ce2lASacicvFqlvyFkihLd1wdYs5tGOmylE/edit?tab=t.0#heading=h.ri8s0oxwn42y
Feature Description
We’ll update the Payments section in the WorkspaceWorkflowsPage here
When the main payments toggle is enabled, we’ll show the Collect employee bank details toggle in subMenuItems
- If
policy.reimbursement.countries contains any country that is NOT the policy’s primary bank account (policy.achAccount), the Collect employee bank details toggle will already be enabled.
- Enabling the Collect employee bank details toggle should show a
MenuItemWithTopDescription for the policy’s bank account countries
- Title should be a comma separated list reimbursement countries in the policy
- Countries are the keys in
policy.reimbursement.countries
- We’ll use the mapping of country ISO codes to pretty names in
CONST.ALL_COUNTRIES
- Countries with a pendingAction will be shown in light gray text. A pending delete will also have strikethrough text.
- Description = “Business bank account countries”
- Pressing the menu item should open a new page in the RHP
WorkspaceReimbursementCountrySelector
- The page will have a
SelectionList with CONST.ALL_COUNTRIES as options
- Countries in
policy.reimbursement.countries will be selected
- If the policy has a bank account setup (
policy.achAccount), it’s country will be disabled so it cannot be deselected
- Selecting “Save” will call a new action
Policy.setReimbursementCountries
- Calls the
SetReimbursementCountries API command with policyID and countryISOList (comma separated string)
- Optimistic data:
- Adds/removes the country in
policy.reimbursement.countries with pendingAction
- Clear
policy.reimbursement.countries.errors
- Success data: clears the pending action
- Failure data:
- revert changes to
policy.reimbursement.countries
- set an error on
policy.reimbursement.countries.errors
- When an error occurs and policy.reimbursement.countries.errors is set, we’ll show a RBR on the path Workspaces > {workspace} > Workflows > Payments > Business bank account countries
- Workspaces button: add an additional check in
usePolicyIndicatorChecks
- Workspaces page: add an additional check in
WorkspaceRowBrickRoadIndicator
- Workspace settings page: set
brickRoadIndicator on the workflows menu item
- Business bank account countries: display a dismissible error using
OfflineWithFeedback
- Error message: "Your reimbursement countries update failed. Please try again."
Manual Test Steps
Payments toggle reveals collect bank details toggle
- As the admin, go to Workspaces > {workspace} > Workflows
- Enable the Payments toggle
- Verify
- The bank account setup button is shown
- A new Collect employee bank details toggle is shown
- As the admin, in Workflows > Payments, enable the Collect employee bank details toggle
- Verify a Business bank account countries item is shown
Edit reimbursement countries
- As the admin, connect a bank account
- Select the Business bank account countries push row
- Verify
- The country selector page opens in the RHP with a selection list of all countries
- The country for the policy’s bank account is selected and disabled so it cannot be deselected
- Select one or more countries and select Save
- Verify the setting shows a list of the selected countries
- Deselect a country and select Save
- Verify the country is removed from the list
Toggle and set countries offline
- As the admin, go to Workspaces > {workspace} > Workflows > Payments
- Enable Collect employee bank details and add a country
- Save
- Go offline
- Remove the selected country and add another one
- Verify
- The removed country shows as light gray with strikethrough text
- The added country shows as light gray
- Go online
- Verify
- The removed country is removed
- The added country is fully opaque
Failure shows RBR
- Enable Simulate failing network requests in test settings
- As the admin, go to Workspaces > {workspace} > Workflows > Payments
- Enable Collect employee bank details and add a Business bank account country
- Verify a RBR (red brick road) is shown on the path Workspaces > {workspace} > Workflows > Payments > Business bank account countries
- Disable Simulate failing network requests
- Add another business bank account country
- Verify the RBR is cleared
Automated Tests
We’ll add tests for the reimbursement countries list to verify it displays the correct list of countries.
Issue Owner
Current Issue Owner: @bernhardoj
Part of the project
Main issue: https://github.com/Expensify/Expensify/issues/594776
Doc section: https://docs.google.com/document/d/1qmjliYT6Ce2lASacicvFqlvyFkihLd1wdYs5tGOmylE/edit?tab=t.0#heading=h.ri8s0oxwn42y
Feature Description
We’ll update the Payments section in the
WorkspaceWorkflowsPagehereWhen the main payments toggle is enabled, we’ll show the Collect employee bank details toggle in
subMenuItemspolicy.reimbursement.countriescontains any country that is NOT the policy’s primary bank account (policy.achAccount), the Collect employee bank details toggle will already be enabled.MenuItemWithTopDescriptionfor the policy’s bank account countriespolicy.reimbursement.countriesCONST.ALL_COUNTRIESWorkspaceReimbursementCountrySelectorSelectionListwithCONST.ALL_COUNTRIESas optionspolicy.reimbursement.countrieswill be selectedpolicy.achAccount), it’s country will be disabled so it cannot be deselectedPolicy.setReimbursementCountriesSetReimbursementCountriesAPI command withpolicyIDandcountryISOList(comma separated string)policy.reimbursement.countrieswithpendingActionpolicy.reimbursement.countries.errorspolicy.reimbursement.countriespolicy.reimbursement.countries.errorsusePolicyIndicatorChecksWorkspaceRowBrickRoadIndicatorbrickRoadIndicatoron the workflows menu itemOfflineWithFeedbackManual Test Steps
Payments toggle reveals collect bank details toggle
Edit reimbursement countries
Toggle and set countries offline
Failure shows RBR
Automated Tests
We’ll add tests for the reimbursement countries list to verify it displays the correct list of countries.
Issue Owner
Current Issue Owner: @bernhardoj