Repository navigation
[Wise] [No QA] Support enhanced due diligence - #105655
mikolajpochec wants to merge 28 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 |
|
@ZhenjaHorbach 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] |
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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fd5730d702
ℹ️ 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".
|
Some questions here, cc @danieldoglas @grgia It seems to me that when collecting the source of wealth, for each one we should also ask if that will be used to fund in the context of answering "Out of all the financial buckets your business has access to, which one(s) are you relying on to capitalize, fund, or operate this newly created account?”. https://docs.wise.com/guides/product/account-setup/customer-onboarding/kyc-requirement-types#business_source_of_wealth_info And it seems that we should send the proof file for each of the source of wealth and also tell which type of document that is. So the page asking the files seems to be missing that. It's just send raw files without proper mapping for source and doc type: https://docs.wise.com/guides/product/account-setup/customer-onboarding/kyc-requirement-types#business_source_of_wealth_proof |
This was feedback from wise, originally it was thought to be only one- will need to look into how wise would differentiate and update the Save command |
|
@heekinho I am confirming with wise here - https://expensify.slack.com/archives/C0AMKE9PMEZ/p1793650586983249?thread_ts=1793650538.648989&cid=C0AMKE9PMEZ |
|
Thanks, @grgia! No access to that, tho 😄 |
…-enhanced-due-diligence # Conflicts: # src/pages/settings/Wallet/EnableGlobalReimbursements/Wise/WiseBusinessOnboardingPage.tsx
|
It is Web, not the App. The firewall rule for |
|
I tested and noticed this as well in App PR. Please check it. Testing your PR |
|
Yes. Only passes for me with the following changes here: - inputs: Object.keys(inputs).length > 0 ? JSON.stringify(inputs) : '[]',
+ inputs: Object.keys(inputs).length > 0 ? JSON.stringify(inputs) : '{}', |
|
Thank you for your comments @joekaufmanexpensify! I've addressed them, and just to make clear how things are after the new commits:
While testing I also found that the server keeps only 20 new files per save and drops the rest without an error. I think we should handle that in the UI somehow. @grgia @joekaufmanexpensify, how would you like us to show it? I think it's worth doing in a follow-up. |
…-enhanced-due-diligence # Conflicts: # src/components/UploadFile.tsx # tests/ui/pages/settings/Wallet/WiseBusinessOnboardingPageTest.tsx
Agree, lets fix in this PR: cap the total at 20 files per save in the UI and show the existing "too many files" error.
|
|
That all sounds good to me. I will retest in a bit. 🫡 |
|
🚧 joekaufmanexpensify has triggered a test Expensify/App build. You can view the workflow run here. |
This comment has been minimized.
This comment has been minimized.
|
I retested this navigation bug and confirmed it is working correctly when you go from one to multiple sources of wealth selected from the confirmation page. However, if you already have multiple selected and add an additional one on top of that (for example, 2 to 3), we're still skipping the Fund Daily Operations question after you select the additional source of wealth. I don't think that's the correct implementation. I would expect that any time you add an additional source of wealth from the confirmation page, we would prompt you to select whether to update your response to the "fund daily operations" question (because any additional source of wealth selected could presumably fund daily operations). Please see video below. 2026-11-13_13-56-20.mp4 |
BUG: renaming documents after revisiting the document upload page from the confirmation pageInitially, when the user uploads a document, we show the file name in the frontend. If you then revisit the file upload page from the confirmation page, we seem to be showing some type of internal document reference name instead of the user's file name. I find this a bit confusing. I think it's helpful feedback to the user to always show them their document file name in the frontend for what they have uploaded. 2026-11-13_14-06-22.mp4 |
|
All of the other fixes are working well from my perspective! |
@mikolajpochec are we using the existing component? I thought we already use this new pattern in some inputs in app which definitely have scroll |
Yes, we are! One prop was missing, I've added it 😄. It now scrolls correctly 1.Wallet.-.High.memory.usage.-.1.3.GB.-.Google.Chrome.Mi.2026-11-16.at.12.35.04.mov |
That makes more sense. Fixed in d07eb56. Now any newly added source of wealth brings back the daily operations page, with your previous answers already selected.
I agree it's not what you'd expect. The backend changes these names. It adds a prefix, lowercases them, and replaces spaces, dots and non-English characters with |
Done, I've applied this fix too. The error shows under the source where the count of new files goes over the cap. The limit of 10 files now counts all buttons of a source together. Regarding uploading the same file twice, I've implemented a naive solution comparing normalized names, to match the server's naming convention. |
|
🚧 joekaufmanexpensify has triggered a test Expensify/App build. You can view the workflow run here. |
|
@grgia @joekaufmanexpensify All comments have been addressed! 😄 |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
joekaufmanexpensify
left a comment
There was a problem hiding this comment.
The fixes for the two bugs I reported are both working well. Good from my perspective. 👍
|
|
||
| /** Saved files come back from the server with lowercased names and symbols replaced, so names are compared in that form to catch the same file picked again */ | ||
| function getComparableFileName(fileName = ''): string { | ||
| return fileName.toLowerCase().replaceAll(/[^a-z0-9]/g, '_'); |
There was a problem hiding this comment.
Blocks
an admin who uploads two documents with Japanese, Chinese or Cyrillic names of the same length under one upload button sees "A file with the same name is already added" and the second file is left out.
getComparableFileName turns 契約書.pdf and 請求書.pdf both into ____pdf, and UploadFile on the non-USD bank account pages goes through it too. can the looser compare apply only against saved files?
There was a problem hiding this comment.
I agree this is a problem. I'll fix the blocking part. New files will be compared by their exact names, so 契約書.pdf and 請求書.pdf can both go under one button.
But there's a bigger problem that the frontend can't fix. The server seems to replace every UTF-8 byte of a non-English name with _, so both files above are stored as _________.pdf. A user who uploads such files can't tell them apart when they continue onboarding later, on the same or another device.
I think it's worth opening a backend issue for this one. I suppose the cleanup happens because of Wise's API requirements, so couldn't we store the original name on our server and send the processed one when the user submits?
There was a problem hiding this comment.
Thanks for the fix @mikolajpochec, comparing new files by their own names covers it. The files are safe, each one gets its own key, so only the name is lost. I've opened https://github.com/Expensify/Expensify/issues/705057 for the names, on hold until Singapore onboarding.
…-enhanced-due-diligence # Conflicts: # src/components/SelectionList/ListItemComposed/ListItemPressable.tsx

Explanation of Change
Asks for the source of wealth of a business that needs enhanced due diligence, behind the
wiseReimbursementsbeta.When the pages show
achData.wise.kycRequirements,requestedBy: EXPENSIFY). They add pages after the business page.isHostedOnly, or one the App has no page for, adds no page.Pages
attributes.acceptedValues.Saving
BUSINESS_SOURCE_OF_WEALTH_INFO, assourceOfWealthListwith one{businessSourceOfWealthInfo, isSourceOfFund}entry per source.isSourceOfFund. A lone source sendstrue. A newly added source sendsfalseuntil page 2 says otherwise.BUSINESS_SOURCE_OF_WEALTH_PROOF:proofFile-<source>-<documentType>documentslists every key of every picked source, empty lists includedinputsis{}, since Auth rejects[]with "Inputs is not a valid json object"Upload buttons (from
attributes.acceptedDocumentTypesBySource)attributes.sourcesNeedingBankStatementgets its own "Upload bank statement" button, with a hint on what the statement must show.File rules
_, as the server stores them.Shared components
uploads: one entry per button, with itsfileTypes, label and hint.UploadFilemoved tosrc/components/UploadFile/. Its picker can draw its own control.Fixed Issues
$ https://github.com/Expensify/Expensify/issues/693935
PROPOSAL:
Tests
A dev account has no Bancorp-verified US business account, so the snippet below adds the account and the requirements by hand, with the attributes Wise sends for a high-risk industry. A fetch of the bank account list overwrites the account, so paste it again after a reload.
Console snippet
Paste this in the browser console (web) or run it through the JS debugger (native) on Account > Wallet:
setRequirements()and verify that "Where does your company's money come from?" opens with a checkbox list of all eight sourcesUpdateWiseOnboardingAdditionalDatawas sent:step=BUSINESS_SOURCE_OF_WEALTH_INFOandsourceOfWealthListininputs, the two funding sources withisSourceOfFund: trueand revenue withisSourceOfFund: falsestep=BUSINESS_SOURCE_OF_WEALTH_PROOF,inputs={},documentslisting theproofFile-REVENUE-*,proofFile-BUSINESS_LOAN-*andproofFile-FUNDING_AND_SHAREHOLDER_INVESTMENTS-*keys, and the files asproofFile-<source>-<documentType>[0]UpdateWiseOnboardingAdditionalDatasends "Grants" withisSourceOfFund: false, and that "Which sources fund your daily operations?" opens with "Business loan" and "Funding & shareholder investments" already selectedsetRequirements([])and verify that the requirement rows are gone from the confirmation pageOffline tests
N/A
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