Skip to content

[NO QA] Vendor matching CC - R4: App (Xero extension)#94093

Draft
Beamanator wants to merge 15 commits into
mainfrom
beaman-vendor-matching-r4-app
Draft

[NO QA] Vendor matching CC - R4: App (Xero extension)#94093
Beamanator wants to merge 15 commits into
mainfrom
beaman-vendor-matching-r4-app

Conversation

@Beamanator

Copy link
Copy Markdown
Contributor

Explanation of Change

Part of Vendor matching CC - Release 4: Xero — Track C (App). Extends the R1 vendor-matching pipeline to Xero workspaces, labelled "Supplier" in the UI per Xero's terminology. Zero new primitives — reuses R1's IOURequestStepVendor RHP, updateMoneyRequestVendor action, BETAS.VENDOR_MATCHING gate, and inactiveVendor violation client-compute. Gated behind the vendorMatching beta (off for every Xero workspace today), so this PR is safe to merge ahead of Track A (Integration-Server supplier sync) and Track B (PHP Xero::hasVendorFeature + matcher branch).

Three logical chunks, one PR (mirrors the R2 Intacct cadence — #91976):

  1. Foundations. defaultContact on XeroConnectionConfig + contacts: Record<string, XeroContact> on XeroConnectionData (Policy.ts). hasVendorFeature extended with an isXeroVendorMatchingActive branch (no export-type gate — Xero has no non-reimbursable destination enum; the connection being present is sufficient, mirroring Xero::hasVendorFeature on the PHP side). getXeroSuppliers / getXeroSupplierByID mirror the QBO helpers and normalize the keyed Record to the shared Vendor shape. ViolationsUtils.ts inactiveVendor check extended to look up Xero suppliers with a guardrail that short-circuits when connections.xero.data.contacts is undefined — without this, every transaction with comment.vendor.externalID set would falsely flag inactive between the beta flip and the first Integration-Server supplier sync for the workspace.

  2. Default-supplier row. Inserted on DynamicXeroExportConfigurationPage.tsx after the "Xero bank account" entry, wrapped in hasVendorFeature(policy) so non-beta admins don't see a dead control. Tapping the row opens the new DynamicXeroNonReimbursableDefaultContactSelectPage (selection screen sourced from connections.xero.data.contacts); selection persists via the generic updateManyPolicyConnectionConfigs(..., 'xero', {defaultContact}, ...) — no dedicated Auth or PHP command, hits api.php:2941. Sequencing note: if Track A hasn't synced suppliers for a beta workspace yet, the picker shows the empty-state Telescope view, not a broken state.

  3. Supplier label + picker branch. IOURequestStepVendor.tsx and the Vendor row on MoneyRequestView.tsx (plus ModifiedExpenseMessage.ts for system-message fragments) read isXeroVendorMatchingActive(policy) and flip their description to common.supplier for Xero workspaces. The picker data source branches between getQBOVendors(policy) and getXeroSuppliers(policy).

What's NOT in this PR

  • Java exporter switch (Track D) — XeroReportExporter2.java:1262 removing getContactsByNames() is unconditional and would regress at-export matching for every Xero customer the moment it deploys, since non-beta customers have neither NVPs set (PHP matcher gated) nor defaultContact configured (App UI gated). Same call as R1's Java track. Ships at GA cutover.
  • Concierge auto-match action label. The existing CONCIERGEAUTOMATCHVENDOR Concierge action still reads "vendor" on Xero workspaces. The R4 issue scopes the rebrand to the picker + Vendor field only; the Concierge message can be reworded as a separate post-GA polish call if it shows up as user-confusion.

Fixed Issues

$ https://github.com/Expensify/Expensify/issues/638611

PROPOSAL: N/A (internal feature, no external proposal)

Tests

Prerequisite: a workspace with the vendorMatching beta enabled, Xero connected (Track A's contact sync running, so policy.connections.xero.data.contacts is populated), and at least one supplier in Xero. The manual-pick path works regardless of Track B; the auto-match + inactive-supplier violation paths need Track B (Web-Expensify PHP matcher) on the environment.

Default supplier on the export config page:

  1. Open Workspace → Accounting → Xero → Export. Verify the new Default supplier row appears after Xero bank account, with right-caret + empty value.
  2. Tap the row. Verify a searchable Supplier select page opens listing the imported contacts.
  3. Select a supplier. Verify the page closes and the row title updates to the picked supplier name.
  4. Reopen the row. Verify the previously-selected supplier is initially focused.
  5. With the vendorMatching beta disabled on the workspace, verify the Default supplier row is hidden.

Manual supplier pick path on an expense:

  1. Create a non-reimbursable expense on a Xero workspace with the beta enabled and open it.
  2. Verify a Supplier row appears on the expense detail view below Category, editable (right caret showing). The row should be labelled "Supplier", not "Vendor".
  3. Tap the Supplier row. Verify the picker opens with title "Supplier" (not "Vendor") and lists connections.xero.data.contacts.
  4. Type a partial supplier name. Verify the list filters by name.
  5. Select a supplier. Verify the picker closes and the Supplier row title updates.
  6. Reopen the picker. Verify the previously-selected supplier is initially focused.
  7. With the vendorMatching beta disabled, verify the Supplier row is hidden.
  8. With the expense flipped to reimbursable, verify the Supplier row is hidden.

Inactive-supplier violation path:

  1. With an expense that has a supplier set, delete that supplier from Xero and re-sync the connection.
  2. Reopen the expense. Verify the Supplier row shows a brick-road indicator and the violation message.
  3. Tap the Supplier row and pick any active supplier. Verify the violation clears.

Guardrail — pre-sync workspace (regression check):

  1. On a workspace where Track A's supplier sync hasn't run yet (connections.xero.data.contacts is undefined) but comment.vendor.externalID is set on a transaction (e.g. carried over from a manual API write), reopen the expense.
  2. Verify no inactiveVendor violation is fired. The expectation is that we don't know what the supplier list looks like, so we shouldn't flag transactions as referencing a missing supplier.
  • Verify that no errors appear in the JS console

Offline tests

Same as the manual-pick test above, executed with the network disabled after step 1. Verify the standard OfflineWithFeedback pending-action indicator appears on the Supplier row, and that the optimistic supplier update (and optimistic inactiveVendor violation clear) from Phase 1's action persist correctly when the connection returns.

QA Steps

Same as Tests, but on staging with the vendorMatching beta enabled. Internal QA only — feature is gated by beta opt-in and only meaningful on Xero workspaces.

  • Verify that no errors appear in the JS console

PR Author Checklist

  • 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 tested this PR with a High Traffic account against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).
  • 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
  • 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 PR doesn't include any logic written more than once, with the exception of tests)
  • I verified any variables that can be defined as constants (ie. in CONST.ts or at the top of the file that uses the constant) are defined as such
  • 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 new assets were added or existing ones were modified, I verified that:
    • The assets are optimized and compressed (for SVG files, run npm run compress-svg)
    • The assets load correctly across all supported platforms.
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • If a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
  • I added unit tests for any new feature or bug fix in this PR to help automatically prevent regressions in this user flow.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.
  • I verified that similar component doesn't exist in the codebase
  • I verified that all props are defined accurately and each prop has a /** comment above it */
  • I verified that each file is named correctly
  • I verified that each component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
  • I verified that the only data being stored in component state is data necessary for rendering and nothing else
  • In component if we are not using the full Onyx data that we loaded, I've added the proper selector in order to ensure the component only re-renders when the data it is using changes
  • For Class Components, any internal methods passed to components event handlers are bound to this properly so there are no scoping issues (i.e. for onClick={this.submit} the method this.submit should be bound to this in the constructor)
  • I verified that component internal methods bound to this are necessary to be bound (i.e. avoid this.submit = this.submit.bind(this); if this.submit is never passed to a component event handler like onClick)
  • I verified that all JSX used for rendering exists in the render method
  • I verified that each component has the minimum amount of code necessary for its purpose, and it is broken down into smaller components in order to separate concerns and functions

Screenshots/Videos

To be added once a local build is up. The new UI surfaces are: the Default supplier row on the Xero export config page, the Supplier select page, and the Supplier label flip on IOURequestStepVendor + MoneyRequestView.

Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari

Extends the R1 vendor-matching pipeline to Xero workspaces, labelled
"Supplier" in the UI per Xero's terminology. Zero new primitives — reuses
R1's IOURequestStepVendor RHP, updateMoneyRequestVendor action, BETAS gate,
and inactiveVendor violation client-compute.

Foundations: defaultContact on XeroConnectionConfig + contacts on
XeroConnectionData (Record<string, XeroContact>); hasVendorFeature gains a
Xero branch (no export-type gate — Xero has no destination enum);
getXeroSuppliers / getXeroSupplierByID mirror the QBO helpers and
normalize the keyed Record to the shared Vendor shape; ViolationsUtils
inactiveVendor extended to look up Xero suppliers with a guardrail that
short-circuits when connections.xero.data.contacts is undefined so we
don't falsely flag transactions before Integration-Server has synced the
supplier list for a workspace.

Default-supplier row inserted on DynamicXeroExportConfigurationPage after
"Xero bank account", wrapped in hasVendorFeature(policy) so non-beta
admins don't see a dead control. Persists via the generic
updatePolicyConnectionConfiguration (api.php:2941) — no dedicated command.

Supplier label flip on the existing vendor picker (IOURequestStepVendor)
and Vendor field row (MoneyRequestView + ModifiedExpenseMessage) when the
workspace is on Xero. Picker data source branches to the keyed-Record
contacts list for Xero.

Translations: common.supplier + workspace.xero.{defaultSupplier,
defaultSupplierDescription, noSuppliersFound, noSuppliersFoundDescription}
across all 10 supported locales.
@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 4fb2e0de017..6fba770983c 100644
--- a/src/languages/de.ts
+++ b/src/languages/de.ts
@@ -4906,7 +4906,7 @@ ${amount} für ${merchant} – ${date}`,
             noAccountsFound: 'Keine Konten gefunden',
             noAccountsFoundDescription: 'Bitte fügen Sie das Konto in Xero hinzu und synchronisieren Sie die Verbindung erneut',
             defaultSupplier: 'Standardlieferant',
-            defaultSupplierDescription: 'Legen Sie einen Standardlieferanten fest, der beim Export auf alle Kreditkartentransaktionen angewendet wird.',
+            defaultSupplierDescription: 'Legen Sie einen Standardsupplier fest, der beim Export auf alle Kreditkartentransaktionen angewendet wird.',
             noSuppliersFound: 'Keine Lieferanten gefunden',
             noSuppliersFoundDescription: 'Bitte fügen Sie den Lieferanten in Xero hinzu und synchronisieren Sie die Verbindung erneut.',
             accountingMethods: {
@@ -9723,7 +9723,6 @@ Hier ist ein *Testbeleg*, um dir zu zeigen, wie es funktioniert:`,
         pdfFailedBody: 'Your file could not be generated. Try again, or reach out to Concierge for help.',
         readyPartialBody: ({count, total}: {count: number; total: number}) =>
             `${count} of ${total} reports exported. If it didn't automatically download, use the button below. See which reports failed in <concierge-link>Concierge</concierge-link>.`,
-
         close: 'Close',
     },
     domain: {
diff --git a/src/languages/es.ts b/src/languages/es.ts
index 6d108cdfd80..0bb4c10de11 100644
--- a/src/languages/es.ts
+++ b/src/languages/es.ts
@@ -4787,9 +4787,9 @@ ${amount} para ${merchant} - ${date}`,
             noAccountsFound: 'No se ha encontrado ninguna cuenta',
             noAccountsFoundDescription: 'Añade la cuenta en Xero y sincroniza de nuevo la conexión',
             defaultSupplier: 'Proveedor predeterminado',
-            defaultSupplierDescription: 'Configura un proveedor predeterminado que se aplicará a todas las transacciones de tarjeta de crédito al exportar.',
-            noSuppliersFound: 'No se han encontrado proveedores',
-            noSuppliersFoundDescription: 'Añade el proveedor en Xero y sincroniza de nuevo la conexión.',
+            defaultSupplierDescription: 'Establece un proveedor predeterminado que se aplicará a todas las transacciones con tarjeta de crédito al exportar.',
+            noSuppliersFound: 'No se encontraron proveedores',
+            noSuppliersFoundDescription: 'Por favor, añade el proveedor en Xero y sincroniza de nuevo la conexión.',
             accountingMethods: {
                 label: 'Cuándo Exportar',
                 description: 'Elige cuándo exportar los gastos:',
diff --git a/src/languages/fr.ts b/src/languages/fr.ts
index b552bb41c00..685db3d8e90 100644
--- a/src/languages/fr.ts
+++ b/src/languages/fr.ts
@@ -4918,7 +4918,7 @@ ${amount} pour ${merchant} - ${date}`,
             noAccountsFound: 'Aucun compte trouvé',
             noAccountsFoundDescription: 'Veuillez ajouter le compte dans Xero et synchroniser à nouveau la connexion',
             defaultSupplier: 'Fournisseur par défaut',
-            defaultSupplierDescription: 'Définissez un fournisseur par défaut qui sera appliqué à toutes les transactions par carte de crédit lors de l’exportation.',
+            defaultSupplierDescription: 'Définissez un fournisseur par défaut qui s’appliquera à toutes les transactions par carte de crédit lors de l’exportation.',
             noSuppliersFound: 'Aucun fournisseur trouvé',
             noSuppliersFoundDescription: 'Veuillez ajouter le fournisseur dans Xero et synchroniser à nouveau la connexion.',
             accountingMethods: {
@@ -9755,7 +9755,6 @@ Voici un *reçu test* pour vous montrer comment ça fonctionne :`,
         pdfFailedBody: 'Your file could not be generated. Try again, or reach out to Concierge for help.',
         readyPartialBody: ({count, total}: {count: number; total: number}) =>
             `${count} of ${total} reports exported. If it didn't automatically download, use the button below. See which reports failed in <concierge-link>Concierge</concierge-link>.`,
-
         close: 'Close',
     },
     domain: {
diff --git a/src/languages/it.ts b/src/languages/it.ts
index 650d2f34723..5c969a3458c 100644
--- a/src/languages/it.ts
+++ b/src/languages/it.ts
@@ -4891,9 +4891,9 @@ ${amount} per ${merchant} - ${date}`,
             noAccountsFound: 'Nessun account trovato',
             noAccountsFoundDescription: 'Aggiungi l’account in Xero e sincronizza nuovamente la connessione',
             defaultSupplier: 'Fornitore predefinito',
-            defaultSupplierDescription: 'Imposta un fornitore predefinito che verrà applicato a tutte le transazioni con carta di credito durante l’esportazione.',
+            defaultSupplierDescription: 'Imposta un fornitore predefinito che verrà applicato a tutte le transazioni con carta di credito al momento dell’esportazione.',
             noSuppliersFound: 'Nessun fornitore trovato',
-            noSuppliersFoundDescription: 'Aggiungi il fornitore in Xero e sincronizza nuovamente la connessione.',
+            noSuppliersFoundDescription: 'Aggiungi il fornitore in Xero e sincronizza di nuovo la connessione.',
             accountingMethods: {
                 label: 'Quando esportare',
                 description: 'Scegli quando esportare le spese:',
@@ -9711,7 +9711,6 @@ Ecco una *ricevuta di prova* per mostrarti come funziona:`,
         pdfFailedBody: 'Your file could not be generated. Try again, or reach out to Concierge for help.',
         readyPartialBody: ({count, total}: {count: number; total: number}) =>
             `${count} of ${total} reports exported. If it didn't automatically download, use the button below. See which reports failed in <concierge-link>Concierge</concierge-link>.`,
-
         close: 'Close',
     },
     domain: {
diff --git a/src/languages/ja.ts b/src/languages/ja.ts
index 274dcd12572..3f4af0754d3 100644
--- a/src/languages/ja.ts
+++ b/src/languages/ja.ts
@@ -4850,10 +4850,10 @@ ${integrationName === CONST.ONBOARDING_ACCOUNTING_MAPPING.other ? 'あなたの'
             },
             noAccountsFound: 'アカウントが見つかりません',
             noAccountsFoundDescription: 'Xero にアカウントを追加して、もう一度同期してください',
-            defaultSupplier: 'デフォルトのサプライヤー',
-            defaultSupplierDescription: 'エクスポート時にすべてのクレジットカード取引に適用されるデフォルトのサプライヤーを設定します。',
-            noSuppliersFound: 'サプライヤーが見つかりません',
-            noSuppliersFoundDescription: 'Xero にサプライヤーを追加して、もう一度同期してください。',
+            defaultSupplier: 'デフォルト仕入先',
+            defaultSupplierDescription: 'エクスポート時にすべてのクレジットカード取引に適用されるデフォルトの仕入先を設定します。',
+            noSuppliersFound: '仕入先が見つかりません',
+            noSuppliersFoundDescription: 'Xero に仕入先を追加して、もう一度同期してください。',
             accountingMethods: {
                 label: 'エクスポートのタイミング',
                 description: '経費をエクスポートするタイミングを選択:',
@@ -9588,7 +9588,6 @@ ${reportName}`,
         pdfFailedBody: 'Your file could not be generated. Try again, or reach out to Concierge for help.',
         readyPartialBody: ({count, total}: {count: number; total: number}) =>
             `${count} of ${total} reports exported. If it didn't automatically download, use the button below. See which reports failed in <concierge-link>Concierge</concierge-link>.`,
-
         close: 'Close',
     },
     domain: {
diff --git a/src/languages/nl.ts b/src/languages/nl.ts
index 4941c5edbd5..3e83cbb9948 100644
--- a/src/languages/nl.ts
+++ b/src/languages/nl.ts
@@ -4881,9 +4881,9 @@ ${amount} voor ${merchant} - ${date}`,
             noAccountsFound: 'Geen accounts gevonden',
             noAccountsFoundDescription: 'Voeg het account toe in Xero en synchroniseer de verbinding opnieuw',
             defaultSupplier: 'Standaardleverancier',
-            defaultSupplierDescription: 'Stel een standaardleverancier in die wordt toegepast op alle creditcardtransacties bij het exporteren.',
+            defaultSupplierDescription: 'Stel een standaardsupplier in die wordt toegepast op alle creditcardtransacties bij het exporteren.',
             noSuppliersFound: 'Geen leveranciers gevonden',
-            noSuppliersFoundDescription: 'Voeg de leverancier toe in Xero en synchroniseer de verbinding opnieuw.',
+            noSuppliersFoundDescription: 'Voeg de leverancier toe in Xero en synchroniseer de koppeling opnieuw.',
             accountingMethods: {
                 label: 'Wanneer exporteren',
                 description: 'Kies wanneer de onkosten moeten worden geëxporteerd:',
@@ -9677,7 +9677,6 @@ Hier is een *proefbon* om je te laten zien hoe het werkt:`,
         pdfFailedBody: 'Your file could not be generated. Try again, or reach out to Concierge for help.',
         readyPartialBody: ({count, total}: {count: number; total: number}) =>
             `${count} of ${total} reports exported. If it didn't automatically download, use the button below. See which reports failed in <concierge-link>Concierge</concierge-link>.`,
-
         close: 'Close',
     },
     domain: {
diff --git a/src/languages/pl.ts b/src/languages/pl.ts
index dc4ef1d646a..54c367c3060 100644
--- a/src/languages/pl.ts
+++ b/src/languages/pl.ts
@@ -9662,7 +9662,6 @@ Oto *paragon testowy*, żeby pokazać Ci, jak to działa:`,
         pdfFailedBody: 'Your file could not be generated. Try again, or reach out to Concierge for help.',
         readyPartialBody: ({count, total}: {count: number; total: number}) =>
             `${count} of ${total} reports exported. If it didn't automatically download, use the button below. See which reports failed in <concierge-link>Concierge</concierge-link>.`,
-
         close: 'Close',
     },
     domain: {
diff --git a/src/languages/pt-BR.ts b/src/languages/pt-BR.ts
index 956e9d716e8..f88af25aed6 100644
--- a/src/languages/pt-BR.ts
+++ b/src/languages/pt-BR.ts
@@ -4873,7 +4873,7 @@ ${amount} para ${merchant} - ${date}`,
             noAccountsFound: 'Nenhuma conta encontrada',
             noAccountsFoundDescription: 'Adicione a conta no Xero e sincronize a conexão novamente',
             defaultSupplier: 'Fornecedor padrão',
-            defaultSupplierDescription: 'Defina um fornecedor padrão que será aplicado a todas as transações de cartão de crédito ao exportar.',
+            defaultSupplierDescription: 'Defina um fornecedor padrão que será aplicado a todas as transações de cartão de crédito na exportação.',
             noSuppliersFound: 'Nenhum fornecedor encontrado',
             noSuppliersFoundDescription: 'Adicione o fornecedor no Xero e sincronize a conexão novamente.',
             accountingMethods: {
@@ -9666,7 +9666,6 @@ Aqui está um *comprovante de teste* para mostrar como funciona:`,
         pdfFailedBody: 'Your file could not be generated. Try again, or reach out to Concierge for help.',
         readyPartialBody: ({count, total}: {count: number; total: number}) =>
             `${count} of ${total} reports exported. If it didn't automatically download, use the button below. See which reports failed in <concierge-link>Concierge</concierge-link>.`,
-
         close: 'Close',
     },
     domain: {
diff --git a/src/languages/zh-hans.ts b/src/languages/zh-hans.ts
index 0add2750351..eefdb98e387 100644
--- a/src/languages/zh-hans.ts
+++ b/src/languages/zh-hans.ts
@@ -4755,9 +4755,9 @@ ${amount},商户:${merchant} - 日期:${date}`,
             noAccountsFound: '未找到账户',
             noAccountsFoundDescription: '请在 Xero 中添加该账户,然后再次同步连接',
             defaultSupplier: '默认供应商',
-            defaultSupplierDescription: '设置一个默认供应商,在导出时将其应用于所有信用卡交易。',
+            defaultSupplierDescription: '设置一个默认供应商,在导出时应用于所有信用卡交易。',
             noSuppliersFound: '未找到供应商',
-            noSuppliersFoundDescription: '请在 Xero 中添加供应商,然后再次同步连接。',
+            noSuppliersFoundDescription: '请在 Xero 中添加该供应商,然后再次同步连接。',
             accountingMethods: {
                 label: '何时导出',
                 description: '选择何时导出报销:',
@@ -9406,7 +9406,6 @@ ${reportName}`,
         pdfFailedBody: 'Your file could not be generated. Try again, or reach out to Concierge for help.',
         readyPartialBody: ({count, total}: {count: number; total: number}) =>
             `${count} of ${total} reports exported. If it didn't automatically download, use the button below. See which reports failed in <concierge-link>Concierge</concierge-link>.`,
-
         close: 'Close',
     },
     domain: {

Note

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

View workflow run

@codecov

codecov Bot commented Jun 19, 2026

Copy link
Copy Markdown

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.

Files with missing lines Coverage Δ
src/CONST/index.ts 93.84% <ø> (ø)
src/ROUTES.ts 21.11% <ø> (ø)
src/SCREENS.ts 100.00% <ø> (ø)
...c/components/ReportActionItem/MoneyRequestView.tsx 72.77% <100.00%> (+0.06%) ⬆️
src/libs/ModifiedExpenseMessage.ts 90.30% <100.00%> (+0.04%) ⬆️
...gation/linkingConfig/RELATIONS/WORKSPACE_TO_RHP.ts 100.00% <ø> (ø)
src/libs/Navigation/linkingConfig/config.ts 76.92% <ø> (ø)
src/libs/Violations/ViolationsUtils.ts 78.27% <100.00%> (+0.13%) ⬆️
...gation/AppNavigator/ModalStackNavigators/index.tsx 6.50% <0.00%> (-0.01%) ⬇️
src/libs/PolicyUtils.ts 75.31% <95.65%> (+0.40%) ⬆️
... and 3 more
... and 10 files with indirect coverage changes

Reconcile R4 Xero helpers with the R2 abstractions that landed on main:

* hasVendorFeature: include isXeroVendorMatchingActive alongside the
  QBO and Intacct branches.
* getMatchingVendors: add a Xero branch that normalizes
  connections.xero.data.contacts (keyed Record) to the shared Vendor
  shape.
* findVendorByID: add Xero fallback so MoneyRequestView and
  ModifiedExpenseMessage resolve supplier names cross-integration.
* Drop the redundant R4 helpers (getXeroSuppliers, getXeroSupplierByID,
  getMatchingVendorName) — their callers now use the R2 abstractions
  directly.

Consumers updated accordingly:
* MoneyRequestView: findVendorByID + isXeroVendorMatchingActive
* ModifiedExpenseMessage: findVendorByID + isXeroVendorMatchingActive
* ViolationsUtils: getMatchingVendorByID, with the Xero
  contacts-undefined guardrail preserved
* IOURequestStepVendor + DynamicXero*: getMatchingVendors / findVendorByID
Calling buildXeroPolicy(undefined) / policyWithXeroVendorFeature(undefined)
triggered the default-parameter mechanic, replacing the explicit undefined
with the populated contacts list. Switch to an explicit
XERO_CONTACTS_UNSYNCED sentinel so the test can actually exercise the
data.contacts === undefined path that the inactive-vendor guardrail relies
on.
@Beamanator

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d02cb2818c

ℹ️ 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".

Comment thread src/libs/Violations/ViolationsUtils.ts Outdated
Codex P2 (#94093 (comment)):
when a workspace has a Xero connection alongside an active QBO or Intacct
vendor-matching connection, the prior guardrail short-circuited the
inactiveVendor check the moment the Xero connection existed, regardless of
whether Xero was actually the active matching source. In dual/stale states
that meant missing QBO/Intacct vendors silently lost their violation and
existing violations stopped clearing.

Tighten the predicate to fire only when Xero is the *active* source — i.e.
neither QBO nor Intacct is in a vendor-matching export mode — so the
unsynced-contacts grace window applies only to truly Xero-driven
workspaces. Export isQBOVendorMatchingActive and isIntacctVendorMatchingActive
from PolicyUtils to support the predicate. Add a regression test covering
the QBO-active + Xero-lingering scenario.
@Beamanator

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Something went wrong. Try again later by commenting “@codex review”.

Unknown error
ℹ️ 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".

@Beamanator

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1ed1e619b7

ℹ️ 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".

… ViolationUtilsTest

* Object-literal keys 'xc-active', 'xc-1', 'xc-acme' etc. violated
  @typescript-eslint/naming-convention. Renamed to camelCase (xcActive,
  xc1, xcAcme) across the new Xero tests in PolicyUtilsTest,
  ViolationUtilsTest, and ModifiedExpenseMessageTest. The string values
  inside externalID/id stay in sync with their now-renamed keys.
* The Xero (R4) describe block in ViolationUtilsTest adds two unsafe
  Policy literal casts mirroring R2's policyWithQBOVendorFeature pattern.
  Bump the eslint-seatbelt entry from 20 to 22 to match; the
  auto-tighten cron will re-baseline after merge.
…pers)

Codex P2 (#94093 (comment)):
on a dual-connected workspace where QBO or Intacct is the active matching
source, getMatchingVendors prefers their vendor list — so the Xero
default-supplier picker would have listed non-Xero vendors and saved
their IDs into xero.config.defaultContact, and the Xero export config row
would have rendered a non-Xero vendor's name when findVendorByID
cross-integration fallback resolved an ID also present in QBO/Intacct.

Restore Xero-scoped helpers getXeroSuppliers and getXeroSupplierByID
(reading connections.xero.data.contacts directly) and switch both
DynamicXeroNonReimbursableDefaultContactSelectPage and
DynamicXeroExportConfigurationPage to use them. Add tests covering the
dual-connection case to lock in the behavior.
@Beamanator

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6293966ae6

ℹ️ 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".

Comment thread src/libs/PolicyUtils.ts
Codex P2 (#94093 (comment)):
isXeroVendorMatchingActive returns true whenever Xero is connected — correct
for hasVendorFeature (the eligibility gate) but wrong for the
Supplier-vs-Vendor label flip. In a dual-connection state with QBO/Intacct
as the active matching source + a lingering Xero connection,
getMatchingVendors still surfaces QBO/Intacct vendors. Using the
connection-presence predicate for labels would relabel those non-Xero
vendors as 'Supplier'.

Introduce isXeroActiveMatchingSource (Xero connected AND neither QBO nor
Intacct in a vendor-matching export mode) and route the three label
consumers + the violations guardrail through it:
* MoneyRequestView.tsx (vendor row label)
* ModifiedExpenseMessage.ts (system message label)
* IOURequestStepVendor.tsx (picker header + empty-state copy)
* ViolationsUtils.ts (replaces the inline composition introduced earlier)

Keep isXeroVendorMatchingActive as the eligibility predicate for
hasVendorFeature. Add unit tests covering single-Xero, dual-active QBO,
dual-active Intacct, QBO-Vendor-Bill-with-Xero, no-Xero, and undefined
policy cases.
@Beamanator

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3095ddfbe3

ℹ️ 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".

…t; bump seatbelt

* Codex P2 (#94093 (comment)):
  the default-supplier picker can be reached via direct deep-link even
  when the parent page hides the row (beta disabled or no Xero
  connection). Gate the page with hasVendorFeature(policy,
  isBetaEnabled(BETAS.VENDOR_MATCHING)) via shouldBeBlocked, and
  short-circuit selectSupplier defensively so a race-completed tap can
  never persist the update.
* Drop the isXeroVendorMatchingActive export (knip) — only the function
  is needed internally now that label consumers route through
  isXeroActiveMatchingSource. Function stays defined for hasVendorFeature.
* Bump the PolicyUtilsTest no-unsafe-type-assertion seatbelt 111 -> 119
  to cover the new dual-connection regression tests added for the
  Xero-scoped helpers and isXeroActiveMatchingSource.
@Beamanator

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Hooray!

Reviewed commit: 7c1dc635eb

ℹ️ 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".

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