Skip to content

Conversation

@luacmartins
Copy link
Contributor

@luacmartins luacmartins commented Jan 28, 2026

Explanation of Change

Add ability to select match type (Contains vs Exactly matches) when creating merchant rules. This improves matching robustness by allowing admins to choose between case-insensitive contains matching or exact matching.

Fixed Issues

$ #80523

Tests

Pre-condition: rules are enabled in the policy

  1. Navigate to Workspace > Rules > Merchant
  2. In For expenses with:, select Merchant
  3. Verify that you see a text input field for the merchant and a menu item for the type of match
  4. Select Match type
  5. Verify that you see Contains (default) and Exactly matches
  6. Select either and create a rule
  7. Verify that the rule description correctly describes it:
  • If merchant exactly matches "..."

  • If merchant contains "..."

  • Verify that no errors appear in the JS console

Offline tests

N/A

QA Steps

Same as tests

  • 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 verified there are no new alerts related to the canBeMissing param for useOnyx
  • 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

Screen.Recording.2026-01-28.at.1.27.39.PM.mov
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari

Add ability to select match type (Contains vs Exactly matches) when
creating merchant rules. This improves matching robustness by allowing
admins to choose between case-insensitive contains matching or exact
matching.

Changes:
- Add MATCH_TYPE field and constants to CONST.MERCHANT_RULES
- Add matchType to MerchantRuleForm type
- Create AddMatchTypePage component with SelectionList
- Update AddMerchantToMatchPage to include match type row
- Add new route and screen for match type selection
- Add translations for en.ts and es.ts
@luacmartins luacmartins self-assigned this Jan 28, 2026
Apply negative margin to offset parent padding so the menu item
extends to full width.
@OSBotify

This comment has been minimized.

@OSBotify

This comment has been minimized.

When the match type is set to 'exact', use 'matches' operator in the
filters. For 'contains' match type, continue using 'eq' operator.
@codecov
Copy link

codecov bot commented Jan 28, 2026

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 87.39% <ø> (ø)
src/SCREENS.ts 100.00% <ø> (ø)
...gation/linkingConfig/RELATIONS/WORKSPACE_TO_RHP.ts 100.00% <ø> (ø)
src/libs/Navigation/linkingConfig/config.ts 75.00% <ø> (ø)
src/libs/SearchQueryUtils.ts 70.61% <ø> (ø)
src/pages/workspace/rules/MerchantRulesSection.tsx 0.00% <ø> (ø)
src/types/form/MerchantRuleForm.ts 0.00% <ø> (ø)
src/ROUTES.ts 13.25% <0.00%> (-0.02%) ⬇️
...gation/AppNavigator/ModalStackNavigators/index.tsx 7.84% <0.00%> (-0.02%) ⬇️
...space/rules/MerchantRules/MerchantRulePageBase.tsx 0.00% <0.00%> (ø)
... and 3 more
... and 8 files with indirect coverage changes

@OSBotify

This comment has been minimized.

@luacmartins luacmartins requested a review from situchan January 28, 2026 21:24
@situchan
Copy link
Contributor

remote build issue fixed on main

@luacmartins
Copy link
Contributor Author

@situchan I pushed a fix

@situchan
Copy link
Contributor

situchan commented Jan 29, 2026

Last bug: Match type is always saved as Contains. Exactly matches is not applied at all.

bug.mov

EDIT: I think this is fixed in latest version

The check was incorrectly comparing to 'eq' (which is contains match)
instead of 'matches' (which is exact match). Now correctly uses
CONST.POLICY.RULE_CONDITIONS.MATCHES to determine if the rule uses
exact matching.
@melvin-bot melvin-bot bot requested a review from youssef-lr January 29, 2026 01:30
@melvin-bot
Copy link

melvin-bot bot commented Jan 29, 2026

@youssef-lr 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]

The isExactMatch check was comparing to 'eq' (contains) instead of
'matches' (exact). Also added expensesExactlyMatching translation
for dynamic section title support.
Copy link

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

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: d48941f396

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

@luacmartins
Copy link
Contributor Author

Last bug: Match type is always saved as Contains. Exactly matches is not applied at all.

Pushed a fix. @situchan please retest

