Skip to content

[WIP - BULLET TESTING][No QA][Wise][Payments][New Feature] Type the Wise business onboarding data and define its first form page - #103979

Closed
grgia wants to merge 17 commits into
mainfrom
georgia-wise-business-form-main
Closed

grgia wants to merge 17 commits into
mainfrom
georgia-wise-business-form-main

Conversation

@grgia

@grgia grgia commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

This PR is a worked example, not a feature. It adds the Onyx types for Wise onboarding and then uses them once, end to end, so you can see how the pieces fit: a business page we wrote ourselves, two source-of-wealth pages we collect up front so Wise does not have to ask for them after we submit, a small registry that says "for this Wise requirement type, show this page", and the function that puts the pages in order. Nothing is wired to a screen. The point is to agree on the shapes before anyone builds the real pages on top of them.

Explanation of Change

The Onyx types and form definitions for Wise onboarding, settling how every Wise form is defined, rendered and stored before the screens are built. No screen uses them yet.

One renderer, DynamicFormFlow, draws every form from a DynamicFormSchema: either {pages} or a flat {fields} list it paginates. What differs is where the schema comes from, and that follows one rule: the schema lives with whoever defines the fields.

Form Fields defined by Schema lives in Onyx
Business profile pages Us Wise/forms/US.ts, one file per country answers on achData.wise
KYC requirement pages Wise, as named types with documented fields; the API returns only the keys Wise/kycRequirementLayouts.ts, one layout per key keys in wiseKYCRequirements; answers under achData.wise.requirements.<key>, files under .documents.<key>.<field>
Employee bank account Wise, per country and currency; the API returns the fields the server, translated into DynamicFormField[] wiseBankAccountFields, never stored

wiseKYCRequirements is one list with two sources. Each entry is {key, state, hostedOnly, requestedBy, attributes?}. Before Submit the server lists the requirements the intake should collect so Wise does not have to ask for them afterwards (requestedBy: EXPENSIFY); the business page save returns the list in the same response, so the two source-of-wealth pages appear from one click. After Submit the list is Wise's live review (requestedBy: WISE) and drives the "more info" tasks. A key with no layout, or marked hostedOnly, opens Wise's embedded page. attributes passes through Wise's own data for a requirement, such as requiredUbos; nothing reads it yet.

A page that collects a requirement is keyed by it. Its field keys are Wise's field names, so saving under requirements.<key> is mechanical and Submit shapes the stored answers into Wise's payload. The proof page asks the source again so it stands alone when Wise raises it after Submit.

What the App never holds. The enhanced due diligence trigger, which lives in Auth and arrives only as the list above. The full SSN, which is encrypted server-side; the client gets ssnLast4 and noSSN. Which documents Wise accepts for which source: the proof page lists Wise's document types unnarrowed until Wise confirms the mapping can ship.

  • WiseBusinessOnboarding on achData.wise: status, currency, step, business, representative, requirements, documents
  • bankAccountList items get wise.status and globalReimbursementProvider
  • RAM_ONLY_WISE_KYC_REVIEW_EMBEDDED_LINK for the embedded link, whose fragment carries a token
  • CONST.WISE: requirement types, sources, document types, roles, categories, statuses
  • Both Wise keys sit in the export masking buckets

Fixed Issues

For https://github.com/Expensify/Expensify/issues/692493

Tests

  1. Run npm run test -- tests/unit/pages/settings/Wallet/EnableGlobalReimbursements/WiseOnboardingFormTest.ts.
  2. Run npm run typecheck.
  • Verify that no errors appear in the JS console

Offline tests

None. No screen uses the form yet.

QA Steps

None. No user-facing change.

  • Verify that no errors appear in the JS console

PR Author Checklist

