@zeniai/client-epic-state 4.15.36 → 4.15.37
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/commonPayloadTypes/recommendationPayload.d.ts +0 -1
- package/lib/commonStateTypes/timePeriod.d.ts +1 -1
- package/lib/commonStateTypes/timePeriod.js +2 -2
- package/lib/commonStateTypes/viewAndReport/agingReportStateTypes.js +1 -1
- package/lib/commonStateTypes/viewAndReport/viewAndReport.d.ts +2 -2
- package/lib/commonStateTypes/viewAndReport/viewAndReport.js +0 -1
- package/lib/configureStore.js +1 -2
- package/lib/entity/account/accountState.d.ts +1 -1
- package/lib/entity/accountGroup/accountGroupState.d.ts +1 -1
- package/lib/entity/class/classReducer.d.ts +4 -4
- package/lib/entity/class/classState.d.ts +1 -1
- package/lib/entity/company/companyReducer.js +1 -0
- package/lib/entity/customer/customerPayload.d.ts +1 -1
- package/lib/entity/customer/customerPayload.js +6 -16
- package/lib/entity/forecast/forecastState.d.ts +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/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.js +0 -4
- package/lib/entity/task/taskState.d.ts +1 -1
- package/lib/entity/tenant/clearAllEpic.d.ts +2 -4
- package/lib/entity/tenant/clearAllEpic.js +0 -4
- package/lib/entity/tenant/tenantReducer.js +1 -0
- package/lib/entity/transaction/payloadTypes/customerTransactionPayload.d.ts +1 -1
- package/lib/entity/transaction/payloadTypes/customerTransactionPayload.js +2 -1
- package/lib/entity/transaction/payloadTypes/transactionPayload.d.ts +0 -2
- package/lib/entity/transaction/payloadTypes/transactionPayload.js +6 -9
- package/lib/entity/transaction/payloadTypes/vendorTransactionPayload.d.ts +1 -9
- package/lib/entity/transaction/payloadTypes/vendorTransactionPayload.js +2 -23
- package/lib/entity/transaction/stateTypes/transaction.d.ts +1 -3
- package/lib/entity/transaction/stateTypes/transactionType.d.ts +1 -1
- package/lib/entity/transaction/stateTypes/transactionType.js +1 -1
- package/lib/entity/transaction/stateTypes/vendorTransaction.d.ts +0 -5
- package/lib/entity/transaction/stateTypes/vendorTransaction.js +1 -5
- package/lib/entity/transaction/toSupportedTransaction.js +1 -6
- package/lib/entity/transaction/transactionReducer.d.ts +0 -17
- package/lib/entity/transaction/transactionReducer.js +2 -47
- package/lib/entity/transaction/transactionSelector.d.ts +0 -2
- package/lib/entity/transaction/transactionSelector.js +0 -5
- package/lib/entity/transaction/transactionState.d.ts +4 -6
- package/lib/entity/vendorExpense/vendorExpenseReducer.js +1 -0
- package/lib/entity/vendorExpense/vendorExpenseSelector.d.ts +2 -2
- package/lib/epic.d.ts +1 -6
- package/lib/epic.js +1 -6
- package/lib/index.d.ts +12 -20
- package/lib/index.js +27 -56
- package/lib/init.d.ts +1 -2
- package/lib/init.js +2 -9
- package/lib/reducer.d.ts +1 -7
- package/lib/reducer.js +0 -6
- package/lib/view/accountList/accountListReducer.js +3 -1
- package/lib/view/accountMappingView/accountMappingReducer.js +1 -0
- package/lib/view/apAgingView/apAgingDetail/apAgingDetailReducer.js +2 -1
- package/lib/view/auditReportView/auditReportViewState.d.ts +1 -1
- package/lib/view/balanceSheet/balanceSheetReducer.js +6 -1
- package/lib/view/bankAccountView/bankAccountViewReducer.js +1 -0
- 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/cashFlow/cashFlowReducer.js +4 -1
- package/lib/view/cashInCashOut/cashInCashOutSelector.d.ts +1 -1
- package/lib/view/cashPosition/cashPositionReducer.js +1 -0
- package/lib/view/cashPosition/cashPositionSelector.d.ts +1 -1
- package/lib/view/commonVendorView/vendorView/epics/fetchAndUpdateVendorRecommendationsEpic.js +3 -1
- package/lib/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewReducer.d.ts +2 -2
- package/lib/view/companyView/companyViewReducer.js +10 -1
- package/lib/view/dashboard/dashboardEpic.js +2 -0
- package/lib/view/dashboard/dashboardReducer.d.ts +2 -2
- package/lib/view/expenseAutomationView/epics/common/fetchAllExpenseAutomationTabsEpic.d.ts +1 -2
- package/lib/view/expenseAutomationView/epics/common/fetchAllExpenseAutomationTabsEpic.js +10 -24
- package/lib/view/expenseAutomationView/epics/common/refreshExpenseAutomationCurrentTabEpic.d.ts +1 -2
- package/lib/view/expenseAutomationView/epics/common/refreshExpenseAutomationCurrentTabEpic.js +0 -14
- package/lib/view/expenseAutomationView/epics/transactionCategorization/updateTransactionCategorizationEpic.js +5 -32
- package/lib/view/expenseAutomationView/expenseAutomationViewReducer.d.ts +2 -2
- package/lib/view/expenseAutomationView/expenseAutomationViewReducer.js +5 -1
- package/lib/view/expenseAutomationView/expenseAutomationViewSelector.js +2 -17
- package/lib/view/expenseAutomationView/expenseAutomationViewState.d.ts +2 -2
- package/lib/view/expenseAutomationView/expenseAutomationViewState.js +1 -1
- package/lib/view/expenseAutomationView/helpers/saveTransactionHelper.js +35 -111
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.js +10 -84
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.d.ts +1 -12
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.js +7 -66
- package/lib/view/expenseAutomationView/selectorTypes/expenseAutomationViewSelectorTypes.d.ts +0 -2
- package/lib/view/expenseAutomationView/selectorTypes/expenseAutomationViewSelectorTypes.js +1 -1
- package/lib/view/expenseAutomationView/types/transactionsViewState.d.ts +0 -10
- package/lib/view/financeStatement/financeStatementReducer.d.ts +1 -1
- package/lib/view/financeStatement/financeStatementReducer.js +4 -1
- package/lib/view/globalMerchantView/globalMerchantViewReducer.d.ts +2 -2
- package/lib/view/netBurnOrIncome/netBurnOrIncomeReducer.js +10 -3
- package/lib/view/netBurnOrIncomeClassesView/netBurnOrIncomeClassesViewReducer.js +6 -1
- package/lib/view/netBurnOrIncomeStoryCard/netBurnOrIncomeStoryCardReducer.js +1 -0
- package/lib/view/onboardingView/cockpitView/onboardingCockpitViewReducer.js +3 -0
- package/lib/view/opEx/opExForTimeFrameEpic.js +1 -1
- package/lib/view/opEx/opExReducer.js +14 -4
- package/lib/view/opExByVendor/opExByVendorReducer.js +3 -1
- package/lib/view/opExClassesView/opExClassesViewReducer.js +6 -1
- package/lib/view/people/fetchPeopleEpic.js +3 -1
- package/lib/view/people/invitePeopleEpic.js +3 -1
- package/lib/view/people/inviteZeniPeopleEpic.js +3 -1
- package/lib/view/people/peopleReducer.js +1 -0
- package/lib/view/people/peopleSaveUpdatesEpic.js +1 -1
- package/lib/view/profitAndLoss/profitAndLossReducer.js +6 -1
- package/lib/view/profitAndLossClassesView/profitAndLossClassesViewReducer.js +6 -1
- package/lib/view/recommendation/recommendationReducer.js +4 -1
- package/lib/view/reimbursementCard/reimbursementCardSelector.d.ts +1 -1
- package/lib/view/reportUIOptions/updateReportUIOptionThisPeriodEpic.js +3 -1
- package/lib/view/revenue/revenueReducer.js +10 -3
- package/lib/view/revenueClassesView/revenueClassesViewReducer.js +6 -1
- package/lib/view/scheduleView/scheduleListView/scheduleListTypes.d.ts +1 -1
- package/lib/view/settingsView/settingsViewReducer.js +1 -0
- package/lib/view/spendManagement/billPay/billList/billListReducer.js +1 -0
- package/lib/view/spendManagement/billPay/billPayConfig/billPayConfigState.js +6 -0
- package/lib/view/spendManagement/billPay/billsBulkActionView/epics/validateBillsBulkActionEpic.ts.js +3 -4
- package/lib/view/spendManagement/billPay/editBillView/epics/fetchBillAndInitializeLocalStoreEpic.js +3 -1
- package/lib/view/spendManagement/plaidAccount/epic/plaidConnection/establishPlaidConnectionEpic.js +3 -11
- package/lib/view/spendManagement/plaidAccount/plaidAccountViewReducer.d.ts +1 -2
- package/lib/view/spendManagement/plaidAccount/plaidAccountViewReducer.js +1 -3
- package/lib/view/spendManagement/plaidAccount/plaidAccountViewState.d.ts +1 -1
- package/lib/view/spendManagement/reimbursement/editRemiView/epics/fetchRecommendationsAndUpdateMerchantRecommendationsEpic.js +6 -2
- package/lib/view/spendManagement/reimbursement/editRemiView/epics/fetchRemiAndInitializeLocalStoreEpic.js +3 -1
- package/lib/view/spendManagement/reimbursement/remiListView/remiListReducer.js +1 -0
- package/lib/view/subscriptionView/subscriptionViewReducer.js +1 -0
- package/lib/view/subscriptionView/types/subscriptionTypes.js +1 -0
- package/lib/view/taskManager/taskListView/epics/dragNDropTasksEpic.js +3 -1
- package/lib/view/tasksCard/fetchTasksCardEpic.js +2 -1
- package/lib/view/tasksCard/tasksCardSelector.d.ts +1 -1
- package/lib/view/tasksCard/tasksCardSelector.js +1 -1
- package/lib/view/topEx/topExSelector.d.ts +1 -1
- package/lib/view/transactionDetail/epics/saveTransactionHelper.js +15 -45
- package/lib/view/transactionDetail/epics/updateTransactionDetailEpic.js +4 -22
- package/lib/view/transactionDetail/transactionDetailLocalDataHelper.js +13 -69
- package/lib/view/transactionDetail/transactionDetailReducer.d.ts +2 -11
- package/lib/view/transactionDetail/transactionDetailReducer.js +21 -51
- package/lib/view/transactionDetail/transactionDetailState.d.ts +0 -1
- package/lib/view/transactionDetail/transactionDetailTypes.d.ts +0 -8
- package/lib/view/transactionList/transactionListByEntitySelector.js +2 -0
- package/lib/view/transactionList/transactionListReducer.js +6 -4
- package/lib/view/trendWithTransactions/trendWithTransactionsReducer.js +1 -0
- package/lib/view/userFinancialAccount/userFinancialAccountReducer.js +3 -1
- package/lib/view/vendorReviewView/vendorGlobalReviewView/vendorGlobalReviewViewState.d.ts +1 -1
- package/lib/zeniAPI.d.ts +0 -1
- package/package.json +3 -8
- package/lib/entity/accountRecon/accountReconPayload.d.ts +0 -70
- package/lib/entity/accountRecon/accountReconPayload.js +0 -125
- package/lib/entity/accountRecon/accountReconReducer.d.ts +0 -16
- package/lib/entity/accountRecon/accountReconReducer.js +0 -71
- package/lib/entity/accountRecon/accountReconSelector.d.ts +0 -28
- package/lib/entity/accountRecon/accountReconSelector.js +0 -44
- package/lib/entity/accountRecon/accountReconState.d.ts +0 -70
- package/lib/entity/accountRecon/accountReconState.js +0 -28
- package/lib/entity/transaction/payloadTypes/reconciliationTransactionPayloads.d.ts +0 -35
- package/lib/entity/transaction/payloadTypes/reconciliationTransactionPayloads.js +0 -53
- package/lib/entity/transaction/stateTypes/reconciliationTransaction.d.ts +0 -32
- package/lib/entity/transaction/stateTypes/reconciliationTransaction.js +0 -10
- package/lib/view/expenseAutomationView/epics/accountRecon/fetchReconciliationViewEpic.d.ts +0 -15
- package/lib/view/expenseAutomationView/epics/accountRecon/fetchReconciliationViewEpic.js +0 -118
- package/lib/view/expenseAutomationView/epics/accountRecon/initialiseLocalDataForSelectedAccountIdEpic.d.ts +0 -10
- package/lib/view/expenseAutomationView/epics/accountRecon/initialiseLocalDataForSelectedAccountIdEpic.js +0 -49
- package/lib/view/expenseAutomationView/epics/accountRecon/saveReconciliationDetailEpic.d.ts +0 -14
- package/lib/view/expenseAutomationView/epics/accountRecon/saveReconciliationDetailEpic.js +0 -169
- package/lib/view/expenseAutomationView/epics/accountRecon/saveReconciliationReviewEpic.d.ts +0 -9
- package/lib/view/expenseAutomationView/epics/accountRecon/saveReconciliationReviewEpic.js +0 -154
- package/lib/view/expenseAutomationView/epics/accountRecon/updateReconcileTabLocalDataEpic.d.ts +0 -6
- package/lib/view/expenseAutomationView/epics/accountRecon/updateReconcileTabLocalDataEpic.js +0 -110
- package/lib/view/expenseAutomationView/helpers/reconciliationHelpers.d.ts +0 -7
- package/lib/view/expenseAutomationView/helpers/reconciliationHelpers.js +0 -18
- package/lib/view/expenseAutomationView/payload/reconciliationPayload.d.ts +0 -28
- package/lib/view/expenseAutomationView/payload/reconciliationPayload.js +0 -51
- package/lib/view/expenseAutomationView/reducers/reconciliationViewReducer.d.ts +0 -66
- package/lib/view/expenseAutomationView/reducers/reconciliationViewReducer.js +0 -384
- package/lib/view/expenseAutomationView/selectorTypes/reconciliationViewSelectorTypes.d.ts +0 -51
- package/lib/view/expenseAutomationView/selectorTypes/reconciliationViewSelectorTypes.js +0 -7
- package/lib/view/expenseAutomationView/selectors/reconciliationViewSelector.d.ts +0 -5
- package/lib/view/expenseAutomationView/selectors/reconciliationViewSelector.js +0 -250
- package/lib/view/expenseAutomationView/types/reconciliationViewState.d.ts +0 -103
- package/lib/view/expenseAutomationView/types/reconciliationViewState.js +0 -38
|
@@ -72,6 +72,7 @@ const revenue = (0, toolkit_1.createSlice)({
|
|
|
72
72
|
initialState: exports.initialState,
|
|
73
73
|
reducers: {
|
|
74
74
|
fetchRevenue: {
|
|
75
|
+
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
75
76
|
prepare(fetchFullReport = false, forecastId, cacheOverride = false) {
|
|
76
77
|
return { payload: { fetchFullReport, forecastId, cacheOverride } };
|
|
77
78
|
},
|
|
@@ -84,7 +85,11 @@ const revenue = (0, toolkit_1.createSlice)({
|
|
|
84
85
|
},
|
|
85
86
|
},
|
|
86
87
|
fetchRevenueForTimeframe: {
|
|
87
|
-
prepare(timeframe, forecastId,
|
|
88
|
+
prepare(timeframe, forecastId,
|
|
89
|
+
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
90
|
+
fetchFullReport = true,
|
|
91
|
+
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
92
|
+
cacheOverride = false) {
|
|
88
93
|
return {
|
|
89
94
|
payload: { forecastId, timeframe, fetchFullReport, cacheOverride },
|
|
90
95
|
};
|
|
@@ -104,7 +109,8 @@ const revenue = (0, toolkit_1.createSlice)({
|
|
|
104
109
|
reducer(draft) {
|
|
105
110
|
draft.lastFetchRequestTime = (0, zeniDayJS_1.dateNow)();
|
|
106
111
|
},
|
|
107
|
-
prepare(cacheOverride = false,
|
|
112
|
+
prepare(cacheOverride = false, // eslint-disable-line @typescript-eslint/no-inferrable-types
|
|
113
|
+
forecastId) {
|
|
108
114
|
return {
|
|
109
115
|
payload: {
|
|
110
116
|
cacheOverride,
|
|
@@ -117,7 +123,8 @@ const revenue = (0, toolkit_1.createSlice)({
|
|
|
117
123
|
reducer(draft) {
|
|
118
124
|
draft.lastFetchRequestTime = (0, zeniDayJS_1.dateNow)();
|
|
119
125
|
},
|
|
120
|
-
prepare(cacheOverride = false,
|
|
126
|
+
prepare(cacheOverride = false, // eslint-disable-line @typescript-eslint/no-inferrable-types
|
|
127
|
+
forecastId) {
|
|
121
128
|
return {
|
|
122
129
|
payload: {
|
|
123
130
|
cacheOverride,
|
|
@@ -37,6 +37,7 @@ const revenueClassesView = (0, toolkit_1.createSlice)({
|
|
|
37
37
|
initialState: exports.initialState,
|
|
38
38
|
reducers: {
|
|
39
39
|
fetchRevenueClassesView: {
|
|
40
|
+
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
40
41
|
prepare(cacheOverride = false) {
|
|
41
42
|
return { payload: { cacheOverride } };
|
|
42
43
|
},
|
|
@@ -49,7 +50,11 @@ const revenueClassesView = (0, toolkit_1.createSlice)({
|
|
|
49
50
|
},
|
|
50
51
|
},
|
|
51
52
|
fetchRevenueForTimeframeClassesView: {
|
|
52
|
-
prepare(timeframe,
|
|
53
|
+
prepare(timeframe,
|
|
54
|
+
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
55
|
+
fetchFullReport = true,
|
|
56
|
+
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
57
|
+
cacheOverride = false) {
|
|
53
58
|
return { payload: { timeframe, fetchFullReport, cacheOverride } };
|
|
54
59
|
},
|
|
55
60
|
reducer(draft, action) {
|
|
@@ -7,7 +7,7 @@ export declare const getScheduleListKey: (selectedCategory: ID, selectedTimefram
|
|
|
7
7
|
export type ScheduleListKey = ReturnType<typeof getScheduleListKey>;
|
|
8
8
|
export declare const toScheduleSubTabType: (v: string) => "all" | "new" | "completed" | "ongoing";
|
|
9
9
|
export type ScheduleSubTabType = ReturnType<typeof toScheduleSubTabType>;
|
|
10
|
-
declare const toScheduleSortKeyType: (v: string) => "status" | "user" | "months" | "class" | "vendor" | "amount" | "createTime" | "balanceAsOfToday" | "memo" | "assetId" | "
|
|
10
|
+
declare const toScheduleSortKeyType: (v: string) => "status" | "user" | "months" | "class" | "vendor" | "amount" | "createTime" | "balanceAsOfToday" | "memo" | "assetId" | "transactionType" | "transactionDate" | "accruedExpenseCategory" | "scheduleCategory" | "expenseCategory" | "accumulatedDepreciationCategory" | "startMonth" | "endMonth";
|
|
11
11
|
export declare type ScheduleListSortKey = ReturnType<typeof toScheduleSortKeyType>;
|
|
12
12
|
export interface DownloadJEScheduleTabOptions {
|
|
13
13
|
timezone: string;
|
|
@@ -93,6 +93,7 @@ const settings = (0, toolkit_1.createSlice)({
|
|
|
93
93
|
reducer() {
|
|
94
94
|
// Do nothing.
|
|
95
95
|
},
|
|
96
|
+
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
96
97
|
prepare(companyId, shouldFetchClassList) {
|
|
97
98
|
return { payload: { companyId, shouldFetchClassList } };
|
|
98
99
|
},
|
|
@@ -163,6 +163,7 @@ function doUpdateBillList(draft, payload, tab) {
|
|
|
163
163
|
const pendingApprovalTransactionIDs = payload.pending_approval_transaction_ids_for_user;
|
|
164
164
|
const start = (0, timePeriod_1.toAbsoluteDay)(payload === null || payload === void 0 ? void 0 : payload.query.start_date); // eslint-disable-line @typescript-eslint/no-non-null-assertion
|
|
165
165
|
const end = (0, timePeriod_1.toAbsoluteDay)(payload === null || payload === void 0 ? void 0 : payload.query.end_date); // eslint-disable-line @typescript-eslint/no-non-null-assertion
|
|
166
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
166
167
|
const key = (0, billListState_1.getBillListKey)({ start, end }, tab);
|
|
167
168
|
draft[key] = Object.assign(Object.assign({}, billListState_1.billListInitialState), { uiState: draft[key] != null ? draft[key].uiState : billListState_1.billListInitialState.uiState, fetchState: 'Completed', error: undefined, transactionIDs,
|
|
168
169
|
pendingApprovalTransactionIDs });
|
|
@@ -30,9 +30,11 @@ exports.BILL_PAYMENT_METHOD_CODE = [
|
|
|
30
30
|
'wire',
|
|
31
31
|
'outside-zeni',
|
|
32
32
|
];
|
|
33
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
33
34
|
const toBillPaymentMethodCodeType = (v) => (0, stringToUnion_1.stringToUnion)(v, exports.BILL_PAYMENT_METHOD_CODE);
|
|
34
35
|
exports.toBillPaymentMethodCodeType = toBillPaymentMethodCodeType;
|
|
35
36
|
exports.PAYMENT_ACH_SUB_CODES = ['standard', 'same-day'];
|
|
37
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
36
38
|
const toPaymentAchSubMethodCodeType = (v) => (0, stringToUnion_1.stringToUnion)(v, exports.PAYMENT_ACH_SUB_CODES);
|
|
37
39
|
exports.toPaymentAchSubMethodCodeType = toPaymentAchSubMethodCodeType;
|
|
38
40
|
const PAYMENT_ACH_SUB_CODES_KEYS = ['standard', 'sameDay'];
|
|
@@ -42,6 +44,7 @@ exports.BILL_PAYMENT_WIRE_SUB_CODES = [
|
|
|
42
44
|
'us-domestic',
|
|
43
45
|
'international',
|
|
44
46
|
];
|
|
47
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
45
48
|
const toBillPaymentWireSubMethodCodeType = (v) => (0, stringToUnion_1.stringToUnion)(v, exports.BILL_PAYMENT_WIRE_SUB_CODES);
|
|
46
49
|
exports.toBillPaymentWireSubMethodCodeType = toBillPaymentWireSubMethodCodeType;
|
|
47
50
|
const BILL_PAYMENT_WIRE_SUB_CODES_KEYS = [
|
|
@@ -51,6 +54,7 @@ const BILL_PAYMENT_WIRE_SUB_CODES_KEYS = [
|
|
|
51
54
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
52
55
|
const toBillPaymentWireSubMethodCodeKeyType = (v) => (0, stringToUnion_1.stringToUnion)(v, BILL_PAYMENT_WIRE_SUB_CODES_KEYS);
|
|
53
56
|
exports.BILL_PAYMENT_OUTSIDE_ZENI_SUB_CODES = ['outside-zeni'];
|
|
57
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
54
58
|
const toBillPaymentOutsideZeniSubMethodCodeType = (v) => (0, stringToUnion_1.stringToUnion)(v, exports.BILL_PAYMENT_OUTSIDE_ZENI_SUB_CODES);
|
|
55
59
|
exports.toBillPaymentOutsideZeniSubMethodCodeType = toBillPaymentOutsideZeniSubMethodCodeType;
|
|
56
60
|
const BILL_PAYMENT_OUTSIDE_ZENI_SUB_CODES_KEYS = ['outsideZeni'];
|
|
@@ -87,12 +91,14 @@ exports.ACCOUNT_TYPE_CODES = [
|
|
|
87
91
|
'deposit_account',
|
|
88
92
|
'payment_account',
|
|
89
93
|
];
|
|
94
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
90
95
|
const toAccType = (v) => (0, stringToUnion_1.stringToUnion)(v, exports.ACCOUNT_TYPE_CODES);
|
|
91
96
|
exports.toAccType = toAccType;
|
|
92
97
|
const ACCOUNT_TYPE_SUB_CODES_KEYS = [
|
|
93
98
|
'depositAccount',
|
|
94
99
|
'paymentAccount',
|
|
95
100
|
];
|
|
101
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
96
102
|
const toAccountTypeSubConfigCodeKeyType = (v) => (0, stringToUnion_1.stringToUnion)(v, ACCOUNT_TYPE_SUB_CODES_KEYS);
|
|
97
103
|
exports.toAccountTypeSubConfigCodeKeyType = toAccountTypeSubConfigCodeKeyType;
|
|
98
104
|
//These const are used in web-components
|
package/lib/view/spendManagement/billPay/billsBulkActionView/epics/validateBillsBulkActionEpic.ts.js
CHANGED
|
@@ -8,12 +8,11 @@ const billsBulkActionViewReducer_1 = require("../billsBulkActionViewReducer");
|
|
|
8
8
|
const validateBillsBulkActionEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(billsBulkActionViewReducer_1.validateBillsBulkAction.match), (0, operators_1.mergeMap)(() => {
|
|
9
9
|
const { billsBulkActionViewState } = state$.value;
|
|
10
10
|
const { billsSelectedForBulkAction: transactionIds, bulkOperationTypeSelected, } = billsBulkActionViewState;
|
|
11
|
-
const validationValue = bulkOperationTypeSelected === 'send_for_approval'
|
|
12
|
-
? 'all'
|
|
13
|
-
: 'sufficient_funds';
|
|
14
11
|
const queryParam = {
|
|
15
12
|
entity_ids: transactionIds,
|
|
16
|
-
validations:
|
|
13
|
+
validations: bulkOperationTypeSelected === 'send_for_approval'
|
|
14
|
+
? 'all'
|
|
15
|
+
: 'sufficient_funds',
|
|
17
16
|
};
|
|
18
17
|
return zeniAPI
|
|
19
18
|
.getJSON(`${zeniAPI.apiEndPoints.spendManagementMicroServiceBaseUrl}/1.0/bulk/bills/transactions/validate?query=${encodeURIComponent(JSON.stringify(queryParam))}`)
|
package/lib/view/spendManagement/billPay/editBillView/epics/fetchBillAndInitializeLocalStoreEpic.js
CHANGED
|
@@ -10,7 +10,9 @@ const operators_1 = require("rxjs/operators");
|
|
|
10
10
|
const billDetailViewReducer_1 = require("../../billDetailView/billDetailViewReducer");
|
|
11
11
|
const billDetailViewState_1 = require("../../billDetailView/billDetailViewState");
|
|
12
12
|
const editBillViewReducer_1 = require("../editBillViewReducer");
|
|
13
|
-
const fetchBillAndInitializeLocalStoreEpic = (actions$,
|
|
13
|
+
const fetchBillAndInitializeLocalStoreEpic = (actions$,
|
|
14
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
15
|
+
state$) => actions$.pipe((0, operators_1.filter)(editBillViewReducer_1.fetchBillAndInitializeLocalStore.match), (0, operators_1.mergeMap)((action) => {
|
|
14
16
|
const { billId, cacheOverride, isShowDeletedBillsEnabled, hasZeniAssistAccess, } = action.payload;
|
|
15
17
|
const state = state$.value;
|
|
16
18
|
const billDetailActions = [];
|
package/lib/view/spendManagement/plaidAccount/epic/plaidConnection/establishPlaidConnectionEpic.js
CHANGED
|
@@ -14,16 +14,14 @@ const paymentAccountListReducer_1 = require("../../../zeniAccounts/paymentAccoun
|
|
|
14
14
|
const plaidAccountViewReducer_1 = require("../../plaidAccountViewReducer");
|
|
15
15
|
const establishPlaidConnectionEpic = (actions$, state, zeniAPI) => actions$.pipe((0, operators_1.filter)(plaidAccountViewReducer_1.establishPlaidConnection.match), (0, operators_1.mergeMap)((action) => {
|
|
16
16
|
var _a, _b;
|
|
17
|
-
const { publicToken, companyId, setupViewType, linkTokenType, plaidAccountKeyType,
|
|
17
|
+
const { publicToken, companyId, setupViewType, linkTokenType, plaidAccountKeyType, } = action.payload;
|
|
18
18
|
const requestPayload = {
|
|
19
19
|
public_token: publicToken,
|
|
20
20
|
};
|
|
21
|
-
const queryPayload = {};
|
|
22
21
|
const userId = (_b = (_a = state.value.tenantState.loggedInUser) === null || _a === void 0 ? void 0 : _a.userId) !== null && _b !== void 0 ? _b : '';
|
|
23
22
|
//setupViewType not passed means this is a user account
|
|
24
23
|
if (linkTokenType !== 'link_external_account') {
|
|
25
|
-
if (setupViewType == null
|
|
26
|
-
plaidAccountKeyType !== 'expense_automation_reconcile') {
|
|
24
|
+
if (setupViewType == null) {
|
|
27
25
|
requestPayload.is_user_account = true;
|
|
28
26
|
}
|
|
29
27
|
else if (plaidAccountKeyType === 'bill_pay_setup') {
|
|
@@ -41,15 +39,9 @@ const establishPlaidConnectionEpic = (actions$, state, zeniAPI) => actions$.pipe
|
|
|
41
39
|
else if (plaidAccountKeyType === 'billing_setup') {
|
|
42
40
|
requestPayload.is_primary_for_onboarding = true;
|
|
43
41
|
}
|
|
44
|
-
else if (plaidAccountKeyType === 'expense_automation_reconcile') {
|
|
45
|
-
queryPayload.zeni_mapped_account_id = zeniMappedAccountId !== null && zeniMappedAccountId !== void 0 ? zeniMappedAccountId : '';
|
|
46
|
-
}
|
|
47
42
|
}
|
|
48
|
-
const queryString = Object.entries(queryPayload).length > 0
|
|
49
|
-
? `?query=${JSON.stringify(queryPayload)}`
|
|
50
|
-
: '';
|
|
51
43
|
return zeniAPI
|
|
52
|
-
.postAndGetJSON(`${zeniAPI.apiEndPoints.payMicroServiceBaseUrl}/1.0/plaid/public-token
|
|
44
|
+
.postAndGetJSON(`${zeniAPI.apiEndPoints.payMicroServiceBaseUrl}/1.0/plaid/public-token`, requestPayload)
|
|
53
45
|
.pipe((0, operators_1.mergeMap)((response) => {
|
|
54
46
|
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
55
47
|
const paymentAccount = response.data.payment_accounts[0];
|
|
@@ -61,13 +61,12 @@ export declare const getPaymentAccounts: import("@reduxjs/toolkit").ActionCreato
|
|
|
61
61
|
error: ZeniAPIStatus<Record<string, unknown>>;
|
|
62
62
|
linkTokenType: PlaidLinkTokenType;
|
|
63
63
|
plaidAccountKeyType: PlaidAccountKeyType;
|
|
64
|
-
}, "plaidAccountView/getPlaidLinkTokenFailure", never, never>, establishPlaidConnection: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[publicToken: string, companyId: string, plaidAccountKeyType: PlaidAccountKeyType, setupViewType?: "billing" | "bill_pay" | "reimbursement" | "zeni_accounts" | "charge_cards" | undefined, linkTokenType?: PlaidLinkTokenType | undefined
|
|
64
|
+
}, "plaidAccountView/getPlaidLinkTokenFailure", never, never>, establishPlaidConnection: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[publicToken: string, companyId: string, plaidAccountKeyType: PlaidAccountKeyType, setupViewType?: "billing" | "bill_pay" | "reimbursement" | "zeni_accounts" | "charge_cards" | undefined, linkTokenType?: PlaidLinkTokenType | undefined], {
|
|
65
65
|
publicToken: string;
|
|
66
66
|
companyId: string;
|
|
67
67
|
setupViewType: "billing" | "bill_pay" | "reimbursement" | "zeni_accounts" | "charge_cards" | undefined;
|
|
68
68
|
linkTokenType: PlaidLinkTokenType;
|
|
69
69
|
plaidAccountKeyType: PlaidAccountKeyType;
|
|
70
|
-
zeniMappedAccountId: string | undefined;
|
|
71
70
|
}, "plaidAccountView/establishPlaidConnection", never, never>, establishPlaidConnectionSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[linkTokenType: PlaidLinkTokenType, plaidAccountKeyType: PlaidAccountKeyType], {
|
|
72
71
|
linkTokenType: PlaidLinkTokenType;
|
|
73
72
|
plaidAccountKeyType: PlaidAccountKeyType;
|
|
@@ -14,7 +14,6 @@ exports.initialState = {
|
|
|
14
14
|
user_reimbursement_account: plaidAccountViewState_1.initialPlaidAccountState,
|
|
15
15
|
external_account: plaidAccountViewState_1.initialPlaidAccountState,
|
|
16
16
|
billing_setup: plaidAccountViewState_1.initialPlaidAccountState,
|
|
17
|
-
expense_automation_reconcile: plaidAccountViewState_1.initialPlaidAccountState,
|
|
18
17
|
};
|
|
19
18
|
const plaidAccountView = (0, toolkit_1.createSlice)({
|
|
20
19
|
name: 'plaidAccountView',
|
|
@@ -265,7 +264,7 @@ const plaidAccountView = (0, toolkit_1.createSlice)({
|
|
|
265
264
|
error: undefined,
|
|
266
265
|
} });
|
|
267
266
|
},
|
|
268
|
-
prepare(publicToken, companyId, plaidAccountKeyType, setupViewType, linkTokenType
|
|
267
|
+
prepare(publicToken, companyId, plaidAccountKeyType, setupViewType, linkTokenType) {
|
|
269
268
|
return {
|
|
270
269
|
payload: {
|
|
271
270
|
publicToken,
|
|
@@ -273,7 +272,6 @@ const plaidAccountView = (0, toolkit_1.createSlice)({
|
|
|
273
272
|
setupViewType,
|
|
274
273
|
linkTokenType: linkTokenType !== null && linkTokenType !== void 0 ? linkTokenType : 'link_account',
|
|
275
274
|
plaidAccountKeyType,
|
|
276
|
-
zeniMappedAccountId,
|
|
277
275
|
},
|
|
278
276
|
};
|
|
279
277
|
},
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FetchStateAndError, ID } from '../../../commonStateTypes/common';
|
|
2
2
|
import { ZeniDate } from '../../../zeniDayJS';
|
|
3
3
|
export type PlaidLinkTokenType = 'link_account' | 'update_account' | 'link_account_no_microdeposit' | 'link_external_account';
|
|
4
|
-
export type PlaidAccountKeyType = 'spend_management_setup' | 'bill_pay_setup' | 'reimbursement_setup' | 'account_setup' | 'charge_card_setup' | 'user_reimbursement_account' | 'external_account' | 'billing_setup'
|
|
4
|
+
export type PlaidAccountKeyType = 'spend_management_setup' | 'bill_pay_setup' | 'reimbursement_setup' | 'account_setup' | 'charge_card_setup' | 'user_reimbursement_account' | 'external_account' | 'billing_setup';
|
|
5
5
|
export type PlaidConnectionDetails = Record<PlaidLinkTokenType, {
|
|
6
6
|
linkToken?: string;
|
|
7
7
|
expiration?: ZeniDate;
|
|
@@ -6,7 +6,9 @@ const operators_1 = require("rxjs/operators");
|
|
|
6
6
|
const recommendationReducer_1 = require("../../../../recommendation/recommendationReducer");
|
|
7
7
|
const recommendationSelector_1 = require("../../../../recommendation/recommendationSelector");
|
|
8
8
|
const editRemiViewReducer_1 = require("../editRemiViewReducer");
|
|
9
|
-
const fetchRecommendationsAndUpdateMerchantRecommendationsEpic = (actions$,
|
|
9
|
+
const fetchRecommendationsAndUpdateMerchantRecommendationsEpic = (actions$,
|
|
10
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
11
|
+
state$) => actions$.pipe((0, operators_1.filter)(editRemiViewReducer_1.fetchRecommendationsAndUpdateMerchantRecommendations.match), (0, operators_1.mergeMap)((action) => {
|
|
10
12
|
const { cacheOverride, lineId, reimbursementId, merchantId, merchantName } = action.payload;
|
|
11
13
|
const state = state$.value;
|
|
12
14
|
const reimbursement = reimbursementId != null
|
|
@@ -65,7 +67,9 @@ const fetchRecommendationsAndUpdateMerchantRecommendationsEpic = (actions$, stat
|
|
|
65
67
|
return (0, rxjs_1.from)(merchantRecommendationActions);
|
|
66
68
|
}));
|
|
67
69
|
exports.fetchRecommendationsAndUpdateMerchantRecommendationsEpic = fetchRecommendationsAndUpdateMerchantRecommendationsEpic;
|
|
68
|
-
const waitForMerchantRecommendationFetchThenUpdateRecommendationInMerchantEpic = (actions$,
|
|
70
|
+
const waitForMerchantRecommendationFetchThenUpdateRecommendationInMerchantEpic = (actions$,
|
|
71
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
72
|
+
state$) => actions$.pipe((0, operators_1.filter)(editRemiViewReducer_1.waitForMerchantRecommendationFetchThenUpdateRecommendationInMerchant.match),
|
|
69
73
|
//used concatMap here, as with mergeMap it was triggering below flow for first completed recommendations (in case of multi receipts)
|
|
70
74
|
(0, operators_1.concatMap)((action) => {
|
|
71
75
|
const { reimbursementId } = action.payload;
|
|
@@ -9,7 +9,9 @@ const rxjs_1 = require("rxjs");
|
|
|
9
9
|
const operators_1 = require("rxjs/operators");
|
|
10
10
|
const remiDetailViewReducer_1 = require("../../remiDetailView/remiDetailViewReducer");
|
|
11
11
|
const editRemiViewReducer_1 = require("../editRemiViewReducer");
|
|
12
|
-
const fetchRemiAndInitializeLocalStoreEpic = (actions$,
|
|
12
|
+
const fetchRemiAndInitializeLocalStoreEpic = (actions$,
|
|
13
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
14
|
+
state$) => actions$.pipe((0, operators_1.filter)(editRemiViewReducer_1.fetchRemiAndInitializeLocalStore.match), (0, operators_1.mergeMap)((action) => {
|
|
13
15
|
const { reimbursementId, cacheOverride, isShowDeletedReimbursementEnabled, } = action.payload;
|
|
14
16
|
const state = state$.value;
|
|
15
17
|
const remiDetailActions = [];
|
|
@@ -173,6 +173,7 @@ function doUpdateRemiList(draft, payload, tab) {
|
|
|
173
173
|
const pendingApprovalTransactionIDs = payload.pending_approval_transaction_ids_for_user;
|
|
174
174
|
const start = (0, timePeriod_1.toAbsoluteDay)(payload === null || payload === void 0 ? void 0 : payload.query.start_date); // eslint-disable-line @typescript-eslint/no-non-null-assertion
|
|
175
175
|
const end = (0, timePeriod_1.toAbsoluteDay)(payload === null || payload === void 0 ? void 0 : payload.query.end_date); // eslint-disable-line @typescript-eslint/no-non-null-assertion
|
|
176
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
176
177
|
const key = (0, remiListState_1.getRemiListKey)({ start, end }, tab);
|
|
177
178
|
draft[key] = Object.assign(Object.assign({}, remiListState_1.remiListInitialState), { uiState: draft[key] != null ? draft[key].uiState : remiListState_1.remiListInitialState.uiState, fetchState: 'Completed', error: undefined, transactionIDs,
|
|
178
179
|
pendingApprovalTransactionIDs });
|
|
@@ -191,6 +191,7 @@ const subscriptionView = (0, toolkit_1.createSlice)({
|
|
|
191
191
|
},
|
|
192
192
|
},
|
|
193
193
|
fetchSubscriptionList: {
|
|
194
|
+
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
194
195
|
prepare(fetchFullResponse = false) {
|
|
195
196
|
return { payload: { fetchFullResponse } };
|
|
196
197
|
},
|
|
@@ -15,6 +15,7 @@ const ALL_SUBSCRIPTION_SORT_KEYS = [
|
|
|
15
15
|
'monthlyRecurringRevenue',
|
|
16
16
|
'notes',
|
|
17
17
|
];
|
|
18
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
18
19
|
const toSubscriptionSortKeyType = (v) => (0, stringToUnion_1.stringToUnion)(v, ALL_SUBSCRIPTION_SORT_KEYS);
|
|
19
20
|
exports.toSubscriptionSortKeyType = toSubscriptionSortKeyType;
|
|
20
21
|
exports.SUBSCRIPTION_STATUS_CODES = [
|
|
@@ -5,7 +5,9 @@ const rxjs_1 = require("rxjs");
|
|
|
5
5
|
const operators_1 = require("rxjs/operators");
|
|
6
6
|
const taskListReducer_1 = require("../taskListReducer");
|
|
7
7
|
const taskListViewHelpers_1 = require("../taskListViewHelpers");
|
|
8
|
-
const dragNDropTasksEpic = (actions$,
|
|
8
|
+
const dragNDropTasksEpic = (actions$,
|
|
9
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
10
|
+
state$) => actions$.pipe((0, operators_1.filter)(taskListReducer_1.dragNDropTasks.match), (0, operators_1.mergeMap)((action) => {
|
|
9
11
|
const { taskIds, groupId } = action.payload;
|
|
10
12
|
const state = state$.value;
|
|
11
13
|
const { groupByKey } = state.taskListState.uiState;
|
|
@@ -9,7 +9,8 @@ const fetchTasksCardEpic = (actions$, _, zeniAPI) => actions$.pipe((0, operators
|
|
|
9
9
|
.getJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/reports/task_card`)
|
|
10
10
|
.pipe((0, operators_1.mergeMap)((response) => {
|
|
11
11
|
if ((0, responsePayload_1.isSuccessResponse)(response)) {
|
|
12
|
-
return (0, rxjs_1.of)((0, tasksCardReducer_1.updateTasksCard)(response.data)
|
|
12
|
+
return (0, rxjs_1.of)((0, tasksCardReducer_1.updateTasksCard)(response.data) // eslint-disable-line @typescript-eslint/no-non-null-assertion
|
|
13
|
+
);
|
|
13
14
|
}
|
|
14
15
|
else {
|
|
15
16
|
return (0, rxjs_1.of)((0, tasksCardReducer_1.updateTasksCardFailure)(response.status));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { RootState } from '../../reducer';
|
|
2
2
|
export declare const getTasksCardReport: (state: RootState) => {
|
|
3
|
-
reportId: "billing" | "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" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "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" | "charge_cards" | "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" | "flux_analysis_operating_expense"
|
|
3
|
+
reportId: "billing" | "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" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "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" | "charge_cards" | "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" | "flux_analysis_operating_expense";
|
|
4
4
|
reportTitle: string;
|
|
5
5
|
version: string | number | undefined;
|
|
6
6
|
status: import("../..").Status | undefined;
|
|
@@ -4,7 +4,7 @@ exports.getTasksCardReport = void 0;
|
|
|
4
4
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
5
5
|
const getTasksCardReportSelector = (0, toolkit_1.createSelector)((state) => state.tasksCardState, (tasksCardState) => {
|
|
6
6
|
const { tasks, fetchState } = tasksCardState;
|
|
7
|
-
let showCard = fetchState !== 'Completed';
|
|
7
|
+
let showCard = false || fetchState !== 'Completed';
|
|
8
8
|
let isMulti = false;
|
|
9
9
|
if (fetchState === 'Completed') {
|
|
10
10
|
for (const key in tasks) {
|
|
@@ -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: "billing" | "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" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "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" | "charge_cards" | "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" | "flux_analysis_operating_expense"
|
|
7
|
+
reportId: "billing" | "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" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "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" | "charge_cards" | "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" | "flux_analysis_operating_expense";
|
|
8
8
|
reportTitle: string;
|
|
9
9
|
version: string | number | undefined;
|
|
10
10
|
status: import("../..").Status | undefined;
|
|
@@ -25,7 +25,7 @@ const recommendationState_1 = require("../../recommendation/recommendationState"
|
|
|
25
25
|
* additionally fire “Mark as not miscat” for every point above.
|
|
26
26
|
*/
|
|
27
27
|
const toTransactionUpdatesFromTransactionDetailLocalData = (transactionDetailLocalData, transaction, isExpenseAutomationEnabled) => {
|
|
28
|
-
var _a, _b;
|
|
28
|
+
var _a, _b, _c;
|
|
29
29
|
const updates = {
|
|
30
30
|
updatesByLineId: {},
|
|
31
31
|
};
|
|
@@ -33,29 +33,21 @@ const toTransactionUpdatesFromTransactionDetailLocalData = (transactionDetailLoc
|
|
|
33
33
|
const entityUpdates = {};
|
|
34
34
|
const isTransactionMisCategorized = (0, exports.isTransactionMiscategorized)(transaction, isExpenseAutomationEnabled);
|
|
35
35
|
updates.memo = transactionDetailLocalData.memo;
|
|
36
|
-
const selectedEntity = transactionDetailLocalData.selectedEntity;
|
|
37
36
|
const updatedEntityId = transactionDetailLocalData.updatePreviousTransactionsWithUpdatedVendor ===
|
|
38
37
|
true
|
|
39
38
|
? (_a = transactionDetailLocalData.vendorUpdates) === null || _a === void 0 ? void 0 : _a.qboId
|
|
40
39
|
: undefined;
|
|
41
|
-
if ((0, vendorTransaction_1.isVendorTransaction)(transaction)
|
|
42
|
-
|
|
43
|
-
selectedEntity.type === 'vendor') {
|
|
44
|
-
updates.vendorId = selectedEntity.id;
|
|
45
|
-
}
|
|
46
|
-
if ((0, vendorTransaction_1.isVendorTransaction)(transaction) &&
|
|
47
|
-
selectedEntity != null &&
|
|
48
|
-
selectedEntity.type === 'customer') {
|
|
49
|
-
updates.customerId = selectedEntity.id;
|
|
40
|
+
if ((0, vendorTransaction_1.isVendorTransaction)(transaction)) {
|
|
41
|
+
updates.vendorId = (_b = transactionDetailLocalData.vendorUpdates) === null || _b === void 0 ? void 0 : _b.id;
|
|
50
42
|
}
|
|
51
43
|
let isBulkUpdate = false;
|
|
52
|
-
const entity = getEntityFromTransaction(transaction
|
|
44
|
+
const entity = getEntityFromTransaction(transaction);
|
|
53
45
|
let lastUpdatedCategory;
|
|
54
46
|
let lastUpdatedClass;
|
|
55
47
|
// single recommendation to just pick the last recommendation in the list of lines
|
|
56
|
-
(
|
|
48
|
+
(_c = transaction.lines) === null || _c === void 0 ? void 0 : _c.forEach((line) => {
|
|
57
49
|
var _a, _b, _c, _d, _e, _f;
|
|
58
|
-
const entityDetails = getEntityDetails(entity, transactionDetailLocalData.lineItemById[line.id], transactionDetailLocalData.vendorUpdates
|
|
50
|
+
const entityDetails = getEntityDetails(entity, transactionDetailLocalData.lineItemById[line.id], transactionDetailLocalData.vendorUpdates);
|
|
59
51
|
if (line.type === 'transaction_with_account_and_class_line' ||
|
|
60
52
|
line.type === 'transaction_with_product_or_service_line' ||
|
|
61
53
|
line.type === 'journal_entry_transaction_line') {
|
|
@@ -209,31 +201,17 @@ const getVendorOrCustomerDetails = (lineItem) => {
|
|
|
209
201
|
}
|
|
210
202
|
return {};
|
|
211
203
|
};
|
|
212
|
-
const getEntityFromTransaction = (transaction
|
|
204
|
+
const getEntityFromTransaction = (transaction) => {
|
|
213
205
|
let entity = undefined;
|
|
214
206
|
if ((0, vendorTransaction_1.isVendorTransaction)(transaction)) {
|
|
215
|
-
const
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
return {
|
|
221
|
-
id: customer.id,
|
|
222
|
-
name: customer.name,
|
|
223
|
-
type: (0, entity_1.toEntityType)('customer'),
|
|
224
|
-
qboId: customer.id,
|
|
225
|
-
zeniId: customer.id,
|
|
226
|
-
};
|
|
227
|
-
}
|
|
228
|
-
if (vendor != null &&
|
|
229
|
-
currentSelectedEntity != null &&
|
|
230
|
-
currentSelectedEntity.type === 'vendor') {
|
|
231
|
-
return {
|
|
232
|
-
id: vendor.id,
|
|
233
|
-
name: vendor.name,
|
|
207
|
+
const vendorEntity = transaction.vendor;
|
|
208
|
+
if (vendorEntity != null) {
|
|
209
|
+
entity = {
|
|
210
|
+
id: vendorEntity.id,
|
|
211
|
+
name: vendorEntity.name,
|
|
234
212
|
type: (0, entity_1.toEntityType)('vendor'),
|
|
235
|
-
qboId:
|
|
236
|
-
zeniId:
|
|
213
|
+
qboId: vendorEntity.id,
|
|
214
|
+
zeniId: vendorEntity.id,
|
|
237
215
|
};
|
|
238
216
|
}
|
|
239
217
|
}
|
|
@@ -251,7 +229,7 @@ const getEntityFromTransaction = (transaction, currentSelectedEntity) => {
|
|
|
251
229
|
}
|
|
252
230
|
return entity;
|
|
253
231
|
};
|
|
254
|
-
const getEntityDetails = (entity, lineItemLocalData, vendorUpdates
|
|
232
|
+
const getEntityDetails = (entity, lineItemLocalData, vendorUpdates) => {
|
|
255
233
|
var _a, _b, _c, _d;
|
|
256
234
|
if (entity != null) {
|
|
257
235
|
return {
|
|
@@ -265,14 +243,6 @@ const getEntityDetails = (entity, lineItemLocalData, vendorUpdates, customerUpda
|
|
|
265
243
|
entityType: lineItemLocalData.vendor != null ? 'vendor' : 'customer',
|
|
266
244
|
};
|
|
267
245
|
}
|
|
268
|
-
if (customerUpdates != null &&
|
|
269
|
-
Boolean(customerUpdates.id) === true &&
|
|
270
|
-
customerUpdates.id != null) {
|
|
271
|
-
return {
|
|
272
|
-
entityId: customerUpdates.id,
|
|
273
|
-
entityType: 'customer',
|
|
274
|
-
};
|
|
275
|
-
}
|
|
276
246
|
if (vendorUpdates != null && vendorUpdates.id != null) {
|
|
277
247
|
return {
|
|
278
248
|
entityId: vendorUpdates.id,
|
|
@@ -126,12 +126,8 @@ function preparePayload(transactionState, vendorState, transactionDetailState, t
|
|
|
126
126
|
const detail = (0, transactionSelector_1.getSupportedTransactionById)(transactionState, transactionDetailKey);
|
|
127
127
|
const tranDetail = (0, get_1.default)(transactionDetailState.transactionDetailById, transactionDetailKey, undefined);
|
|
128
128
|
const tranVendorUpdates = tranDetail === null || tranDetail === void 0 ? void 0 : tranDetail.transactionDetailLocalData.vendorUpdates;
|
|
129
|
-
const tranCustomerUpdates = tranDetail === null || tranDetail === void 0 ? void 0 : tranDetail.transactionDetailLocalData.customerUpdates;
|
|
130
|
-
const currentSelectedEntity = tranDetail === null || tranDetail === void 0 ? void 0 : tranDetail.transactionDetailLocalData.selectedEntity;
|
|
131
129
|
let vendorUpdates = undefined;
|
|
132
|
-
if ((tranVendorUpdates === null || tranVendorUpdates === void 0 ? void 0 : tranVendorUpdates.qboId) != null
|
|
133
|
-
currentSelectedEntity != null &&
|
|
134
|
-
currentSelectedEntity.type === 'vendor') {
|
|
130
|
+
if ((tranVendorUpdates === null || tranVendorUpdates === void 0 ? void 0 : tranVendorUpdates.qboId) != null) {
|
|
135
131
|
const vendor = (0, vendorSelector_1.getVendorByVendorId)(vendorState, tranVendorUpdates.qboId);
|
|
136
132
|
if (vendor != null) {
|
|
137
133
|
vendorUpdates = {
|
|
@@ -146,17 +142,8 @@ function preparePayload(transactionState, vendorState, transactionDetailState, t
|
|
|
146
142
|
};
|
|
147
143
|
}
|
|
148
144
|
}
|
|
149
|
-
let customerUpdates = undefined;
|
|
150
|
-
if ((tranCustomerUpdates === null || tranCustomerUpdates === void 0 ? void 0 : tranCustomerUpdates.qboId) != null &&
|
|
151
|
-
currentSelectedEntity != null &&
|
|
152
|
-
currentSelectedEntity.type === 'customer') {
|
|
153
|
-
customerUpdates = {
|
|
154
|
-
id: tranCustomerUpdates.qboId,
|
|
155
|
-
name: tranCustomerUpdates.name,
|
|
156
|
-
};
|
|
157
|
-
}
|
|
158
145
|
if (detail != null) {
|
|
159
|
-
const transUpdates = toTransactionUpdatePayload(saveUpdates.updates, detail, vendorUpdates
|
|
146
|
+
const transUpdates = toTransactionUpdatePayload(saveUpdates.updates, detail, vendorUpdates);
|
|
160
147
|
const entityUpdates = toEntityUpdatePayload(saveUpdates.entityRelatedUpdates);
|
|
161
148
|
return {
|
|
162
149
|
entity_related_updates: entityUpdates,
|
|
@@ -166,7 +153,7 @@ function preparePayload(transactionState, vendorState, transactionDetailState, t
|
|
|
166
153
|
}
|
|
167
154
|
return undefined;
|
|
168
155
|
}
|
|
169
|
-
const toTransactionUpdatePayload = (updates, detail, vendorUpdates
|
|
156
|
+
const toTransactionUpdatePayload = (updates, detail, vendorUpdates) => {
|
|
170
157
|
var _a, _b;
|
|
171
158
|
const transaction = Object.assign({}, detail);
|
|
172
159
|
transaction.memo = (_a = updates.memo) !== null && _a !== void 0 ? _a : '';
|
|
@@ -210,12 +197,7 @@ const toTransactionUpdatePayload = (updates, detail, vendorUpdates, customerUpda
|
|
|
210
197
|
return (0, customerTransactionPayload_1.toCustomerTransactionPayload)(transaction);
|
|
211
198
|
}
|
|
212
199
|
else if ((0, vendorTransaction_1.isVendorTransaction)(transaction)) {
|
|
213
|
-
|
|
214
|
-
return (0, vendorTransactionPayload_1.toVendorTransactionWithCustomerPayload)(transaction, vendorUpdates, customerUpdates);
|
|
215
|
-
}
|
|
216
|
-
else {
|
|
217
|
-
return (0, vendorTransactionPayload_1.toVendorTransactionPayload)(transaction, vendorUpdates);
|
|
218
|
-
}
|
|
200
|
+
return (0, vendorTransactionPayload_1.toVendorTransactionPayload)(transaction, vendorUpdates);
|
|
219
201
|
}
|
|
220
202
|
else if ((0, otherTransaction_1.isTransferTransaction)(transaction)) {
|
|
221
203
|
return (0, otherTransactionPayload_1.toTransferTransactionPayload)(transaction);
|