@luacmartins luacmartins removed the request for review from youssef-lr January 29, 2026 01:41
@OSBotify
Copy link
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 c25b7bcb..9036690f 100644
--- a/src/languages/de.ts
+++ b/src/languages/de.ts
@@ -6383,7 +6383,7 @@ Fordere Spesendetails wie Belege und Beschreibungen an, lege Limits und Standard
                 title: 'Händler',
                 subtitle: 'Legen Sie Händlerregeln fest, damit Ausgaben korrekt codiert ankommen und weniger Nachbearbeitung erfordern.',
                 addRule: 'Händlerregel hinzufügen',
-                ruleSummaryTitle: (merchantName: string, isExactMatch: boolean) => `Wenn Händler ${isExactMatch ? 'genau übereinstimmt mit' : 'enthält'} „${merchantName}"`,
+                ruleSummaryTitle: (merchantName: string, isExactMatch: boolean) => `Wenn Händler ${isExactMatch ? 'stimmt genau überein' : 'enthält'} „${merchantName}“`,
                 ruleSummarySubtitleMerchant: (merchantName: string) => `Händler in „${merchantName}“ umbenennen`,
                 ruleSummarySubtitleUpdateField: (fieldName: string, fieldValue: string) => `Aktualisiere ${fieldName} zu „${fieldValue}“`,
                 ruleSummarySubtitleReimbursable: (reimbursable: boolean) => `Als "${reimbursable ? 'erstattungsfähig' : 'nicht erstattungsfähig'}" markieren`,
@@ -6398,9 +6398,10 @@ Fordere Spesendetails wie Belege und Beschreibungen an, lege Limits und Standard
                 editRuleTitle: 'Regel bearbeiten',
                 deleteRule: 'Regel löschen',
                 deleteRuleConfirmation: 'Sind Sie sicher, dass Sie diese Regel löschen möchten?',
-                matchType: 'Übereinstimmungstyp',
+                matchType: 'Abgleichstyp',
                 matchTypeContains: 'Enthält',
                 matchTypeExact: 'Exakte Übereinstimmung',
+                expensesExactlyMatching: 'Für Ausgaben mit genau folgender Übereinstimmung:',
             },
         },
         planTypePage: {
@@ -7003,7 +7004,7 @@ Fordere Spesendetails wie Belege und Beschreibungen an, lege Limits und Standard
                 [CONST.SEARCH.GROUP_BY.WITHDRAWAL_ID]: 'Auszahlungs-ID',
                 [CONST.SEARCH.GROUP_BY.CATEGORY]: 'Kategorie',
                 [CONST.SEARCH.GROUP_BY.MERCHANT]: 'Händler',
-                [CONST.SEARCH.GROUP_BY.TAG]: 'Stichwort',
+                [CONST.SEARCH.GROUP_BY.TAG]: 'Tag',
                 [CONST.SEARCH.GROUP_BY.MONTH]: 'Monat',
                 [CONST.SEARCH.GROUP_BY.WEEK]: 'Woche',
             },
diff --git a/src/languages/fr.ts b/src/languages/fr.ts
index 4adb77b8..bede777d 100644
--- a/src/languages/fr.ts
+++ b/src/languages/fr.ts
@@ -6412,6 +6412,7 @@ Exigez des informations de dépense comme les reçus et les descriptions, défin
                 matchType: 'Type de correspondance',
                 matchTypeContains: 'Contient',
                 matchTypeExact: 'Correspond exactement',
