feat: Gather KYB documents when verification fails for USD BA's#76033
feat: Gather KYB documents when verification fails for USD BA's#76033MrMuzyk wants to merge 46 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 ts-node ./scripts/generateTranslations.ts --helpTypically, you'd want to translate only what you changed by 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.
|
…07-usd-flow-kyb-files
…07-usd-flow-kyb-files
…07-usd-flow-kyb-files
…07-usd-flow-kyb-files
…07-usd-flow-kyb-files
…07-usd-flow-kyb-files
…07-usd-flow-kyb-files
…07-usd-flow-kyb-files
…07-usd-flow-kyb-files
…07-usd-flow-kyb-files
…07-usd-flow-kyb-files
…07-usd-flow-kyb-files
…07-usd-flow-kyb-files
…07-usd-flow-kyb-files
…07-usd-flow-kyb-files
…07-usd-flow-kyb-files
|
@gijoe0295 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] |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ec512c7955
ℹ️ 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".
| ); | ||
|
|
||
| const defaultValues = { | ||
| companyTaxID: reimbursementAccountDraft?.companyTaxID ?? [], |
There was a problem hiding this comment.
Avoid reusing
companyTaxID form key for KYB file uploads
This uses the same key as the business Tax ID text field (companyTaxID) but treats it as FileObject[] on this page. When a draft contains a prior Tax ID string (e.g., from editing), uploadedFiles.companyTaxID is initialized with that string and later spread/serialized as files, which can send invalid payload data (first character of the string) instead of an uploaded file. Use a distinct upload field key and map it explicitly to the API parameter to avoid cross-step type collisions.
Useful? React with 👍 / 👎.
|
Requested confirmation of translations |
|
I think @joekaufmanexpensify is best suited for the product review of this one. Looks okay to me though! |
|
Nice, I'll take a look! |
gijoe0295
left a comment
There was a problem hiding this comment.
Haven't been able to test this because site is down
| userAddressVerificationDescription: dedent(` | ||
| Please upload one of the following files: | ||
| • Voter Registration Card | ||
| • Drivers License |
There was a problem hiding this comment.
| • Drivers License | |
| • Driver's License |
| /** Statuses of additional checks hinting at missing documents user still needs to upload */ | ||
| verifications?: { | ||
| /** points towards one of external providers */ | ||
| externalApiResponse?: { |
There was a problem hiding this comment.
Mismatch with backend screenshot here #75707 (comment)
| externalApiResponse?: { | |
| externalApiResponses?: { |
| }> | ||
| | undefined, | ||
| ): boolean { | ||
| return status !== 'pass' && !!CONST.BANK_ACCOUNT.KYB_REQUESTOR_IDENTITY_ERROR.DOB.find((error) => qualifiers?.map((qualifier) => qualifier.key).includes(error)); |
There was a problem hiding this comment.
Please create a constant for 'pass' in CONST/index.ts.
Also why don't we check exact match === here?
There was a problem hiding this comment.
We agreed that anything else than 'pass' status is enough to require a document from user
| [CONST.BANK_ACCOUNT.STEP.COMPANY]: CONST.BANK_ACCOUNT.PAGE_NAMES.COMPANY, | ||
| [CONST.BANK_ACCOUNT.STEP.BENEFICIAL_OWNERS]: CONST.BANK_ACCOUNT.PAGE_NAMES.BENEFICIAL_OWNERS, | ||
| [CONST.BANK_ACCOUNT.STEP.ACH_CONTRACT]: CONST.BANK_ACCOUNT.PAGE_NAMES.ACH_CONTRACT, | ||
| [CONST.BANK_ACCOUNT.STEP.KYB_DOCS]: CONST.BANK_ACCOUNT.PAGE_NAMES.KYB_DOCS, |
There was a problem hiding this comment.
I can't see we navigate to this step any where in App. Is it controlled by the backend?
There was a problem hiding this comment.
The step is set by BE, yes - https://expensify.slack.com/archives/C01GTK53T8Q/p1764762713169849?thread_ts=1763989665.580719&cid=C01GTK53T8Q
| const [betas] = useOnyx(ONYXKEYS.BETAS); | ||
| const [isSelfTourViewed] = useOnyx(ONYXKEYS.NVP_ONBOARDING, {selector: hasSeenTourSelector}); | ||
| const {accountID: currentUserAccountID} = useCurrentUserPersonalDetails(); | ||
| const reimbursementAccountData = reimbursementAccount?.achData?.verifications?.externalApiResponse; |
There was a problem hiding this comment.
| const reimbursementAccountData = reimbursementAccount?.achData?.verifications?.externalApiResponse; | |
| const reimbursementAccountVerificationData = reimbursementAccount?.achData?.verifications?.externalApiResponse; |
There was a problem hiding this comment.
Can we move these functions to BankAccountUtils? I believe there could be more similar ones in the future.
| const validate = (values: FormOnyxValues<typeof ONYXKEYS.FORMS.REIMBURSEMENT_ACCOUNT_FORM>): FormInputErrors<typeof ONYXKEYS.FORMS.REIMBURSEMENT_ACCOUNT_FORM> => { | ||
| const errors: FormInputErrors<typeof ONYXKEYS.FORMS.REIMBURSEMENT_ACCOUNT_FORM> = {}; | ||
|
|
||
| for (const document of DOCUMENTS_CONFIG.filter((documentItem) => documentItem.required)) { |
There was a problem hiding this comment.
| for (const document of DOCUMENTS_CONFIG.filter((documentItem) => documentItem.required)) { | |
| for (const document of requiredDocuments) { |
|
This is just for Tincheck/LexisNexis/IDology, yeah ? I see the mocks in the GH issue mention GIACT, but then there is no mention of that in the detailed description. |
|
Hey, the PR that this was held on was reverted so we need to wait a bit here before moving forward - Im currently fixing the issues that caused the revert - after that I'll get back to it.
Maybe @madmax330 can answer that - I was just told the fields to look out for 😅 If I remember correctly GIACT error is appearing in response already but we're not acting on the error in any way. |
…pensify-App into feat/75707-usd-flow-kyb-files
|
I've applied or responded to all of the comments, thank you. The PR that its is being held on right now is still in review. Hopefully we will be able to proceed here soon. Let me know if you have any more comments regarding the code itself here. This was developed over spans of many months as various BE adjustments were needed. This thread might be helpful for you to get whole context |
|
The PR its held on is still being tested atm -> #90302 (comment) |
Explanation of Change
Fixed Issues
$ #75707
PROPOSAL:
Tests
Same as QA steps
Testing this requires to have an account that was manually set to a certain state, ie: #75707 (comment)
We will make sure that current functionality works without any issues, ship the new step and look out for regressions - https://expensify.slack.com/archives/C01GTK53T8Q/p1778070528787499?thread_ts=1763989665.580719&cid=C01GTK53T8Q
Offline tests
QA Steps
Verify you can connect USD bank account to USD workspace without any issue
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand 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
android-native.mp4
Android: mWeb Chrome
android.mweb.mp4
iOS: Native
ios-native.mp4
iOS: mWeb Safari
ios.web.mp4
MacOS: Chrome / Safari
web.mp4