Expand
  • I linked the correct issue in the ### Fixed Issues section above
  • I wrote clear testing steps that cover the changes made in this PR
    • I added steps for local testing in the Tests section
    • I added steps for the expected offline behavior in the Offline steps section
    • I added steps for Staging and/or Production testing in the QA steps section
    • I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
  • I included screenshots or videos for tests on all platforms
  • I ran the tests on all platforms & verified they passed on:
    • Android: Native
    • Android: mWeb Chrome
    • iOS: Native
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
    • MacOS: Desktop
  • I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
  • I followed proper code patterns (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick)
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text shown in the product is localized by adding it to src/languages/* files and using the translation method
      • If any non-english text was added/modified, I used JaimeGPT to get English > Spanish translation. I then posted it in #expensify-open-source and it was approved by an internal Expensify engineer. Link to Slack message:
    • I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
    • I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
    • I verified the JSDocs style guidelines (in STYLE.md) were followed
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I followed the guidelines as stated in the Review Guidelines
  • I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected)
  • I verified all code is DRY (the same code is not repeated in different components)
  • I verified any variables that determine the style of a component are DRY
  • I verified any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
  • I verified that if a function's arguments changed that all usages have also been updated correctly
  • If any new file was added I verified that:
    • The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))
  • If the PR modifies code that runs when a user signs in, or signs out, I verified there are no console errors
  • If the PR modifies a generic component, I tested and verified that it works correctly in all the places it's used in the app
  • I verified that all UX-related changes work on all supported platforms and browsers
  • I verified the lint checks pass
  • I verified the typescript checks pass
  • I verified that jest unit tests pass
  • If any new or modified reusable components were added I verified they work well in all supported platforms

Screenshots/Videos

Android: Native

N/A, no user-facing change

Android: mWeb Chrome

N/A, no user-facing change

iOS: Native

N/A, no user-facing change

iOS: mWeb Safari

N/A, no user-facing change

MacOS: Chrome / Safari

N/A, no user-facing change

MacOS: Desktop

N/A, no user-facing change

@OSBotify

This comment has been minimized.

* is the key the screen prefills it from. Pages are added one at a time with their Auth step.
*/
const US: DynamicFormSchema = {
pages: [

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note this is just an example, we will add the actual pages in individual PRs

@OSBotify

Copy link
Copy Markdown
Contributor

🦜 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 diff
diff --git a/src/languages/de.ts b/src/languages/de.ts
index 9443b7ef..4df9e53c 100644
--- a/src/languages/de.ts
+++ b/src/languages/de.ts
@@ -12052,5 +12052,18 @@ Hier ist ein *Testbeleg*, um dir zu zeigen, wie es funktioniert:`,
         mobileRenewPrompt: 'Besuchen Sie Expensify in Ihrem Webbrowser, um vorzeitig zu verlängern.',
         mobileClaimPrompt: 'Besuchen Sie Expensify in Ihrem Webbrowser, um Ihren Verlängerungsrabatt zu erhalten.',
     },
+    wiseOnboarding: {
+        business: {
+            title: 'Geben Sie Ihre Unternehmensinformationen ein',
+            legalName: 'Rechtlicher Unternehmensname',
+            companyRole: 'Ihre Rolle im Unternehmen',
+            companyRoleOwner: 'Inhaber',
+            companyRoleDirector: 'Direktor',
+            companyRoleOther: 'Sonstiges',
+            industryCategories: 'Branche',
+            businessDescription: 'Unternehmensbeschreibung',
+            businessDescriptionHint: 'Beschreiben Sie kurz, was Ihr Unternehmen macht.',
+        },
+    },
 };
 export default translations;
diff --git a/src/languages/el.ts b/src/languages/el.ts
index 45c848e2..29045be7 100644
--- a/src/languages/el.ts
+++ b/src/languages/el.ts
@@ -12289,5 +12289,18 @@ ${reportName}`,
         mobileRenewPrompt: 'Επισκεφθείτε το Expensify στον περιηγητή ιστού σας για να ανανεώσετε νωρίτερα.',
         mobileClaimPrompt: 'Επισκεφθείτε το Expensify στον φυλλομετρητή σας για να διεκδικήσετε την έκπτωση ανανέωσης.',
     },
+    wiseOnboarding: {
+        business: {
+            title: 'Εισαγάγετε τα στοιχεία της επιχείρησής σας',
+            legalName: 'Νόμιμη επωνυμία επιχείρησης',
+            companyRole: 'Ο ρόλος σας στην εταιρεία',
+            companyRoleOwner: 'Ιδιοκτήτης',
+            companyRoleDirector: 'Διευθυντής',
+            companyRoleOther: 'Άλλο',
+            industryCategories: 'Κλάδος',
+            businessDescription: 'Περιγραφή επιχείρησης',
+            businessDescriptionHint: 'Περιγράψτε σύντομα με τι ασχολείται η εταιρεία σας.',
+        },
+    },
 };
 export default translations;
