Skip to content

Commit e5de046

Browse files
authored
Merge pull request Expensify#80778 from Expensify/cmartins-merchantRulesExactMatch
Improve merchant matching robustness by adding Match type options: Is exactly & Contains
2 parents 4001075 + f9eedaa commit e5de046

24 files changed

Lines changed: 337 additions & 71 deletions

File tree

src/CONST/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3782,6 +3782,7 @@ const CONST = {
37823782
BILLABLE: 'billable',
37833783
CATEGORY: 'category',
37843784
DESCRIPTION: 'comment',
3785+
MATCH_TYPE: 'matchType',
37853786
MERCHANT_TO_MATCH: 'merchantToMatch',
37863787
MERCHANT: 'merchant',
37873788
REIMBURSABLE: 'reimbursable',
@@ -7138,6 +7139,7 @@ const CONST = {
71387139
AND: 'and',
71397140
OR: 'or',
71407141
EQUAL_TO: 'eq',
7142+
CONTAINS: 'contains',
71417143
NOT_EQUAL_TO: 'neq',
71427144
GREATER_THAN: 'gt',
71437145
GREATER_THAN_OR_EQUAL_TO: 'gte',

src/ROUTES.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2680,6 +2680,10 @@ const ROUTES = {
26802680
route: 'workspaces/:policyID/rules/merchant-rules/:ruleID/merchant-to-match',
26812681
getRoute: (policyID: string, ruleID?: string) => `workspaces/${policyID}/rules/merchant-rules/${ruleID ?? 'new'}/merchant-to-match` as const,
26822682
},
2683+
RULES_MERCHANT_MATCH_TYPE: {
2684+
route: 'workspaces/:policyID/rules/merchant-rules/:ruleID/merchant-to-match/type',
2685+
getRoute: (policyID: string, ruleID?: string) => `workspaces/${policyID}/rules/merchant-rules/${ruleID ?? 'new'}/merchant-to-match/type` as const,
2686+
},
26832687
RULES_MERCHANT_MERCHANT: {
26842688
route: 'workspaces/:policyID/rules/merchant-rules/:ruleID/merchant',
26852689
getRoute: (policyID: string, ruleID?: string) => `workspaces/${policyID}/rules/merchant-rules/${ruleID ?? 'new'}/merchant` as const,

src/SCREENS.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -761,6 +761,7 @@ const SCREENS = {
761761
RULES_PROHIBITED_DEFAULT: 'Rules_Prohibited_Default',
762762
RULES_MERCHANT_NEW: 'Rules_Merchant_New',
763763
RULES_MERCHANT_MERCHANT_TO_MATCH: 'Rules_Merchant_Merchant_To_Match',
764+
RULES_MERCHANT_MATCH_TYPE: 'Rules_Merchant_Match_Type',
764765
RULES_MERCHANT_MERCHANT: 'Rules_Merchant_Merchant',
765766
RULES_MERCHANT_CATEGORY: 'Rules_Merchant_Category',
766767
RULES_MERCHANT_TAG: 'Rules_Merchant_Tag',

src/languages/de.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6382,22 +6382,25 @@ Fordere Spesendetails wie Belege und Beschreibungen an, lege Limits und Standard
63826382
title: 'Händler',
63836383
subtitle: 'Legen Sie Händlerregeln fest, damit Ausgaben korrekt codiert ankommen und weniger Nachbearbeitung erfordern.',
63846384
addRule: 'Händlerregel hinzufügen',
6385-
ruleSummaryTitle: (merchantName: string) => `Wenn Händler „${merchantName}“ enthält`,
6385+
ruleSummaryTitle: (merchantName: string, isExactMatch: boolean) => `Wenn Händler ${isExactMatch ? 'stimmt genau überein' : 'enthält'} „${merchantName}“`,
63866386
ruleSummarySubtitleMerchant: (merchantName: string) => `Händler in „${merchantName}“ umbenennen`,
63876387
ruleSummarySubtitleUpdateField: (fieldName: string, fieldValue: string) => `Aktualisiere ${fieldName} zu „${fieldValue}“`,
63886388
ruleSummarySubtitleReimbursable: (reimbursable: boolean) => `Als "${reimbursable ? 'erstattungsfähig' : 'nicht erstattungsfähig'}" markieren`,
63896389
ruleSummarySubtitleBillable: (billable: boolean) => `Als „${billable ? 'Abrechenbar' : 'nicht abrechenbar'}“ markieren`,
63906390
addRuleTitle: 'Regel hinzufügen',
63916391
expensesWith: 'Für Ausgaben mit:',
63926392
applyUpdates: 'Diese Updates anwenden:',
6393-
merchantHint: 'Einem Händlernamen mit groß-/kleinschreibungsunabhängiger „Enthält“-Übereinstimmung zuordnen',
63946393
saveRule: 'Regel speichern',
63956394
confirmError: 'Geben Sie den Händler ein und nehmen Sie mindestens eine Änderung vor',
63966395
confirmErrorMerchant: 'Bitte geben Sie den Händler ein',
63976396
confirmErrorUpdate: 'Bitte wenden Sie mindestens eine Aktualisierung an',
63986397
editRuleTitle: 'Regel bearbeiten',
63996398
deleteRule: 'Regel löschen',
64006399
deleteRuleConfirmation: 'Sind Sie sicher, dass Sie diese Regel löschen möchten?',
6400+
matchType: 'Abgleichstyp',
6401+
matchTypeContains: 'Enthält',
6402+
matchTypeExact: 'Exakte Übereinstimmung',
6403+
expensesExactlyMatching: 'Für Ausgaben mit genau folgender Übereinstimmung:',
64016404
},
64026405
},
64036406
planTypePage: {
@@ -7000,7 +7003,7 @@ Fordere Spesendetails wie Belege und Beschreibungen an, lege Limits und Standard
70007003
[CONST.SEARCH.GROUP_BY.WITHDRAWAL_ID]: 'Auszahlungs-ID',
70017004
[CONST.SEARCH.GROUP_BY.CATEGORY]: 'Kategorie',
70027005
[CONST.SEARCH.GROUP_BY.MERCHANT]: 'Händler',
7003-
[CONST.SEARCH.GROUP_BY.TAG]: 'Stichwort',
7006+
[CONST.SEARCH.GROUP_BY.TAG]: 'Tag',
70047007
[CONST.SEARCH.GROUP_BY.MONTH]: 'Monat',
70057008
},
70067009
feed: 'Feed',

src/languages/en.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6242,19 +6242,22 @@ const translations = {
62426242
addRuleTitle: 'Add rule',
62436243
editRuleTitle: 'Edit rule',
62446244
expensesWith: 'For expenses with:',
6245+
expensesExactlyMatching: 'For expenses exactly matching:',
62456246
applyUpdates: 'Apply these updates:',
6246-
merchantHint: 'Match a merchant name with case-insensitive "contains" matching',
62476247
saveRule: 'Save rule',
62486248
confirmError: 'Enter merchant and apply at least one update',
62496249
confirmErrorMerchant: 'Please enter merchant',
62506250
confirmErrorUpdate: 'Please apply at least one update',
62516251
deleteRule: 'Delete rule',
62526252
deleteRuleConfirmation: 'Are you sure you want to delete this rule?',
6253-
ruleSummaryTitle: (merchantName: string) => `If merchant contains "${merchantName}"`,
6253+
ruleSummaryTitle: (merchantName: string, isExactMatch: boolean) => `If merchant ${isExactMatch ? 'exactly matches' : 'contains'} "${merchantName}"`,
62546254
ruleSummarySubtitleMerchant: (merchantName: string) => `Rename merchant to "${merchantName}"`,
62556255
ruleSummarySubtitleUpdateField: (fieldName: string, fieldValue: string) => `Update ${fieldName} to "${fieldValue}"`,
62566256
ruleSummarySubtitleReimbursable: (reimbursable: boolean) => `Mark as "${reimbursable ? 'reimbursable' : 'non-reimbursable'}"`,
62576257
ruleSummarySubtitleBillable: (billable: boolean) => `Mark as "${billable ? 'billable' : 'non-billable'}"`,
6258+
matchType: 'Match type',
6259+
matchTypeContains: 'Contains',
6260+
matchTypeExact: 'Exactly matches',
62586261
},
62596262
categoryRules: {
62606263
title: 'Category rules',

src/languages/es.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6020,19 +6020,22 @@ ${amount} para ${merchant} - ${date}`,
60206020
addRuleTitle: 'Añadir regla',
60216021
editRuleTitle: 'Editar regla',
60226022
expensesWith: 'Para gastos con:',
6023+
expensesExactlyMatching: 'Para gastos que coincidan exactamente con:',
60236024
applyUpdates: 'Aplicar estas actualizaciones:',
6024-
merchantHint: 'Coincide con un nombre de comerciante con coincidencia "contiene" sin distinción de mayúsculas y minúsculas',
60256025
saveRule: 'Guardar regla',
60266026
confirmError: 'Ingresa comerciante y aplica al menos una actualización',
60276027
confirmErrorMerchant: 'Por favor ingresa comerciante',
60286028
confirmErrorUpdate: 'Por favor aplica al menos una actualización',
60296029
deleteRule: 'Eliminar regla',
60306030
deleteRuleConfirmation: '¿Estás seguro de que quieres eliminar esta regla?',
6031-
ruleSummaryTitle: (merchantName: string) => `Si el comerciante contiene "${merchantName}"`,
6031+
ruleSummaryTitle: (merchantName: string, isExactMatch: boolean) => `Si el comerciante ${isExactMatch ? 'coincide exactamente con' : 'contiene'} "${merchantName}"`,
60326032
ruleSummarySubtitleMerchant: (merchantName: string) => `Renombrar comerciante a "${merchantName}"`,
60336033
ruleSummarySubtitleUpdateField: (fieldName: string, fieldValue: string) => `Actualizar ${fieldName} a "${fieldValue}"`,
60346034
ruleSummarySubtitleReimbursable: (reimbursable: boolean) => `Marcar como "${reimbursable ? 'reembolsable' : 'no reembolsable'}"`,
60356035
ruleSummarySubtitleBillable: (billable: boolean) => `Marcar como "${billable ? 'facturable' : 'no facturable'}"`,
6036+
matchType: 'Tipo de coincidencia',
6037+
matchTypeContains: 'Contiene',
6038+
matchTypeExact: 'Coincide exactamente',
60366039
},
60376040
categoryRules: {
60386041
title: 'Reglas de categoría',

src/languages/fr.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6393,22 +6393,25 @@ Exigez des informations de dépense comme les reçus et les descriptions, défin
63936393
title: 'Commerçant',
63946394
subtitle: 'Définissez les règles de marchand afin que les dépenses arrivent correctement codées et nécessitent moins de nettoyage.',
63956395
addRule: 'Ajouter une règle de commerçant',
6396-
ruleSummaryTitle: (merchantName: string) => `Si le commerçant contient « ${merchantName} »`,
6396+
ruleSummaryTitle: (merchantName: string, isExactMatch: boolean) => `Si le commerçant ${isExactMatch ? 'correspond exactement' : 'contient'} « ${merchantName} »`,
63976397
ruleSummarySubtitleMerchant: (merchantName: string) => `Renommer le marchand en « ${merchantName} »`,
63986398
ruleSummarySubtitleUpdateField: (fieldName: string, fieldValue: string) => `Mettre à jour ${fieldName} sur « ${fieldValue} »`,
63996399
ruleSummarySubtitleReimbursable: (reimbursable: boolean) => `Marquer comme « ${reimbursable ? 'remboursable' : 'non remboursable'} »`,
64006400
ruleSummarySubtitleBillable: (billable: boolean) => `Marquer comme « ${billable ? 'facturable' : 'non facturable'} »`,
64016401
addRuleTitle: 'Ajouter une règle',
64026402
expensesWith: 'Pour les dépenses avec :',
64036403
applyUpdates: 'Appliquer ces mises à jour :',
6404-
merchantHint: 'Faire correspondre un nom de commerçant avec une correspondance « contient » insensible à la casse',
64056404
saveRule: 'Enregistrer la règle',
64066405
confirmError: 'Saisissez un marchand et appliquez au moins une mise à jour',
64076406
confirmErrorMerchant: 'Veuillez saisir le commerçant',
64086407
confirmErrorUpdate: 'Veuillez appliquer au moins une mise à jour',
64096408
editRuleTitle: 'Modifier la règle',
64106409
deleteRule: 'Supprimer la règle',
64116410
deleteRuleConfirmation: 'Voulez-vous vraiment supprimer cette règle ?',
6411+
matchType: 'Type de correspondance',
6412+
matchTypeContains: 'Contient',
6413+
matchTypeExact: 'Correspond exactement',
6414+
expensesExactlyMatching: 'Pour les dépenses correspondant exactement :',
64126415
},
64136416
},
64146417
planTypePage: {

src/languages/it.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6364,22 +6364,25 @@ Richiedi dettagli di spesa come ricevute e descrizioni, imposta limiti e valori
63646364
title: 'Esercente',
63656365
subtitle: 'Imposta le regole per gli esercenti in modo che le spese arrivino già codificate correttamente e richiedano meno correzioni.',
63666366
addRule: 'Aggiungi regola esercente',
6367-
ruleSummaryTitle: (merchantName: string) => `Se lesercente contiene "${merchantName}"`,
6367+
ruleSummaryTitle: (merchantName: string, isExactMatch: boolean) => `Se l'esercente ${isExactMatch ? 'corrisponde esattamente' : 'contiene'} "${merchantName}"`,
63686368
ruleSummarySubtitleMerchant: (merchantName: string) => `Rinomina esercente in "${merchantName}"`,
63696369
ruleSummarySubtitleUpdateField: (fieldName: string, fieldValue: string) => `Aggiorna ${fieldName} a "${fieldValue}"`,
63706370
ruleSummarySubtitleReimbursable: (reimbursable: boolean) => `Segna come "${reimbursable ? 'rimborsabile' : 'non rimborsabile'}"`,
63716371
ruleSummarySubtitleBillable: (billable: boolean) => `Contrassegna come "${billable ? 'fatturabile' : 'non fatturabile'}"`,
63726372
addRuleTitle: 'Aggiungi regola',
63736373
expensesWith: 'Per spese con:',
63746374
applyUpdates: 'Applica questi aggiornamenti:',
6375-
merchantHint: 'Abbina un nome commerciante con una corrispondenza "contiene" che non distingue tra maiuscole e minuscole',
63766375
saveRule: 'Salva regola',
63776376
confirmError: 'Inserisci l’esercente e applica almeno un aggiornamento',
63786377
confirmErrorMerchant: 'Per favore inserisci l’esercente',
63796378
confirmErrorUpdate: 'Applica almeno un aggiornamento',
63806379
editRuleTitle: 'Modifica regola',
63816380
deleteRule: 'Elimina regola',
63826381
deleteRuleConfirmation: 'Sei sicuro di voler eliminare questa regola?',
6382+
matchType: 'Tipo di corrispondenza',
6383+
matchTypeContains: 'Contiene',
6384+
matchTypeExact: 'Corrisponde esattamente',
6385+
expensesExactlyMatching: 'Per le spese che corrispondono esattamente:',
63836386
},
63846387
},
63856388
planTypePage: {

src/languages/ja.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6320,22 +6320,25 @@ ${reportName}
63206320
title: '加盟店',
63216321
subtitle: '取引先ルールを設定して、経費が正しくコード化された状態で届くようにし、後処理を最小限に抑えましょう。',
63226322
addRule: '店舗ルールを追加',
6323-
ruleSummaryTitle: (merchantName: string) => `もし取引先に「${merchantName}」が含まれている場合`,
6323+
ruleSummaryTitle: (merchantName: string, isExactMatch: boolean) => `もし加盟店 ${isExactMatch ? '完全一致' : '含む'} 「${merchantName}」`,
63246324
ruleSummarySubtitleMerchant: (merchantName: string) => `支払先名を「${merchantName}」に変更`,
63256325
ruleSummarySubtitleUpdateField: (fieldName: string, fieldValue: string) => `${fieldName} を「${fieldValue}」に更新`,
63266326
ruleSummarySubtitleReimbursable: (reimbursable: boolean) => `「${reimbursable ? '払い戻し対象' : '精算対象外'}」としてマーク`,
63276327
ruleSummarySubtitleBillable: (billable: boolean) => `「${billable ? '請求可能' : '請求対象外'}」としてマーク`,
63286328
addRuleTitle: 'ルールを追加',
63296329
expensesWith: '次の条件の経費について:',
63306330
applyUpdates: 'これらの更新を適用:',
6331-
merchantHint: '大文字小文字を区別しない「含む」一致で支払先名を照合する',
63326331
saveRule: 'ルールを保存',
63336332
confirmError: '支払先を入力し、少なくとも 1 つの更新を適用してください',
63346333
confirmErrorMerchant: '商人を入力してください',
63356334
confirmErrorUpdate: '少なくとも 1 件の更新を適用してください',
63366335
editRuleTitle: 'ルールを編集',
63376336
deleteRule: 'ルールを削除',
63386337
deleteRuleConfirmation: 'このルールを削除してもよろしいですか?',
6338+
matchType: '一致タイプ',
6339+
matchTypeContains: '含む',
6340+
matchTypeExact: '完全一致',
6341+
expensesExactlyMatching: '以下と完全一致する経費について:',
63396342
},
63406343
},
63416344
planTypePage: {

src/languages/nl.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6352,22 +6352,25 @@ Vraag verplichte uitgavedetails zoals bonnetjes en beschrijvingen, stel limieten
63526352
title: 'Handelaar',
63536353
subtitle: 'Stel de merchantregels zo in dat onkosten met de juiste codering binnenkomen en er minder nabewerking nodig is.',
63546354
addRule: 'Merchantregel toevoegen',
6355-
ruleSummaryTitle: (merchantName: string) => `Als handelaar "${merchantName}" bevat`,
6355+
ruleSummaryTitle: (merchantName: string, isExactMatch: boolean) => `Als handelaar ${isExactMatch ? 'komt exact overeen' : 'bevat'} "${merchantName}"`,
63566356
ruleSummarySubtitleMerchant: (merchantName: string) => `Naam handelaar wijzigen in "${merchantName}"`,
63576357
ruleSummarySubtitleUpdateField: (fieldName: string, fieldValue: string) => `Werk ${fieldName} bij naar "${fieldValue}"`,
63586358
ruleSummarySubtitleReimbursable: (reimbursable: boolean) => `Markeren als "${reimbursable ? 'Vergoedbaar' : 'niet-vergoedbaar'}"`,
63596359
ruleSummarySubtitleBillable: (billable: boolean) => `Markeren als "${billable ? 'factureerbaar' : 'niet-factureerbaar'}"`,
63606360
addRuleTitle: 'Regel toevoegen',
63616361
expensesWith: 'Voor uitgaven met:',
63626362
applyUpdates: 'Deze updates toepassen:',
6363-
merchantHint: 'Een handelsnaam koppelen met hoofdletterongevoelige "bevat"-overeenkomst',
63646363
saveRule: 'Regel opslaan',
63656364
confirmError: 'Voer een leverancier in en pas ten minste één wijziging toe',
63666365
confirmErrorMerchant: 'Voer handelaar in',
63676366
confirmErrorUpdate: 'Breng ten minste één wijziging aan alstublieft',
63686367
editRuleTitle: 'Regel bewerken',
63696368
deleteRule: 'Regel verwijderen',
63706369
deleteRuleConfirmation: 'Weet je zeker dat je deze regel wilt verwijderen?',
6370+
matchType: 'Type overeenkomen',
6371+
matchTypeContains: 'Bevat',
6372+
matchTypeExact: 'Komt exact overeen',
6373+
expensesExactlyMatching: 'Voor uitgaven die exact overeenkomen met:',
63716374
},
63726375
},
63736376
planTypePage: {

0 commit comments

Comments
 (0)