@zeniai/client-epic-state 5.0.61-betaAR1 → 5.0.61-betaML1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonStateTypes/viewAndReport/viewAndReport.d.ts +2 -2
- package/lib/commonStateTypes/viewAndReport/viewAndReport.js +2 -0
- package/lib/entity/account/accountSelector.d.ts +9 -0
- package/lib/entity/account/accountSelector.js +14 -1
- package/lib/entity/account/accountState.d.ts +1 -1
- package/lib/entity/accountGroup/accountGroupState.d.ts +1 -1
- package/lib/entity/approvalRule/approvalRulePayload.d.ts +5 -27
- package/lib/entity/approvalRule/approvalRulePayload.js +10 -131
- package/lib/entity/approvalRule/approvalRuleSelector.d.ts +1 -25
- package/lib/entity/approvalRule/approvalRuleSelector.js +0 -40
- package/lib/entity/approvalRule/approvalRuleState.d.ts +7 -48
- package/lib/entity/class/classReducer.d.ts +4 -4
- package/lib/entity/class/classState.d.ts +1 -1
- package/lib/entity/forecast/forecastState.d.ts +1 -1
- package/lib/entity/project/projectPayload.d.ts +1 -1
- package/lib/entity/project/projectPayload.js +1 -1
- package/lib/entity/sectionAccountsView/sectionAccountsView.d.ts +1 -1
- package/lib/entity/sectionClassesViewV2/sectionClassesView.d.ts +1 -1
- package/lib/entity/sectionClassesViewV2/sectionClassesViewReducer.d.ts +2 -2
- package/lib/entity/sectionProjectView/sectionProjectView.d.ts +1 -1
- package/lib/entity/sectionProjectView/sectionProjectViewReducer.d.ts +2 -2
- package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.js +2 -0
- package/lib/entity/transaction/payloadTypes/transactionPayload.d.ts +4 -0
- package/lib/entity/transaction/payloadTypes/transactionPayload.js +10 -0
- package/lib/entity/transaction/stateTypes/transaction.d.ts +3 -0
- package/lib/epic.d.ts +3 -1
- package/lib/epic.js +3 -1
- package/lib/esm/commonStateTypes/viewAndReport/viewAndReport.js +2 -0
- package/lib/esm/entity/account/accountSelector.js +11 -0
- package/lib/esm/entity/approvalRule/approvalRulePayload.js +10 -131
- package/lib/esm/entity/approvalRule/approvalRuleSelector.js +0 -35
- package/lib/esm/entity/project/projectPayload.js +1 -1
- package/lib/esm/entity/snackbar/snackbarTypes.js +2 -0
- package/lib/esm/entity/transaction/payloadTypes/transactionPayload.js +10 -0
- package/lib/esm/epic.js +3 -1
- package/lib/esm/index.js +5 -6
- package/lib/esm/view/expenseAutomationView/epics/transactionCategorization/createTransferEntryEpic.js +81 -0
- package/lib/esm/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationViewEpic.js +8 -1
- package/lib/esm/view/expenseAutomationView/epics/transactionCategorization/fetchTransferAccountsEpic.js +30 -0
- package/lib/esm/view/expenseAutomationView/reducers/transactionsViewReducer.js +79 -1
- package/lib/esm/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +30 -0
- package/lib/esm/view/expenseAutomationView/types/transactionsViewState.js +5 -0
- package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/epic/initializeBillPaySetupApproverViewUpdateDataEpic.js +7 -11
- package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/types/commonPayload.js +16 -61
- package/lib/esm/view/spendManagement/billPay/editBillView/editBillViewSelector.js +2 -7
- package/lib/esm/view/spendManagement/reimbursement/remiSetupApproverView/epic/initializeRemiSetupApproverViewUpdateDataEpic.js +7 -11
- package/lib/esm/view/transactionDetail/epics/transactionDetailEpic.js +10 -0
- package/lib/esm/view/transactionDetail/transactionDetailSelector.js +24 -2
- package/lib/index.d.ts +6 -7
- package/lib/index.js +42 -39
- package/lib/tsconfig.typecheck.tsbuildinfo +1 -1
- package/lib/view/auditReportView/auditReportViewState.d.ts +1 -1
- package/lib/view/billPayCard/billPayCardSelector.d.ts +1 -1
- package/lib/view/cardBalance/cardBalanceSelector.d.ts +1 -1
- package/lib/view/cashBalance/cashBalanceSelector.d.ts +1 -1
- package/lib/view/cashInCashOut/cashInCashOutSelector.d.ts +1 -1
- package/lib/view/cashPosition/cashPositionSelector.d.ts +1 -1
- package/lib/view/companyTaskManagerView/companyTaskManagerViewReducer.d.ts +2 -2
- package/lib/view/companyView/types/cockpitTypes.d.ts +1 -1
- package/lib/view/dashboard/dashboardReducer.d.ts +2 -2
- package/lib/view/expenseAutomationView/epics/transactionCategorization/createTransferEntryEpic.d.ts +9 -0
- package/lib/view/expenseAutomationView/epics/transactionCategorization/createTransferEntryEpic.js +85 -0
- package/lib/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationViewEpic.d.ts +2 -2
- package/lib/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationViewEpic.js +7 -0
- package/lib/view/expenseAutomationView/epics/transactionCategorization/fetchTransferAccountsEpic.d.ts +8 -0
- package/lib/view/expenseAutomationView/epics/transactionCategorization/fetchTransferAccountsEpic.js +34 -0
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.d.ts +21 -2
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.js +80 -2
- package/lib/view/expenseAutomationView/selectorTypes/transactionsViewSelectorTypes.d.ts +4 -1
- package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.d.ts +2 -0
- package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +31 -0
- package/lib/view/expenseAutomationView/types/transactionsViewState.d.ts +18 -1
- package/lib/view/expenseAutomationView/types/transactionsViewState.js +6 -1
- package/lib/view/financeStatement/financeStatementReducer.d.ts +1 -1
- package/lib/view/globalMerchantView/globalMerchantViewReducer.d.ts +2 -2
- package/lib/view/people/peopleTypes.d.ts +1 -1
- package/lib/view/reimbursementCard/reimbursementCardSelector.d.ts +1 -1
- package/lib/view/reportsResync/reportsResyncReducer.d.ts +2 -2
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/epic/initializeBillPaySetupApproverViewUpdateDataEpic.js +6 -10
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/types/commonPayload.d.ts +1 -9
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/types/commonPayload.js +16 -61
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/types/commonState.d.ts +5 -31
- package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.js +2 -7
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardList.d.ts +1 -1
- package/lib/view/spendManagement/reimbursement/remiSetupApproverView/epic/initializeRemiSetupApproverViewUpdateDataEpic.js +6 -10
- package/lib/view/taskManager/taskListView/taskList.d.ts +3 -3
- package/lib/view/tasksCard/tasksCardSelector.d.ts +1 -1
- package/lib/view/topEx/topExSelector.d.ts +1 -1
- package/lib/view/transactionDetail/epics/transactionDetailEpic.d.ts +2 -1
- package/lib/view/transactionDetail/epics/transactionDetailEpic.js +10 -0
- package/lib/view/transactionDetail/transactionDetailPayload.d.ts +1 -1
- package/lib/view/transactionDetail/transactionDetailSelector.d.ts +6 -1
- package/lib/view/transactionDetail/transactionDetailSelector.js +23 -1
- package/package.json +1 -1
|
@@ -3,10 +3,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.getLastTransferEntryReplacement = getLastTransferEntryReplacement;
|
|
6
7
|
exports.getExpenseAutomationTransactionView = getExpenseAutomationTransactionView;
|
|
7
8
|
const omit_1 = __importDefault(require("lodash/omit"));
|
|
8
9
|
const reduceFetchState_1 = require("../../../commonStateTypes/reduceFetchState");
|
|
9
10
|
const timePeriod_1 = require("../../../commonStateTypes/timePeriod");
|
|
11
|
+
const accountSelector_1 = require("../../../entity/account/accountSelector");
|
|
10
12
|
const tenantSelector_1 = require("../../../entity/tenant/tenantSelector");
|
|
11
13
|
const transactionHelper_1 = require("../../../entity/transaction/transactionHelper");
|
|
12
14
|
const transactionSelector_1 = require("../../../entity/transaction/transactionSelector");
|
|
@@ -14,6 +16,9 @@ const accountListSelector_1 = require("../../accountList/accountListSelector");
|
|
|
14
16
|
const classListSelector_1 = require("../../classList/classListSelector");
|
|
15
17
|
const projectListSelector_1 = require("../../projectList/projectListSelector");
|
|
16
18
|
const expenseAutomationViewSelectorTypes_1 = require("../selectorTypes/expenseAutomationViewSelectorTypes");
|
|
19
|
+
function getLastTransferEntryReplacement(state) {
|
|
20
|
+
return state.expenseAutomationTransactionsViewState.lastTransferEntryReplacement;
|
|
21
|
+
}
|
|
17
22
|
function getExpenseAutomationTransactionView(state) {
|
|
18
23
|
const { accountState, classState, classListState, accountListState, expenseAutomationTransactionsViewState, expenseAutomationViewState, projectState, projectListState, transactionState, monthEndCloseChecksState, monthEndCloseChecksViewState, } = state;
|
|
19
24
|
const { selectedTransactionCategorizationTab } = expenseAutomationTransactionsViewState;
|
|
@@ -92,6 +97,29 @@ function getExpenseAutomationTransactionView(state) {
|
|
|
92
97
|
: [];
|
|
93
98
|
const transactionCompletionStatus = allSteps.find((step) => step.step === 'transaction_categorization')?.completionStatus;
|
|
94
99
|
const completionStatus = transactionCompletionStatus ?? 'incomplete';
|
|
100
|
+
const transferAccountsFromApi = expenseAutomationTransactionsViewState.transferAccounts.accountIds
|
|
101
|
+
.map((id) => (0, accountSelector_1.getAccountBaseForTransferAccounts)(accountState, id))
|
|
102
|
+
.filter((account) => account != null);
|
|
103
|
+
/**
|
|
104
|
+
* Credit transfer picker uses transfer-account ids from a dedicated fetch. If that list
|
|
105
|
+
* resolves to nothing while the COA list is loaded, fall back to the full COA list so the
|
|
106
|
+
* credit dropdown is not empty.
|
|
107
|
+
*/
|
|
108
|
+
const transferAccountsList = transferAccountsFromApi.length > 0
|
|
109
|
+
? transferAccountsFromApi
|
|
110
|
+
: accountList.accounts
|
|
111
|
+
.map((a) => (0, accountSelector_1.getAccountBase)(accountState, a.accountId, 'account_list'))
|
|
112
|
+
.filter((account) => account != null);
|
|
113
|
+
const creditCardAccountsFromApi = expenseAutomationTransactionsViewState.creditCardAccountsForTransfer.accountIds
|
|
114
|
+
.map((id) => (0, accountSelector_1.getAccountBaseForCreditCardTransferAccounts)(accountState, id))
|
|
115
|
+
.filter((account) => account != null);
|
|
116
|
+
const coaCreditCardsFallback = accountList.accounts
|
|
117
|
+
.map((a) => (0, accountSelector_1.getAccountBase)(accountState, a.accountId, 'account_list'))
|
|
118
|
+
.filter((account) => account != null)
|
|
119
|
+
.filter((a) => a.accountType === 'credit_card');
|
|
120
|
+
const creditCardAccountsForTransferList = creditCardAccountsFromApi.length > 0
|
|
121
|
+
? creditCardAccountsFromApi
|
|
122
|
+
: coaCreditCardsFallback;
|
|
95
123
|
return {
|
|
96
124
|
version: 0,
|
|
97
125
|
fetchState: fetchStatus.fetchState,
|
|
@@ -112,11 +140,14 @@ function getExpenseAutomationTransactionView(state) {
|
|
|
112
140
|
refreshStatus,
|
|
113
141
|
saveStatus,
|
|
114
142
|
markAsNotMiscategorizedStatus,
|
|
143
|
+
createTransferEntryStatus: expenseAutomationTransactionsViewState.createTransferEntryStatus,
|
|
115
144
|
completionStatus,
|
|
116
145
|
totalCountByTab,
|
|
117
146
|
fetchStateByTransactionTabs: fetchStateByTab,
|
|
118
147
|
uploadReceiptStatusById,
|
|
119
148
|
selectedTransactionId,
|
|
120
149
|
selectedTransactionLineId,
|
|
150
|
+
creditCardAccountsForTransferList,
|
|
151
|
+
transferAccounts: transferAccountsList,
|
|
121
152
|
};
|
|
122
153
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Amount } from '../../../commonStateTypes/amount';
|
|
2
|
-
import { FetchStateAndError, FetchedState, ID } from '../../../commonStateTypes/common';
|
|
2
|
+
import { FetchState, FetchStateAndError, FetchedState, ID } from '../../../commonStateTypes/common';
|
|
3
3
|
import { Recommendation, RecommendationWithCOT } from '../../../commonStateTypes/recommendationBase';
|
|
4
4
|
import { SortOrder } from '../../../commonStateTypes/selectorTypes/sortOrderTypes';
|
|
5
5
|
import { MonthYearPeriodId } from '../../../commonStateTypes/timePeriod';
|
|
@@ -103,9 +103,26 @@ export interface TransactionsTabViewState extends FetchedState {
|
|
|
103
103
|
selectedTransactionId?: ID;
|
|
104
104
|
selectedTransactionLineId?: ID;
|
|
105
105
|
}
|
|
106
|
+
export interface TransferAccountsState {
|
|
107
|
+
accountIds: ID[];
|
|
108
|
+
fetchState: FetchState;
|
|
109
|
+
}
|
|
110
|
+
/** Which pool `fetchAccountsForTransferFlow` / transfer-flow epic should load. */
|
|
111
|
+
export declare const TRANSFER_ACCOUNTS_FETCH_KIND: readonly ["transfer_eligible", "credit_card_only"];
|
|
112
|
+
export type TransferAccountsFetchKind = (typeof TRANSFER_ACCOUNTS_FETCH_KIND)[number];
|
|
113
|
+
export type TransferEntryRouteReplacement = {
|
|
114
|
+
newTransactionId: TransactionID;
|
|
115
|
+
previousTransactionId: TransactionID;
|
|
116
|
+
};
|
|
106
117
|
export type TransactionsViewState = {
|
|
118
|
+
createTransferEntryStatus: FetchState;
|
|
119
|
+
/** Credit-card-only accounts for transfer drawer when type is credit_card_payment. */
|
|
120
|
+
creditCardAccountsForTransfer: TransferAccountsState;
|
|
121
|
+
/** Set when create-transfer returns a new transaction id; host navigates then acknowledges. */
|
|
122
|
+
lastTransferEntryReplacement: TransferEntryRouteReplacement | undefined;
|
|
107
123
|
selectedTransactionCategorizationTab: TransactionsTab;
|
|
108
124
|
transactionCategorizationView: Record<TransactionsTab, TransactionsTabViewState>;
|
|
125
|
+
transferAccounts: TransferAccountsState;
|
|
109
126
|
};
|
|
110
127
|
export interface TransactionLineUpdates {
|
|
111
128
|
account?: AccountBase;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.initialSupportedTransactionCategorization = exports.getTransactionCategorizationKey = exports.toTransactionsTabKey = exports.TRANSACTIONS_TABS = exports.toTransactionsSortKey = void 0;
|
|
3
|
+
exports.TRANSFER_ACCOUNTS_FETCH_KIND = exports.initialSupportedTransactionCategorization = exports.getTransactionCategorizationKey = exports.toTransactionsTabKey = exports.TRANSACTIONS_TABS = exports.toTransactionsSortKey = void 0;
|
|
4
4
|
const stringToUnion_1 = require("../../../commonStateTypes/stringToUnion");
|
|
5
5
|
const transactionDetailState_1 = require("../../transactionDetail/transactionDetailState");
|
|
6
6
|
const TRANSACTIONS_SORT_KEYS = [
|
|
@@ -31,3 +31,8 @@ exports.initialSupportedTransactionCategorization = {
|
|
|
31
31
|
tabSpecificLineItems: {},
|
|
32
32
|
},
|
|
33
33
|
};
|
|
34
|
+
/** Which pool `fetchAccountsForTransferFlow` / transfer-flow epic should load. */
|
|
35
|
+
exports.TRANSFER_ACCOUNTS_FETCH_KIND = [
|
|
36
|
+
'transfer_eligible',
|
|
37
|
+
'credit_card_only',
|
|
38
|
+
];
|
|
@@ -17,7 +17,7 @@ export declare const fetchFinanceStatement: import("@reduxjs/toolkit").ActionCre
|
|
|
17
17
|
firstMonthOfFY: Month;
|
|
18
18
|
maxNumOfPeriodsToHighlight: number;
|
|
19
19
|
thisPeriod: TimeframeTick;
|
|
20
|
-
}, "financeStatement/updateFinanceStatementThisPeriod">, updateCOABalancesRange: import("@reduxjs/toolkit").ActionCreatorWithPayload<COABalancesRange, "financeStatement/updateCOABalancesRange">, updateSelectedReportId: import("@reduxjs/toolkit").ActionCreatorWithPayload<"cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "revenue" | "revenue_by_classes" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "profit_and_loss_by_projects" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_list_of_account_by_project" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "zeni_treasury" | "charge_cards" | "other_connection" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "billing" | "flux_analysis_operating_expense" | "account_reconciliation" | "zeni_credit_promo_card" | "treasury_promo_card" | "excluded_account_reconciliation", "financeStatement/updateSelectedReportId">, updateFinanceStatementAdditionalBalancesSelection: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
20
|
+
}, "financeStatement/updateFinanceStatementThisPeriod">, updateCOABalancesRange: import("@reduxjs/toolkit").ActionCreatorWithPayload<COABalancesRange, "financeStatement/updateCOABalancesRange">, updateSelectedReportId: import("@reduxjs/toolkit").ActionCreatorWithPayload<"cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "revenue" | "revenue_by_classes" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "profit_and_loss_by_projects" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_list_of_account_by_project" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "zeni_treasury" | "charge_cards" | "other_connection" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "billing" | "flux_analysis_operating_expense" | "account_reconciliation" | "zeni_credit_promo_card" | "treasury_promo_card" | "excluded_account_reconciliation" | "transfer_accounts" | "credit_card_transfer_accounts", "financeStatement/updateSelectedReportId">, updateFinanceStatementAdditionalBalancesSelection: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
21
21
|
additionalBalances: COABalanceType[];
|
|
22
22
|
coaBalances: COABalance[];
|
|
23
23
|
firstMonthOfFY: Month;
|
|
@@ -3,9 +3,9 @@ import { ZeniAPIStatus } from '../../responsePayload';
|
|
|
3
3
|
import { VendorReviewViewAllRecommendationsPayload } from '../vendorReviewView/common/payload/commonTypes';
|
|
4
4
|
import { GlobalMerchantViewState, GlobalRecommendationFetchSource, NewGlobalMerchantCurrentSelection } from './globalMerchantViewState';
|
|
5
5
|
export declare const initialState: GlobalMerchantViewState;
|
|
6
|
-
export declare const createGlobalMerchant: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[merchantId?: string | undefined, context?: "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "revenue" | "revenue_by_classes" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "profit_and_loss_by_projects" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_list_of_account_by_project" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "zeni_treasury" | "charge_cards" | "other_connection" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "billing" | "flux_analysis_operating_expense" | "account_reconciliation" | "zeni_credit_promo_card" | "treasury_promo_card" | "excluded_account_reconciliation" | undefined], {
|
|
6
|
+
export declare const createGlobalMerchant: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[merchantId?: string | undefined, context?: "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "revenue" | "revenue_by_classes" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "profit_and_loss_by_projects" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_list_of_account_by_project" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "zeni_treasury" | "charge_cards" | "other_connection" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "billing" | "flux_analysis_operating_expense" | "account_reconciliation" | "zeni_credit_promo_card" | "treasury_promo_card" | "excluded_account_reconciliation" | "transfer_accounts" | "credit_card_transfer_accounts" | undefined], {
|
|
7
7
|
merchantId: string | undefined;
|
|
8
|
-
context: "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "revenue" | "revenue_by_classes" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "profit_and_loss_by_projects" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_list_of_account_by_project" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "zeni_treasury" | "charge_cards" | "other_connection" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "billing" | "flux_analysis_operating_expense" | "account_reconciliation" | "zeni_credit_promo_card" | "treasury_promo_card" | "excluded_account_reconciliation" | undefined;
|
|
8
|
+
context: "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "revenue" | "revenue_by_classes" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "profit_and_loss_by_projects" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_list_of_account_by_project" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "zeni_treasury" | "charge_cards" | "other_connection" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "billing" | "flux_analysis_operating_expense" | "account_reconciliation" | "zeni_credit_promo_card" | "treasury_promo_card" | "excluded_account_reconciliation" | "transfer_accounts" | "credit_card_transfer_accounts" | undefined;
|
|
9
9
|
}, "globalMerchantView/createGlobalMerchant", never, never>, createGlobalMerchantSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
10
10
|
merchantId: ID;
|
|
11
11
|
}, "globalMerchantView/createGlobalMerchantSuccess">, createGlobalMerchantFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
declare const toPeopleSortKeyType: (v: string) => "role" | "manager" | "
|
|
1
|
+
declare const toPeopleSortKeyType: (v: string) => "role" | "manager" | "name" | "department" | "lastSeen";
|
|
2
2
|
export type PeopleViewSortKey = ReturnType<typeof toPeopleSortKeyType>;
|
|
3
3
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { RootState } from '../../reducer';
|
|
2
2
|
export declare const getReimbursementCardReport: (state: RootState) => {
|
|
3
|
-
reportId: "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "revenue" | "revenue_by_classes" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "profit_and_loss_by_projects" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_list_of_account_by_project" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "zeni_treasury" | "charge_cards" | "other_connection" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "billing" | "flux_analysis_operating_expense" | "account_reconciliation" | "zeni_credit_promo_card" | "treasury_promo_card" | "excluded_account_reconciliation";
|
|
3
|
+
reportId: "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "revenue" | "revenue_by_classes" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "profit_and_loss_by_projects" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_list_of_account_by_project" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "zeni_treasury" | "charge_cards" | "other_connection" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "billing" | "flux_analysis_operating_expense" | "account_reconciliation" | "zeni_credit_promo_card" | "treasury_promo_card" | "excluded_account_reconciliation" | "transfer_accounts" | "credit_card_transfer_accounts";
|
|
4
4
|
reportTitle: string;
|
|
5
5
|
version: string | number | undefined;
|
|
6
6
|
fetchState: import("../..").FetchState;
|
|
@@ -2,8 +2,8 @@ import { ReportID } from '../../commonStateTypes/viewAndReport/viewAndReport';
|
|
|
2
2
|
import { ZeniAPIStatus } from '../../responsePayload';
|
|
3
3
|
import { ReportsResyncState } from './reportsResyncState';
|
|
4
4
|
export declare const initialReportsResyncState: ReportsResyncState;
|
|
5
|
-
export declare const initiateReportsResync: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[reportIdToResync: "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "revenue" | "revenue_by_classes" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "profit_and_loss_by_projects" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_list_of_account_by_project" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "zeni_treasury" | "charge_cards" | "other_connection" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "billing" | "flux_analysis_operating_expense" | "account_reconciliation" | "zeni_credit_promo_card" | "treasury_promo_card" | "excluded_account_reconciliation"], {
|
|
6
|
-
reportIdToResync: "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "revenue" | "revenue_by_classes" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "profit_and_loss_by_projects" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_list_of_account_by_project" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "zeni_treasury" | "charge_cards" | "other_connection" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "billing" | "flux_analysis_operating_expense" | "account_reconciliation" | "zeni_credit_promo_card" | "treasury_promo_card" | "excluded_account_reconciliation";
|
|
5
|
+
export declare const initiateReportsResync: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[reportIdToResync: "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "revenue" | "revenue_by_classes" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "profit_and_loss_by_projects" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_list_of_account_by_project" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "zeni_treasury" | "charge_cards" | "other_connection" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "billing" | "flux_analysis_operating_expense" | "account_reconciliation" | "zeni_credit_promo_card" | "treasury_promo_card" | "excluded_account_reconciliation" | "transfer_accounts" | "credit_card_transfer_accounts"], {
|
|
6
|
+
reportIdToResync: "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "revenue" | "revenue_by_classes" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "profit_and_loss_by_projects" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_list_of_account_by_project" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "zeni_treasury" | "charge_cards" | "other_connection" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "billing" | "flux_analysis_operating_expense" | "account_reconciliation" | "zeni_credit_promo_card" | "treasury_promo_card" | "excluded_account_reconciliation" | "transfer_accounts" | "credit_card_transfer_accounts";
|
|
7
7
|
}, "initiateReportsResync/initiateReportsResync", never, never>, initiateReportsClassViewRefetching: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
8
8
|
reportIdToResync: ReportID;
|
|
9
9
|
}, "initiateReportsResync/initiateReportsClassViewRefetching">, reportsResyncSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
@@ -11,20 +11,16 @@ const initializeBillPaySetupApproverViewUpdateDataEpic = (actions$, state$) => a
|
|
|
11
11
|
if (approvalRuleId != null) {
|
|
12
12
|
const approvalRule = (0, approvalRuleSelector_1.getApprovalRuleById)(state$.value.approvalRuleState, approvalRuleId);
|
|
13
13
|
if (approvalRule != null) {
|
|
14
|
+
const criteria = approvalRule.criteria[0];
|
|
15
|
+
const range = criteria?.range;
|
|
14
16
|
const billPaySetupApproverViewUpdateData = {
|
|
15
17
|
approvalRuleId,
|
|
16
18
|
steps: approvalRule.steps,
|
|
17
19
|
criteria: {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
20
|
+
rangeType: criteria?.rangeType,
|
|
21
|
+
rangeEntity: criteria?.rangeEntity,
|
|
22
|
+
range,
|
|
21
23
|
},
|
|
22
|
-
// Approval Rules 3.0 — seed rule-level fields so the form can
|
|
23
|
-
// round-trip them on edit. Each may be undefined on legacy rules.
|
|
24
|
-
name: approvalRule.name,
|
|
25
|
-
description: approvalRule.description,
|
|
26
|
-
separationOfDuties: approvalRule.separationOfDuties,
|
|
27
|
-
isFallback: approvalRule.isFallback,
|
|
28
24
|
};
|
|
29
25
|
fetchActions.push((0, billPaySetupApproverViewReducer_1.clearBillPaySetupApproverViewUpdateData)(), (0, billPaySetupApproverViewReducer_1.saveBillPaySetupApproverViewUpdateData)(billPaySetupApproverViewUpdateData));
|
|
30
26
|
}
|
|
@@ -32,7 +28,7 @@ const initializeBillPaySetupApproverViewUpdateDataEpic = (actions$, state$) => a
|
|
|
32
28
|
else {
|
|
33
29
|
const billPaySetupApproverViewCreateData = {
|
|
34
30
|
steps: [],
|
|
35
|
-
criteria:
|
|
31
|
+
criteria: undefined,
|
|
36
32
|
};
|
|
37
33
|
fetchActions.push((0, billPaySetupApproverViewReducer_1.clearBillPaySetupApproverViewUpdateData)(), (0, billPaySetupApproverViewReducer_1.saveBillPaySetupApproverViewUpdateData)(billPaySetupApproverViewCreateData));
|
|
38
34
|
}
|
|
@@ -14,17 +14,9 @@ interface ApproverViewStepPayload extends Omit<StepPayload, 'actors'> {
|
|
|
14
14
|
}
|
|
15
15
|
interface ApprovalUpdatableInfoPayload {
|
|
16
16
|
approval_rule_id: ID;
|
|
17
|
-
criteria: CriteriaPayload;
|
|
17
|
+
criteria: CriteriaPayload[];
|
|
18
18
|
is_applicable_on_pending_approval_entity: boolean;
|
|
19
19
|
steps: ApproverViewStepPayload[];
|
|
20
|
-
description?: string;
|
|
21
|
-
is_fallback?: boolean;
|
|
22
|
-
/**
|
|
23
|
-
* Approval Rules 3.0 — rule-level wire fields. The backend accepts these
|
|
24
|
-
* as optional today; once 3.0 ships they become first-class.
|
|
25
|
-
*/
|
|
26
|
-
name?: string;
|
|
27
|
-
separation_of_duties?: boolean;
|
|
28
20
|
}
|
|
29
21
|
export declare const toApprovalChangableInfoPayload: (approverViewUpdateData: ApprovalRuleUpdateData | ApprovalRuleCreateData) => Partial<ApprovalUpdatableInfoPayload>;
|
|
30
22
|
export {};
|
|
@@ -2,50 +2,22 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.toApprovalChangableInfoPayload = void 0;
|
|
4
4
|
const toApprovalChangableInfoPayload = (approverViewUpdateData) => {
|
|
5
|
-
|
|
6
|
-
// amount / vendor / department; flatten it into the wire format's
|
|
7
|
-
// `conditions[]` array.
|
|
8
|
-
let criteriaPayload;
|
|
5
|
+
let criteriaPayload = [];
|
|
9
6
|
if (approverViewUpdateData.criteria != null) {
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
if (vendor != null && vendor.vendorIds.length > 0) {
|
|
27
|
-
conditions.push({
|
|
28
|
-
field: 'vendor_id',
|
|
29
|
-
type: vendor.operator === 'is_not' ? 'not_in' : 'in',
|
|
30
|
-
value: vendor.vendorIds,
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
if (department != null && department.departmentIds.length > 0) {
|
|
34
|
-
conditions.push({
|
|
35
|
-
field: 'department_id',
|
|
36
|
-
type: department.operator === 'is_not' ? 'not_in' : 'in',
|
|
37
|
-
value: department.departmentIds,
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
if (conditions.length > 0) {
|
|
41
|
-
const currency = amount?.min ?? amount?.max ?? null;
|
|
42
|
-
criteriaPayload = {
|
|
43
|
-
conditions,
|
|
44
|
-
criteria_operator: 'and',
|
|
45
|
-
currency_code: currency?.currencyCode ?? 'USD',
|
|
46
|
-
currency_symbol: currency?.currencySymbol ?? '$',
|
|
47
|
-
};
|
|
48
|
-
}
|
|
7
|
+
const criteria = approverViewUpdateData.criteria;
|
|
8
|
+
const { rangeType, rangeEntity, range } = criteria;
|
|
9
|
+
const { min, max } = range;
|
|
10
|
+
const { currencyCode, currencySymbol } = min;
|
|
11
|
+
criteriaPayload = [
|
|
12
|
+
{
|
|
13
|
+
type: rangeType,
|
|
14
|
+
range_entity: rangeEntity,
|
|
15
|
+
min: min.amount,
|
|
16
|
+
max: max?.amount ?? null,
|
|
17
|
+
currency_code: currencyCode,
|
|
18
|
+
currency_symbol: currencySymbol,
|
|
19
|
+
},
|
|
20
|
+
];
|
|
49
21
|
}
|
|
50
22
|
const steps = approverViewUpdateData.steps.map((step) => {
|
|
51
23
|
return {
|
|
@@ -66,27 +38,10 @@ const toApprovalChangableInfoPayload = (approverViewUpdateData) => {
|
|
|
66
38
|
});
|
|
67
39
|
const isUpdate = approverViewUpdateData.approvalRuleId != null;
|
|
68
40
|
const payload = {
|
|
41
|
+
criteria: criteriaPayload,
|
|
69
42
|
steps,
|
|
70
43
|
is_applicable_on_pending_approval_entity: approverViewUpdateData.isApplicableOnPendingApprovalEntity ?? true,
|
|
71
44
|
};
|
|
72
|
-
if (criteriaPayload != null) {
|
|
73
|
-
payload.criteria = criteriaPayload;
|
|
74
|
-
}
|
|
75
|
-
// Approval Rules 3.0 — surface rule-level fields when the form set them.
|
|
76
|
-
// Send only what the user actually entered: an undefined value means
|
|
77
|
-
// "no opinion" and stays off the wire.
|
|
78
|
-
if (approverViewUpdateData.name != null) {
|
|
79
|
-
payload.name = approverViewUpdateData.name;
|
|
80
|
-
}
|
|
81
|
-
if (approverViewUpdateData.description != null) {
|
|
82
|
-
payload.description = approverViewUpdateData.description;
|
|
83
|
-
}
|
|
84
|
-
if (approverViewUpdateData.separationOfDuties != null) {
|
|
85
|
-
payload.separation_of_duties = approverViewUpdateData.separationOfDuties;
|
|
86
|
-
}
|
|
87
|
-
if (approverViewUpdateData.isFallback != null) {
|
|
88
|
-
payload.is_fallback = approverViewUpdateData.isFallback;
|
|
89
|
-
}
|
|
90
45
|
if (isUpdate) {
|
|
91
46
|
payload.approval_rule_id = approverViewUpdateData.approvalRuleId;
|
|
92
47
|
}
|
|
@@ -1,45 +1,19 @@
|
|
|
1
1
|
import { FetchStateAndError, ID } from '../../../../../commonStateTypes/common';
|
|
2
|
-
import {
|
|
2
|
+
import { Criteria, Step } from '../../../../../entity/approvalRule/approvalRuleState';
|
|
3
3
|
export type ApprovalUpdateActionType = 'approval_create' | 'approval_update';
|
|
4
4
|
export interface ApproverViewUpdateData {
|
|
5
5
|
type: ApprovalUpdateActionType;
|
|
6
6
|
updateStatus: FetchStateAndError;
|
|
7
7
|
data?: ApprovalRuleUpdateData | ApprovalRuleCreateData;
|
|
8
8
|
}
|
|
9
|
-
|
|
10
|
-
* Form-side criteria shape used by the rule create/edit form.
|
|
11
|
-
*
|
|
12
|
-
* Each condition kind gets its own optional slot, mirroring how the UI
|
|
13
|
-
* edits them as distinct rows. At most one of each kind is present; this
|
|
14
|
-
* matches the design constraint that each condition type can be added once.
|
|
15
|
-
*/
|
|
16
|
-
export interface ApprovalRuleFormCriteria {
|
|
17
|
-
amount?: AmountCriteria;
|
|
18
|
-
department?: DepartmentCriteria;
|
|
19
|
-
vendor?: VendorCriteria;
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Rule-level fields shared by both create and update flows.
|
|
23
|
-
*
|
|
24
|
-
* These come from the 3.0 design: the form now owns a name, an optional
|
|
25
|
-
* description, an optional Separation-of-Duties toggle, and a flag that
|
|
26
|
-
* marks the rule as the org-wide fallback rule. They live alongside
|
|
27
|
-
* criteria/steps but are not part of either.
|
|
28
|
-
*/
|
|
29
|
-
export interface ApprovalRuleFormBase {
|
|
30
|
-
description?: string;
|
|
31
|
-
isFallback?: boolean;
|
|
32
|
-
name?: string;
|
|
33
|
-
separationOfDuties?: boolean;
|
|
34
|
-
}
|
|
35
|
-
export interface ApprovalRuleUpdateData extends ApprovalRuleFormBase {
|
|
9
|
+
export interface ApprovalRuleUpdateData {
|
|
36
10
|
approvalRuleId: ID;
|
|
37
|
-
criteria:
|
|
11
|
+
criteria: Criteria;
|
|
38
12
|
steps: Step[];
|
|
39
13
|
isApplicableOnPendingApprovalEntity?: boolean;
|
|
40
14
|
}
|
|
41
|
-
export interface ApprovalRuleCreateData
|
|
42
|
-
criteria:
|
|
15
|
+
export interface ApprovalRuleCreateData {
|
|
16
|
+
criteria: Criteria;
|
|
43
17
|
steps: Step[];
|
|
44
18
|
isApplicableOnPendingApprovalEntity?: boolean;
|
|
45
19
|
}
|
|
@@ -9,7 +9,6 @@ exports.getPaymentSection = getPaymentSection;
|
|
|
9
9
|
exports.toPaymentToOption = toPaymentToOption;
|
|
10
10
|
const get_1 = __importDefault(require("lodash/get"));
|
|
11
11
|
const has_1 = __importDefault(require("lodash/has"));
|
|
12
|
-
const approvalRuleSelector_1 = require("../../../../entity/approvalRule/approvalRuleSelector");
|
|
13
12
|
const reduceFetchState_1 = require("../../../../commonStateTypes/reduceFetchState");
|
|
14
13
|
const bankAccountSelector_1 = require("../../../../entity/bankAccount/bankAccountSelector");
|
|
15
14
|
const contactSelector_1 = require("../../../../entity/billPay/contact/contactSelector");
|
|
@@ -699,13 +698,9 @@ exports.getDefaultWithdrawFromAccount = getDefaultWithdrawFromAccount;
|
|
|
699
698
|
const checkIfCreatorIsApprover = (billAmount, approvalRules, signedInUser) => {
|
|
700
699
|
let isCreatorAlsoApprover = false;
|
|
701
700
|
const approvalRule = approvalRules.find((rule) => {
|
|
702
|
-
const
|
|
703
|
-
if (amountCriteria?.min == null) {
|
|
704
|
-
return false;
|
|
705
|
-
}
|
|
706
|
-
const { min, max } = amountCriteria;
|
|
701
|
+
const { max, min } = rule.criteria[0].range;
|
|
707
702
|
return (billAmount > min.amount &&
|
|
708
|
-
(max?.amount != null ? billAmount <= max
|
|
703
|
+
(max?.amount != null ? billAmount <= max?.amount : true));
|
|
709
704
|
});
|
|
710
705
|
if (approvalRule != null) {
|
|
711
706
|
const requireApprovalSteps = approvalRule.steps.filter((step) => step.action === 'require_approval');
|
|
@@ -61,7 +61,7 @@ export declare const initialCreditAcc: CreditAccount;
|
|
|
61
61
|
export declare const initialDebitCardSummaries: DebitCardSummaries;
|
|
62
62
|
export declare const initialResendRevokeCardInvite: ResendRevokeCardInvite;
|
|
63
63
|
export declare const initialCreditAccountRepayment: CreditAccountRepayment;
|
|
64
|
-
export declare const toChargeCardSortKeyType: (v: string) => "status" | "
|
|
64
|
+
export declare const toChargeCardSortKeyType: (v: string) => "status" | "accountType" | "owner" | "cardName" | "limit" | "department" | "cardType" | "utilisation";
|
|
65
65
|
export declare type ChargeCardViewSortKey = ReturnType<typeof toChargeCardSortKeyType>;
|
|
66
66
|
export declare const ALL_CASHBACK_SORT_KEYS: readonly ["month", "cashback"];
|
|
67
67
|
export declare const toCashbackSortKeyType: (v: string) => "month" | "cashback";
|
|
@@ -11,20 +11,16 @@ const initializeRemiSetupApproverViewUpdateDataEpic = (actions$, state$) => acti
|
|
|
11
11
|
if (approvalRuleId != null) {
|
|
12
12
|
const approvalRule = (0, approvalRuleSelector_1.getApprovalRuleById)(state$.value.approvalRuleState, approvalRuleId);
|
|
13
13
|
if (approvalRule != null) {
|
|
14
|
+
const criteria = approvalRule.criteria[0];
|
|
15
|
+
const range = criteria?.range;
|
|
14
16
|
const remiSetupApproverViewUpdateData = {
|
|
15
17
|
approvalRuleId,
|
|
16
18
|
steps: approvalRule.steps,
|
|
17
19
|
criteria: {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
20
|
+
rangeType: criteria?.rangeType,
|
|
21
|
+
rangeEntity: criteria?.rangeEntity,
|
|
22
|
+
range,
|
|
21
23
|
},
|
|
22
|
-
// Approval Rules 3.0 — seed rule-level fields so the form can
|
|
23
|
-
// round-trip them on edit. Each may be undefined on legacy rules.
|
|
24
|
-
name: approvalRule.name,
|
|
25
|
-
description: approvalRule.description,
|
|
26
|
-
separationOfDuties: approvalRule.separationOfDuties,
|
|
27
|
-
isFallback: approvalRule.isFallback,
|
|
28
24
|
};
|
|
29
25
|
fetchActions.push((0, remiSetupApproverViewReducer_1.clearRemiSetupApproverViewUpdateData)(), (0, remiSetupApproverViewReducer_1.saveRemiSetupApproverViewUpdateData)(remiSetupApproverViewUpdateData));
|
|
30
26
|
}
|
|
@@ -32,7 +28,7 @@ const initializeRemiSetupApproverViewUpdateDataEpic = (actions$, state$) => acti
|
|
|
32
28
|
else {
|
|
33
29
|
const remiSetupApproverViewCreateData = {
|
|
34
30
|
steps: [],
|
|
35
|
-
criteria:
|
|
31
|
+
criteria: undefined,
|
|
36
32
|
};
|
|
37
33
|
fetchActions.push((0, remiSetupApproverViewReducer_1.clearRemiSetupApproverViewUpdateData)(), (0, remiSetupApproverViewReducer_1.saveRemiSetupApproverViewUpdateData)(remiSetupApproverViewCreateData));
|
|
38
34
|
}
|
|
@@ -50,15 +50,15 @@ export interface TaskFilterCategory {
|
|
|
50
50
|
}
|
|
51
51
|
export type TaskListFilterCategoryField = 'status' | 'dueDate' | 'assignee' | 'creationDate' | 'priority' | 'tag';
|
|
52
52
|
export declare const TASK_LIST_GROUP_BY_KEYS: readonly ["groupName", "status", "dueDate", "assignee", "priority", "tag"];
|
|
53
|
-
export declare const toTaskListGroupByKeyType: (v: string) => "status" | "
|
|
54
|
-
export declare const toTaskListGroupByKeyTypeStrict: (v: string) => "status" | "
|
|
53
|
+
export declare const toTaskListGroupByKeyType: (v: string) => "status" | "dueDate" | "groupName" | "tag" | "priority" | "assignee";
|
|
54
|
+
export declare const toTaskListGroupByKeyTypeStrict: (v: string) => "status" | "dueDate" | "groupName" | "tag" | "priority" | "assignee" | undefined;
|
|
55
55
|
export declare type TaskGroupKey = ReturnType<typeof toTaskListGroupByKeyType>;
|
|
56
56
|
export interface TaskListUIState extends SpendManagementUIState {
|
|
57
57
|
groupByKey: TaskGroupKey;
|
|
58
58
|
searchText: string;
|
|
59
59
|
sortKey: TaskListViewSortKey;
|
|
60
60
|
}
|
|
61
|
-
declare const toTaskListSortKeyType: (v: string) => "status" | "name" | "
|
|
61
|
+
declare const toTaskListSortKeyType: (v: string) => "status" | "name" | "dueDate" | "tag" | "priority" | "timeSpent" | "assignee" | "creationDate" | "visibility";
|
|
62
62
|
export declare type TaskListViewSortKey = ReturnType<typeof toTaskListSortKeyType>;
|
|
63
63
|
export declare const TASK_LIST_FILTER_CATEGORIES: TaskListFilterCategoryOption[];
|
|
64
64
|
interface TaskListFilterCategoryOption {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { RootState } from '../../reducer';
|
|
2
2
|
export declare const getTasksCardReport: (state: RootState) => {
|
|
3
|
-
reportId: "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "revenue" | "revenue_by_classes" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "profit_and_loss_by_projects" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_list_of_account_by_project" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "zeni_treasury" | "charge_cards" | "other_connection" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "billing" | "flux_analysis_operating_expense" | "account_reconciliation" | "zeni_credit_promo_card" | "treasury_promo_card" | "excluded_account_reconciliation";
|
|
3
|
+
reportId: "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "revenue" | "revenue_by_classes" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "profit_and_loss_by_projects" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_list_of_account_by_project" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "zeni_treasury" | "charge_cards" | "other_connection" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "billing" | "flux_analysis_operating_expense" | "account_reconciliation" | "zeni_credit_promo_card" | "treasury_promo_card" | "excluded_account_reconciliation" | "transfer_accounts" | "credit_card_transfer_accounts";
|
|
4
4
|
reportTitle: string;
|
|
5
5
|
version: string | number | undefined;
|
|
6
6
|
status: import("../..").Status | undefined;
|
|
@@ -4,7 +4,7 @@ import { RootState } from '../../reducer';
|
|
|
4
4
|
import { TopExReport, TopExTimePeriodWithMetaData } from './topExSelectorTypes';
|
|
5
5
|
import { TopExState } from './topExState';
|
|
6
6
|
export declare const getTopExpenses: (accountState: AccountState, topExState: TopExState, numberOfExpenses?: number) => {
|
|
7
|
-
reportId: "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "revenue" | "revenue_by_classes" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "profit_and_loss_by_projects" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_list_of_account_by_project" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "zeni_treasury" | "charge_cards" | "other_connection" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "billing" | "flux_analysis_operating_expense" | "account_reconciliation" | "zeni_credit_promo_card" | "treasury_promo_card" | "excluded_account_reconciliation";
|
|
7
|
+
reportId: "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "revenue" | "revenue_by_classes" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "profit_and_loss_by_projects" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_list_of_account_by_project" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "zeni_treasury" | "charge_cards" | "other_connection" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "billing" | "flux_analysis_operating_expense" | "account_reconciliation" | "zeni_credit_promo_card" | "treasury_promo_card" | "excluded_account_reconciliation" | "transfer_accounts" | "credit_card_transfer_accounts";
|
|
8
8
|
reportTitle: string;
|
|
9
9
|
version: string | number | undefined;
|
|
10
10
|
status: import("../..").Status | undefined;
|
|
@@ -7,9 +7,10 @@ import { ZeniAPI } from '../../../zeniAPI';
|
|
|
7
7
|
import { fetchAccountList } from '../../accountList/accountListReducer';
|
|
8
8
|
import { fetchClassList } from '../../classList/classListReducer';
|
|
9
9
|
import { updateTransactionVendorLocalData } from '../../commonVendorView/transactionVendorView/transactionVendorViewReducer';
|
|
10
|
+
import { fetchAccountsForTransferFlow } from '../../expenseAutomationView/reducers/transactionsViewReducer';
|
|
10
11
|
import { fetchOwnerList } from '../../ownerList/ownerListReducer';
|
|
11
12
|
import { fetchProjectList } from '../../projectList/projectListReducer';
|
|
12
13
|
import { updateSortUiState } from '../../vendorList/vendorListReducer';
|
|
13
14
|
import { fetchTransactionDetail, initializeTransactionDetailLocalData, removeTransactionDetail, updateTransactionDetailFetchState } from '../transactionDetailReducer';
|
|
14
|
-
export type ActionType = ReturnType<typeof fetchTransactionDetail> | ReturnType<typeof updateTransaction> | ReturnType<typeof updateTransactionDetailFetchState> | ReturnType<typeof initializeTransactionDetailLocalData> | ReturnType<typeof removeTransaction> | ReturnType<typeof removeTransactionDetail> | ReturnType<typeof fetchClassList> | ReturnType<typeof fetchProjectList> | ReturnType<typeof fetchAccountList> | ReturnType<typeof updateSortUiState> | ReturnType<typeof updateVendors> | ReturnType<typeof updateTransactionVendorLocalData> | ReturnType<typeof fetchOwnerList>;
|
|
15
|
+
export type ActionType = ReturnType<typeof fetchTransactionDetail> | ReturnType<typeof updateTransaction> | ReturnType<typeof updateTransactionDetailFetchState> | ReturnType<typeof initializeTransactionDetailLocalData> | ReturnType<typeof removeTransaction> | ReturnType<typeof removeTransactionDetail> | ReturnType<typeof fetchClassList> | ReturnType<typeof fetchProjectList> | ReturnType<typeof fetchAccountList> | ReturnType<typeof updateSortUiState> | ReturnType<typeof updateVendors> | ReturnType<typeof updateTransactionVendorLocalData> | ReturnType<typeof fetchOwnerList> | ReturnType<typeof fetchAccountsForTransferFlow>;
|
|
15
16
|
export declare const fetchTransactionDetailEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -19,6 +19,7 @@ const accountListReducer_1 = require("../../accountList/accountListReducer");
|
|
|
19
19
|
const classListReducer_1 = require("../../classList/classListReducer");
|
|
20
20
|
const transactionVendorLocalDataHelper_1 = require("../../commonVendorView/transactionVendorView/transactionVendorLocalDataHelper");
|
|
21
21
|
const transactionVendorViewReducer_1 = require("../../commonVendorView/transactionVendorView/transactionVendorViewReducer");
|
|
22
|
+
const transactionsViewReducer_1 = require("../../expenseAutomationView/reducers/transactionsViewReducer");
|
|
22
23
|
const ownerListReducer_1 = require("../../ownerList/ownerListReducer");
|
|
23
24
|
const projectListReducer_1 = require("../../projectList/projectListReducer");
|
|
24
25
|
const transactionDetailReducer_1 = require("../transactionDetailReducer");
|
|
@@ -41,6 +42,15 @@ const fetchTransactionDetailEpic = (actions$, state$, zeniAPI) => actions$.pipe(
|
|
|
41
42
|
accountList.fetchState !== 'In-Progress') {
|
|
42
43
|
transactionActions.push((0, accountListReducer_1.fetchAccountList)('accountList'));
|
|
43
44
|
}
|
|
45
|
+
const { transferAccounts, creditCardAccountsForTransfer, } = state$.value.expenseAutomationTransactionsViewState;
|
|
46
|
+
if (transferAccounts.fetchState !== 'In-Progress' &&
|
|
47
|
+
transferAccounts.fetchState !== 'Completed') {
|
|
48
|
+
transactionActions.push((0, transactionsViewReducer_1.fetchAccountsForTransferFlow)({ kind: 'transfer_eligible' }));
|
|
49
|
+
}
|
|
50
|
+
if (creditCardAccountsForTransfer.fetchState !== 'In-Progress' &&
|
|
51
|
+
creditCardAccountsForTransfer.fetchState !== 'Completed') {
|
|
52
|
+
transactionActions.push((0, transactionsViewReducer_1.fetchAccountsForTransferFlow)({ kind: 'credit_card_only' }));
|
|
53
|
+
}
|
|
44
54
|
const classList = state$.value.classListState;
|
|
45
55
|
if (classList.hasValidState() === false &&
|
|
46
56
|
classList.fetchState !== 'In-Progress') {
|
|
@@ -3,7 +3,7 @@ import { TransactionPayload } from '../../entity/transaction/payloadTypes/transa
|
|
|
3
3
|
import { SupportedTransactionPayload } from '../../entity/transaction/transactionState';
|
|
4
4
|
import { VendorPayload } from '../../entity/vendor/vendorPayload';
|
|
5
5
|
import { ZeniAPIResponse } from '../../responsePayload';
|
|
6
|
-
interface TransactionDetailPayload {
|
|
6
|
+
export interface TransactionDetailPayload {
|
|
7
7
|
query: {
|
|
8
8
|
transaction_id: string;
|
|
9
9
|
transaction_type: string;
|