Repository navigation
[Wise] Submit business onboarding with SubmitWiseBusinessOnboarding - #104697
Closed
mikolajpochec wants to merge 3 commits into
Closed
mikolajpochec wants to merge 3 commits into
mikolajpochec wants to merge 3 commits into
Conversation
|
Hey, I noticed you changed If you want to automatically generate translations for other locales, an Expensify employee will have to:
Alternatively, if you are an external contributor, you can run the translation script locally with your own OpenAI API key. To learn more, try running: npx bun ./scripts/generateTranslations.ts --helpTypically, you'd want to translate only what you changed by running |
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.
Explanation of Change
Part of Wise Release 1 (US business onboarding).
Important
Stacked on two PRs: the intake form PR, #104696 (the onboarding pages, branch
@mikolajpochec/wise-intake-form), and the page saves PR, #104695 (UpdateWiseOnboardingAdditionalData, branch@mikolajpochec/wise-intake-save). Please review only the changes on top of them.This PR submits the business onboarding to Wise from the terms page. The answers are already on the server, since each page is saved when the user leaves it, so Confirm only sends what those saves did not.
What it adds:
SubmitWiseBusinessOnboardingcommand andsubmitWiseBusinessOnboardinginsrc/libs/actions/Wise.ts. Confirm on the terms page calls it withbankAccountID,termsAccepted, the representative'sssn, andpolicyIDwhen the onboarding started from Workspace > Workflows (the dynamic routes pass the workspace'spolicyIDdown to the terms page). A Wallet entry sends nopolicyID.makeRequestWithSideEffects, not as a queued write, so the request and the SSN in it are never stored in the request queue on the device, and a request that loses its connection is never sent again later. It still goes after any page save left in the queue, since Auth reads the answers those saves store.wiseBusinessOnboardingSubmit, not on the sharedreimbursementAccount. So a failed Submit puts no red dot on the Account tab or the workspace rows, and an app closed during the request never leaves Confirm loading. The error shows the App's standard way, above Confirm inFormAlertWithSubmitButton.wiseBusinessOnboardingForm), the terms page goes back to the onboarding, which opens that page (from the page saves PR). There the error shows under the field. An error on the read-only legal name, or under a key no page collects, keeps the user on the terms page with the error above Confirm. Both pages decide this with the samegetPageWithServerError. Each Submit first clears the field errors of the previous attempt, so an old one cannot send the next attempt back.ssn. This also coversUpdatePersonalDetailsForWallet, which sends one too.Note
After a successful Submit the doc opens the hosted form kickout. That page is built in its own PR, not merged yet, so for now Confirm closes the flow. The navigation to the kickout lands once that PR merges.
Important
HOLD on Auth:
SubmitWiseBusinessOnboardingdoes not exist yet. Until it lands, Confirm ends in the generic error.Points I'd like to discuss
Open questions
termsAcceptanceandmandateAcceptance, and Web builds them from two booleans. The terms page has three boxes (the certification, Expensify's terms, Wise's terms), and none of them is a direct-debit mandate (intake PR decision 7). This PR sendstermsAccepted: trueand nomandateAccepted. Do we need a fourth box with the mandate wording, or does one of the three cover it?ssnparameter onSubmitWiseBusinessOnboarding, and saves it toadditionalData.wise.representative.ssnbefore it creates the profile.makeRequestWithSideEffectsis the API's discouraged path, so this is a pattern to agree on. Options: (a) keep the request that is not queued; (b) make Submit a normal queued write, which stores the SSN in the request queue on the device until it finishes and sends it again after a crash; (c) send the SSN with the representative page save, as the doc says, with the same storage as (b) for as long as the device is offline.CONST.WISE.TERMS_URL,PRIVACY_URL). Web saves the accepted wording with the acceptance, so the wording should be final before this ships (intake PR decision 12).errorsintowiseBusinessOnboardingSubmitin its response, since the server can update a RAM-only key like any other. Should it, or is the generic message enough?Not in this PR
Fixed Issues
$ https://github.com/Expensify/Expensify/issues/692494
PROPOSAL:
Tests
Precondition: an account with the
wiseReimbursementsbeta and a USD business bank account in Wallet. Note itsbankAccountID. Open the browser's network tab./settings/wallet/global-reimbursements/<bankAccountID>, press Get started, fill in both pages (with the SSN and an ID file) and press Confirm on the confirmation pageSubmitWiseBusinessOnboardingrequest is sent withbankAccountID,termsAccepted, the SSN typed in step 1 and nopolicyID, and that Confirm shows a spinner while it runsSubmitWiseBusinessOnboardingrequest > Override content, replace the response with{"jsonCode": 400, "onyxData": [{"onyxMethod": "merge", "key": "wiseBusinessOnboardingForm", "value": {"errorFields": {"description": {"1": "Too vague"}}}}]}, save it, and press Confirmdescriptionin the override toregistrationNumber, and press ConfirmpolicyIDwiseBusinessOnboardingFormDraft) is emptyOffline tests
SubmitWiseBusinessOnboardingnetworkRequestQueueandnetworkOngoingRequestQueuedo not hold the SSN or aSubmitWiseBusinessOnboardingrequestSubmitWiseBusinessOnboardingrequest is sent until Confirm is pressed againQA Steps
Once
SubmitWiseBusinessOnboardingis in Auth (until then, Confirm ends in the generic error from Tests step 6):Precondition: an account with the
wiseReimbursementsbeta, two USD business bank accounts, and a workspace whose Workflows > Payments shows the global reimbursements banner.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