Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions src/CONST/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4195,6 +4195,20 @@ const CONST = {
},
},

SPEND_RULE_FORM: {
FIELDS: {
CARD_IDS: 'cardIDs',
RESTRICTION_ACTION: 'restrictionAction',
},
},

SPEND_CARD_RULE: {
ACTION: {
ALLOW: 'allow',
BLOCK: 'block',
},
},

get SUBSCRIPTION_PRICES() {
return {
[this.PAYMENT_CARD_CURRENCY.USD]: {
Expand Down Expand Up @@ -9126,6 +9140,7 @@ const CONST = {
THREE_DOT_MENU: 'WorkspaceAccounting-ThreeDotMenu',
},
RULES: {
ADD_SPEND_RULE: 'WorkspaceRules-AddSpendRule',
INDIVIDUAL_EXPENSES_MENU_ITEM: 'WorkspaceRules-IndividualExpensesMenuItem',
SPEND_RULE_ITEM: 'WorkspaceRules-SpendRuleItem',
MERCHANT_RULE_ITEM: 'WorkspaceRules-MerchantRuleItem',
Expand All @@ -9135,6 +9150,9 @@ const CONST = {
MERCHANT_RULE_PREVIEW_MATCHES: 'WorkspaceRules-MerchantRulePreviewMatches',
MERCHANT_RULE_DELETE: 'WorkspaceRules-MerchantRuleDelete',
CATEGORY_SELECTOR: 'WorkspaceRules-CategorySelector',
SPEND_RULE_SECTION_ITEM: 'WorkspaceRules-SpendRuleSectionItem',
SPEND_RULE_SAVE: 'WorkspaceRules-SpendRuleSave',
SPEND_RULE_RESTRICTION_TYPE: 'WorkspaceRules-SpendRuleRestrictionType',
},
EXPENSIFY_CARD: {
ISSUE_CARD_BUTTON: 'WorkspaceExpensifyCard-IssueCardButton',
Expand Down
3 changes: 3 additions & 0 deletions src/ONYXKEYS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1055,6 +1055,8 @@ const ONYXKEYS = {
EXPENSE_RULE_FORM_DRAFT: 'expenseRuleFormDraft',
MERCHANT_RULE_FORM: 'merchantRuleForm',
MERCHANT_RULE_FORM_DRAFT: 'merchantRuleFormDraft',
SPEND_RULE_FORM: 'spendRuleForm',
SPEND_RULE_FORM_DRAFT: 'spendRuleFormDraft',
ADD_DOMAIN_MEMBER_FORM: 'addDomainMemberForm',
ADD_DOMAIN_MEMBER_FORM_DRAFT: 'addDomainMemberFormDraft',
ADD_WORK_EMAIL_FORM: 'addWorkEmailForm',
Expand Down Expand Up @@ -1193,6 +1195,7 @@ type OnyxFormValuesMapping = {
[ONYXKEYS.FORMS.SPLIT_EXPENSE_EDIT_DATES]: FormTypes.SplitExpenseEditDateForm;
[ONYXKEYS.FORMS.EXPENSE_RULE_FORM]: FormTypes.ExpenseRuleForm;
[ONYXKEYS.FORMS.MERCHANT_RULE_FORM]: FormTypes.MerchantRuleForm;
[ONYXKEYS.FORMS.SPEND_RULE_FORM]: FormTypes.SpendRuleForm;
[ONYXKEYS.FORMS.ADD_DOMAIN_MEMBER_FORM]: FormTypes.AddDomainMemberForm;
[ONYXKEYS.FORMS.ADD_WORK_EMAIL_FORM]: FormTypes.AddWorkEmailForm;
};
Expand Down
8 changes: 8 additions & 0 deletions src/ROUTES.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2943,6 +2943,14 @@ const ROUTES = {
route: 'workspaces/:policyID/rules/merchant-rules/new',
getRoute: (policyID: string) => `workspaces/${policyID}/rules/merchant-rules/new` as const,
},
RULES_SPEND_NEW: {
route: 'workspaces/:policyID/rules/spend-rules/new',
getRoute: (policyID: string) => `workspaces/${policyID}/rules/spend-rules/new` as const,
},
RULES_SPEND_CARD: {
route: 'workspaces/:policyID/rules/spend-rules/new/card',
getRoute: (policyID: string) => `workspaces/${policyID}/rules/spend-rules/new/card` as const,
},
RULES_MERCHANT_MERCHANT_TO_MATCH: {
route: 'workspaces/:policyID/rules/merchant-rules/:ruleID/merchant-to-match',
getRoute: (policyID: string, ruleID?: string) => `workspaces/${policyID}/rules/merchant-rules/${ruleID ?? 'new'}/merchant-to-match` as const,
Expand Down
2 changes: 2 additions & 0 deletions src/SCREENS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -802,6 +802,8 @@ const SCREENS = {
RULES_CUSTOM: 'Rules_Custom',
RULES_PROHIBITED_DEFAULT: 'Rules_Prohibited_Default',
RULES_MERCHANT_NEW: 'Rules_Merchant_New',
RULES_SPEND_NEW: 'Rules_Spend_New',
RULES_SPEND_CARD: 'Rules_Spend_Card',
RULES_MERCHANT_MERCHANT_TO_MATCH: 'Rules_Merchant_Merchant_To_Match',
RULES_MERCHANT_MATCH_TYPE: 'Rules_Merchant_Match_Type',
RULES_MERCHANT_MERCHANT: 'Rules_Merchant_Merchant',
Expand Down
1 change: 1 addition & 0 deletions src/components/SelectionList/BaseSelectionList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,7 @@ function BaseSelectionList<TItem extends ListItem>({
canSelectMultiple={canSelectMultiple}
onSelectAll={handleSelectAll}
headerStyle={style?.listHeaderWrapperStyle}
selectAllTextStyle={style?.listHeaderSelectAllTextStyle}
shouldShowSelectAllButton={!!onSelectAll}
shouldPreventDefaultFocusOnSelectRow={shouldPreventDefaultFocusOnSelectRow}
/>
Expand Down
8 changes: 6 additions & 2 deletions src/components/SelectionList/components/ListHeader.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import type {StyleProp, ViewStyle} from 'react-native';
import type {StyleProp, TextStyle, ViewStyle} from 'react-native';
import {View} from 'react-native';
import Checkbox from '@components/Checkbox';
import {PressableWithFeedback} from '@components/Pressable';
Expand All @@ -22,6 +22,9 @@ type ListHeaderProps<TItem extends ListItem> = {
/** Styles for the list header wrapper */
headerStyle?: StyleProp<ViewStyle>;

/** Styles for the "Select all" text (merged after textStrong) */
selectAllTextStyle?: StyleProp<TextStyle>;

/** Function called when the select all button is pressed */
onSelectAll: () => void;

Expand All @@ -38,6 +41,7 @@ function ListHeader<TItem extends ListItem>({
canSelectMultiple,
onSelectAll,
headerStyle,
selectAllTextStyle,
shouldShowSelectAllButton,
shouldPreventDefaultFocusOnSelectRow,
}: ListHeaderProps<TItem>) {
Expand Down Expand Up @@ -84,7 +88,7 @@ function ListHeader<TItem extends ListItem>({
dataSet={{[CONST.SELECTION_SCRAPER_HIDDEN_ELEMENT]: true}}
onMouseDown={handleMouseDown}
>
<Text style={[styles.textStrong, styles.ph3]}>{translate('workspace.people.selectAll')}</Text>
<Text style={[styles.textStrong, styles.ph3, selectAllTextStyle]}>{translate('workspace.people.selectAll')}</Text>
</PressableWithFeedback>
)}
</View>
Expand Down
3 changes: 3 additions & 0 deletions src/components/SelectionList/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,9 @@ type SelectionListStyle = {
/** Styles for the list header wrapper */
listHeaderWrapperStyle?: StyleProp<ViewStyle>;

/** Styles for the default "Select all" label in the list header (merged after textStrong) */
listHeaderSelectAllTextStyle?: StyleProp<TextStyle>;

/** Styles for the title container of the list item */
listItemTitleContainerStyles?: StyleProp<ViewStyle>;

Expand Down
5 changes: 5 additions & 0 deletions src/languages/de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6669,7 +6669,7 @@
title: 'Spesenrichtlinie',
cardSubtitle: 'Hier ist die Spesenrichtlinie deines Teams hinterlegt, damit alle denselben Stand haben, was abgedeckt ist.',
},
spendRules: {

Check failure on line 6672 in src/languages/de.ts

View workflow job for this annotation

GitHub Actions / typecheck

Type '{ title: string; subtitle: string; defaultRuleDescription: string; block: string; defaultRuleTitle: string; builtInProtectionModal: { title: string; description: string; }; addSpendRule: string; cardPageTitle: string; cardsSectionTitle: string; chooseCards: string; saveRule: string; }' is missing the following properties from type 'TranslationDeepObject<{ title: string; subtitle: string; defaultRuleDescription: string; block: string; defaultRuleTitle: string; builtInProtectionModal: { title: string; description: string; }; addSpendRule: string; ... 8 more ...; restrictionTypeHelpBlock: string; }>': allow, spendRuleSectionTitle, restrictionType, restrictionTypeHelpAllow, restrictionTypeHelpBlock
title: 'Ausgaben',
subtitle: 'Genehmigen oder lehnen Sie Expensify Karten-Transaktionen in Echtzeit ab.',
defaultRuleDescription: 'Alle Karten',
Expand All @@ -6679,6 +6679,11 @@
title: 'Expensify Karten bieten integrierten Schutz – jederzeit',
description: `Expensify lehnt diese Belastungen immer ab:\n\n • Dienstleistungen für Erwachsene\n • Geldautomaten (ATMs)\n • Glücksspiel\n • Geldüberweisungen\n\nFügen Sie weitere Ausgabenregeln hinzu, um den Cashflow des Unternehmens zu schützen.`,
},
addSpendRule: 'Ausgabenregel hinzufügen',
cardPageTitle: 'Karte',
cardsSectionTitle: 'Karten',
chooseCards: 'Karten auswählen',
saveRule: 'Regel speichern',
},
},
planTypePage: {
Expand Down
10 changes: 10 additions & 0 deletions src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6664,6 +6664,16 @@ const translations = {
title: 'Expensify Cards offer built-in protection - always',
description: `Expensify always declines these charges:\n\n • Adult services\n • ATMs\n • Gambling\n • Money transfers\n\nAdd more spend rules to protect company cash flow.`,
},
addSpendRule: 'Add spend rule',
cardPageTitle: 'Card',
cardsSectionTitle: 'Cards',
chooseCards: 'Choose cards',
saveRule: 'Save rule',
allow: 'Allow',
spendRuleSectionTitle: 'Spend rule',
restrictionType: 'Restriction type',
restrictionTypeHelpAllow: "Charges are approved if they match any merchant or category, and don't exceed a max amount.",
restrictionTypeHelpBlock: 'Charges are declined if they match any merchant or category, or exceed a max amount.',
},
},
planTypePage: {
Expand Down
10 changes: 10 additions & 0 deletions src/languages/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6579,6 +6579,16 @@ ${amount} para ${merchant} - ${date}`,
title: 'Las tarjetas Expensify incluyen protección integrada: siempre',
description: `Expensify siempre rechaza estos cargos:\n\n • Servicios para adultos\n • Cajeros automáticos\n • Juegos de azar\n • Transferencias de dinero\n\nAñada más reglas de gastos para proteger el flujo de caja de la empresa.`,
},
addSpendRule: 'Añadir regla de gastos',
cardPageTitle: 'Tarjeta',
cardsSectionTitle: 'Tarjetas',
chooseCards: 'Elegir tarjetas',
saveRule: 'Guardar regla',
allow: 'Permitir',
spendRuleSectionTitle: 'Regla de gastos',
restrictionType: 'Tipo de restricción',
restrictionTypeHelpAllow: "Los cargos se aprueban si coinciden con cualquier comerciante o categoría, y no superan un importe máximo.",
restrictionTypeHelpBlock: 'Los cargos se rechazan si coinciden con cualquier comerciante o categoría, o superan un importe máximo.',
},
},
},
Expand Down
5 changes: 5 additions & 0 deletions src/languages/fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6693,7 +6693,7 @@
title: 'Politique de dépenses',
cardSubtitle: 'C’est ici que se trouve la politique de dépenses de votre équipe, pour que tout le monde soit d’accord sur ce qui est couvert.',
},
spendRules: {

Check failure on line 6696 in src/languages/fr.ts

View workflow job for this annotation

GitHub Actions / typecheck

Type '{ title: string; subtitle: string; defaultRuleDescription: string; block: string; defaultRuleTitle: string; builtInProtectionModal: { title: string; description: string; }; addSpendRule: string; cardPageTitle: string; cardsSectionTitle: string; chooseCards: string; saveRule: string; }' is missing the following properties from type 'TranslationDeepObject<{ title: string; subtitle: string; defaultRuleDescription: string; block: string; defaultRuleTitle: string; builtInProtectionModal: { title: string; description: string; }; addSpendRule: string; ... 8 more ...; restrictionTypeHelpBlock: string; }>': allow, spendRuleSectionTitle, restrictionType, restrictionTypeHelpAllow, restrictionTypeHelpBlock
title: 'Dépenser',
subtitle: 'Approuvez ou refusez les transactions Carte Expensify en temps réel.',
defaultRuleDescription: 'Toutes les cartes',
Expand All @@ -6703,6 +6703,11 @@
title: 'Les Cartes Expensify offrent une protection intégrée – en permanence',
description: `Expensify refuse toujours ces types de dépenses:\n\n • Services pour adultes\n • DAB\n • Jeux d’argent\n • Transferts d’argent\n\nAjoutez davantage de règles de dépenses pour protéger la trésorerie de l’entreprise.`,
},
addSpendRule: 'Ajouter une règle de dépenses',
cardPageTitle: 'Carte',
cardsSectionTitle: 'Cartes',
chooseCards: 'Choisir des cartes',
saveRule: 'Enregistrer la règle',
},
},
planTypePage: {
Expand Down
5 changes: 5 additions & 0 deletions src/languages/it.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6656,7 +6656,7 @@
title: 'Politica di spesa',
cardSubtitle: 'Qui trovi il regolamento spese del tuo team, così tutti sono allineati su cosa è coperto.',
},
spendRules: {

Check failure on line 6659 in src/languages/it.ts

View workflow job for this annotation

GitHub Actions / typecheck

Type '{ title: string; subtitle: string; defaultRuleDescription: string; block: string; defaultRuleTitle: string; builtInProtectionModal: { title: string; description: string; }; addSpendRule: string; cardPageTitle: string; cardsSectionTitle: string; chooseCards: string; saveRule: string; }' is missing the following properties from type 'TranslationDeepObject<{ title: string; subtitle: string; defaultRuleDescription: string; block: string; defaultRuleTitle: string; builtInProtectionModal: { title: string; description: string; }; addSpendRule: string; ... 8 more ...; restrictionTypeHelpBlock: string; }>': allow, spendRuleSectionTitle, restrictionType, restrictionTypeHelpAllow, restrictionTypeHelpBlock
title: 'Spesa',
subtitle: 'Approva o rifiuta le transazioni della Carta Expensify in tempo reale.',
defaultRuleDescription: 'Tutte le carte',
Expand All @@ -6666,6 +6666,11 @@
title: 'Le Carte Expensify offrono una protezione integrata, sempre',
description: `Expensify rifiuta sempre queste spese:\n\n • Servizi per adulti\n • Bancomat\n • Gioco d’azzardo\n • Trasferimenti di denaro\n\nAggiungi altre regole di spesa per proteggere il flusso di cassa dell’azienda.`,
},
addSpendRule: 'Aggiungi regola di spesa',
cardPageTitle: 'Carta',
cardsSectionTitle: 'Carte',
chooseCards: 'Scegli le carte',
saveRule: 'Salva regola',
},
},
planTypePage: {
Expand Down
5 changes: 5 additions & 0 deletions src/languages/ja.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6582,7 +6582,7 @@
title: '経費ポリシー',
cardSubtitle: 'ここはチームの経費ポリシーが保存されている場所です。何が対象になるか、全員が同じ認識を持てます。',
},
spendRules: {

Check failure on line 6585 in src/languages/ja.ts

View workflow job for this annotation

GitHub Actions / typecheck

Type '{ title: string; subtitle: string; defaultRuleDescription: string; block: string; defaultRuleTitle: string; builtInProtectionModal: { title: string; description: string; }; addSpendRule: string; cardPageTitle: string; cardsSectionTitle: string; chooseCards: string; saveRule: string; }' is missing the following properties from type 'TranslationDeepObject<{ title: string; subtitle: string; defaultRuleDescription: string; block: string; defaultRuleTitle: string; builtInProtectionModal: { title: string; description: string; }; addSpendRule: string; ... 8 more ...; restrictionTypeHelpBlock: string; }>': allow, spendRuleSectionTitle, restrictionType, restrictionTypeHelpAllow, restrictionTypeHelpBlock
title: '支出',
subtitle: 'Expensify カードの取引をリアルタイムで承認または却下できます。',
defaultRuleDescription: 'すべてのカード',
Expand All @@ -6592,6 +6592,11 @@
title: 'Expensify カードは、常に組み込みの保護機能を備えています',
description: `Expensify は常に次の利用を拒否します:\n\n ・アダルトサービス\n ・ATM\n ・ギャンブル\n ・送金\n\n会社のキャッシュフローを守るために、支出ルールをさらに追加しましょう。`,
},
addSpendRule: '支出ルールを追加',
cardPageTitle: 'カード',
cardsSectionTitle: 'カード',
chooseCards: 'カードを選択',
saveRule: 'ルールを保存',
},
},
planTypePage: {
Expand Down
5 changes: 5 additions & 0 deletions src/languages/nl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6635,7 +6635,7 @@
title: 'Declaratiebeleid',
cardSubtitle: 'Hier staat het declaratiebeleid van je team, zodat iedereen hetzelfde beeld heeft van wat er wordt vergoed.',
},
spendRules: {

Check failure on line 6638 in src/languages/nl.ts

View workflow job for this annotation

GitHub Actions / typecheck

Type '{ title: string; subtitle: string; defaultRuleDescription: string; block: string; defaultRuleTitle: string; builtInProtectionModal: { title: string; description: string; }; addSpendRule: string; cardPageTitle: string; cardsSectionTitle: string; chooseCards: string; saveRule: string; }' is missing the following properties from type 'TranslationDeepObject<{ title: string; subtitle: string; defaultRuleDescription: string; block: string; defaultRuleTitle: string; builtInProtectionModal: { title: string; description: string; }; addSpendRule: string; ... 8 more ...; restrictionTypeHelpBlock: string; }>': allow, spendRuleSectionTitle, restrictionType, restrictionTypeHelpAllow, restrictionTypeHelpBlock
title: 'Uitgaven',
subtitle: 'Keur transacties met de Expensify Kaart in realtime goed of wijs ze af.',
defaultRuleDescription: 'Alle kaarten',
Expand All @@ -6645,6 +6645,11 @@
title: 'Expensify Kaarten bieden altijd ingebouwde bescherming',
description: `Expensify wijst deze transacties altijd af:\n\n • Seksdiensten\n • Geldautomaten (ATM's)\n • Gokken\n • Geldoverschrijvingen\n\nVoeg meer bestedingsregels toe om de cashflow van je bedrijf te beschermen.`,
},
addSpendRule: 'Bestedingsregel toevoegen',
cardPageTitle: 'Kaart',
cardsSectionTitle: 'Kaarten',
chooseCards: 'Kaarten kiezen',
saveRule: 'Regel opslaan',
},
},
planTypePage: {
Expand Down
5 changes: 5 additions & 0 deletions src/languages/pl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6630,7 +6630,7 @@
title: 'Polityka wydatków',
cardSubtitle: 'To tutaj znajduje się polityka wydatków Twojego zespołu, aby wszyscy mieli jasność co do tego, co jest objęte.',
},
spendRules: {

Check failure on line 6633 in src/languages/pl.ts

View workflow job for this annotation

GitHub Actions / typecheck

Type '{ title: string; subtitle: string; defaultRuleDescription: string; block: string; defaultRuleTitle: string; builtInProtectionModal: { title: string; description: string; }; addSpendRule: string; cardPageTitle: string; cardsSectionTitle: string; chooseCards: string; saveRule: string; }' is missing the following properties from type 'TranslationDeepObject<{ title: string; subtitle: string; defaultRuleDescription: string; block: string; defaultRuleTitle: string; builtInProtectionModal: { title: string; description: string; }; addSpendRule: string; ... 8 more ...; restrictionTypeHelpBlock: string; }>': allow, spendRuleSectionTitle, restrictionType, restrictionTypeHelpAllow, restrictionTypeHelpBlock
title: 'Wydatki',
subtitle: 'Zatwierdzaj lub odrzucaj transakcje Kartą Expensify w czasie rzeczywistym.',
defaultRuleDescription: 'Wszystkie karty',
Expand All @@ -6640,6 +6640,11 @@
title: 'Karty Expensify zapewniają wbudowaną ochronę – zawsze',
description: `Expensify zawsze odrzuca te obciążenia:\n\n • Usługi dla dorosłych\n • Bankomaty\n • Hazard\n • Przelewy pieniężne\n\nDodaj więcej zasad wydatków, żeby chronić przepływy pieniężne firmy.`,
},
addSpendRule: 'Dodaj zasadę wydatków',
cardPageTitle: 'Karta',
cardsSectionTitle: 'Karty',
chooseCards: 'Wybierz karty',
saveRule: 'Zapisz regułę',
},
},
planTypePage: {
Expand Down
5 changes: 5 additions & 0 deletions src/languages/pt-BR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6634,7 +6634,7 @@
title: 'Política de despesas',
cardSubtitle: 'Aqui é onde fica a política de despesas da sua equipe, para que todo mundo esteja alinhado sobre o que é coberto.',
},
spendRules: {

Check failure on line 6637 in src/languages/pt-BR.ts

View workflow job for this annotation

GitHub Actions / typecheck

Type '{ title: string; subtitle: string; defaultRuleDescription: string; block: string; defaultRuleTitle: string; builtInProtectionModal: { title: string; description: string; }; addSpendRule: string; cardPageTitle: string; cardsSectionTitle: string; chooseCards: string; saveRule: string; }' is missing the following properties from type 'TranslationDeepObject<{ title: string; subtitle: string; defaultRuleDescription: string; block: string; defaultRuleTitle: string; builtInProtectionModal: { title: string; description: string; }; addSpendRule: string; ... 8 more ...; restrictionTypeHelpBlock: string; }>': allow, spendRuleSectionTitle, restrictionType, restrictionTypeHelpAllow, restrictionTypeHelpBlock
title: 'Gasto',
subtitle: 'Aprove ou recuse transações do Cartão Expensify em tempo real.',
defaultRuleDescription: 'Todos os cartões',
Expand All @@ -6644,6 +6644,11 @@
title: 'Os Cartões Expensify oferecem proteção integrada — sempre',
description: `A Expensify sempre recusa estas cobranças:\n\n • Serviços adultos\n • Caixas eletrônicos (ATMs)\n • Jogos de azar\n • Transferências de dinheiro\n\nAdicione mais regras de gasto para proteger o fluxo de caixa da empresa.`,
},
addSpendRule: 'Adicionar regra de gastos',
cardPageTitle: 'Cartão',
cardsSectionTitle: 'Cartões',
chooseCards: 'Escolher cartões',
saveRule: 'Salvar regra',
},
},
planTypePage: {
Expand Down
5 changes: 5 additions & 0 deletions src/languages/zh-hans.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6470,7 +6470,7 @@
title: '报销政策',
cardSubtitle: '这是你们团队的报销政策所在之处,让所有人都清楚哪些内容在报销范围之内。',
},
spendRules: {

Check failure on line 6473 in src/languages/zh-hans.ts

View workflow job for this annotation

GitHub Actions / typecheck

Type '{ title: string; subtitle: string; defaultRuleDescription: string; block: string; defaultRuleTitle: string; builtInProtectionModal: { title: string; description: string; }; addSpendRule: string; cardPageTitle: string; cardsSectionTitle: string; chooseCards: string; saveRule: string; }' is missing the following properties from type 'TranslationDeepObject<{ title: string; subtitle: string; defaultRuleDescription: string; block: string; defaultRuleTitle: string; builtInProtectionModal: { title: string; description: string; }; addSpendRule: string; ... 8 more ...; restrictionTypeHelpBlock: string; }>': allow, spendRuleSectionTitle, restrictionType, restrictionTypeHelpAllow, restrictionTypeHelpBlock
title: '支出',
subtitle: '实时批准或拒绝 Expensify 卡交易。',
defaultRuleDescription: '所有卡片',
Expand All @@ -6480,6 +6480,11 @@
title: 'Expensify 卡提供始终内置的保护',
description: `Expensify 始终会拒绝以下消费:\n\n • 成人服务\n • 自动取款机(ATM)\n • 赌博\n • 转账汇款\n\n添加更多消费规则,保护公司的现金流。`,
},
addSpendRule: '添加支出规则',
cardPageTitle: '卡',
cardsSectionTitle: '卡',
chooseCards: '选择卡',
saveRule: '保存规则',
},
},
planTypePage: {
Expand Down
7 changes: 7 additions & 0 deletions src/libs/API/parameters/SetExpensifyCardRuleParams.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
type SetExpensifyCardRuleParams = {
domainAccountID: number;
cardRuleID: string;
cardRuleValue: string;
};

export default SetExpensifyCardRuleParams;
1 change: 1 addition & 0 deletions src/libs/API/parameters/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,7 @@ export type {default as DisablePolicyBillableModeParams} from './DisablePolicyBi
export type {default as SetWorkspaceEReceiptsEnabled} from './SetWorkspaceEReceiptsEnabled';
export type {default as SetPolicyAttendeeTrackingEnabledParams} from './SetPolicyAttendeeTrackingEnabledParams';
export type {default as ConfigureExpensifyCardsForPolicyParams} from './ConfigureExpensifyCardsForPolicyParams';
export type {default as SetExpensifyCardRuleParams} from './SetExpensifyCardRuleParams';
export type {default as CreateExpensifyCardParams} from './CreateExpensifyCardParams';
export type {default as UpdateExpensifyCardTitleParams} from './UpdateExpensifyCardTitleParams';
export type {default as AddDelegateParams} from './AddDelegateParams';
Expand Down
2 changes: 2 additions & 0 deletions src/libs/API/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,7 @@ const WRITE_COMMANDS = {
UPDATE_WORKSPACE_APPROVAL: 'UpdateWorkspaceApproval',
REMOVE_WORKSPACE_APPROVAL: 'RemoveWorkspaceApproval',
CONFIGURE_EXPENSIFY_CARDS_FOR_POLICY: 'ConfigureExpensifyCardsForPolicy',
SET_EXPENSIFY_CARD_RULE: 'SetExpensifyCardRule',
CREATE_EXPENSIFY_CARD: 'CreateExpensifyCard',
CREATE_ADMIN_ISSUED_VIRTUAL_CARD: 'CreateAdminIssuedVirtualCard',
QUEUE_EXPENSIFY_CARD_FOR_BILLING: 'Domain_QueueExpensifyCardForBilling',
Expand Down Expand Up @@ -1071,6 +1072,7 @@ type WriteCommandParameters = {
[WRITE_COMMANDS.UPDATE_WORKSPACE_APPROVAL]: Parameters.UpdateWorkspaceApprovalParams;
[WRITE_COMMANDS.REMOVE_WORKSPACE_APPROVAL]: Parameters.RemoveWorkspaceApprovalParams;
[WRITE_COMMANDS.CONFIGURE_EXPENSIFY_CARDS_FOR_POLICY]: Parameters.ConfigureExpensifyCardsForPolicyParams;
[WRITE_COMMANDS.SET_EXPENSIFY_CARD_RULE]: Parameters.SetExpensifyCardRuleParams;
[WRITE_COMMANDS.CREATE_EXPENSIFY_CARD]: Omit<Parameters.CreateExpensifyCardParams, 'validFrom' | 'validThru'>;
[WRITE_COMMANDS.CREATE_ADMIN_ISSUED_VIRTUAL_CARD]: Omit<Parameters.CreateExpensifyCardParams, 'feedCountry'>;
[WRITE_COMMANDS.QUEUE_EXPENSIFY_CARD_FOR_BILLING]: Parameters.QueueExpensifyCardForBillingParams;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -882,6 +882,8 @@ const SettingsModalStackNavigator = createModalStackNavigator<SettingsNavigatorP
[SCREENS.WORKSPACE.RULES_CUSTOM]: () => require<ReactComponentModule>('../../../../pages/workspace/rules/RulesCustomPage').default,
[SCREENS.WORKSPACE.RULES_PROHIBITED_DEFAULT]: () => require<ReactComponentModule>('../../../../pages/workspace/rules/RulesProhibitedDefaultPage').default,
[SCREENS.WORKSPACE.RULES_MERCHANT_NEW]: () => require<ReactComponentModule>('../../../../pages/workspace/rules/MerchantRules/AddMerchantRulePage').default,
[SCREENS.WORKSPACE.RULES_SPEND_NEW]: () => require<ReactComponentModule>('../../../../pages/workspace/rules/SpendRules/AddSpendRulePage').default,
[SCREENS.WORKSPACE.RULES_SPEND_CARD]: () => require<ReactComponentModule>('../../../../pages/workspace/rules/SpendRules/AddCardPage').default,
[SCREENS.WORKSPACE.RULES_MERCHANT_MERCHANT_TO_MATCH]: () => require<ReactComponentModule>('../../../../pages/workspace/rules/MerchantRules/AddMerchantToMatchPage').default,
[SCREENS.WORKSPACE.RULES_MERCHANT_MATCH_TYPE]: () => require<ReactComponentModule>('../../../../pages/workspace/rules/MerchantRules/AddMatchTypePage').default,
[SCREENS.WORKSPACE.RULES_MERCHANT_MERCHANT]: () => require<ReactComponentModule>('../../../../pages/workspace/rules/MerchantRules/AddMerchantPage').default,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,8 @@ const WORKSPACE_TO_RHP: Partial<Record<keyof WorkspaceSplitNavigatorParamList, s
SCREENS.WORKSPACE.RULES_REIMBURSABLE_DEFAULT,
SCREENS.WORKSPACE.RULES_PROHIBITED_DEFAULT,
SCREENS.WORKSPACE.RULES_MERCHANT_NEW,
SCREENS.WORKSPACE.RULES_SPEND_NEW,
SCREENS.WORKSPACE.RULES_SPEND_CARD,
SCREENS.WORKSPACE.RULES_MERCHANT_MERCHANT_TO_MATCH,
SCREENS.WORKSPACE.RULES_MERCHANT_MATCH_TYPE,
SCREENS.WORKSPACE.RULES_MERCHANT_MERCHANT,
Expand Down
6 changes: 6 additions & 0 deletions src/libs/Navigation/linkingConfig/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1245,6 +1245,12 @@ const config: LinkingOptions<RootNavigatorParamList>['config'] = {
[SCREENS.WORKSPACE.RULES_MERCHANT_NEW]: {
path: ROUTES.RULES_MERCHANT_NEW.route,
},
[SCREENS.WORKSPACE.RULES_SPEND_NEW]: {
path: ROUTES.RULES_SPEND_NEW.route,
},
[SCREENS.WORKSPACE.RULES_SPEND_CARD]: {
path: ROUTES.RULES_SPEND_CARD.route,
},
[SCREENS.WORKSPACE.RULES_MERCHANT_MERCHANT_TO_MATCH]: {
path: ROUTES.RULES_MERCHANT_MERCHANT_TO_MATCH.route,
},
Expand Down
6 changes: 6 additions & 0 deletions src/libs/Navigation/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1466,6 +1466,12 @@ type SettingsNavigatorParamList = {
[SCREENS.WORKSPACE.RULES_MERCHANT_NEW]: {
policyID: string;
};
[SCREENS.WORKSPACE.RULES_SPEND_NEW]: {
policyID: string;
};
[SCREENS.WORKSPACE.RULES_SPEND_CARD]: {
policyID: string;
};
[SCREENS.WORKSPACE.RULES_MERCHANT_MERCHANT_TO_MATCH]: {
policyID: string;
ruleID: string;
Expand Down
Loading
Loading