diff --git a/src/languages/es.ts b/src/languages/es.ts
index 6a5faeed..8b568575 100644
--- a/src/languages/es.ts
+++ b/src/languages/es.ts
@@ -769,9 +769,9 @@ const translations: TranslationDeepObject<typeof en> = {
     },
     wiseOnboarding: {
         business: {
-            title: 'Introduce los datos de tu empresa',
+            title: 'Introduce la información de tu empresa',
             legalName: 'Nombre legal de la empresa',
-            companyRole: 'Tu cargo en la empresa',
+            companyRole: 'Tu puesto en la empresa',
             companyRoleOwner: 'Propietario',
             companyRoleDirector: 'Director',
             companyRoleOther: 'Otro',
diff --git a/src/languages/fr.ts b/src/languages/fr.ts
index 1397788a..fda29965 100644
--- a/src/languages/fr.ts
+++ b/src/languages/fr.ts
@@ -12080,5 +12080,18 @@ Voici un *reçu test* pour vous montrer comment ça fonctionne :`,
         mobileRenewPrompt: 'Visitez Expensify dans votre navigateur web pour renouveler en avance.',
         mobileClaimPrompt: 'Visitez Expensify dans votre navigateur web pour bénéficier de votre réduction de renouvellement.',
     },
+    wiseOnboarding: {
+        business: {
+            title: 'Saisissez les informations de votre entreprise',
+            legalName: 'Raison sociale officielle',
+            companyRole: 'Votre rôle dans l’entreprise',
+            companyRoleOwner: 'Responsable',
+            companyRoleDirector: 'Directeur',
+            companyRoleOther: 'Autre',
+            industryCategories: 'Secteur d’activité',
+            businessDescription: 'Description de l’activité',
+            businessDescriptionHint: 'Décrivez brièvement ce que fait votre entreprise.',
+        },
+    },
 };
 export default translations;
diff --git a/src/languages/it.ts b/src/languages/it.ts
index 9b5a9461..361e1283 100644
--- a/src/languages/it.ts
+++ b/src/languages/it.ts
@@ -12004,5 +12004,18 @@ Ecco una *ricevuta di prova* per mostrarti come funziona:`,
         mobileRenewPrompt: 'Visita Expensify nel browser web per rinnovare in anticipo.',
         mobileClaimPrompt: 'Visita Expensify nel tuo browser web per richiedere lo sconto di rinnovo.',
     },
+    wiseOnboarding: {
+        business: {
+            title: 'Inserisci i dati della tua azienda',
+            legalName: 'Ragione sociale',
+            companyRole: 'Il tuo ruolo in azienda',
+            companyRoleOwner: 'Proprietario',
+            companyRoleDirector: 'Direttore',
+            companyRoleOther: 'Altro',
+            industryCategories: 'Settore',
+            businessDescription: 'Descrizione dell’attività',
+            businessDescriptionHint: 'Descrivi brevemente cosa fa la tua azienda.',
+        },
+    },
 };
 export default translations;
