@zeniai/client-epic-state 5.2.69 → 5.2.70
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/entity/actualMatching/actualMatchingReducer.d.ts +1 -3
- package/lib/entity/actualMatching/actualMatchingReducer.js +2 -11
- package/lib/entity/aiCfo/aiCfoState.d.ts +2 -2
- package/lib/entity/billPay/billTransaction/billTransactionState.d.ts +2 -2
- package/lib/entity/chargeCardTransaction/chargeCardTransaction.d.ts +1 -1
- package/lib/entity/depositAccountTransaction/depositAccountTransaction.d.ts +1 -1
- package/lib/entity/invoicing/plan/planPayload.d.ts +40 -0
- package/lib/entity/invoicing/plan/planPayload.js +51 -0
- package/lib/entity/invoicing/plan/planReducer.d.ts +14 -0
- package/lib/entity/invoicing/{invoicingCatalog/invoicingCatalogReducer.js → plan/planReducer.js} +21 -20
- package/lib/entity/invoicing/{invoicingCatalog/invoicingCatalogSelector.d.ts → plan/planSelector.d.ts} +6 -5
- package/lib/entity/invoicing/{invoicingCatalog/invoicingCatalogSelector.js → plan/planSelector.js} +12 -12
- package/lib/entity/invoicing/plan/planState.d.ts +43 -0
- package/lib/entity/invoicing/{invoicingCatalog/invoicingCatalogPayload.d.ts → product/productPayload.d.ts} +6 -44
- package/lib/entity/invoicing/{invoicingCatalog/invoicingCatalogPayload.js → product/productPayload.js} +6 -50
- package/lib/entity/invoicing/product/productReducer.d.ts +9 -0
- package/lib/entity/invoicing/product/productReducer.js +50 -0
- package/lib/entity/invoicing/product/productSelector.d.ts +4 -0
- package/lib/entity/invoicing/product/productSelector.js +17 -0
- package/lib/entity/invoicing/{invoicingCatalog/invoicingCatalogState.d.ts → product/productState.d.ts} +6 -42
- package/lib/entity/invoicing/product/productState.js +2 -0
- package/lib/entity/jeSchedules/jeSchedulesPayload.d.ts +0 -1
- package/lib/entity/jeSchedules/jeSchedulesPayload.js +0 -1
- package/lib/entity/jeSchedules/jeSchedulesState.d.ts +0 -1
- package/lib/entity/jeSchedules/jeSchedulesTypes.d.ts +4 -4
- package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.js +0 -3
- package/lib/entity/transaction/payloadTypes/transactionLinePayload.js +10 -2
- package/lib/epic.d.ts +2 -4
- package/lib/epic.js +1 -5
- package/lib/esm/entity/actualMatching/actualMatchingReducer.js +1 -9
- package/lib/esm/entity/invoicing/plan/planPayload.js +47 -0
- package/lib/esm/entity/invoicing/{invoicingCatalog/invoicingCatalogReducer.js → plan/planReducer.js} +20 -19
- package/lib/esm/entity/invoicing/{invoicingCatalog/invoicingCatalogSelector.js → plan/planSelector.js} +8 -8
- package/lib/esm/entity/invoicing/{invoicingCatalog/invoicingCatalogPayload.js → product/productPayload.js} +3 -46
- package/lib/esm/entity/invoicing/product/productReducer.js +43 -0
- package/lib/esm/entity/invoicing/product/productSelector.js +10 -0
- package/lib/esm/entity/invoicing/product/productState.js +1 -0
- package/lib/esm/entity/jeSchedules/jeSchedulesPayload.js +0 -1
- package/lib/esm/entity/snackbar/snackbarTypes.js +0 -3
- package/lib/esm/entity/transaction/payloadTypes/transactionLinePayload.js +10 -2
- package/lib/esm/epic.js +1 -5
- package/lib/esm/index.js +11 -9
- package/lib/esm/reducer.js +7 -4
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/actualMatching/fetchActualMatchingMatchEpic.js +2 -4
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/actualMatching/matchAndReverseAccrualsEpic.js +13 -26
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/actualMatching/searchMatchTransactionsEpic.js +23 -2
- package/lib/esm/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.js +2 -1
- package/lib/esm/view/expenseAutomationView/reducers/actualMatchingViewReducer.js +38 -89
- package/lib/esm/view/expenseAutomationView/selectors/actualMatchingViewSelector.js +64 -66
- package/lib/esm/view/expenseAutomationView/types/actualMatchingViewState.js +0 -15
- package/lib/esm/view/invoicing/createInvoice/createInvoiceEpic.js +1 -9
- package/lib/esm/view/invoicing/createInvoice/createInvoiceSelector.js +1 -1
- package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewSelector.js +3 -5
- package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/fetchInvoicingCatalogItemDetailEpic.js +2 -2
- package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/runInvoicingCatalogPlanActionEpic.js +2 -2
- package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/runInvoicingCatalogProductActionEpic.js +4 -4
- package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/saveInvoicingCatalogItemEpic.js +7 -3
- package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/seedInvoicingCatalogItemFormDraftEpic.js +2 -2
- package/lib/esm/view/invoicing/editInvoicingCustomerDetailView/editInvoicingCustomerDetailViewReducer.js +1 -5
- package/lib/esm/view/invoicing/editInvoicingSubscriptionDetailView/saveInvoicingSubscriptionEpic.js +1 -5
- package/lib/esm/view/invoicing/invoiceList/invoiceListReducer.js +1 -8
- package/lib/esm/view/invoicing/invoicingCatalogListView/epics/fetchInvoicingCatalogPlanListEpic.js +2 -2
- package/lib/esm/view/invoicing/invoicingCatalogListView/epics/fetchInvoicingCatalogProductListEpic.js +2 -2
- package/lib/esm/view/invoicing/invoicingCatalogListView/invoicingCatalogListViewSelector.js +4 -4
- package/lib/esm/view/invoicing/settingsView/settingsViewSelector.js +9 -18
- package/lib/esm/view/invoicing/settingsView/submitInvoicingBrandingFormEpic.js +2 -11
- package/lib/esm/view/onboardingView/customerView/epic/customerDetails/updateOnboardingCustomerViewEpic.js +11 -31
- package/lib/esm/view/onboardingView/customerView/onboardingCustomerViewReducer.js +1 -2
- package/lib/esm/view/spendManagement/billPay/editBillView/editBillViewSelector.js +30 -4
- package/lib/esm/view/spendManagement/commonSetup/setupViewReducer.js +1 -21
- package/lib/esm/view/spendManagement/commonSetup/setupViewSelector.js +1 -2
- package/lib/index.d.ts +16 -13
- package/lib/index.js +60 -65
- package/lib/reducer.d.ts +2 -1
- package/lib/reducer.js +7 -4
- package/lib/rootStateTypes.d.ts +5 -3
- package/lib/view/expenseAutomationView/epics/jeSchedule/actualMatching/fetchActualMatchingMatchEpic.d.ts +2 -2
- package/lib/view/expenseAutomationView/epics/jeSchedule/actualMatching/fetchActualMatchingMatchEpic.js +1 -3
- package/lib/view/expenseAutomationView/epics/jeSchedule/actualMatching/matchAndReverseAccrualsEpic.js +11 -24
- package/lib/view/expenseAutomationView/epics/jeSchedule/actualMatching/searchMatchTransactionsEpic.js +22 -1
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.js +2 -1
- package/lib/view/expenseAutomationView/payload/actualMatchingPayload.d.ts +1 -12
- package/lib/view/expenseAutomationView/reducers/actualMatchingViewReducer.d.ts +8 -19
- package/lib/view/expenseAutomationView/reducers/actualMatchingViewReducer.js +39 -90
- package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.d.ts +2 -2
- package/lib/view/expenseAutomationView/selectorTypes/actualMatchingViewSelectorTypes.d.ts +8 -20
- package/lib/view/expenseAutomationView/selectors/actualMatchingViewSelector.d.ts +4 -7
- package/lib/view/expenseAutomationView/selectors/actualMatchingViewSelector.js +64 -69
- package/lib/view/expenseAutomationView/types/actualMatchingViewState.d.ts +4 -20
- package/lib/view/expenseAutomationView/types/actualMatchingViewState.js +1 -18
- package/lib/view/invoicing/createInvoice/createInvoiceEpic.d.ts +2 -3
- package/lib/view/invoicing/createInvoice/createInvoiceEpic.js +0 -8
- package/lib/view/invoicing/createInvoice/createInvoiceSelector.d.ts +2 -2
- package/lib/view/invoicing/createInvoice/createInvoiceSelector.js +2 -2
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewPayload.d.ts +9 -8
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewSelector.d.ts +2 -2
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewSelector.js +3 -5
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/fetchInvoicingCatalogItemDetailEpic.d.ts +2 -2
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/fetchInvoicingCatalogItemDetailEpic.js +2 -2
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/invoicingCatalogItemFormHelper.d.ts +4 -3
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/runInvoicingCatalogPlanActionEpic.d.ts +2 -2
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/runInvoicingCatalogPlanActionEpic.js +2 -2
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/runInvoicingCatalogProductActionEpic.d.ts +3 -2
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/runInvoicingCatalogProductActionEpic.js +4 -4
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/saveInvoicingCatalogItemEpic.d.ts +3 -2
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/saveInvoicingCatalogItemEpic.js +7 -3
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/seedInvoicingCatalogItemFormDraftEpic.js +2 -2
- package/lib/view/invoicing/editInvoicingCustomerDetailView/editInvoicingCustomerDetailViewReducer.d.ts +1 -3
- package/lib/view/invoicing/editInvoicingCustomerDetailView/editInvoicingCustomerDetailViewReducer.js +2 -6
- package/lib/view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewSelector.d.ts +2 -2
- package/lib/view/invoicing/editInvoicingSubscriptionDetailView/saveInvoicingSubscriptionEpic.d.ts +1 -3
- package/lib/view/invoicing/editInvoicingSubscriptionDetailView/saveInvoicingSubscriptionEpic.js +1 -5
- package/lib/view/invoicing/invoiceList/invoiceListReducer.d.ts +1 -3
- package/lib/view/invoicing/invoiceList/invoiceListReducer.js +2 -9
- package/lib/view/invoicing/invoicingCatalogListView/epics/fetchInvoicingCatalogListPageEpic.d.ts +2 -2
- package/lib/view/invoicing/invoicingCatalogListView/epics/fetchInvoicingCatalogPlanListEpic.d.ts +2 -2
- package/lib/view/invoicing/invoicingCatalogListView/epics/fetchInvoicingCatalogPlanListEpic.js +2 -2
- package/lib/view/invoicing/invoicingCatalogListView/epics/fetchInvoicingCatalogProductListEpic.d.ts +2 -2
- package/lib/view/invoicing/invoicingCatalogListView/epics/fetchInvoicingCatalogProductListEpic.js +2 -2
- package/lib/view/invoicing/invoicingCatalogListView/invoicingCatalogListViewPayload.d.ts +3 -3
- package/lib/view/invoicing/invoicingCatalogListView/invoicingCatalogListViewSelector.d.ts +5 -4
- package/lib/view/invoicing/invoicingCatalogListView/invoicingCatalogListViewSelector.js +4 -4
- package/lib/view/invoicing/invoicingCatalogListView/invoicingCatalogListViewState.d.ts +1 -1
- package/lib/view/invoicing/invoicingDunningCaseListView/invoicingDunningCaseListViewReducer.d.ts +1 -1
- package/lib/view/invoicing/invoicingDunningCaseListView/invoicingDunningCaseListViewState.d.ts +1 -1
- package/lib/view/invoicing/invoicingSubscriptionListView/invoicingSubscriptionListViewReducer.d.ts +1 -1
- package/lib/view/invoicing/invoicingSubscriptionListView/invoicingSubscriptionListViewState.d.ts +1 -1
- package/lib/view/invoicing/settingsView/settingsViewSelector.d.ts +3 -12
- package/lib/view/invoicing/settingsView/settingsViewSelector.js +8 -17
- package/lib/view/invoicing/settingsView/submitInvoicingBrandingFormEpic.js +2 -11
- package/lib/view/onboardingView/customerView/epic/customerDetails/updateOnboardingCustomerViewEpic.js +11 -31
- package/lib/view/onboardingView/customerView/onboardingCustomerViewReducer.d.ts +2 -3
- package/lib/view/onboardingView/customerView/onboardingCustomerViewReducer.js +1 -2
- package/lib/view/onboardingView/customerView/onboardingCustomerViewState.d.ts +0 -4
- package/lib/view/scheduleView/scheduleListView/scheduleListTypes.d.ts +1 -1
- package/lib/view/spendManagement/billPay/billList/billListReducer.d.ts +5 -5
- package/lib/view/spendManagement/billPay/billList/billListState.d.ts +1 -1
- package/lib/view/spendManagement/billPay/editBillView/editBillViewReducer.d.ts +2 -2
- package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.d.ts +1 -1
- package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.js +30 -4
- package/lib/view/spendManagement/commonSetup/setupViewReducer.d.ts +1 -1
- package/lib/view/spendManagement/commonSetup/setupViewReducer.js +2 -22
- package/lib/view/spendManagement/commonSetup/setupViewSelector.d.ts +0 -1
- package/lib/view/spendManagement/commonSetup/setupViewSelector.js +1 -2
- package/lib/view/spendManagement/commonSetup/setupViewState.d.ts +0 -1
- package/lib/view/spendManagement/commonSetup/types/businessVerification.d.ts +1 -2
- package/lib/view/spendManagement/reimbursement/editRemiView/editRemiViewReducer.d.ts +2 -2
- package/lib/view/spendManagement/reimbursement/remiListView/remiListReducer.d.ts +5 -5
- package/lib/view/spendManagement/reimbursement/remiListView/remiListState.d.ts +2 -2
- package/package.json +1 -1
- package/lib/entity/invoicing/invoicingCatalog/invoicingCatalogReducer.d.ts +0 -12
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/actualMatching/ignoreActualMatchingSuggestionEpic.js +0 -50
- package/lib/esm/view/spendManagement/commonSetup/epic/setup/resetKycKybEpic.js +0 -37
- package/lib/view/expenseAutomationView/epics/jeSchedule/actualMatching/ignoreActualMatchingSuggestionEpic.d.ts +0 -10
- package/lib/view/expenseAutomationView/epics/jeSchedule/actualMatching/ignoreActualMatchingSuggestionEpic.js +0 -54
- package/lib/view/spendManagement/commonSetup/epic/setup/resetKycKybEpic.d.ts +0 -8
- package/lib/view/spendManagement/commonSetup/epic/setup/resetKycKybEpic.js +0 -41
- /package/lib/entity/invoicing/{invoicingCatalog/invoicingCatalogState.js → plan/planState.js} +0 -0
- /package/lib/esm/entity/invoicing/{invoicingCatalog/invoicingCatalogState.js → plan/planState.js} +0 -0
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import recordGet from 'lodash/get';
|
|
2
|
-
export function
|
|
3
|
-
const
|
|
4
|
-
.map((id) =>
|
|
2
|
+
export function getInvoicingPlansByIds(planState, ids) {
|
|
3
|
+
const plans = ids
|
|
4
|
+
.map((id) => getInvoicingPlanById(planState, id))
|
|
5
5
|
.filter((value) => value != null);
|
|
6
|
-
return
|
|
6
|
+
return plans;
|
|
7
7
|
}
|
|
8
|
-
export function
|
|
9
|
-
return recordGet(
|
|
8
|
+
export function getInvoicingPlanById(planState, id) {
|
|
9
|
+
return recordGet(planState.planByID, id);
|
|
10
10
|
}
|
|
11
11
|
/**
|
|
12
12
|
* A price point counts while it is active. A missing status is treated as
|
|
@@ -30,8 +30,8 @@ export const invoicingPricePointDisplayAmount = (pricePoint) => pricePoint.displ
|
|
|
30
30
|
* points are priced in different currencies, where the smallest number is not
|
|
31
31
|
* the lowest price. A zero is a real price and wins on its merits.
|
|
32
32
|
*/
|
|
33
|
-
export const
|
|
34
|
-
const amounts = (
|
|
33
|
+
export const getLowestInvoicingPlanPricePointAmount = (plan) => {
|
|
34
|
+
const amounts = (plan?.subFamilies ?? [])
|
|
35
35
|
.filter(isActiveInvoicingPricePoint)
|
|
36
36
|
.map(invoicingPricePointDisplayAmount)
|
|
37
37
|
.filter((amount) => amount != null);
|
|
@@ -3,7 +3,7 @@ import { defaultCustomerCurrency } from '../../../commonStateTypes/currencyHelpe
|
|
|
3
3
|
import { date } from '../../../zeniDayJS';
|
|
4
4
|
import { firstSelectableInvoicingId } from '../invoicingCommonPayload';
|
|
5
5
|
// ── Payload → State mappers (snake_case wire shape → camelCase domain shape) ──
|
|
6
|
-
export const
|
|
6
|
+
export const mapInvoicingPlanTierPayloadToState = (payload, currencyCode, currencySymbol) => ({
|
|
7
7
|
price: toAmount(payload.price, currencyCode, currencySymbol),
|
|
8
8
|
startingUnit: payload.starting_unit,
|
|
9
9
|
endingUnit: payload.ending_unit,
|
|
@@ -29,7 +29,7 @@ const mapInvoicingAccountingDetailPayloadToState = (payload) => ({
|
|
|
29
29
|
]),
|
|
30
30
|
sku: payload.sku,
|
|
31
31
|
});
|
|
32
|
-
export const
|
|
32
|
+
export const mapInvoicingProductPayloadToState = (payload) => {
|
|
33
33
|
const currencyCode = payload.currency_code ?? defaultCustomerCurrency.currencyCode;
|
|
34
34
|
const currencySymbol = payload.currency_symbol ?? defaultCustomerCurrency.currencySymbol;
|
|
35
35
|
return {
|
|
@@ -76,7 +76,7 @@ export const mapInvoicingCatalogPricePointPayloadToState = (payload) => {
|
|
|
76
76
|
showDescriptionInQuotes: payload.show_description_in_quotes,
|
|
77
77
|
status: payload.status,
|
|
78
78
|
subscriptionCount: payload.subscription_count ?? 0,
|
|
79
|
-
tiers: payload.tiers?.map((tier) =>
|
|
79
|
+
tiers: payload.tiers?.map((tier) => mapInvoicingPlanTierPayloadToState(tier, currencyCode, currencySymbol)),
|
|
80
80
|
trialEndAction: payload.trial_end_action,
|
|
81
81
|
trialPeriod: payload.trial_period,
|
|
82
82
|
trialPeriodUnit: payload.trial_period_unit,
|
|
@@ -87,46 +87,3 @@ export const mapInvoicingCatalogPricePointPayloadToState = (payload) => {
|
|
|
87
87
|
usageCalculation: payload.usage_calculation,
|
|
88
88
|
};
|
|
89
89
|
};
|
|
90
|
-
// ── Payload → State mappers (snake_case wire shape → camelCase domain shape) ──
|
|
91
|
-
export const mapInvoicingCatalogItemPayloadToState = (payload) => {
|
|
92
|
-
const currencyCode = payload.currency_code ?? defaultCustomerCurrency.currencyCode;
|
|
93
|
-
const currencySymbol = payload.currency_symbol ?? defaultCustomerCurrency.currencySymbol;
|
|
94
|
-
return {
|
|
95
|
-
id: payload.id,
|
|
96
|
-
applicableItems: payload.applicable_items,
|
|
97
|
-
archivedAt: payload.archived_at != null ? date(payload.archived_at) : undefined,
|
|
98
|
-
billingCycles: payload.billing_cycles,
|
|
99
|
-
createdAt: payload.created_at != null ? date(payload.created_at) : undefined,
|
|
100
|
-
currencyCode: payload.currency_code,
|
|
101
|
-
description: payload.description,
|
|
102
|
-
enabledForCheckout: payload.enabled_for_checkout,
|
|
103
|
-
enabledInPortal: payload.enabled_in_portal,
|
|
104
|
-
externalId: payload.external_id,
|
|
105
|
-
externalName: payload.external_name,
|
|
106
|
-
giftClaimRedirectUrl: payload.gift_claim_redirect_url,
|
|
107
|
-
includedInMrr: payload.included_in_mrr,
|
|
108
|
-
isGiftable: payload.is_giftable,
|
|
109
|
-
isShippable: payload.is_shippable,
|
|
110
|
-
itemApplicability: payload.item_applicability,
|
|
111
|
-
itemFamilyID: payload.item_family_id,
|
|
112
|
-
itemType: payload.item_type,
|
|
113
|
-
metadata: payload.metadata,
|
|
114
|
-
metered: payload.metered,
|
|
115
|
-
name: payload.name,
|
|
116
|
-
period: payload.period,
|
|
117
|
-
periodUnit: payload.period_unit,
|
|
118
|
-
productCode: payload.product_code,
|
|
119
|
-
price: payload.price != null
|
|
120
|
-
? toAmount(payload.price, currencyCode, currencySymbol)
|
|
121
|
-
: undefined,
|
|
122
|
-
subFamilies: payload.sub_families?.map(mapInvoicingCatalogPricePointPayloadToState),
|
|
123
|
-
status: payload.status,
|
|
124
|
-
tiers: payload.tiers?.map((tier) => mapInvoicingCatalogTierPayloadToState(tier, currencyCode, currencySymbol)),
|
|
125
|
-
trialPeriod: payload.trial_period,
|
|
126
|
-
trialPeriodUnit: payload.trial_period_unit,
|
|
127
|
-
type: payload.type,
|
|
128
|
-
unit: payload.unit,
|
|
129
|
-
updatedAt: payload.updated_at != null ? date(payload.updated_at) : undefined,
|
|
130
|
-
usageCalculation: payload.usage_calculation,
|
|
131
|
-
};
|
|
132
|
-
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { createSlice } from '@reduxjs/toolkit';
|
|
2
|
+
import assignWith from 'lodash/assignWith';
|
|
3
|
+
import { clearAll } from '../../../rootActions';
|
|
4
|
+
import { mapInvoicingProductPayloadToState, } from './productPayload';
|
|
5
|
+
export const initialState = { productByID: {} };
|
|
6
|
+
const product = createSlice({
|
|
7
|
+
name: 'invoicingProduct',
|
|
8
|
+
initialState,
|
|
9
|
+
reducers: {
|
|
10
|
+
updateInvoicingProducts: {
|
|
11
|
+
reducer(draft, action) {
|
|
12
|
+
doUpdateInvoicingProducts(draft.productByID, action.payload, action.meta.updateType);
|
|
13
|
+
},
|
|
14
|
+
prepare(payload, updateType = 'replace') {
|
|
15
|
+
return { payload, meta: { updateType } };
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
removeInvoicingProduct(draft, action) {
|
|
19
|
+
delete draft.productByID[action.payload];
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
extraReducers: (builder) => {
|
|
23
|
+
builder.addCase(clearAll, (draft) => {
|
|
24
|
+
Object.assign(draft, initialState);
|
|
25
|
+
});
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
export const { updateInvoicingProducts, removeInvoicingProduct } = product.actions;
|
|
29
|
+
export default product.reducer;
|
|
30
|
+
/**
|
|
31
|
+
* Helper functions.
|
|
32
|
+
*/
|
|
33
|
+
function doUpdateInvoicingProducts(draft, payload, updateType) {
|
|
34
|
+
payload.forEach((productPayload) => {
|
|
35
|
+
const latestProduct = mapInvoicingProductPayloadToState(productPayload);
|
|
36
|
+
if (latestProduct.id in draft && updateType === 'merge') {
|
|
37
|
+
assignWith(draft[latestProduct.id], latestProduct, (objValue, srcValue) => (srcValue == null ? objValue : srcValue));
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
draft[latestProduct.id] = latestProduct;
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import recordGet from 'lodash/get';
|
|
2
|
+
export function getInvoicingProductsByIds(productState, ids) {
|
|
3
|
+
const products = ids
|
|
4
|
+
.map((id) => getInvoicingProductById(productState, id))
|
|
5
|
+
.filter((value) => value != null);
|
|
6
|
+
return products;
|
|
7
|
+
}
|
|
8
|
+
export function getInvoicingProductById(productState, id) {
|
|
9
|
+
return recordGet(productState.productByID, id);
|
|
10
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -482,7 +482,6 @@ function toJEOneTimeAccrualMatchSuggestion(payload, currencyCode) {
|
|
|
482
482
|
matchedTransactionId: payload.matched_transaction_id ?? undefined,
|
|
483
483
|
matchedTransactionType: payload.matched_transaction_type ?? undefined,
|
|
484
484
|
matchedLineId: payload.matched_line_id ?? undefined,
|
|
485
|
-
consumedLineIds: payload.consumed_line_ids ?? undefined,
|
|
486
485
|
matchedAmount: payload.matched_amount != null
|
|
487
486
|
? toOneTimeAccrualAmount(payload.matched_amount, currencyCode)
|
|
488
487
|
: undefined,
|
|
@@ -11,7 +11,6 @@ const ALL_SNACKBAR_MESSAGE_SECTIONS = [
|
|
|
11
11
|
'je_posted',
|
|
12
12
|
'actual_matching_match_and_reverse',
|
|
13
13
|
'actual_matching_undo_reversal',
|
|
14
|
-
'actual_matching_ignore_suggestion',
|
|
15
14
|
'audit_score_updated',
|
|
16
15
|
'people_invite_people',
|
|
17
16
|
'people_invite_multiple_people',
|
|
@@ -237,7 +236,6 @@ const ALL_SNACKBAR_MESSAGE_SECTIONS = [
|
|
|
237
236
|
'accounting_projects_qbo_reconnect_failed',
|
|
238
237
|
'product_services_update',
|
|
239
238
|
'qbo_realm_id_update',
|
|
240
|
-
'kyc_kyb_reset',
|
|
241
239
|
'invoicing_dunning_case_resolved',
|
|
242
240
|
'invoicing_dunning_retry',
|
|
243
241
|
'invoicing_dunning_cancel',
|
|
@@ -267,7 +265,6 @@ const ALL_SNACKBAR_MESSAGE_SECTIONS = [
|
|
|
267
265
|
'invoicing_subscription_reactivated',
|
|
268
266
|
'invoicing_subscription_resumed',
|
|
269
267
|
'invoicing_subscription_term_end_changed',
|
|
270
|
-
'invoicing_data_import_download',
|
|
271
268
|
];
|
|
272
269
|
export const toSnackbarMessageSection = (v) => stringToUnion(v, ALL_SNACKBAR_MESSAGE_SECTIONS);
|
|
273
270
|
// Keeping this different from the message type, since we may not have messages in all instances
|
|
@@ -81,8 +81,13 @@ function getLineType(payload) {
|
|
|
81
81
|
const lineDetailType = payload.line_detail_type;
|
|
82
82
|
switch (lineDetailType) {
|
|
83
83
|
case 'sales_item_line_detail':
|
|
84
|
-
case 'item_based_expense_line_detail':
|
|
85
|
-
|
|
84
|
+
case 'item_based_expense_line_detail': {
|
|
85
|
+
const lineDetail = payload
|
|
86
|
+
.line_detail;
|
|
87
|
+
return lineDetail?.item == null
|
|
88
|
+
? 'transaction_with_account_and_class_line'
|
|
89
|
+
: 'transaction_with_product_or_service_line';
|
|
90
|
+
}
|
|
86
91
|
case 'journal_entry_line_detail':
|
|
87
92
|
return 'journal_entry_transaction_line';
|
|
88
93
|
case 'account_based_expense_line_detail':
|
|
@@ -90,6 +95,9 @@ function getLineType(payload) {
|
|
|
90
95
|
return 'transaction_with_account_and_class_line';
|
|
91
96
|
case 'sub_total_line_detail':
|
|
92
97
|
case 'description_only_line_detail':
|
|
98
|
+
case 'discount_line_detail':
|
|
99
|
+
case 'tax_line_detail':
|
|
100
|
+
case 'group_line_detail':
|
|
93
101
|
return 'transaction_info_line';
|
|
94
102
|
case 'deposit_without_account_line_detail':
|
|
95
103
|
case '':
|
package/lib/esm/epic.js
CHANGED
|
@@ -207,7 +207,6 @@ import { saveAccountSettingsViewEpic, } from './view/expenseAutomationView/epics
|
|
|
207
207
|
import { fetchActualMatchingEpic as fetchExpenseAutomationActualMatchingEpic, } from './view/expenseAutomationView/epics/jeSchedule/actualMatching/fetchActualMatchingEpic';
|
|
208
208
|
import { fetchActualMatchingMatchEpic as fetchExpenseAutomationActualMatchingMatchEpic, } from './view/expenseAutomationView/epics/jeSchedule/actualMatching/fetchActualMatchingMatchEpic';
|
|
209
209
|
import { fetchActualMatchingPageEpic as fetchExpenseAutomationActualMatchingPageEpic, } from './view/expenseAutomationView/epics/jeSchedule/actualMatching/fetchActualMatchingPageEpic';
|
|
210
|
-
import { ignoreActualMatchingSuggestionEpic, } from './view/expenseAutomationView/epics/jeSchedule/actualMatching/ignoreActualMatchingSuggestionEpic';
|
|
211
210
|
import { matchAndReverseAccrualsEpic, } from './view/expenseAutomationView/epics/jeSchedule/actualMatching/matchAndReverseAccrualsEpic';
|
|
212
211
|
import { searchMatchAccrualsEpic, } from './view/expenseAutomationView/epics/jeSchedule/actualMatching/searchMatchAccrualsEpic';
|
|
213
212
|
import { searchMatchTransactionsEpic, } from './view/expenseAutomationView/epics/jeSchedule/actualMatching/searchMatchTransactionsEpic';
|
|
@@ -530,8 +529,8 @@ import { approveOrRejectBillsBulkActionEpic, } from './view/spendManagement/bill
|
|
|
530
529
|
import { cancelOrDeleteBillsBulkActionEpic, } from './view/spendManagement/billPay/billsBulkActionView/epics/cancelOrDeleteBillsBulkActionEpic';
|
|
531
530
|
import { submitDraftBillsBulkActionEpic, } from './view/spendManagement/billPay/billsBulkActionView/epics/submitDraftBillsBulkActionEpic';
|
|
532
531
|
import { validateBillsBulkActionEpic, } from './view/spendManagement/billPay/billsBulkActionView/epics/validateBillsBulkActionEpic.ts';
|
|
533
|
-
import { applyBillRecommendationsToLocalStoreEpic, } from './view/spendManagement/billPay/editBillView/epics/applyBillRecommendationsToLocalStoreEpic';
|
|
534
532
|
import { convertAmountToHomeCurrencyEpic, } from './view/spendManagement/billPay/editBillView/epics/convertAmountToHomeCurrencyEpic';
|
|
533
|
+
import { applyBillRecommendationsToLocalStoreEpic, } from './view/spendManagement/billPay/editBillView/epics/applyBillRecommendationsToLocalStoreEpic';
|
|
535
534
|
import { fetchBillAndInitializeLocalStoreEpic, waitForBillDetailThenInitializeLocalStoreEpic, } from './view/spendManagement/billPay/editBillView/epics/fetchBillAndInitializeLocalStoreEpic';
|
|
536
535
|
import { fetchEditBillDetailPageEpic, } from './view/spendManagement/billPay/editBillView/epics/fetchEditBillDetailPageEpic';
|
|
537
536
|
import { fetchVendorAndUpdateBillLocalDataEpic, waitForVendorByIdThenSaveBillUpdatetoLocalStoreEpic, } from './view/spendManagement/billPay/editBillView/epics/fetchVendorAndUpdateBillLocalDataEpic';
|
|
@@ -611,7 +610,6 @@ import { fetchEntityHistoryEpic, } from './view/spendManagement/commonHistoryVie
|
|
|
611
610
|
import { enableSetupEpic, } from './view/spendManagement/commonSetup/epic/setup/enableSetupEpic';
|
|
612
611
|
import { parseUploadedKybDocumentEpic, } from './view/spendManagement/commonSetup/epic/setup/parseUploadedKybDocumentEpic';
|
|
613
612
|
import { parseUploadedKycDocumentEpic, } from './view/spendManagement/commonSetup/epic/setup/parseUploadedKycDocumentEpic';
|
|
614
|
-
import { resetKycKybEpic, } from './view/spendManagement/commonSetup/epic/setup/resetKycKybEpic';
|
|
615
613
|
import { updateBusinessVerificationDetailsEpic, } from './view/spendManagement/commonSetup/epic/setup/updateBusinessVerificationDetailsEpic';
|
|
616
614
|
import { updateSetupViewLocalStoreDataEpic, } from './view/spendManagement/commonSetup/epic/setup/updateSetupViewLocalStoreDataEpic';
|
|
617
615
|
import { fetchMerchantListEpic, } from './view/spendManagement/merchantList/fetchMerchantListEpic';
|
|
@@ -1271,7 +1269,6 @@ const ALL_EPICS = [
|
|
|
1271
1269
|
getOnboardingPlaidLinkTokenEpic,
|
|
1272
1270
|
getPaymentAccountsEpic,
|
|
1273
1271
|
getPlaidLinkTokenEpic,
|
|
1274
|
-
ignoreActualMatchingSuggestionEpic,
|
|
1275
1272
|
ignoreExpenseAutomationJEScheduleEpic,
|
|
1276
1273
|
improveUsingZeniGPTEpic,
|
|
1277
1274
|
includeAccountInReconciliationEpic,
|
|
@@ -1351,7 +1348,6 @@ const ALL_EPICS = [
|
|
|
1351
1348
|
resendOtpEpic,
|
|
1352
1349
|
resendReferralInviteEpic,
|
|
1353
1350
|
resendVerifyDeviceOTPEpic,
|
|
1354
|
-
resetKycKybEpic,
|
|
1355
1351
|
resetTransactionVendorLocalDataEpic,
|
|
1356
1352
|
resetVendorDetailLocalDataEpic,
|
|
1357
1353
|
resetVendorsTabVendorDetailLocalDataEpic,
|
package/lib/esm/index.js
CHANGED
|
@@ -188,7 +188,7 @@ import { toExpenseAutomationViewType, toExpenseAutomationViewTypeStrict, } from
|
|
|
188
188
|
import { computeNewScheduleJeDetails } from './view/expenseAutomationView/helpers/newScheduleLocalDataHelper';
|
|
189
189
|
import { isReviewTransactionBankTransferType, isReviewTransactionBillPaymentType, isReviewTransactionCreditCardCreditType, isReviewTransactionCreditCardPaymentType, isReviewTransactionDepositType, isReviewTransactionExpenseType, } from './view/expenseAutomationView/helpers/reconciliationHelpers';
|
|
190
190
|
import { MAX_SELECTION_LIMIT, checkIfAllLineItemsAreCategoryClassFilled, getLineItemsByTransactionIdsFromLocalData, isAnyItemWithUncategorizedExpenseAccount, } from './view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper';
|
|
191
|
-
import {
|
|
191
|
+
import { ackCloseMatchAfterUndo, clearActualMatchingView as clearExpenseAutomationActualMatchingView, clearMatchNewModal, closeMatchNewModal, fetchActualMatchingMatch, fetchActualMatching as fetchExpenseAutomationActualMatching, fetchActualMatchingPage as fetchExpenseAutomationActualMatchingPage, matchAndReverseAccruals, openMatchNewModal, searchMatchAccruals, searchMatchTransactions, undoReversalAccruals, updateActualMatchingUIState as updateExpenseAutomationActualMatchingUIState, } from './view/expenseAutomationView/reducers/actualMatchingViewReducer';
|
|
192
192
|
import { clearExpenseAutomationFluxAnalysisView, fetchFluxAnalysisView, reviewFluxAnalysisView, updateFluxAnalysisViewPageMetaData, updateFluxAnalysisViewUIState, updateOperatingExpensesIdsForReview, updateSelectedSectionIdsForReview, } from './view/expenseAutomationView/reducers/fluxAnalysisViewReducer';
|
|
193
193
|
import { clearJeScheduleLocalData as clearExpenseAutomationJEScheduleLocalData, clearExpenseAutomationJESchedulesView, clearSearchTransactionsForNewSchedule as clearJeSearchTransactionsForNewSchedule, createOneTimeAccrual, createOneTimeAccrualFailure, createOneTimeAccrualSuccess, fetchJeSchedulesPage as fetchExpenseAutomationJESchedulesPage, fetchOneTimeAccrual, ignoreRecommendedJeSchedule as ignoreExpenseAutomationJESchedule, ignoreOneTimeAccrual, initializeAccountSettingsView as initializeJeAccountSettingsView, initializeNewSchedule as initializeJeNewSchedule, initializeJeScheduleLocalData, promoteOneTimeAccrual, removeJeOneTimeAccrualLocalData, removeJeScheduleTransactionKey, resetNewScheduleLocalData as resetJeNewScheduleLocalData, retryJeSchedule as retryExpenseAutomationJESchedule, revertJeSchedule, revertOneTimeAccrual, saveAccountSettings as saveJeAccountSettings, saveAccountSettingsLocalData as saveJeAccountSettingsLocalData, saveNewSchedule as saveJeNewSchedule, saveNewScheduleFailure as saveJeNewScheduleFailure, saveNewScheduleSuccess as saveJeNewScheduleSuccess, searchTransactionsForNewSchedule as searchJeTransactionsForNewSchedule, searchTransactionsForNewScheduleFailure as searchJeTransactionsForNewScheduleFailure, searchTransactionsForNewScheduleSuccess as searchJeTransactionsForNewScheduleSuccess, toggleJECreatedGroupCollapsed, toggleJEFailedGroupCollapsed, toggleJEPendingGroupCollapsed, updateJESchedulesUIState as updateExpenseAutomationJESchedulesUIState, updateJEScheduleTypeFilter, updateNewScheduleLocalData as updateJeNewScheduleLocalData, updateJeOneTimeAccrualLocalData, updateJeScheduleLocalDataById, updateJeScheduleTransactionKeys, } from './view/expenseAutomationView/reducers/jeSchedulesViewReducer';
|
|
194
194
|
import { acknowledgeBulkUploadConfirmMatchComplete, bulkUploadAutomatchingTimedOut, bulkUploadReceipts, bulkUploadReceiptsFailure, bulkUploadReceiptsSuccess, clearBulkUpload, clearBulkUploadBatchDetailsForScopeChange, clearManualSearchResults, clearMissingReceiptsTabNavigation, confirmBulkUploadMatch, confirmBulkUploadMatchFailure, confirmBulkUploadMatchSuccess, fetchBulkUploadBatchDetails, fetchBulkUploadBatchDetailsFailure, fetchBulkUploadBatchDetailsSuccess, fetchBulkUploadBatches, fetchBulkUploadBatchesFailure, fetchBulkUploadBatchesSuccess, fetchCompletedTransactions, fetchCompletedTransactionsFailure, fetchCompletedTransactionsSuccess, fetchMissingReceipts as fetchExpenseAutomationMissingReceipts, fetchMoreBatchDetails, fetchMoreBatchDetailsComplete, fetchMoreBatchDetailsFailure, markBatchDetailRefreshAttempted, markMissingReceiptAsDone as markExpenseAutomationMissingReceiptAsDone, pusherBatchStatusUpdate, refreshBatchDetailsForBatchId, requestMissingReceiptsTabNavigation, restoreBulkUploadAutomatchingOnMount, restoreBulkUploadMatchingState, searchTransactionsForManualMatch, searchTransactionsForManualMatchFailure, searchTransactionsForManualMatchSuccess, setBulkUploadCompletedSubTab, setBulkUploadResultsTab, setBulkUploadSortConfig, setBulkUploadUploadedFileCount, storeBatchDetails, updateBulkUploadProgress, updateMissingReceiptUploadState as updateExpenseAutomationMissingReceiptUploadState, updateMissingReceiptsUIState as updateExpenseAutomationMissingReceiptsUIState, uploadMissingReceiptSuccess as uploadExpenseAutomationMissingReceiptSuccess, } from './view/expenseAutomationView/reducers/missingReceiptsViewReducer';
|
|
@@ -200,7 +200,7 @@ import { getExpenseAutomationReconciliationView, getLedgerAccountIdsWithStatemen
|
|
|
200
200
|
import { getExpenseAutomationTransactionView, getLastTransferEntryReplacement, } from './view/expenseAutomationView/selectors/transactionCategorizationSelector';
|
|
201
201
|
import { applyTransactionFilters } from './view/expenseAutomationView/transactionFilterHelpers';
|
|
202
202
|
import { TRANSACTION_FILTER_CATEGORIES, } from './view/expenseAutomationView/transactionFilterTypes';
|
|
203
|
-
import {
|
|
203
|
+
import { MATCH_ACCRUAL_SEARCH_LIMIT, MATCH_SEARCH_DEBOUNCE_MS, MATCH_TRANSACTION_SEARCH_PAGE_SIZE, actualMatchingTransactionLineKey, toActualMatchingSortKey as toExpenseAutomationActualMatchingSortKey, toMatchAndReverseResultStatus, toUndoReversalResultStatus, } from './view/expenseAutomationView/types/actualMatchingViewState';
|
|
204
204
|
import { DEFAULT_COMPLETED_SUB_TAB, toCompletedSubTab, } from './view/expenseAutomationView/types/completedSubTab';
|
|
205
205
|
import { ALL_JE_PAGE_TABS, toJEScheduleSortKey as toExpenseAutomationJEScheduleSortKey, toJEPageTab, } from './view/expenseAutomationView/types/jeSchedulesViewState';
|
|
206
206
|
import { BATCH_FILE_STATUSES, isUnmatchedTabFileStatus, toBatchFileStatus, toBatchStatusValue, toBulkUploadPhase, toBulkUploadResultsTab, toBulkUploadSortKey, toMatchSource, toMissingReceiptsTab, } from './view/expenseAutomationView/types/missingReceiptsViewState';
|
|
@@ -360,7 +360,7 @@ import { clearAiCardCreationFormDraft, fetchDepositAccountListForCards, fetchIss
|
|
|
360
360
|
import { getAiCardCreationFormDraft, getInFlightIssueChargeCardsCount, getIssueChargeCardView, getIssueChargeCardsSaveStatus, getLastIssueChargeCardsSourceChatSessionId, getLastIssuedChargeCardIds, selectIssueChargeCardLocalDataFromDraft, } from './view/spendManagement/chargeCards/issueChargeCard/issueChargeCardSelector';
|
|
361
361
|
import { toIssueChargeCardLocalDataFromDraft } from './view/spendManagement/chargeCards/issueChargeCard/toIssueChargeCardLocalDataFromDraft';
|
|
362
362
|
import { parseUploadedKybDocument, parseUploadedKycDocument, } from './view/spendManagement/commonSetup/kycKybAutofillActions';
|
|
363
|
-
import { applyKybDocumentAutofillForSetup, applyKycDocumentAutofillForSetup, clearKycKybAutofillForSetup,
|
|
363
|
+
import { applyKybDocumentAutofillForSetup, applyKycDocumentAutofillForSetup, clearKycKybAutofillForSetup, clearSetupViewDataInLocalStore, enableSetup, saveCompnayOfficerAdditionalDocumentsInLocalStore, saveCompnayOfficerPhoneInLocalStore, saveIndustryAndIncDateInLocalStore, saveSetupViewDataInLocalStore, saveTreasuryAdditionalDocumentsInLocalStore, updateBusinessVerificationDetails, updateSelectedCompanyOfficer, updateSetupViewLocalStoreData, } from './view/spendManagement/commonSetup/setupViewReducer';
|
|
364
364
|
import { getBusinessVerificationDetails, getCommonSetupViewDetails, } from './view/spendManagement/commonSetup/setupViewSelector';
|
|
365
365
|
import { COMPANY_ONBOARDING_INDUSTRY_TYPE_CODES, COMPANY_ONBOARDING_SUB_INDUSTRY_CODES_BY_INDUSTRY, COMPANY_PURPOSE_OF_ACCOUNT_CODES, COMPANY_SOURCE_OF_FUNDS_CODES, COMPANY_TRANSACTION_VOLUME_CODES, COMPANY_US_NEXUS_TYPE_CODES, getCompanyOnboardingSubIndustryCodesForIndustry, } from './view/spendManagement/commonSetup/types/businessVerification';
|
|
366
366
|
import { checkIfLowBalance, getBillListUniqueType, getBulkOperationSuffix, getRemiListUniqueType, getSelectedCompanyOfficer, getSpendManagementEffectiveListPeriod, isAwaitingMarkAsPaid, isBulkProcessing, isPaymentMethodOutsideZeni, isVerifiedPaymentAccountProviderStatusCode, isVerifiedStatusCode, showBillPayPromoPage, showReimbursementPromoPage, toAccountsPromoConfig, toSameDayAchDisablementConfig, } from './view/spendManagement/helpers';
|
|
@@ -492,7 +492,7 @@ export { stringToUnion, stringToUnionStrict };
|
|
|
492
492
|
export { fetchMonthEndCloseChecks, fetchMonthClosePerformanceTrend, getMonthEndCloseChecksViewByTenantId, ALL_MONTH_END_CLOSE_CHECKS_FREQUENCY, };
|
|
493
493
|
export {
|
|
494
494
|
// Bulk Upload Types
|
|
495
|
-
BATCH_FILE_STATUSES, isUnmatchedTabFileStatus, DEFAULT_COMPLETED_SUB_TAB, DEFAULT_TRANSACTION_GROUP, TRANSACTION_GROUPS, toTransactionGroup, toBatchFileStatus, toBatchStatusValue, toBulkUploadPhase, toBulkUploadResultsTab, toBulkUploadSortKey, toCompletedSubTab, toMatchSource, toMissingReceiptsTab,
|
|
495
|
+
BATCH_FILE_STATUSES, isUnmatchedTabFileStatus, DEFAULT_COMPLETED_SUB_TAB, DEFAULT_TRANSACTION_GROUP, TRANSACTION_GROUPS, toTransactionGroup, toBatchFileStatus, toBatchStatusValue, toBulkUploadPhase, toBulkUploadResultsTab, toBulkUploadSortKey, toCompletedSubTab, toMatchSource, toMissingReceiptsTab, actualMatchingTransactionLineKey, ALL_JE_PAGE_TABS, MATCH_ACCRUAL_SEARCH_LIMIT, MATCH_SEARCH_DEBOUNCE_MS, MATCH_TRANSACTION_SEARCH_PAGE_SIZE, toExpenseAutomationJEScheduleSortKey, toExpenseAutomationActualMatchingSortKey, toJEPageTab, toMatchAndReverseResultStatus, toUndoReversalResultStatus, toggleJECreatedGroupCollapsed, toggleJEFailedGroupCollapsed, toggleJEPendingGroupCollapsed, updateJEScheduleTypeFilter, getExpenseAutomationView, toExpenseAutomationMissingReceiptsSortKey, toExpenseAutomationTransactionsTabKey, toExpenseAutomationViewType, toExpenseAutomationViewTypeStrict, uploadExpenseAutomationMissingReceiptSuccess, markExpenseAutomationMissingReceiptAsDone, fetchAllExpenseAutomationTabs, refreshExpenseAutomationCurrentTab, updateCurrentSelectedTransactionCategorizationTab, updateTransactionCategorizationCompletedSubTab, updateTransactionGroup, fetchExpenseAutomationMissingReceipts,
|
|
496
496
|
// Bulk Upload Actions
|
|
497
497
|
bulkUploadReceipts, bulkUploadAutomatchingTimedOut, bulkUploadReceiptsSuccess, bulkUploadReceiptsFailure, restoreBulkUploadAutomatchingOnMount, restoreBulkUploadMatchingState, updateBulkUploadProgress, pusherBatchStatusUpdate, requestMissingReceiptsTabNavigation, clearMissingReceiptsTabNavigation, fetchBulkUploadBatchDetails, fetchBulkUploadBatchDetailsSuccess, fetchBulkUploadBatchDetailsFailure, storeBatchDetails, fetchMoreBatchDetails, fetchMoreBatchDetailsComplete, fetchMoreBatchDetailsFailure, fetchBulkUploadBatches, fetchBulkUploadBatchesSuccess, fetchBulkUploadBatchesFailure, clearBulkUploadBatchDetailsForScopeChange, markBatchDetailRefreshAttempted, refreshBatchDetailsForBatchId, confirmBulkUploadMatch, confirmBulkUploadMatchSuccess, confirmBulkUploadMatchFailure, setBulkUploadResultsTab, setBulkUploadCompletedSubTab, setBulkUploadSortConfig, setBulkUploadUploadedFileCount, clearBulkUpload, searchTransactionsForManualMatch, searchTransactionsForManualMatchSuccess, searchTransactionsForManualMatchFailure, clearManualSearchResults, acknowledgeBulkUploadConfirmMatchComplete, fetchCompletedTransactions, fetchCompletedTransactionsSuccess, fetchCompletedTransactionsFailure, fetchFluxAnalysisView, clearExpenseAutomationFluxAnalysisView, updateOperatingExpensesIdsForReview as updateFluxOperatingExpensesIdsForReview, updateSelectedSectionIdsForReview as updateFluxAnalysisSelectedSectionIdsForReview, reviewFluxAnalysisView, updateExpenseAutomationMissingReceiptUploadState, updateExpenseAutomationMissingReceiptsUIState, updateTransactionCategorizationUploadReceiptState, uploadTransactionCategorizationReceiptSuccess, getExpenseAutomationFluxAnalysisView, updateCurrentSelectedView, updateCurrentSelectedPeriod, getExpenseAutomationTransactionView, getLastTransferEntryReplacement, updateFluxAnalysisViewUIState, updateFluxAnalysisViewPageMetaData, MAX_SELECTION_LIMIT, checkIfAllLineItemsAreCategoryClassFilled, getLineItemsByTransactionIdsFromLocalData, isAnyItemWithUncategorizedExpenseAccount, excludeAccountFromReconciliation, includeAccountInReconciliation, saveExpenseAutomationReconciliationDetail, updateExpenseAutomationReconcileTabListScrollState, updateExpenseAutomationReconReviewTabListSortState, updateExpenseAutomationReconcileTabListSortState, updateExpenseAutomationReconcileTabLocalData, updateExpenseAutomationAccountReconciliationSelectedTab, updateExpenseAutomationAccountReconciliationSelectedAccountId, getExpenseAutomationReconciliationView, getLedgerAccountIdsWithStatementOverrideWarning, getLedgerAccountsForCombinedStatementMapping, getReparseStatementStatusByAccountId, getUnavailableLedgerAccountIds, fetchReconciliationView, uploadAccountStatementIntoDocumentAI, updateExpenseAutomationReconListScrollPosition, setConnectionInProgressForAccountReconciliation, getAccountReconByAccountIdAndSelectedPeriod, toReconciliationTabsType, isAccountReconReport, updateExpenseAutomationReconReviewTabLocalData, updateExpenseAutomationSelectedDrawerAccountId, updateStatementProcessingFailed, saveExpenseAutomationReconciliationReview, updateExpenseAutomationAccountReconciliationLocalData, toReconciliationAccountSource, deleteAccountStatement, deleteCombinedStatement, uploadAccountStatement, parseCombinedStatement, parseStatement, parseStatementSuccess, parseStatementFailure, reparseStatement, reparseStatementSuccess, reparseStatementFailure, resetReparseStatementStatus, updateParsedStatementData, updateNodeCollapseState, updateStatementUploadChosen, submitCombinedStatementUpdate, submitStatementUpdate, clearStatementDateConflict, confirmStatementMapping, updateStatementUpdateLocalData, isReviewTransactionBankTransferType, isReviewTransactionBillPaymentType, isReviewTransactionCreditCardPaymentType, isReviewTransactionDepositType, isReviewTransactionExpenseType, isReviewTransactionCreditCardCreditType, setStatementParseInProgress, setStatementProcessingDismissedToBackground, updateStatementProcessingBackgroundCompletedSteps, };
|
|
498
498
|
export { computeNewScheduleJeDetails, createOneTimeAccrual, createOneTimeAccrualFailure, createOneTimeAccrualSuccess, fetchOneTimeAccrual, getJeNewAccrualAccountsView, ignoreOneTimeAccrual, promoteOneTimeAccrual, revertJeSchedule, revertOneTimeAccrual, getJeNewScheduleSearchTransactionsView, getJeNewScheduleView, };
|
|
@@ -613,7 +613,7 @@ export { hideCreatedByFilter, };
|
|
|
613
613
|
// not Spend Management. Kept in a separate re-export block to make the
|
|
614
614
|
// separation visible at the barrel level.
|
|
615
615
|
export { TRANSACTION_FILTER_CATEGORIES, applyTransactionFilters, };
|
|
616
|
-
export { fetchBillPaySetupView, fetchZeniAccountSetupView, enableSetup, getPaymentAccounts, getPlaidLinkToken, updateSelectedCompanyOfficer, updateSetupViewLocalStoreData, updateBusinessVerificationDetails,
|
|
616
|
+
export { fetchBillPaySetupView, fetchZeniAccountSetupView, enableSetup, getPaymentAccounts, getPlaidLinkToken, updateSelectedCompanyOfficer, updateSetupViewLocalStoreData, updateBusinessVerificationDetails, updatePaymentAccount, updatePaymentAccountLoginStatus, updatePaymentAccountStatus, establishPlaidConnection, updateMappedCashAccount, updatePrimaryFundingAccount, acceptBillPayTerms, acceptZeniAccountTerms, acceptBillPayUpdatedTerms, saveSetupViewDataInLocalStore, saveCompnayOfficerPhoneInLocalStore, saveCompnayOfficerAdditionalDocumentsInLocalStore, saveTreasuryAdditionalDocumentsInLocalStore, saveIndustryAndIncDateInLocalStore, clearSetupViewDataInLocalStore, applyKycDocumentAutofillForSetup, applyKybDocumentAutofillForSetup, clearKycKybAutofillForSetup, parseUploadedKycDocument, parseUploadedKybDocument, sendOtp, resendOtp, verifyOtp, getBillPaySetupViewDetails, getPlaidAccountDetails, getPlaidPaymentAccounts, getZeniAccountSetupViewDetails, getBusinessVerificationDetails, getBillPayBusinessVerificationDetails, getZeniAccountBusinessVerificationDetails, getTreasuryBusinessVerificationDetails, getCommonSetupViewDetails, getTwoFactorAuthenticationView, getTwoFactorAuthenticationViewForCardUserOnboarding, getTwoFactorAuthenticationViewForChargeCardHolder, };
|
|
617
617
|
export { getApprovalRuleViewDetails, getBankConnectionsSetupViewDetails, getIntegrationsView, };
|
|
618
618
|
export { fetchUserFinancialAccount };
|
|
619
619
|
export { getUserFinancialAccount };
|
|
@@ -663,7 +663,7 @@ export { TIME_SERIES_DURATIONS, convertToTimeSeriesSelectionRange, toTimeSeriesD
|
|
|
663
663
|
export { fetchApAging, getApAgingReport, updateApAgingUIState, };
|
|
664
664
|
export { fetchApAgingDetail, getApAgingDetailForVendor, updateApAgingDetailUIState, };
|
|
665
665
|
export { clearExpenseAutomationJEScheduleLocalData, clearExpenseAutomationJESchedulesView, clearJeSearchTransactionsForNewSchedule, fetchExpenseAutomationJESchedulesPage, ignoreExpenseAutomationJESchedule, initializeJeAccountSettingsView, initializeJeNewSchedule, initializeJeScheduleLocalData, removeJeScheduleTransactionKey, resetJeNewScheduleLocalData, retryExpenseAutomationJESchedule, saveJeNewSchedule, saveJeNewScheduleFailure, saveJeNewScheduleSuccess, searchJeTransactionsForNewSchedule, searchJeTransactionsForNewScheduleFailure, searchJeTransactionsForNewScheduleSuccess, updateExpenseAutomationJESchedulesUIState, updateJeNewScheduleLocalData, removeJeOneTimeAccrualLocalData, updateJeOneTimeAccrualLocalData, updateJeScheduleLocalDataById, updateJeScheduleTransactionKeys, };
|
|
666
|
-
export {
|
|
666
|
+
export { ackCloseMatchAfterUndo, clearExpenseAutomationActualMatchingView, closeMatchNewModal, clearMatchNewModal, fetchExpenseAutomationActualMatching, fetchActualMatchingMatch, fetchExpenseAutomationActualMatchingPage, matchAndReverseAccruals, openMatchNewModal, searchMatchAccruals, searchMatchTransactions, undoReversalAccruals, updateExpenseAutomationActualMatchingUIState, };
|
|
667
667
|
export { createNewSchedulesAccrued, deleteScheduleAccruedDetail, cancelScheduleAccruedJournalEntry, fetchScheduleAccruedDetails, fetchScheduleAccruedDetailsPage, resetJEAccruedLinkInLocalData, saveScheduleAccruedDetails, updateAmountsInScheduleAccruedDetail, updatedJEAccruedLinkWithRecommendedLocalData, updatedJELinkInLocalDataAccruedExpenses, fetchRecommendedTransactionRowIndex, clearSelectedJELinkRowIndex, updateLinkBillExpenseLocalData, updateScheduleAccruedDetailsLocalData, updateSelectedJEAccruedScheduleKey, resetSelectedJEAccruedScheduleKey, resetAccruedDetailNewScheduleState, };
|
|
668
668
|
export { getJEScheduleTransactionKey, ALL_JE_SCHEDULE_IGNORE_REASONS, ALL_JE_SCHEDULE_REVERT_REASONS, ALL_ONE_TIME_ACCRUAL_IGNORE_REASONS, ALL_ONE_TIME_ACCRUAL_REVERT_REASONS, ALL_SCHEDULES_TYPES, getScheduleListReport, getAccruedScheduleListReport, fetchScheduleList, fetchAccruedScheduleList, fetchDownloadSchedules, fetchSchedulesAccount, updateScheduleListLocalData, getFetchStateForScheduleAccountList, toScheduleTypesType, toScheduleTypesTypeStrict, toScheduleListTabsFileTypeStrict, toScheduleSubTabType, updateScheduleListSubTab, updateScheduleListSearchText, updateScheduleListScrollState, updateScheduleListSortState, updateSelectedJEScheduleKey, fetchScheduleDetails, getScheduleDetailsView, getAccruedScheduleDetailsView, fetchScheduleDetailsPage, saveScheduleDetails, deleteScheduleDetail, createNewSchedules, updateScheduleDetailsLocalData, updateScheduleListDownloadState, updateAccruedJEScheduleAccruedByListKey, updatedSelectedJELinkRowIndex, getQBOUrlForLink, getThirdPartyIDFromQBOURL, updatedJELinkInLocalData, updateAmountsInScheduleDetail, resetJELinkInLocalData, updatedJELinkWithRecommendedLocalData, getFetchStateForScheduleListByType, getDefaultSelectedTimeframeForScheduleType, markAsCompleteScheduleDetail, resetMarkAsCompleteStatus, fetchVendorTabView, updateVendorTabViewTab, getVendorTabView, };
|
|
669
669
|
export { toVendorFirstReviewViewColumnKeyType, getGlobalMerchantAutoCompleteResults, getVendorFirstReviewView, getVendorFirstReviewAttachmentView, fetchVendorFirstReviewView, fetchVendorFirstReviewAttachments, updateVendorFirstReviewViewScrollYOffset, resetVendorFirstReviewLocalData, updateVendorFirstReviewViewPageToken, clearRecentlySavedErroredVendorData, saveVendorFirstReviewView, updateVendorFirstReviewViewLocalData, updateVendorFirstReviewSortUiState, fetchGlobalMerchantAutoCompleteView, clearGlobalMerchantAutoCompleteResults, updateReviewVendorDetailLocalData, saveVendorDetailsView, getVendorDetailSelectorView, };
|
|
@@ -841,12 +841,14 @@ export { getInvoicingDunningCaseListView } from './view/invoicing/invoicingDunni
|
|
|
841
841
|
export { clearInvoicingDunningCaseDetailView, fetchInvoicingDunningCaseDetail, fetchInvoicingDunningCaseDetailPage, fetchInvoicingDunningEmailPreviewPage, invalidateInvoicingDunningEmailPreview, } from './view/invoicing/invoicingDunningCaseDetailView/invoicingDunningCaseDetailViewReducer';
|
|
842
842
|
export { getInvoicingDunningCaseById, getInvoicingDunningCaseDetail, getInvoicingDunningEmailPreview, } from './view/invoicing/invoicingDunningCaseDetailView/invoicingDunningCaseDetailViewSelector';
|
|
843
843
|
// ── Invoicing: catalog (plans + products) ─────────────────────────────────────
|
|
844
|
-
export {
|
|
844
|
+
export { mergeInvoicingPlanSubFamily, removeInvoicingPlan, updateInvoicingPlans, } from './entity/invoicing/plan/planReducer';
|
|
845
|
+
export { removeInvoicingProduct, updateInvoicingProducts, } from './entity/invoicing/product/productReducer';
|
|
845
846
|
export { fetchInvoicingCatalogCounts, fetchInvoicingCatalogListPage, fetchInvoicingCatalogPlanList, fetchInvoicingCatalogProductList, updateInvoicingCatalogPlanFilters, updateInvoicingCatalogProductFilters, } from './view/invoicing/invoicingCatalogListView/invoicingCatalogListViewReducer';
|
|
846
847
|
export { ALL_INVOICING_PRODUCT_SORT_KEYS, INVOICING_PRODUCT_COLUMNS, } from './view/invoicing/invoicingCatalogListView/invoicingCatalogListViewState';
|
|
847
848
|
export { getInvoicingCatalogListView } from './view/invoicing/invoicingCatalogListView/invoicingCatalogListViewSelector';
|
|
848
849
|
export { fetchInvoicingCatalogItemDetail } from './view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewReducer';
|
|
849
|
-
export {
|
|
850
|
+
export { getInvoicingPlanById, getLowestInvoicingPlanPricePointAmount, } from './entity/invoicing/plan/planSelector';
|
|
851
|
+
export { getInvoicingProductById } from './entity/invoicing/product/productSelector';
|
|
850
852
|
// ── Invoicing: settings ───────────────────────────────────────────────────────
|
|
851
853
|
export { connectInvoicingStripe, disconnectInvoicingStripe, fetchInvoicingSettings, resetInvoicingBrandingFormDraft, resetInvoicingQboSettingsDraft, resetSaveInvoicingSettings, saveInvoicingSettings, submitInvoicingBrandingForm, submitInvoicingQboSettings, updateInvoicingBrandingFormDraft, updateInvoicingQboSettingsDraft, updateInvoicingSettings, } from './view/invoicing/settingsView/settingsViewReducer';
|
|
852
854
|
export { getInvoicingBrandingFormView, getInvoicingQboSettingsFormView, getInvoicingSettings, getInvoicingSettingsFetchState, getInvoicingSettingsHubView, getInvoicingSettingsView, } from './view/invoicing/settingsView/settingsViewSelector';
|
|
@@ -865,4 +867,4 @@ export { getInvoicingOnboardingGateView } from './view/invoicing/invoicingConfig
|
|
|
865
867
|
// Accrued JE schedules are not a discriminated union member, so consumers need this guard to
|
|
866
868
|
// narrow a JEScheduleRow before reading baseTransaction / recurringAmount.
|
|
867
869
|
export { getExpenseAutomationJEOneTimeAccrualDetailView, getJEScheduleRowType, isAccruedScheduleRow, isAiAccountantSchedule, isExistingTabRow, isOneTimeAccrualRow, isRenderableOneTimeAccrual, isPendingReviewRow, } from './view/expenseAutomationView/selectors/jeSchedulesViewSelector';
|
|
868
|
-
export { getActualMatchingAmount, getActualMatchingReversalDate,
|
|
870
|
+
export { getActualMatchingAmount, getActualMatchingReversalDate, getCloseMatchAfterUndo, parseActualMatchingMatchId, getExpenseAutomationActualMatchingMatchView, getExpenseAutomationActualMatchingView, isAutoReversedAccrual, isManuallyReversedAccrual, isPendingReviewAccrual, } from './view/expenseAutomationView/selectors/actualMatchingViewSelector';
|
package/lib/esm/reducer.js
CHANGED
|
@@ -2,7 +2,6 @@ import { combineReducers } from 'redux';
|
|
|
2
2
|
import account, { initialState as initialAccountState, } from './entity/account/accountReducer';
|
|
3
3
|
import accountGroup, { initialState as initialAccountGroupState, } from './entity/accountGroup/accountGroupReducer';
|
|
4
4
|
import accountRecon, { initialState as initialAccountReconState, } from './entity/accountRecon/accountReconReducer';
|
|
5
|
-
import actualMatching, { initialState as initialActualMatchingState, } from './entity/actualMatching/actualMatchingReducer';
|
|
6
5
|
import address, { initialState as initialAddressState, } from './entity/address/addressReducer';
|
|
7
6
|
import aiAccountantCustomer, { initialAiAccountantCustomerState, } from './entity/aiAccountantCustomer/aiAccountantCustomerReducer';
|
|
8
7
|
import aiCfo, { initialAiCfoState } from './entity/aiCfo/aiCfoReducer';
|
|
@@ -41,7 +40,9 @@ import invoicingInvoice, { initialState as initialInvoicingInvoiceState, } from
|
|
|
41
40
|
import invoicingCustomer, { initialState as initialInvoicingCustomerState, } from './entity/invoicing/invoicingCustomer/invoicingCustomerReducer';
|
|
42
41
|
import invoicingSubscription, { initialState as initialInvoicingSubscriptionState, } from './entity/invoicing/invoicingSubscription/invoicingSubscriptionReducer';
|
|
43
42
|
import invoicingTransaction, { initialState as initialInvoicingTransactionState, } from './entity/invoicing/invoicingTransaction/invoicingTransactionReducer';
|
|
44
|
-
import
|
|
43
|
+
import invoicingPlan, { initialState as initialInvoicingPlanState, } from './entity/invoicing/plan/planReducer';
|
|
44
|
+
import invoicingProduct, { initialState as initialInvoicingProductState, } from './entity/invoicing/product/productReducer';
|
|
45
|
+
import actualMatching, { initialState as initialActualMatchingState, } from './entity/actualMatching/actualMatchingReducer';
|
|
45
46
|
import jeSchedules, { initialState as initialJESchedulesState, } from './entity/jeSchedules/jeSchedulesReducer';
|
|
46
47
|
import merchant, { initialState as initialMerchantState, } from './entity/merchant/merchantReducer';
|
|
47
48
|
import monthEndCloseChecks, { initialState as initialMonthEndCloseChecksState, } from './entity/monthEndCloseChecks/monthEndCloseChecksReducer';
|
|
@@ -315,7 +316,8 @@ const initialEntitiesState = {
|
|
|
315
316
|
invoicingCustomerState: initialInvoicingCustomerState,
|
|
316
317
|
invoicingDunningCaseState: initialInvoicingDunningCaseState,
|
|
317
318
|
invoicingInvoiceState: initialInvoicingInvoiceState,
|
|
318
|
-
|
|
319
|
+
invoicingPlanState: initialInvoicingPlanState,
|
|
320
|
+
invoicingProductState: initialInvoicingProductState,
|
|
319
321
|
invoicingSubscriptionState: initialInvoicingSubscriptionState,
|
|
320
322
|
invoicingTransactionState: initialInvoicingTransactionState,
|
|
321
323
|
jeSchedulesState: initialJESchedulesState,
|
|
@@ -601,7 +603,8 @@ const entityReducers = {
|
|
|
601
603
|
invoicingCustomerState: invoicingCustomer,
|
|
602
604
|
invoicingDunningCaseState: invoicingDunningCase,
|
|
603
605
|
invoicingInvoiceState: invoicingInvoice,
|
|
604
|
-
|
|
606
|
+
invoicingPlanState: invoicingPlan,
|
|
607
|
+
invoicingProductState: invoicingProduct,
|
|
605
608
|
invoicingSubscriptionState: invoicingSubscription,
|
|
606
609
|
invoicingTransactionState: invoicingTransaction,
|
|
607
610
|
jeSchedulesState: jeSchedules,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { from } from 'rxjs';
|
|
2
2
|
import { catchError, filter, mergeMap, takeUntil } from 'rxjs/operators';
|
|
3
|
-
import {
|
|
3
|
+
import { updateActualMatchingMatches } from '../../../../../entity/actualMatching/actualMatchingReducer';
|
|
4
4
|
import { createZeniAPIStatus, isSuccessResponse, } from '../../../../../responsePayload';
|
|
5
5
|
import { clearAll } from '../../../../../rootActions';
|
|
6
6
|
import { fetchActualMatchingMatch, fetchActualMatchingMatchFailure, fetchActualMatchingMatchSuccess, } from '../../../reducers/actualMatchingViewReducer';
|
|
@@ -32,7 +32,5 @@ export const fetchActualMatchingMatchEpic = (actions$, state$, zeniAPI) => actio
|
|
|
32
32
|
refreshViewInBackground,
|
|
33
33
|
status: createZeniAPIStatus('Unexpected Error', `Fetch actual matching match REST API call errored out ${JSON.stringify(error)}`),
|
|
34
34
|
}),
|
|
35
|
-
])), takeUntil(actions$.pipe(filter(
|
|
36
|
-
(removeActualMatchingMatch.match(action) &&
|
|
37
|
-
action.payload.matchId === matchId)))));
|
|
35
|
+
])), takeUntil(actions$.pipe(filter(clearAll.match))));
|
|
38
36
|
}));
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { from, of } from 'rxjs';
|
|
2
|
-
import { catchError, exhaustMap, filter,
|
|
2
|
+
import { catchError, exhaustMap, filter, mergeMap, takeUntil } from 'rxjs/operators';
|
|
3
3
|
import { getActualMatchingMatchById } from '../../../../../entity/actualMatching/actualMatchingSelector';
|
|
4
4
|
import { openSnackbar } from '../../../../../entity/snackbar/snackbarReducer';
|
|
5
|
-
import { createZeniAPIStatus, isSuccessResponse
|
|
5
|
+
import { createZeniAPIStatus, isSuccessResponse } from '../../../../../responsePayload';
|
|
6
6
|
import { clearAll } from '../../../../../rootActions';
|
|
7
7
|
import { toMatchAndReverseResult, } from '../../../payload/actualMatchingPayload';
|
|
8
8
|
import { clearMatchNewModal, fetchActualMatchingMatch, matchAndReverseAccruals, matchAndReverseAccrualsFailure, matchAndReverseAccrualsSuccess, } from '../../../reducers/actualMatchingViewReducer';
|
|
9
9
|
import { isMatchAndReverseCompleteStatus, } from '../../../types/actualMatchingViewState';
|
|
10
10
|
import { refreshActualMatchingList } from './refreshActualMatchingList';
|
|
11
11
|
function isMatchFailedStatus(status) {
|
|
12
|
-
return status === 'conflict' || status === 'claim_lost' || status === 'error';
|
|
12
|
+
return (status === 'conflict' || status === 'claim_lost' || status === 'error');
|
|
13
13
|
}
|
|
14
14
|
function matchAndReverseSnackbar(results, vendorName) {
|
|
15
15
|
const reversedCount = results.filter((result) => result.status === 'reversed').length;
|
|
@@ -56,15 +56,12 @@ function matchAndReverseHttpFailSnackbar(vendorName) {
|
|
|
56
56
|
});
|
|
57
57
|
}
|
|
58
58
|
function matchVendorName(state, matchId) {
|
|
59
|
-
return
|
|
60
|
-
?.vendorName ?? '');
|
|
59
|
+
return getActualMatchingMatchById(state.actualMatchingState, matchId)?.vendorName ?? '';
|
|
61
60
|
}
|
|
62
61
|
export const matchAndReverseAccrualsEpic = (actions$, state$, zeniAPI) => actions$.pipe(filter(matchAndReverseAccruals.match),
|
|
63
|
-
//
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
groupBy((action) => `${action.payload.transactionType.toLowerCase()}:${action.payload.transactionIntegrationId}`), mergeMap((perMatch$) => perMatch$.pipe(exhaustMap((action) => {
|
|
67
|
-
const { transactionId, transactionIntegrationId, transactionType, lineIds, accrualIds, transactionSyncToken, forMatchModal, } = action.payload;
|
|
62
|
+
// Posts reversing JEs; drop duplicate clicks while a request is in flight.
|
|
63
|
+
exhaustMap((action) => {
|
|
64
|
+
const { transactionId, transactionIntegrationId, transactionType, lineIds, accrualIds, transactionSyncToken, } = action.payload;
|
|
68
65
|
const body = {
|
|
69
66
|
transaction_id: transactionId,
|
|
70
67
|
transaction_integration_id: transactionIntegrationId,
|
|
@@ -83,39 +80,29 @@ groupBy((action) => `${action.payload.transactionType.toLowerCase()}:${action.pa
|
|
|
83
80
|
if (isSuccessResponse(response) && response.data != null) {
|
|
84
81
|
const results = response.data.results.map(toMatchAndReverseResult);
|
|
85
82
|
const successActions = [
|
|
86
|
-
matchAndReverseAccrualsSuccess({
|
|
87
|
-
matchId,
|
|
88
|
-
results,
|
|
89
|
-
...(forMatchModal === true ? { forMatchModal: true } : {}),
|
|
90
|
-
}),
|
|
83
|
+
matchAndReverseAccrualsSuccess({ matchId, results }),
|
|
91
84
|
];
|
|
92
85
|
const occupancyChanged = results.some((result) => isMatchAndReverseCompleteStatus(result.status));
|
|
93
86
|
const allComplete = results.length > 0 &&
|
|
94
87
|
results.every((result) => isMatchAndReverseCompleteStatus(result.status));
|
|
95
88
|
if (occupancyChanged) {
|
|
96
89
|
// List + detail: list can omit leftovers; detail GET always
|
|
97
|
-
// writes intended occupancy so
|
|
98
|
-
//
|
|
90
|
+
// writes intended occupancy so Continue match prefills the
|
|
91
|
+
// remaining leftover set instead of a stale cached row.
|
|
99
92
|
successActions.push(...refreshActualMatchingList(state$.value), fetchActualMatchingMatch(matchId, true));
|
|
100
93
|
}
|
|
101
94
|
const snackbar = matchAndReverseSnackbar(results, vendorName);
|
|
102
95
|
if (snackbar != null) {
|
|
103
96
|
successActions.push(snackbar);
|
|
104
97
|
}
|
|
105
|
-
if (allComplete
|
|
98
|
+
if (allComplete) {
|
|
106
99
|
successActions.push(clearMatchNewModal());
|
|
107
100
|
}
|
|
108
101
|
return from(successActions);
|
|
109
102
|
}
|
|
110
|
-
return of(matchAndReverseAccrualsFailure({
|
|
111
|
-
status: response.status,
|
|
112
|
-
matchId,
|
|
113
|
-
...(forMatchModal === true ? { forMatchModal: true } : {}),
|
|
114
|
-
}), matchAndReverseHttpFailSnackbar(vendorName));
|
|
103
|
+
return of(matchAndReverseAccrualsFailure({ status: response.status }), matchAndReverseHttpFailSnackbar(vendorName));
|
|
115
104
|
}), catchError((error) => of(matchAndReverseAccrualsFailure({
|
|
116
|
-
matchId,
|
|
117
|
-
...(forMatchModal === true ? { forMatchModal: true } : {}),
|
|
118
105
|
status: createZeniAPIStatus('Unexpected Error', 'Match and reverse accruals REST API call errored out' +
|
|
119
106
|
JSON.stringify(error)),
|
|
120
107
|
}), matchAndReverseHttpFailSnackbar(vendorName))), takeUntil(actions$.pipe(filter(clearAll.match))));
|
|
121
|
-
}))
|
|
108
|
+
}));
|
|
@@ -1,13 +1,34 @@
|
|
|
1
1
|
import { from, merge, of } from 'rxjs';
|
|
2
2
|
import { catchError, debounceTime, filter, mergeMap, switchMap, takeUntil, } from 'rxjs/operators';
|
|
3
|
+
import { getActualMatchingMatchById } from '../../../../../entity/actualMatching/actualMatchingSelector';
|
|
3
4
|
import { createZeniAPIStatus, isSuccessResponse, } from '../../../../../responsePayload';
|
|
4
5
|
import { clearAll } from '../../../../../rootActions';
|
|
5
6
|
import { toActualMatchingTransactionSearchResult, } from '../../../payload/actualMatchingPayload';
|
|
6
7
|
import { openMatchNewModal, searchMatchAccruals, searchMatchTransactions, searchMatchTransactionsFailure, searchMatchTransactionsSuccess, } from '../../../reducers/actualMatchingViewReducer';
|
|
7
|
-
import { getTenantDisplayCurrency } from '../../../selectors/actualMatchingViewSelector';
|
|
8
|
+
import { getTenantDisplayCurrency, parseActualMatchingMatchId, } from '../../../selectors/actualMatchingViewSelector';
|
|
8
9
|
import { MATCH_SEARCH_DEBOUNCE_MS, MATCH_TRANSACTION_SEARCH_PAGE_SIZE, } from '../../../types/actualMatchingViewState';
|
|
9
10
|
export const searchMatchTransactionsEpic = (actions$, state$, zeniAPI) => {
|
|
10
|
-
const openModal$ = actions$.pipe(filter(openMatchNewModal.match), mergeMap(() =>
|
|
11
|
+
const openModal$ = actions$.pipe(filter(openMatchNewModal.match), mergeMap((action) => {
|
|
12
|
+
const matchId = action.payload.matchId;
|
|
13
|
+
if (matchId == null || matchId === '') {
|
|
14
|
+
return from([
|
|
15
|
+
searchMatchTransactions(''),
|
|
16
|
+
searchMatchAccruals(''),
|
|
17
|
+
]);
|
|
18
|
+
}
|
|
19
|
+
const match = getActualMatchingMatchById(state$.value.actualMatchingState, matchId);
|
|
20
|
+
const parsed = parseActualMatchingMatchId(matchId);
|
|
21
|
+
const transactionType = match?.transactionType != null && match.transactionType !== ''
|
|
22
|
+
? match.transactionType
|
|
23
|
+
: parsed?.transactionType;
|
|
24
|
+
const transactionIntegrationId = match?.transactionIntegrationId != null &&
|
|
25
|
+
match.transactionIntegrationId !== ''
|
|
26
|
+
? match.transactionIntegrationId
|
|
27
|
+
: parsed?.transactionIntegrationId;
|
|
28
|
+
return from([
|
|
29
|
+
searchMatchTransactions('', undefined, transactionType, transactionIntegrationId),
|
|
30
|
+
]);
|
|
31
|
+
}));
|
|
11
32
|
const searchActions$ = actions$.pipe(filter(searchMatchTransactions.match));
|
|
12
33
|
const pagination$ = searchActions$.pipe(filter((action) => action.payload.pageToken != null));
|
|
13
34
|
const newSearchDebounced$ = searchActions$.pipe(filter((action) => action.payload.pageToken == null), debounceTime(MATCH_SEARCH_DEBOUNCE_MS));
|
package/lib/esm/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.js
CHANGED
|
@@ -304,7 +304,8 @@ const buildLineItemById = (transaction, recommendations) => {
|
|
|
304
304
|
isClassMiscategorized: false,
|
|
305
305
|
};
|
|
306
306
|
}
|
|
307
|
-
if (line.type === 'transaction_info_line'
|
|
307
|
+
if (line.type === 'transaction_info_line' ||
|
|
308
|
+
line.type === 'transaction_line_base') {
|
|
308
309
|
const infoRecord = line;
|
|
309
310
|
lineItemData[line.id] = {
|
|
310
311
|
...infoRecord,
|