+                expensesExactlyMatching: 'Pour les dépenses correspondant exactement :',
             },
         },
         planTypePage: {
diff --git a/src/languages/it.ts b/src/languages/it.ts
index c58e6eb9..c75c7614 100644
--- a/src/languages/it.ts
+++ b/src/languages/it.ts
@@ -6365,7 +6365,7 @@ Richiedi dettagli di spesa come ricevute e descrizioni, imposta limiti e valori
                 title: 'Esercente',
                 subtitle: 'Imposta le regole per gli esercenti in modo che le spese arrivino già codificate correttamente e richiedano meno correzioni.',
                 addRule: 'Aggiungi regola esercente',
-                ruleSummaryTitle: (merchantName: string, isExactMatch: boolean) => `Se l'esercente ${isExactMatch ? 'corrisponde esattamente a' : 'contiene'} "${merchantName}"`,
+                ruleSummaryTitle: (merchantName: string, isExactMatch: boolean) => `Se l'esercente ${isExactMatch ? 'corrisponde esattamente' : 'contiene'} "${merchantName}"`,
                 ruleSummarySubtitleMerchant: (merchantName: string) => `Rinomina esercente in "${merchantName}"`,
                 ruleSummarySubtitleUpdateField: (fieldName: string, fieldValue: string) => `Aggiorna ${fieldName} a "${fieldValue}"`,
                 ruleSummarySubtitleReimbursable: (reimbursable: boolean) => `Segna come "${reimbursable ? 'rimborsabile' : 'non rimborsabile'}"`,
@@ -6382,7 +6382,8 @@ Richiedi dettagli di spesa come ricevute e descrizioni, imposta limiti e valori
                 deleteRuleConfirmation: 'Sei sicuro di voler eliminare questa regola?',
                 matchType: 'Tipo di corrispondenza',
                 matchTypeContains: 'Contiene',
-                matchTypeExact: 'Corrispondenza esatta',
+                matchTypeExact: 'Corrisponde esattamente',
+                expensesExactlyMatching: 'Per le spese che corrispondono esattamente:',
             },
         },
         planTypePage: {
@@ -6991,7 +6992,7 @@ Richiedi dettagli di spesa come ricevute e descrizioni, imposta limiti e valori
                 [CONST.SEARCH.GROUP_BY.CARD]: 'Carta',
                 [CONST.SEARCH.GROUP_BY.WITHDRAWAL_ID]: 'ID prelievo', //_/\__/_/  \_,_/\__/\__/\_,_/
                 [CONST.SEARCH.GROUP_BY.CATEGORY]: 'Categoria',
-                [CONST.SEARCH.GROUP_BY.MERCHANT]: 'Commerciante',
+                [CONST.SEARCH.GROUP_BY.MERCHANT]: 'Esercente',
                 [CONST.SEARCH.GROUP_BY.TAG]: 'Etichetta',
                 [CONST.SEARCH.GROUP_BY.MONTH]: 'Mese',
                 [CONST.SEARCH.GROUP_BY.WEEK]: 'Settimana',
diff --git a/src/languages/ja.ts b/src/languages/ja.ts
index f37e0a65..01c5cdce 100644
--- a/src/languages/ja.ts
+++ b/src/languages/ja.ts
@@ -6321,7 +6321,7 @@ ${reportName}
                 title: '加盟店',
                 subtitle: '取引先ルールを設定して、経費が正しくコード化された状態で届くようにし、後処理を最小限に抑えましょう。',
                 addRule: '店舗ルールを追加',
-                ruleSummaryTitle: (merchantName: string, isExactMatch: boolean) => `もし取引先 ${isExactMatch ? '完全一致' : '含む'} 「${merchantName}」`,
+                ruleSummaryTitle: (merchantName: string, isExactMatch: boolean) => `もし加盟店 ${isExactMatch ? '完全一致' : '含む'} 「${merchantName}」`,
                 ruleSummarySubtitleMerchant: (merchantName: string) => `支払先名を「${merchantName}」に変更`,
                 ruleSummarySubtitleUpdateField: (fieldName: string, fieldValue: string) => `${fieldName} を「${fieldValue}」に更新`,
                 ruleSummarySubtitleReimbursable: (reimbursable: boolean) => `「${reimbursable ? '払い戻し対象' : '精算対象外'}」としてマーク`,
@@ -6339,6 +6339,7 @@ ${reportName}
                 matchType: '一致タイプ',
                 matchTypeContains: '含む',
                 matchTypeExact: '完全一致',
+                expensesExactlyMatching: '以下と完全一致する経費について:',
             },
         },
         planTypePage: {
@@ -6927,10 +6928,10 @@ ${reportName}
             reimbursable: '精算対象',
             purchaseCurrency: '購入通貨',
             groupBy: {
-                [CONST.SEARCH.GROUP_BY.FROM]: '送信者',
+                [CONST.SEARCH.GROUP_BY.FROM]: '差出人',
                 [CONST.SEARCH.GROUP_BY.CARD]: 'カード',
                 [CONST.SEARCH.GROUP_BY.WITHDRAWAL_ID]: '出金ID',
-                [CONST.SEARCH.GROUP_BY.CATEGORY]: 'カテゴリー',
+                [CONST.SEARCH.GROUP_BY.CATEGORY]: 'カテゴリ',
                 [CONST.SEARCH.GROUP_BY.MERCHANT]: '加盟店',
                 [CONST.SEARCH.GROUP_BY.TAG]: 'タグ',
                 [CONST.SEARCH.GROUP_BY.MONTH]: '月',
diff --git a/src/languages/nl.ts b/src/languages/nl.ts
index 18290f3a..45a64be9 100644
--- a/src/languages/nl.ts
+++ b/src/languages/nl.ts
@@ -6368,9 +6368,10 @@ Vraag verplichte uitgavedetails zoals bonnetjes en beschrijvingen, stel limieten
                 editRuleTitle: 'Regel bewerken',
                 deleteRule: 'Regel verwijderen',
                 deleteRuleConfirmation: 'Weet je zeker dat je deze regel wilt verwijderen?',
-                matchType: 'Overeenkomsttype',
+                matchType: 'Type overeenkomen',
                 matchTypeContains: 'Bevat',
                 matchTypeExact: 'Komt exact overeen',
+                expensesExactlyMatching: 'Voor uitgaven die exact overeenkomen met:',
             },
         },
         planTypePage: {
@@ -6974,7 +6975,7 @@ Vraag verplichte uitgavedetails zoals bonnetjes en beschrijvingen, stel limieten
                 [CONST.SEARCH.GROUP_BY.CARD]: 'Kaart',
                 [CONST.SEARCH.GROUP_BY.WITHDRAWAL_ID]: 'Opname-ID',
                 [CONST.SEARCH.GROUP_BY.CATEGORY]: 'Categorie',
-                [CONST.SEARCH.GROUP_BY.MERCHANT]: 'Verkoper',
+                [CONST.SEARCH.GROUP_BY.MERCHANT]: 'Handelaar',
                 [CONST.SEARCH.GROUP_BY.TAG]: 'Label',
                 [CONST.SEARCH.GROUP_BY.MONTH]: 'Maand',
                 [CONST.SEARCH.GROUP_BY.WEEK]: 'Week',
diff --git a/src/languages/pl.ts b/src/languages/pl.ts
index 41783967..da80b01c 100644
--- a/src/languages/pl.ts
+++ b/src/languages/pl.ts
@@ -6346,7 +6346,7 @@ Wymagaj szczegółów wydatków, takich jak paragony i opisy, ustawiaj limity i
                 title: 'Sprzedawca',
                 subtitle: 'Skonfiguruj reguły dla sprzedawców, aby wydatki trafiały z poprawnym kodowaniem i wymagały mniej poprawek.',
                 addRule: 'Dodaj regułę sprzedawcy',
-                ruleSummaryTitle: (merchantName: string, isExactMatch: boolean) => `Jeśli sprzedawca ${isExactMatch ? 'dokładnie pasuje' : 'zawiera'} „${merchantName}”`,
+                ruleSummaryTitle: (merchantName: string, isExactMatch: boolean) => `Jeśli sprzedawca ${isExactMatch ? 'dokładnie pasuje' : 'Zawiera'} „${merchantName}”`,
                 ruleSummarySubtitleMerchant: (merchantName: string) => `Zmień sprzedawcę na „${merchantName}”`,
                 ruleSummarySubtitleUpdateField: (fieldName: string, fieldValue: string) => `Zaktualizuj ${fieldName} na „${fieldValue}”`,
                 ruleSummarySubtitleReimbursable: (reimbursable: boolean) => `Oznacz jako "${reimbursable ? 'kwalifikujący się do zwrotu kosztów' : 'niepodlegający zwrotowi'}"`,
@@ -6363,7 +6363,8 @@ Wymagaj szczegółów wydatków, takich jak paragony i opisy, ustawiaj limity i
                 deleteRuleConfirmation: 'Czy na pewno chcesz usunąć tę regułę?',
                 matchType: 'Typ dopasowania',
                 matchTypeContains: 'Zawiera',
-                matchTypeExact: 'Dokładne dopasowania',
+                matchTypeExact: 'Dokładne dopasowanie',
+                expensesExactlyMatching: 'Dla wydatków dokładnie pasujących:',
             },
         },
         planTypePage: {
@@ -6964,7 +6965,7 @@ Wymagaj szczegółów wydatków, takich jak paragony i opisy, ustawiaj limity i
                 [CONST.SEARCH.GROUP_BY.WITHDRAWAL_ID]: 'ID wypłaty',
                 [CONST.SEARCH.GROUP_BY.CATEGORY]: 'Kategoria',
                 [CONST.SEARCH.GROUP_BY.MERCHANT]: 'Sprzedawca',
-                [CONST.SEARCH.GROUP_BY.TAG]: 'Etykieta',
+                [CONST.SEARCH.GROUP_BY.TAG]: 'Tag',
                 [CONST.SEARCH.GROUP_BY.MONTH]: 'Miesiąc',
                 [CONST.SEARCH.GROUP_BY.WEEK]: 'Tydzień',
             },