diff --git a/src/languages/ja.ts b/src/languages/ja.ts
index d4b6395a..a6fd2cef 100644
--- a/src/languages/ja.ts
+++ b/src/languages/ja.ts
@@ -11830,5 +11830,18 @@ ${reportName}`,
         mobileRenewPrompt: '早期に更新するには、ウェブブラウザで Expensify にアクセスしてください。',
         mobileClaimPrompt: '更新割引を受け取るには、Web ブラウザで Expensify にアクセスしてください。',
     },
+    wiseOnboarding: {
+        business: {
+            title: 'ビジネス情報を入力してください',
+            legalName: '法人名',
+            companyRole: '会社でのあなたの役割',
+            companyRoleOwner: 'オーナー',
+            companyRoleDirector: 'ディレクター',
+            companyRoleOther: 'その他',
+            industryCategories: '業種',
+            businessDescription: '事業内容',
+            businessDescriptionHint: '御社の事業内容を簡潔に説明してください。',
+        },
+    },
 };
 export default translations;
diff --git a/src/languages/nl.ts b/src/languages/nl.ts
index 4fd00237..6ae9cc30 100644
--- a/src/languages/nl.ts
+++ b/src/languages/nl.ts
@@ -11964,5 +11964,18 @@ Hier is een *proefbon* om je te laten zien hoe het werkt:`,
         mobileRenewPrompt: 'Bezoek Expensify in je webbrowser om vroegtijdig te verlengen.',
         mobileClaimPrompt: 'Bezoek Expensify in je webbrowser om je verlengingskorting te claimen.',
     },
+    wiseOnboarding: {
+        business: {
+            title: 'Voer je bedrijfsgegevens in',
+            legalName: 'Juridische bedrijfsnaam',
+            companyRole: 'Je rol binnen het bedrijf',
+            companyRoleOwner: 'Eigenaar',
+            companyRoleDirector: 'Directeur',
+            companyRoleOther: 'Overig',
+            industryCategories: 'Branche',
+            businessDescription: 'Bedrijfsomschrijving',
+            businessDescriptionHint: 'Beschrijf kort wat je bedrijf doet.',
+        },
+    },
 };
 export default translations;
diff --git a/src/languages/pl.ts b/src/languages/pl.ts
index 829cfa26..26ffdfff 100644
--- a/src/languages/pl.ts
+++ b/src/languages/pl.ts
@@ -11983,5 +11983,18 @@ Oto *paragon testowy*, żeby pokazać Ci, jak to działa:`,
         mobileRenewPrompt: 'Odwiedź Expensify w przeglądarce internetowej, żeby odnowić wcześniej.',
         mobileClaimPrompt: 'Odwiedź Expensify w swojej przeglądarce internetowej, aby odebrać zniżkę na odnowienie.',
     },
+    wiseOnboarding: {
+        business: {
+            title: 'Wpisz dane swojej firmy',
+            legalName: 'Prawna nazwa firmy',
+            companyRole: 'Twoja rola w firmie',
+            companyRoleOwner: 'Właściciel',
+            companyRoleDirector: 'Dyrektor',
+            companyRoleOther: 'Inne',
+            industryCategories: 'Branża',
+            businessDescription: 'Opis działalności',
+            businessDescriptionHint: 'Krótko opisz, czym zajmuje się twoja firma.',
+        },
+    },
 };
 export default translations;
diff --git a/src/languages/pt-BR.ts b/src/languages/pt-BR.ts
index c48f53b8..2b2c2976 100644
--- a/src/languages/pt-BR.ts
+++ b/src/languages/pt-BR.ts
@@ -11956,5 +11956,18 @@ Aqui está um *comprovante de teste* para mostrar como funciona:`,
         mobileRenewPrompt: 'Visite o Expensify no seu navegador para renovar antecipadamente.',
         mobileClaimPrompt: 'Visite o Expensify no seu navegador para resgatar seu desconto de renovação.',
     },
+    wiseOnboarding: {
+        business: {
+            title: 'Insira as informações da sua empresa',
+            legalName: 'Nome comercial registrado',
+            companyRole: 'Seu cargo na empresa',
+            companyRoleOwner: 'Proprietário',
+            companyRoleDirector: 'Diretor',
+            companyRoleOther: 'Outro',
+            industryCategories: 'Setor',
+            businessDescription: 'Descrição da empresa',
+            businessDescriptionHint: 'Descreva brevemente o que a sua empresa faz.',
+        },
+    },
 };
 export default translations;
