Skip to content

Commit beeda19

Browse files
authored
Merge pull request #92736 from Expensify/add-ai-rule
[Payment due @mkhutornyi] Add ai rule
2 parents d10a82f + 2f009c3 commit beeda19

37 files changed

Lines changed: 1363 additions & 5 deletions

src/CONST/index.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4791,7 +4791,6 @@ const CONST = {
47914791
BLOCK: 'block',
47924792
},
47934793
},
4794-
47954794
get SUBSCRIPTION_PRICES() {
47964795
return {
47974796
[this.PAYMENT_CARD_CURRENCY.USD]: {
@@ -9159,6 +9158,10 @@ const CONST = {
91599158
SPEND_RULE_SECTION_ITEM: 'WorkspaceRules-SpendRuleSectionItem',
91609159
SPEND_RULE_SAVE: 'WorkspaceRules-SpendRuleSave',
91619160
SPEND_RULE_RESTRICTION_TYPE: 'WorkspaceRules-SpendRuleRestrictionType',
9161+
AI_RULE_ITEM: 'WorkspaceRules-AIRuleItem',
9162+
ADD_AI_RULE: 'WorkspaceRules-AddAIRule',
9163+
AI_RULE_SAVE: 'WorkspaceRules-AIRuleSave',
9164+
AI_RULE_DELETE: 'WorkspaceRules-AIRuleDelete',
91629165
},
91639166
EXPENSIFY_CARD: {
91649167
ISSUE_CARD_BUTTON: 'WorkspaceExpensifyCard-IssueCardButton',

src/ONYXKEYS.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1196,6 +1196,10 @@ const ONYXKEYS = {
11961196
EDIT_AGENT_NAME_FORM_DRAFT: 'editAgentNameFormDraft',
11971197
EDIT_AGENT_PROMPT_FORM: 'editAgentPromptForm',
11981198
EDIT_AGENT_PROMPT_FORM_DRAFT: 'editAgentPromptFormDraft',
1199+
ADD_AI_RULE_FORM: 'addAIRuleForm',
1200+
ADD_AI_RULE_FORM_DRAFT: 'addAIRuleFormDraft',
1201+
EDIT_AI_RULE_FORM: 'editAIRuleForm',
1202+
EDIT_AI_RULE_FORM_DRAFT: 'editAIRuleFormDraft',
11991203
},
12001204
DERIVED: {
12011205
REPORT_ATTRIBUTES: 'reportAttributes',
@@ -1347,6 +1351,8 @@ type OnyxFormValuesMapping = {
13471351
[ONYXKEYS.FORMS.CREATE_DOMAIN_GROUP_FORM]: FormTypes.DomainGroupCreateForm;
13481352
[ONYXKEYS.FORMS.EDIT_AGENT_NAME_FORM]: FormTypes.EditAgentNameForm;
13491353
[ONYXKEYS.FORMS.EDIT_AGENT_PROMPT_FORM]: FormTypes.EditAgentPromptForm;
1354+
[ONYXKEYS.FORMS.ADD_AI_RULE_FORM]: FormTypes.AddAIRuleForm;
1355+
[ONYXKEYS.FORMS.EDIT_AI_RULE_FORM]: FormTypes.EditAIRuleForm;
13501356
};
13511357

13521358
type OnyxFormDraftValuesMapping = {

src/ROUTES.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3289,6 +3289,14 @@ const ROUTES = {
32893289
route: 'workspaces/:policyID/rules/merchant-rules/:ruleID/preview-matches',
32903290
getRoute: (policyID: string, ruleID?: string) => `workspaces/${policyID}/rules/merchant-rules/${ruleID ?? 'new'}/preview-matches` as const,
32913291
},
3292+
RULES_AI_NEW: {
3293+
route: 'workspaces/:policyID/rules/ai-rules/new',
3294+
getRoute: (policyID: string) => `workspaces/${policyID}/rules/ai-rules/new` as const,
3295+
},
3296+
RULES_AI_EDIT: {
3297+
route: 'workspaces/:policyID/rules/ai-rules/:ruleID',
3298+
getRoute: (policyID: string, ruleID: string) => `workspaces/${policyID}/rules/ai-rules/${ruleID}` as const,
3299+
},
32923300
SHARE_ROOT: 'share/root',
32933301
SHARE_ROOT_SHARE: 'share/root/share',
32943302
SHARE_ROOT_SUBMIT: 'share/root/submit',

src/SCREENS.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -916,6 +916,8 @@ const SCREENS = {
916916
RULES_MERCHANT_EDIT: 'Rules_Merchant_Edit',
917917
RULES_SPEND_MERCHANTS: 'Rules_Spend_Merchants',
918918
RULES_SPEND_MERCHANT_EDIT: 'Rules_Spend_Merchant_Edit',
919+
RULES_AI_NEW: 'Rules_AI_New',
920+
RULES_AI_EDIT: 'Rules_AI_Edit',
919921
PER_DIEM: 'Per_Diem',
920922
PER_DIEM_IMPORT: 'Per_Diem_Import',
921923
PER_DIEM_IMPORTED: 'Per_Diem_Imported',

src/languages/de.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7345,6 +7345,18 @@ Fügen Sie weitere Ausgabelimits hinzu, um den Cashflow Ihres Unternehmens zu sc
73457345
}) =>
73467346
`${action === CONST.SPEND_RULES.ACTION.BLOCK ? 'Blockiert' : 'Erlaubt'} ${shownCount > 1 ? 'Kategorien' : 'Kategorie'}: ${categories}${hiddenCount > 0 ? `, +${hiddenCount} weitere` : ''}`,
73477347
},
7348+
aiRules: {
7349+
title: 'KI-Regeln',
7350+
subtitle: 'Beschreiben Sie flexible Regeln, die ausgeführt werden, wenn Sie sie benötigen',
7351+
addRule: 'KI-Regel hinzufügen',
7352+
findRule: 'KI-Regel finden',
7353+
addRuleTitle: 'Regel hinzufügen',
7354+
editRuleTitle: 'Regel bearbeiten',
7355+
deleteRule: 'Regel löschen',
7356+
deleteRuleConfirmation: 'Sind Sie sicher, dass Sie diese Regel löschen möchten?',
7357+
describeRuleTitle: 'Beschreiben Sie Ihre Regel',
7358+
describeRuleSubtitle: 'Beschreiben Sie Ihre Regel und Concierge erstellt sie',
7359+
},
73487360
},
73497361
planTypePage: {
73507362
planTypes: {

src/languages/en.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7443,6 +7443,18 @@ const translations = {
74437443
[CONST.SPEND_RULES.CATEGORIES.TRAVEL_AGENCIES]: 'Travel agencies',
74447444
},
74457445
},
7446+
aiRules: {
7447+
title: 'AI Rules',
7448+
subtitle: 'Describe flexible rules that run when you need them',
7449+
addRule: 'Add AI rule',
7450+
findRule: 'Find AI rule',
7451+
addRuleTitle: 'Add rule',
7452+
editRuleTitle: 'Edit rule',
7453+
deleteRule: 'Delete rule',
7454+
deleteRuleConfirmation: 'Are you sure you want to delete this rule?',
7455+
describeRuleTitle: 'Describe your rule',
7456+
describeRuleSubtitle: 'Describe your rule and Concierge will build it',
7457+
},
74467458
},
74477459
planTypePage: {
74487460
planTypes: {

src/languages/es.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7240,6 +7240,18 @@ ${amount} para ${merchant} - ${date}`,
72407240
[CONST.SPEND_RULES.CATEGORIES.TRAVEL_AGENCIES]: 'Agencias de viajes',
72417241
},
72427242
},
7243+
aiRules: {
7244+
title: 'Reglas de IA',
7245+
subtitle: 'Describe reglas flexibles que se ejecutan cuando las necesitas',
7246+
addRule: 'Añadir regla de IA',
7247+
findRule: 'Buscar regla de IA',
7248+
addRuleTitle: 'Añadir regla',
7249+
describeRuleTitle: 'Describe tu regla',
7250+
describeRuleSubtitle: 'Describe tu regla y Concierge la creará',
7251+
editRuleTitle: 'Editar regla',
7252+
deleteRule: 'Eliminar regla',
7253+
deleteRuleConfirmation: '¿Seguro que quieres eliminar esta regla?',
7254+
},
72437255
},
72447256
emptyDomain: {
72457257
title: 'Mejora tu seguridad con dominios',

src/languages/fr.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7373,6 +7373,18 @@ Ajoutez davantage de règles de dépenses pour protéger la trésorerie de l’e
73737373
}) =>
73747374
`${action === CONST.SPEND_RULES.ACTION.BLOCK ? 'Bloqué' : 'Autorisé'} ${shownCount > 1 ? 'catégories' : 'catégorie'}: ${categories}${hiddenCount > 0 ? `, +${hiddenCount} de plus` : ''}`,
73757375
},
7376+
aiRules: {
7377+
title: 'Règles IA',
7378+
subtitle: 'Décrivez des règles flexibles qui s’exécutent quand vous en avez besoin',
7379+
addRule: 'Ajouter une règle IA',
7380+
findRule: 'Rechercher une règle d’IA',
7381+
addRuleTitle: 'Ajouter une règle',
7382+
editRuleTitle: 'Modifier la règle',
7383+
deleteRule: 'Supprimer la règle',
7384+
deleteRuleConfirmation: 'Voulez-vous vraiment supprimer cette règle ?',
7385+
describeRuleTitle: 'Décrivez votre règle',
7386+
describeRuleSubtitle: 'Décrivez votre règle et Concierge la créera',
7387+
},
73767388
},
73777389
planTypePage: {
73787390
planTypes: {

src/languages/it.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7330,6 +7330,18 @@ Aggiungi altre regole di spesa per proteggere il flusso di cassa aziendale.`,
73307330
}) =>
73317331
`${action === CONST.SPEND_RULES.ACTION.BLOCK ? 'Bloccato' : 'Consentito'} ${shownCount > 1 ? 'categorie' : 'categoria'}: ${categories}${hiddenCount > 0 ? `, +${hiddenCount} in più` : ''}`,
73327332
},
7333+
aiRules: {
7334+
title: 'Regole IA',
7335+
subtitle: 'Descrivi regole flessibili che vengono eseguite quando ne hai bisogno',
7336+
addRule: 'Aggiungi regola IA',
7337+
findRule: 'Trova regola IA',
7338+
addRuleTitle: 'Aggiungi regola',
7339+
editRuleTitle: 'Modifica regola',
7340+
deleteRule: 'Elimina regola',
7341+
deleteRuleConfirmation: 'Sei sicuro di voler eliminare questa regola?',
7342+
describeRuleTitle: 'Descrivi la tua regola',
7343+
describeRuleSubtitle: 'Descrivi la tua regola e Concierge la creerà',
7344+
},
73337345
},
73347346
planTypePage: {
73357347
planTypes: {

src/languages/ja.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7248,6 +7248,18 @@ ${reportName}
72487248
}) =>
72497249
`${action === CONST.SPEND_RULES.ACTION.BLOCK ? 'ブロック済み' : '許可されています'} ${shownCount > 1 ? 'カテゴリ' : 'カテゴリ'}: ${categories}${hiddenCount > 0 ? `、ほか +${hiddenCount} 件` : ''}`,
72507250
},
7251+
aiRules: {
7252+
title: 'AI ルール',
7253+
subtitle: '必要なときに実行される柔軟なルールを記述します',
7254+
addRule: 'AI ルールを追加',
7255+
findRule: 'AI ルールを検索',
7256+
addRuleTitle: 'ルールを追加',
7257+
editRuleTitle: 'ルールを編集',
7258+
deleteRule: 'ルールを削除',
7259+
deleteRuleConfirmation: 'このルールを削除してもよろしいですか?',
7260+
describeRuleTitle: 'ルールの内容を記入してください',
7261+
describeRuleSubtitle: 'ルールの内容を入力すると、Concierge が自動作成します',
7262+
},
72517263
},
72527264
planTypePage: {
72537265
planTypes: {

0 commit comments

Comments
 (0)