diff --git a/src/languages/pt-BR.ts b/src/languages/pt-BR.ts
index f298d530..e5ee5738 100644
--- a/src/languages/pt-BR.ts
+++ b/src/languages/pt-BR.ts
@@ -6364,6 +6364,7 @@ Exija detalhes de despesas como recibos e descrições, defina limites e padrõe
                 matchType: 'Tipo de correspondência',
                 matchTypeContains: 'Contém',
                 matchTypeExact: 'Corresponde exatamente',
+                expensesExactlyMatching: 'Para despesas que correspondem exatamente:',
             },
         },
         planTypePage: {
@@ -6962,9 +6963,9 @@ Exija detalhes de despesas como recibos e descrições, defina limites e padrõe
             groupBy: {
                 [CONST.SEARCH.GROUP_BY.FROM]: 'De',
                 [CONST.SEARCH.GROUP_BY.CARD]: 'Cartão',
-                [CONST.SEARCH.GROUP_BY.WITHDRAWAL_ID]: 'ID da retirada',
+                [CONST.SEARCH.GROUP_BY.WITHDRAWAL_ID]: 'ID de saque',
                 [CONST.SEARCH.GROUP_BY.CATEGORY]: 'Categoria',
-                [CONST.SEARCH.GROUP_BY.MERCHANT]: 'Comerciante',
+                [CONST.SEARCH.GROUP_BY.MERCHANT]: 'Estabelecimento',
                 [CONST.SEARCH.GROUP_BY.TAG]: 'Etiqueta',
                 [CONST.SEARCH.GROUP_BY.MONTH]: 'Mês',
                 [CONST.SEARCH.GROUP_BY.WEEK]: 'Semana',
diff --git a/src/languages/zh-hans.ts b/src/languages/zh-hans.ts
index 04d23c97..acd6a4ae 100644
--- a/src/languages/zh-hans.ts
+++ b/src/languages/zh-hans.ts
@@ -6211,7 +6211,7 @@ ${reportName}
                 title: '商家',
                 subtitle: '设置商家规则,让报销费用自动按正确科目归类,减少后期清理工作。',
                 addRule: '添加商家规则',
-                ruleSummaryTitle: (merchantName: string, isExactMatch: boolean) => `如果商家 ${isExactMatch ? '完全匹配' : '包含'} “${merchantName}”`,
+                ruleSummaryTitle: (merchantName: string, isExactMatch: boolean) => `如果商家 ${isExactMatch ? '完全匹配' : '包含'}「${merchantName}」`,
                 ruleSummarySubtitleMerchant: (merchantName: string) => `将商家重命名为 “${merchantName}”`,
                 ruleSummarySubtitleUpdateField: (fieldName: string, fieldValue: string) => `将 ${fieldName} 更新为“${fieldValue}”`,
                 ruleSummarySubtitleReimbursable: (reimbursable: boolean) => `标记为“${reimbursable ? '可报销' : '不予报销'}”`,
@@ -6229,6 +6229,7 @@ ${reportName}
                 matchType: '匹配类型',
                 matchTypeContains: '包含',
                 matchTypeExact: '完全匹配',
+                expensesExactlyMatching: '对于完全匹配以下条件的报销:',
             },
         },
         planTypePage: {
@@ -6808,12 +6809,12 @@ ${reportName}
             purchaseCurrency: '购买货币',
             groupBy: {
                 [CONST.SEARCH.GROUP_BY.FROM]: '来自',
-                [CONST.SEARCH.GROUP_BY.CARD]: '卡片',
+                [CONST.SEARCH.GROUP_BY.CARD]: '卡',
                 [CONST.SEARCH.GROUP_BY.WITHDRAWAL_ID]: '提现 ID',
                 [CONST.SEARCH.GROUP_BY.CATEGORY]: '类别',
                 [CONST.SEARCH.GROUP_BY.MERCHANT]: '商家',
                 [CONST.SEARCH.GROUP_BY.TAG]: '标签',
-                [CONST.SEARCH.GROUP_BY.MONTH]: '月',
+                [CONST.SEARCH.GROUP_BY.MONTH]: '月份',
                 [CONST.SEARCH.GROUP_BY.WEEK]: '周',
             },
             feed: '动态',

Note

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

@situchan
Copy link
Contributor

Retested. Confirmed fix

Copy link

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

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: 1ce80cdee4

ℹ️ 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 on lines 122 to 124
const targetRuleID = ruleID ?? NumberUtils.rand64();
const ruleForOptimisticUpdate: CodingRule =
isEditing && existingRule
? {
...existingRule,
...ruleFields,
filters: {
...existingRule.filters,
right: form.merchantToMatch,
},
}
: {
ruleID: targetRuleID,
filters: {
left: 'merchant',
operator: 'eq',
right: form.merchantToMatch,
},
...ruleFields,
created: new Date().toISOString(),
};
const operator = form.matchType;
const created = existingRule?.created ?? new Date().toISOString();

Choose a reason for hiding this comment

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

P1 Badge Default match type is never persisted before save

When creating a new merchant rule, the match type defaults to “contains” only in the UI (see AddMerchantToMatchPage, which derives a default label but never writes it to Onyx). As a result form.matchType stays undefined unless the user explicitly opens the match-type selector, and setPolicyCodingRule then sets filters.operator from this undefined value. Because JSON.stringify omits undefined, the API payload can end up with a filter missing operator, which is a regression from the previous always-eq behavior and can cause rule creation to fail or apply the wrong matching semantics in the common “just type a merchant and save” flow. A safe fix is to default matchType to CONTAINS when initializing the form or to fallback in setPolicyCodingRule.

Useful? React with 👍 / 👎.

JS00001
JS00001 previously approved these changes Jan 29, 2026
@situchan
Copy link
Contributor

@codex review

@luacmartins luacmartins requested a review from JS00001 January 29, 2026 02:08
Copy link

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

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: 4fdbafdb44

ℹ️ 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 on lines +49 to +50
reimbursable: form.reimbursable ?? null,
billable: form.billable ?? null,

Choose a reason for hiding this comment

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

P2 Badge Avoid persisting null booleans in coding rules

Setting reimbursable/billable to null here means newly created rules with no billable/reimbursable update will store null in Onyx, but the UI treats “not set” as undefined (e.g., getBooleanTitle and the summary checks only compare to undefined). As a result, the rule will display as “No” (non‑billable/non‑reimbursable) even though the user didn’t choose it, and if they edit/save later the form value remains null so mapFormFieldsToRuleForAPI includes it (!== undefined), sending null to the API. This is a regression introduced by swapping undefined for null on these booleans; either keep undefined for booleans or update downstream checks to treat null as “unset.”

Useful? React with 👍 / 👎.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

null is removed from Onyx so it's undefined after merged.

@luacmartins luacmartins merged commit e5de046 into main Jan 29, 2026
36 checks passed
@luacmartins luacmartins deleted the cmartins-merchantRulesExactMatch branch January 29, 2026 02:36
@OSBotify
Copy link
Contributor

✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

@OSBotify
Copy link
Contributor

🚀 Deployed to staging by https://github.com/luacmartins in version: 9.3.11-16 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

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.

6 participants