diff --git a/src/languages/zh-hans.ts b/src/languages/zh-hans.ts
index 80c14fa5..c0445dab 100644
--- a/src/languages/zh-hans.ts
+++ b/src/languages/zh-hans.ts
@@ -11520,5 +11520,18 @@ ${reportName}`,
         mobileRenewPrompt: '请在网页浏览器中访问 Expensify 以提前续订。',
         mobileClaimPrompt: '请在网页浏览器中访问 Expensify 以领取您的续订折扣。',
     },
+    wiseOnboarding: {
+        business: {
+            title: '输入您的企业信息',
+            legalName: '法定企业名称',
+            companyRole: '您在公司的职位',
+            companyRoleOwner: '所有者',
+            companyRoleDirector: '主管',
+            companyRoleOther: '其他',
+            industryCategories: '行业',
+            businessDescription: '业务描述',
+            businessDescriptionHint: '请简要描述贵公司的业务。',
+        },
+    },
 };
 export default translations;

Note

You can apply these changes to your branch by copying the patch to your clipboard, then running pbpaste | git apply 😉

View workflow run

grgia added 8 commits October 14, 2026 15:15
The full SSN stays on the server, encrypted and stripped like Corpay's owner SSNs. The client receives the last four for the confirmation page and the no-SSN choice that routes the representative to Wise's hosted ID check.
requirements and documents hold what Submit forwards from the EDD and representative pages. The embedded link carries isLoading and errors so the page can show a request in flight and a failed one.
Wise takes files as an unnamed array, so our record is the only thing that says which upload answers which field. Keying documents by requirement and then by field lets a second device show the right row as uploaded, a resubmit replace one side, and Auth order the parts in schema order. requirements takes the same generic shape.
The member shows the shape to add when a native page starts collecting a requirement; the index signature keeps the rest open.
sourceOfWealthList takes Wise's six values, kept in CONST.WISE like companyRole, so the EDD page's options and the stored answers share one source.
…the server

The EDD pages are authored by Auth and arrive as wiseKYCRequirements after the business page save, so the trigger list and the document mapping never reach the App. The form file keeps profile pages only, and the source-of-wealth enum goes with the page that would have used it.
Auth saves a requirement page's answers keyed by the page's field names and shapes them into Wise's payload at Submit, so the stored object is what the page prefills from.
@grgia grgia changed the title [WIP - TESTING TYPES][No QA][Wise][Payments][New Feature] Define the business onboarding form [WIP - BULLET TESTING][No QA][Wise][Payments][New Feature] Type the Wise business onboarding data and define its first form page Oct 15, 2026
grgia added 4 commits October 15, 2026 17:36
…buckets

The embedded link's URL fragment carries a token, so its Onyx key joins ramOnlyKeys under the RAM_ONLY name the Plaid and Merge link tokens use, and the state export drops it. The requirements key is masked like the Corpay fields.
The Auth proof page asks the source again so its document picker can depend on it within one form, so the requirement carries sourceOfWealthType. The onboarding form map imports Country from CONST instead of redeclaring it.
…from a registry

The server lists the requirement types the intake should collect before Submit, so Wise does not have to ask for them after, and the same list carries Wise's live review once it opens; requestedBy says which. The App holds one layout per requirement type and composes the intake from its profile pages plus the pre-collected ones, so the trigger never leaves Auth. The two source-of-wealth pages are keyed by Wise's requirement type with Wise's field names, so their answers save under requirements and Submit forwards them.
Release 2's form comes from Wise's recipient API as fields, so the server translates them and the App paginates them. Typing the key now settles the third of the three form kinds alongside the App-owned profile pages and the KYC layout registry.
Comment on lines +19 to +20
/** The flat field list, in Wise's order; the App groups it into pages */
fields: DynamicFormField[];

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pass through example:

Wise sends

{"key": "sortCode", "name": "Sort code", "type": "text", "required": true, "minLength": 6, "maxLength": 6, "validationRegexp": "^\d{6}$", "refreshRequirementsOnChange": false}

and Auth writes it to wiseBankAccountFields as this:

{"key": "sortCode", "label": "Sort code", "type": "text", "required": true, "minLength": 6, "maxLength": 6, "regex": "^\d{6}$", "refreshOnChange": false}

@grgia

grgia commented Nov 2, 2026

Copy link
Copy Markdown
Contributor Author

Closing as this was a test

@grgia grgia closed this Nov 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants