@zeniai/client-epic-state 4.16.3 → 4.16.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonStateTypes/animations.d.ts +1 -1
- package/lib/commonStateTypes/animations.js +1 -1
- package/lib/entity/chargeCard/chargeCard.d.ts +8 -26
- package/lib/entity/chargeCard/chargeCard.js +6 -25
- package/lib/entity/chargeCard/chargeCardPayload.d.ts +5 -41
- package/lib/entity/chargeCard/chargeCardPayload.js +8 -20
- package/lib/entity/chargeCardTransaction/chargeCardTransaction.d.ts +1 -1
- package/lib/entity/chargeCardTransaction/chargeCardTransaction.js +1 -5
- package/lib/entity/company/companyPayload.d.ts +1 -12
- package/lib/entity/company/companyPayload.js +0 -14
- package/lib/entity/company/companyStateTypes.d.ts +0 -11
- package/lib/entity/depositAccount/depositAccount.d.ts +2 -20
- package/lib/entity/depositAccount/depositAccountPayload.d.ts +1 -22
- package/lib/entity/depositAccount/depositAccountPayload.js +1 -39
- package/lib/entity/depositAccount/depositAccountReducer.d.ts +2 -2
- package/lib/entity/depositAccount/depositAccountReducer.js +2 -8
- package/lib/entity/depositAccount/depositAccountSelector.d.ts +1 -3
- package/lib/entity/depositAccount/depositAccountSelector.js +0 -10
- package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.js +0 -2
- package/lib/entity/tenant/clearAllEpic.d.ts +1 -2
- package/lib/entity/tenant/clearAllEpic.js +0 -2
- package/lib/entity/tenant/tenantSelector.d.ts +2 -6
- package/lib/entity/tenant/tenantSelector.js +2 -10
- package/lib/epic.d.ts +1 -5
- package/lib/epic.js +1 -5
- package/lib/index.d.ts +16 -16
- package/lib/index.js +29 -39
- package/lib/reducer.d.ts +0 -3
- package/lib/reducer.js +0 -3
- package/lib/view/addressView/__mocks__/json/createCompanyAddressSuccess.json +0 -8
- package/lib/view/addressView/__mocks__/json/createCompanyUserAddressSuccess.json +0 -16
- package/lib/view/addressView/addressViewState.d.ts +1 -1
- package/lib/view/dashboard/dashboardSelector.js +6 -7
- package/lib/view/expenseAutomationView/epics/accountRecon/updateReconcileTabLocalDataEpic.js +4 -5
- package/lib/view/expenseAutomationView/epics/common/fetchAllExpenseAutomationTabsEpic.js +2 -1
- package/lib/view/expenseAutomationView/epics/fluxAnalysis/fetchFluxAnalysisViewEpic.js +6 -18
- package/lib/view/expenseAutomationView/epics/fluxAnalysis/reviewFluxAnalysisEpic.js +4 -1
- package/lib/view/expenseAutomationView/helpers/helpers.js +4 -4
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.js +23 -25
- package/lib/view/expenseAutomationView/payload/fluxAnalysisPayload.d.ts +9 -22
- package/lib/view/expenseAutomationView/payload/fluxAnalysisPayload.js +2 -2
- package/lib/view/expenseAutomationView/reducers/fluxAnalysisViewReducer.d.ts +5 -13
- package/lib/view/expenseAutomationView/reducers/fluxAnalysisViewReducer.js +115 -245
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.js +15 -9
- package/lib/view/expenseAutomationView/selectorTypes/fluxAnalysisViewSelectorTypes.d.ts +9 -29
- package/lib/view/expenseAutomationView/selectors/fluxAnalysisViewSelector.js +40 -108
- package/lib/view/expenseAutomationView/types/fluxAnalysisViewState.d.ts +15 -40
- package/lib/view/expenseAutomationView/types/fluxAnalysisViewState.js +1 -1
- package/lib/view/onboardingView/cockpitView/epic/initializeOnboardingCustomerViewUpdateDataEpic.js +4 -4
- package/lib/view/onboardingView/cockpitView/onboardingCockpitViewReducer.d.ts +1 -2
- package/lib/view/onboardingView/cockpitView/onboardingCockpitViewReducer.js +2 -2
- package/lib/view/settingsView/settingsViewHelpers.d.ts +4 -4
- package/lib/view/settingsView/settingsViewHelpers.js +8 -9
- package/lib/view/spendManagement/billPay/billPayReview/billPayReviewSelector.js +1 -1
- package/lib/view/spendManagement/billPay/editBillView/editBillViewReducer.d.ts +1 -6
- package/lib/view/spendManagement/billPay/editBillView/editBillViewReducer.js +2 -20
- package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.d.ts +0 -5
- package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.js +2 -9
- package/lib/view/spendManagement/billPay/editBillView/editBillViewState.d.ts +0 -1
- package/lib/view/spendManagement/chargeCards/cardUserOnboarding/cardUserOnboardingSelector.js +3 -4
- package/lib/view/spendManagement/chargeCards/chargeCardConfig/chargeCardConfigPayload.d.ts +3 -5
- package/lib/view/spendManagement/chargeCards/chargeCardConfig/chargeCardConfigPayload.js +2 -4
- package/lib/view/spendManagement/chargeCards/chargeCardConfig/chargeCardConfigReducer.js +3 -8
- package/lib/view/spendManagement/chargeCards/chargeCardConfig/chargeCardConfigState.d.ts +2 -4
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetail.d.ts +0 -12
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetail.js +0 -26
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailPayload.d.ts +0 -2
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailReducer.d.ts +4 -43
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailReducer.js +9 -104
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailSelector.d.ts +0 -15
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailSelector.js +16 -70
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/fetchChargeCardDetailEpic.d.ts +1 -2
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/fetchChargeCardDetailEpic.js +3 -12
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/fetchChargeCardTransactionListEpic.js +1 -2
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/updateChargeCardLimitEpic.js +2 -2
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardList.d.ts +1 -11
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardList.js +1 -20
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListPayload.d.ts +1 -16
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListReducer.d.ts +4 -6
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListReducer.js +4 -30
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.d.ts +2 -5
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.js +14 -26
- package/lib/view/spendManagement/chargeCards/chargeCardList/fetchChargeCardListPageEpic.d.ts +2 -2
- package/lib/view/spendManagement/chargeCards/chargeCardList/fetchChargeCardListPageEpic.js +5 -20
- package/lib/view/spendManagement/chargeCards/chargeCardSetUp/chargeCardSetUpViewReducer.d.ts +1 -2
- package/lib/view/spendManagement/chargeCards/chargeCardSetUp/chargeCardSetUpViewReducer.js +2 -4
- package/lib/view/spendManagement/chargeCards/chargeCardSetUp/chargeCardSetUpViewSelector.d.ts +1 -2
- package/lib/view/spendManagement/chargeCards/chargeCardSetUp/chargeCardSetUpViewSelector.js +0 -2
- package/lib/view/spendManagement/chargeCards/chargeCardSetUp/epic/acceptChargeCardTermsEpic.js +2 -19
- package/lib/view/spendManagement/chargeCards/issueChargeCard/fetchIssueCardPageEpic.d.ts +2 -2
- package/lib/view/spendManagement/chargeCards/issueChargeCard/fetchIssueCardPageEpic.js +3 -15
- package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardEpic.d.ts +2 -2
- package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardEpic.js +25 -65
- package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardReducer.d.ts +3 -11
- package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardReducer.js +11 -45
- package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardSelector.d.ts +3 -6
- package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardSelector.js +18 -33
- package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardState.d.ts +8 -41
- package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardState.js +21 -0
- package/lib/view/spendManagement/commonSetup/epic/setup/enableSetupEpic.js +0 -9
- package/lib/view/spendManagement/commonSetup/epic/setup/updateBusinessVerificationDetailsEpic.js +3 -8
- package/lib/view/spendManagement/commonSetup/setupViewReducer.d.ts +4 -4
- package/lib/view/spendManagement/commonSetup/setupViewSelector.js +1 -2
- package/lib/view/spendManagement/commonSetup/setupViewState.d.ts +1 -3
- package/lib/view/spendManagement/commonSetup/setupViewState.js +1 -13
- package/lib/view/spendManagement/helpers.d.ts +0 -3
- package/lib/view/spendManagement/helpers.js +1 -13
- package/lib/view/spendManagement/plaidAccount/epic/paymentAccounts/getPaymentAccountsEpic.js +1 -2
- package/lib/view/spendManagement/plaidAccount/epic/paymentAccounts/updatePaymentAccountEpic.js +1 -2
- package/lib/view/spendManagement/plaidAccount/epic/paymentAccounts/updatePaymentAccountLoginStatusEpic.js +1 -2
- package/lib/view/spendManagement/plaidAccount/epic/paymentAccounts/updatePaymentAccountStatusEpic.js +1 -2
- package/lib/view/spendManagement/plaidAccount/epic/plaidConnection/establishPlaidConnectionEpic.d.ts +1 -2
- package/lib/view/spendManagement/plaidAccount/epic/plaidConnection/establishPlaidConnectionEpic.js +1 -6
- package/lib/view/spendManagement/plaidAccount/plaidAccountViewReducer.d.ts +10 -10
- package/lib/view/spendManagement/plaidAccount/plaidAccountViewReducer.js +0 -1
- package/lib/view/spendManagement/plaidAccount/plaidAccountViewState.d.ts +1 -1
- package/lib/view/spendManagement/zeniAccounts/checkDeposit/checkDepositSelector.js +1 -1
- package/lib/view/spendManagement/zeniAccounts/depositAccountList/depositAccountListSelector.d.ts +1 -1
- package/lib/view/spendManagement/zeniAccounts/depositAccountList/depositAccountListSelector.js +3 -3
- package/lib/view/spendManagement/zeniAccounts/expressPay/expressPaySelector.js +1 -1
- package/lib/view/spendManagement/zeniAccounts/transferDetail/transferDetailSelector.js +1 -1
- package/lib/view/spendManagement/zeniAccounts/zeniAccountList/zeniAccountListSelector.js +1 -1
- package/lib/view/twoFactorAuthentication/resendOtpEpic.d.ts +2 -3
- package/lib/view/twoFactorAuthentication/resendOtpEpic.js +19 -44
- package/lib/view/twoFactorAuthentication/sendOtpEpic.d.ts +1 -2
- package/lib/view/twoFactorAuthentication/sendOtpEpic.js +18 -45
- package/lib/view/twoFactorAuthentication/twoFactorAuthentication.d.ts +5 -17
- package/lib/view/twoFactorAuthentication/twoFactorAuthentication.js +0 -33
- package/lib/view/twoFactorAuthentication/twoFactorAuthenticationPayload.d.ts +7 -7
- package/lib/view/twoFactorAuthentication/twoFactorAuthenticationPayload.js +6 -6
- package/lib/view/twoFactorAuthentication/twoFactorAuthenticationReducer.d.ts +6 -22
- package/lib/view/twoFactorAuthentication/twoFactorAuthenticationReducer.js +60 -176
- package/lib/view/twoFactorAuthentication/twoFactorAuthenticationSelector.d.ts +3 -5
- package/lib/view/twoFactorAuthentication/twoFactorAuthenticationSelector.js +2 -13
- package/lib/view/twoFactorAuthentication/verifyOtpEpic.d.ts +2 -5
- package/lib/view/twoFactorAuthentication/verifyOtpEpic.js +5 -46
- package/lib/view/userListView/fetchUserListByTypeEpic.d.ts +2 -2
- package/lib/view/userListView/fetchUserListByTypeEpic.js +3 -4
- package/lib/view/userListView/userListViewPayload.d.ts +0 -11
- package/package.json +4 -5
- package/lib/entity/connectedAccount/connectedAccount.d.ts +0 -19
- package/lib/entity/connectedAccount/connectedAccount.js +0 -10
- package/lib/entity/connectedAccount/connectedAccountPayload.d.ts +0 -11
- package/lib/entity/connectedAccount/connectedAccountPayload.js +0 -15
- package/lib/entity/connectedAccount/connectedAccountReducer.d.ts +0 -6
- package/lib/entity/connectedAccount/connectedAccountReducer.js +0 -27
- package/lib/entity/connectedAccount/connectedAccountSelector.d.ts +0 -4
- package/lib/entity/connectedAccount/connectedAccountSelector.js +0 -17
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/fetchDepositAccountLimitEpic.d.ts +0 -8
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/fetchDepositAccountLimitEpic.js +0 -41
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/updateDebitCardPinAttemptEpic.d.ts +0 -11
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/updateDebitCardPinAttemptEpic.js +0 -42
- package/lib/view/spendManagement/chargeCards/chargeCardList/fetchDebitCardSummaryEpic.d.ts +0 -7
- package/lib/view/spendManagement/chargeCards/chargeCardList/fetchDebitCardSummaryEpic.js +0 -23
- package/lib/view/spendManagement/chargeCards/issueChargeCard/depositAccountWithLimitPayload.d.ts +0 -6
- package/lib/view/spendManagement/chargeCards/issueChargeCard/depositAccountWithLimitPayload.js +0 -2
- package/lib/view/spendManagement/chargeCards/issueChargeCard/fetchDepositAccountListForCardsEpic.d.ts +0 -8
- package/lib/view/spendManagement/chargeCards/issueChargeCard/fetchDepositAccountListForCardsEpic.js +0 -31
|
@@ -9,9 +9,9 @@ const userSelector_1 = require("../../../entity/user/userSelector");
|
|
|
9
9
|
const vendorSelector_1 = require("../../../entity/vendor/vendorSelector");
|
|
10
10
|
const expenseAutomationViewSelectorTypes_1 = require("../selectorTypes/expenseAutomationViewSelectorTypes");
|
|
11
11
|
function getExpenseAutomationFluxAnalysisView(state) {
|
|
12
|
-
var _a
|
|
12
|
+
var _a;
|
|
13
13
|
const { expenseAutomationFluxAnalysisViewState, monthEndCloseChecksState } = state;
|
|
14
|
-
const { fetchState, error, refreshStatus, uiState,
|
|
14
|
+
const { fetchState, error, refreshStatus, uiState, reviewOperatingExpensesIds, reviewStatusById, fluxAnalysisEntities, operatingExpenseIdsBySelectedPeriod, bulkReviewStatus, } = expenseAutomationFluxAnalysisViewState;
|
|
15
15
|
const fetchStateAndError = {
|
|
16
16
|
fetchState,
|
|
17
17
|
error,
|
|
@@ -20,125 +20,57 @@ function getExpenseAutomationFluxAnalysisView(state) {
|
|
|
20
20
|
const { selectedPeriodByTenantId } = state.expenseAutomationViewState;
|
|
21
21
|
const selectedPeriod = selectedPeriodByTenantId[currentTenant.tenantId];
|
|
22
22
|
const monthYearPeriodId = selectedPeriod != null ? (0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod) : null;
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
? ((_a = selectedSectionIdsByPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)]) !== null && _a !== void 0 ? _a : [])
|
|
30
|
-
: [];
|
|
31
|
-
const generalExpenseState = selectedPeriod != null
|
|
32
|
-
? (_b = groupsBySelectedPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)]) === null || _b === void 0 ? void 0 : _b.generalExpense
|
|
33
|
-
: undefined;
|
|
34
|
-
const reimbursementOpExState = selectedPeriod != null
|
|
35
|
-
? (_c = groupsBySelectedPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)]) === null || _c === void 0 ? void 0 : _c.reimbursement
|
|
36
|
-
: undefined;
|
|
37
|
-
const generalExpenseIdsForCurrentPeriod = monthYearPeriodId != null && generalExpenseState != null
|
|
38
|
-
? generalExpenseState.operatingExpenseIds
|
|
39
|
-
: [];
|
|
40
|
-
const reimbursementIdsForCurrentPeriod = monthYearPeriodId != null && reimbursementOpExState != null
|
|
41
|
-
? reimbursementOpExState.operatingExpenseIds
|
|
42
|
-
: [];
|
|
43
|
-
const generalExpenses = [];
|
|
44
|
-
const reimbursements = [];
|
|
45
|
-
const expenseMap = new Map(fluxAnalysisEntities.operatingExpenses.map((e) => [
|
|
46
|
-
e.fluxAnalysisEntityId,
|
|
47
|
-
e,
|
|
48
|
-
]));
|
|
49
|
-
generalExpenseIdsForCurrentPeriod.forEach((opExId) => {
|
|
50
|
-
const fluxEntity = expenseMap.get(opExId);
|
|
51
|
-
if (fluxEntity != null) {
|
|
52
|
-
generalExpenses.push(fluxEntity);
|
|
53
|
-
}
|
|
54
|
-
});
|
|
55
|
-
reimbursementIdsForCurrentPeriod.forEach((opExId) => {
|
|
56
|
-
const fluxEntity = fluxAnalysisEntities.operatingExpenses.find((fluxEntity) => fluxEntity.fluxAnalysisEntityId === opExId);
|
|
23
|
+
const operatingExpenseIdsForCurrentPeriod = monthYearPeriodId != null
|
|
24
|
+
? operatingExpenseIdsBySelectedPeriod[monthYearPeriodId]
|
|
25
|
+
: null;
|
|
26
|
+
const operatingExpenses = [];
|
|
27
|
+
operatingExpenseIdsForCurrentPeriod === null || operatingExpenseIdsForCurrentPeriod === void 0 ? void 0 : operatingExpenseIdsForCurrentPeriod.forEach((opExId) => {
|
|
28
|
+
const fluxEntity = fluxAnalysisEntities.operatingExpenses.find((fluxEntity) => fluxEntity.operatingExpenseId === opExId);
|
|
57
29
|
if (fluxEntity != null) {
|
|
58
|
-
|
|
30
|
+
operatingExpenses.push(fluxEntity);
|
|
59
31
|
}
|
|
60
32
|
});
|
|
61
33
|
const allSteps = monthYearPeriodId != null
|
|
62
34
|
? (0, expenseAutomationViewSelectorTypes_1.getAllSteps)(monthEndCloseChecksState, monthYearPeriodId, currentTenant.tenantId)
|
|
63
35
|
: [];
|
|
64
|
-
const fluxCompletionStatus = (
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
};
|
|
36
|
+
const fluxCompletionStatus = (_a = allSteps.find((step) => step.step === 'flux_analysis')) === null || _a === void 0 ? void 0 : _a.completionStatus;
|
|
37
|
+
const operatingExpensesView = [];
|
|
38
|
+
operatingExpenses.forEach((operatingExpense) => {
|
|
39
|
+
const vendor = (0, vendorSelector_1.getVendorByVendorId)(state.vendorState, operatingExpense.vendorId);
|
|
40
|
+
if (vendor != null) {
|
|
41
|
+
operatingExpensesView.push({
|
|
42
|
+
operatingExpenseId: operatingExpense.operatingExpenseId,
|
|
43
|
+
vendor,
|
|
44
|
+
accountBase: operatingExpense.accountId != null
|
|
45
|
+
? (0, accountSelector_1.getAccountBase)(state.accountState, operatingExpense.accountId, 'account_list')
|
|
46
|
+
: undefined,
|
|
47
|
+
classBase: operatingExpense.classId != null
|
|
48
|
+
? (0, classSelector_1.getClassById)(state.classState, {
|
|
49
|
+
classId: operatingExpense.classId,
|
|
50
|
+
reportId: 'class_list',
|
|
51
|
+
})
|
|
52
|
+
: undefined,
|
|
53
|
+
reviewedByUser: operatingExpense.userId != null
|
|
54
|
+
? (0, userSelector_1.getUserByUserId)(state.userState, operatingExpense.userId)
|
|
55
|
+
: undefined,
|
|
56
|
+
varianceAmount: operatingExpense.varianceAmount,
|
|
57
|
+
variancePercentage: operatingExpense.variancePercentage,
|
|
58
|
+
currency: operatingExpense.currency,
|
|
59
|
+
anomalyReason: operatingExpense.anomalyReason,
|
|
60
|
+
status: operatingExpense.status,
|
|
61
|
+
balancesByMonth: operatingExpense.balancesByMonth,
|
|
62
|
+
reviewStatus: reviewStatusById[operatingExpense.operatingExpenseId],
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
});
|
|
95
66
|
const completionStatus = fluxCompletionStatus != null ? fluxCompletionStatus : 'incomplete';
|
|
96
67
|
return {
|
|
97
|
-
sections,
|
|
98
|
-
totalBalancesAndVariance,
|
|
99
68
|
fetchStatus: fetchStateAndError,
|
|
69
|
+
operatingExpensesView,
|
|
100
70
|
bulkReviewStatus,
|
|
101
71
|
reviewOperatingExpensesIds,
|
|
102
|
-
selectedSectionIds,
|
|
103
72
|
uiState,
|
|
104
73
|
refreshStatus,
|
|
105
|
-
currency,
|
|
106
74
|
completionStatus,
|
|
107
75
|
};
|
|
108
76
|
}
|
|
109
|
-
// Helper function to transform operating expense to vendor view
|
|
110
|
-
const mapOperatingExpenseToVendorView = (state, operatingExpense) => {
|
|
111
|
-
const vendor = (0, vendorSelector_1.getVendorByVendorId)(state.vendorState, operatingExpense.vendorId);
|
|
112
|
-
if (!vendor) {
|
|
113
|
-
return null;
|
|
114
|
-
}
|
|
115
|
-
const vendorAccountsAndClasses = operatingExpense.vendorAccountsAndClasses.map((accAndClass) => ({
|
|
116
|
-
varianceAmount: accAndClass.varianceAmount,
|
|
117
|
-
variancePercentage: accAndClass.variancePercentage,
|
|
118
|
-
currency: operatingExpense.currency,
|
|
119
|
-
accountBase: accAndClass.accountId != null
|
|
120
|
-
? (0, accountSelector_1.getAccountBase)(state.accountState, accAndClass.accountId, 'account_list')
|
|
121
|
-
: undefined,
|
|
122
|
-
classBase: accAndClass.classId != null
|
|
123
|
-
? (0, classSelector_1.getClassById)(state.classState, {
|
|
124
|
-
classId: accAndClass.classId,
|
|
125
|
-
reportId: 'class_list',
|
|
126
|
-
})
|
|
127
|
-
: undefined,
|
|
128
|
-
balancesByMonth: accAndClass.balancesByMonth,
|
|
129
|
-
}));
|
|
130
|
-
return {
|
|
131
|
-
fluxAnalysisEntityId: operatingExpense.fluxAnalysisEntityId,
|
|
132
|
-
vendor,
|
|
133
|
-
reviewedByUser: operatingExpense.userId != null
|
|
134
|
-
? (0, userSelector_1.getUserByUserId)(state.userState, operatingExpense.userId)
|
|
135
|
-
: undefined,
|
|
136
|
-
varianceAmount: operatingExpense.varianceAmount,
|
|
137
|
-
variancePercentage: operatingExpense.variancePercentage,
|
|
138
|
-
currency: operatingExpense.currency,
|
|
139
|
-
anomalyReason: operatingExpense.anomalyReason,
|
|
140
|
-
status: operatingExpense.status,
|
|
141
|
-
balancesByMonth: operatingExpense.balancesByMonth,
|
|
142
|
-
vendorAccountsAndClasses,
|
|
143
|
-
};
|
|
144
|
-
};
|
|
@@ -4,8 +4,7 @@ import { FetchStateAndError, FetchedState, ID } from '../../../commonStateTypes/
|
|
|
4
4
|
import { SortOrder } from '../../../commonStateTypes/selectorTypes/sortOrderTypes';
|
|
5
5
|
import { MonthYearPeriodId } from '../../../commonStateTypes/timePeriod';
|
|
6
6
|
import { PageToken } from '../../../commonStateTypes/viewAndReport/viewAndReport';
|
|
7
|
-
|
|
8
|
-
declare const toFluxAnalysisSortKey: (v: string) => "vendor" | "status" | "variance";
|
|
7
|
+
declare const toFluxAnalysisSortKey: (v: string) => "vendor" | "class" | "category";
|
|
9
8
|
export type FluxAnalysisSortKey = ReturnType<typeof toFluxAnalysisSortKey>;
|
|
10
9
|
export type FluxAnalysisActionType = 'review' | 'unreview';
|
|
11
10
|
export type FluxAnalysisReviewStatus = 'Pending Review' | 'Reviewed';
|
|
@@ -13,32 +12,21 @@ export interface FluxBalancesByMonth {
|
|
|
13
12
|
month1: COABalance;
|
|
14
13
|
month2: COABalance;
|
|
15
14
|
}
|
|
16
|
-
export interface BalancesAndVariance {
|
|
17
|
-
balancesByMonth: FluxBalancesByMonth | undefined;
|
|
18
|
-
varianceAmount: number;
|
|
19
|
-
variancePercentage: number;
|
|
20
|
-
}
|
|
21
15
|
export interface FluxAnalysisEntities {
|
|
22
16
|
operatingExpenses: FluxAnalysisOperatingExpense[];
|
|
23
17
|
}
|
|
24
|
-
export interface
|
|
18
|
+
export interface FluxAnalysisOperatingExpense {
|
|
19
|
+
operatingExpenseId: ID;
|
|
20
|
+
vendorId: ID;
|
|
25
21
|
accountId: ID | undefined;
|
|
26
22
|
classId: ID | undefined;
|
|
27
|
-
}
|
|
28
|
-
export interface FluxAnalysisOperatingExpense extends BalancesAndVariance {
|
|
29
|
-
fluxAnalysisEntityId: ID;
|
|
30
|
-
vendorId: ID;
|
|
31
|
-
vendorAccountsAndClasses: FluxVendorAccountsAndClasses[];
|
|
32
23
|
userId: ID | undefined;
|
|
24
|
+
varianceAmount: number;
|
|
25
|
+
variancePercentage: number;
|
|
33
26
|
currency: Currency;
|
|
34
27
|
anomalyReason: string;
|
|
35
28
|
status: FluxAnalysisReviewStatus;
|
|
36
|
-
|
|
37
|
-
interface GroupPaginationInfo {
|
|
38
|
-
pageToken: PageToken;
|
|
39
|
-
hasMore: boolean;
|
|
40
|
-
limit?: number;
|
|
41
|
-
totalCount: number;
|
|
29
|
+
balancesByMonth?: FluxBalancesByMonth;
|
|
42
30
|
}
|
|
43
31
|
export interface FluxAnalysisViewUIState {
|
|
44
32
|
sortKey: FluxAnalysisSortKey;
|
|
@@ -48,32 +36,19 @@ export interface FluxAnalysisViewUIState {
|
|
|
48
36
|
scrollTop: number;
|
|
49
37
|
scrollLeft?: number;
|
|
50
38
|
} | undefined;
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
collapsableStatus: {
|
|
56
|
-
[nodeId: string]: boolean;
|
|
57
|
-
};
|
|
58
|
-
}
|
|
59
|
-
export interface FluxAnalysisViewGroup {
|
|
60
|
-
fetchStatus: FetchStateAndError;
|
|
61
|
-
operatingExpenseIds: ID[];
|
|
62
|
-
total: BalancesAndVariance | undefined;
|
|
63
|
-
}
|
|
64
|
-
export interface FluxAnalysisViewGroups {
|
|
65
|
-
generalExpense: FluxAnalysisViewGroup;
|
|
66
|
-
reimbursement: FluxAnalysisViewGroup;
|
|
39
|
+
pageToken: PageToken;
|
|
40
|
+
hasMore: boolean;
|
|
41
|
+
limit?: number;
|
|
42
|
+
totalCount: number;
|
|
67
43
|
}
|
|
68
44
|
export interface FluxAnalysisViewState extends FetchedState {
|
|
45
|
+
fluxAnalysisReportGenerated: boolean;
|
|
69
46
|
fluxAnalysisEntities: FluxAnalysisEntities;
|
|
70
|
-
|
|
71
|
-
|
|
47
|
+
operatingExpenseIdsBySelectedPeriod: Record<MonthYearPeriodId, ID[]>;
|
|
48
|
+
reviewStatusById: Record<ID, FetchStateAndError>;
|
|
72
49
|
bulkReviewStatus: FetchStateAndError;
|
|
73
50
|
refreshStatus: FetchStateAndError;
|
|
74
51
|
uiState: FluxAnalysisViewUIState;
|
|
75
|
-
|
|
76
|
-
reviewOperatingExpenseIdsByPeriod: Record<MonthYearPeriodId, ID[]>;
|
|
77
|
-
selectedSectionIdsByPeriod: Record<MonthYearPeriodId, FluxAnalysisSectionType[]>;
|
|
52
|
+
reviewOperatingExpensesIds: ID[];
|
|
78
53
|
}
|
|
79
54
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const stringToUnion_1 = require("../../../commonStateTypes/stringToUnion");
|
|
4
|
-
const FLUX_ANALYSIS_SORT_KEYS = ['vendor', '
|
|
4
|
+
const FLUX_ANALYSIS_SORT_KEYS = ['vendor', 'category', 'class'];
|
|
5
5
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
6
6
|
const toFluxAnalysisSortKey = (v) => (0, stringToUnion_1.stringToUnion)(v, FLUX_ANALYSIS_SORT_KEYS);
|
package/lib/view/onboardingView/cockpitView/epic/initializeOnboardingCustomerViewUpdateDataEpic.js
CHANGED
|
@@ -13,7 +13,7 @@ const addressViewReducer_1 = require("../../../addressView/addressViewReducer");
|
|
|
13
13
|
const onboardingCockpitViewReducer_1 = require("../onboardingCockpitViewReducer");
|
|
14
14
|
const initializeOnboardingCustomerViewUpdateDataEpic = (actions$, state$) => actions$.pipe((0, operators_1.filter)(onboardingCockpitViewReducer_1.initializeOnboardingCustomerViewUpdateData.match), (0, operators_1.mergeMap)((action) => {
|
|
15
15
|
var _a, _b, _c;
|
|
16
|
-
const { companyId
|
|
16
|
+
const { companyId } = action.payload;
|
|
17
17
|
const fetchActions = [];
|
|
18
18
|
if (companyId != null) {
|
|
19
19
|
const onboardingCustomerInfo = (0, onboardingCustomerSelector_1.getOnboardingCustomersByCompanyId)(state$.value.onboardingCustomerState, companyId);
|
|
@@ -57,7 +57,7 @@ const initializeOnboardingCustomerViewUpdateDataEpic = (actions$, state$) => act
|
|
|
57
57
|
accountingConnectionCreationMode: ((_b = company.company.companyOnboardingInfo.onboardingInfo) === null || _b === void 0 ? void 0 : _b.accountingConnectionCreationMode) != null
|
|
58
58
|
? (0, companyStateTypes_1.toAccountingConnectionCreationModeStrict)((_c = company.company.companyOnboardingInfo.onboardingInfo) === null || _c === void 0 ? void 0 : _c.accountingConnectionCreationMode)
|
|
59
59
|
: undefined,
|
|
60
|
-
selectedProducts: getSelectedProducts(
|
|
60
|
+
selectedProducts: getSelectedProducts(tenant),
|
|
61
61
|
};
|
|
62
62
|
if (onboardingCustomerId != null) {
|
|
63
63
|
const onboardingCustomerDetails = (0, userSelector_1.getUserByUserId)(state$.value.userState, onboardingCustomerId);
|
|
@@ -106,11 +106,11 @@ const initializeOnboardingCustomerViewUpdateDataEpic = (actions$, state$) => act
|
|
|
106
106
|
return (0, rxjs_1.from)(fetchActions);
|
|
107
107
|
}));
|
|
108
108
|
exports.initializeOnboardingCustomerViewUpdateDataEpic = initializeOnboardingCustomerViewUpdateDataEpic;
|
|
109
|
-
const getSelectedProducts = (
|
|
109
|
+
const getSelectedProducts = (tenant) => {
|
|
110
110
|
if (tenant == null) {
|
|
111
111
|
return [];
|
|
112
112
|
}
|
|
113
|
-
const isBankingOnly = (0, tenantSelector_1.isTenantBankingOnly)(
|
|
113
|
+
const isBankingOnly = (0, tenantSelector_1.isTenantBankingOnly)(tenant);
|
|
114
114
|
const isBookkeepingEnabled = (0, tenantSelector_1.isTenantBookkeepingEnabled)(tenant);
|
|
115
115
|
const isOtherProductsEnabled = (0, tenantSelector_1.isOtherProductsEnabledForTenant)(tenant);
|
|
116
116
|
const isCardsEnabled = (0, tenantSelector_1.isTenantCardsOnly)(tenant);
|
|
@@ -30,9 +30,8 @@ export declare const fetchCompanyOnboardingView: import("@reduxjs/toolkit").Acti
|
|
|
30
30
|
onboardingEmailGroup: OnboardingEmailGroupPayload;
|
|
31
31
|
}, "onboardingCockpitView/updateOnboardingEmailGroupOnSuccess", never, never>, updateOnboardingEmailGroupOnFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[error: ZeniAPIStatus<Record<string, unknown>>], {
|
|
32
32
|
error: ZeniAPIStatus<Record<string, unknown>>;
|
|
33
|
-
}, "onboardingCockpitView/updateOnboardingEmailGroupOnFailure", never, never>, initializeOnboardingCustomerViewUpdateData: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[
|
|
33
|
+
}, "onboardingCockpitView/updateOnboardingEmailGroupOnFailure", never, never>, initializeOnboardingCustomerViewUpdateData: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[companyId?: string | undefined], {
|
|
34
34
|
companyId: string | undefined;
|
|
35
|
-
isDebitCardFlagEnabled: boolean;
|
|
36
35
|
}, "onboardingCockpitView/initializeOnboardingCustomerViewUpdateData", never, never>, saveOnboardingCustomerViewUpdateData: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[newOnboardingCustomer: Partial<NewOnboardingCustomer>], {
|
|
37
36
|
newOnboardingCustomer: Partial<NewOnboardingCustomer>;
|
|
38
37
|
}, "onboardingCockpitView/saveOnboardingCustomerViewUpdateData", never, never>, clearOnboardingCustomerViewUpdateData: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"onboardingCockpitView/clearOnboardingCustomerViewUpdateData">, saveOnboardingCustomerViewUpdates: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[sendInvite: boolean, skipSnackbarOnSuccess?: boolean | undefined], {
|
|
@@ -130,8 +130,8 @@ const onboardingCockpitView = (0, toolkit_1.createSlice)({
|
|
|
130
130
|
reducer(draft) {
|
|
131
131
|
draft.customerLocalStoreInitState = 'In-Progress';
|
|
132
132
|
},
|
|
133
|
-
prepare(
|
|
134
|
-
return { payload: { companyId
|
|
133
|
+
prepare(companyId) {
|
|
134
|
+
return { payload: { companyId } };
|
|
135
135
|
},
|
|
136
136
|
},
|
|
137
137
|
saveOnboardingCustomerViewUpdateData: {
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { CurrentTenant } from '../../entity/tenant/tenantSelector';
|
|
2
2
|
import { RoleMap, UserRoleType } from '../../entity/userRole/userRoleType';
|
|
3
3
|
import { MonthEndInsightsNotificationSettingsData, NotificationSettingsData, ReminderNotificationSettingsData } from './settingsViewState';
|
|
4
|
-
export declare const isAccountingTabVisible: (userRole: UserRoleType[],
|
|
5
|
-
export declare const isApprovalRulesTabVisible: (userRole: UserRoleType[],
|
|
4
|
+
export declare const isAccountingTabVisible: (userRole: UserRoleType[], currentTenant: CurrentTenant | undefined, userRoleMap?: RoleMap) => boolean;
|
|
5
|
+
export declare const isApprovalRulesTabVisible: (userRole: UserRoleType[], currentTenant: CurrentTenant | undefined, userRoleMap?: RoleMap) => boolean;
|
|
6
6
|
export declare const isBillingTabVisible: (userRole: UserRoleType[], currentTenant: CurrentTenant | undefined) => boolean;
|
|
7
7
|
export declare const isBankConnectionsTabVisible: (currentTenant: CurrentTenant | undefined, userRoleMap?: RoleMap) => boolean;
|
|
8
8
|
export declare const isBusinessVerificationTabVisible: (currentTenant: CurrentTenant | undefined, userRoleMap?: RoleMap) => boolean;
|
|
9
9
|
export declare const isCompanyDetailsTabVisible: (userRole: UserRoleType[], currentTenant: CurrentTenant | undefined, userRoleMap?: RoleMap) => boolean;
|
|
10
|
-
export declare const isIntegrationsTabVisible: (userRole: UserRoleType[],
|
|
10
|
+
export declare const isIntegrationsTabVisible: (userRole: UserRoleType[], currentTenant: CurrentTenant | undefined) => boolean;
|
|
11
11
|
export declare const isSettingsVisible: (currentTenant: CurrentTenant | undefined) => boolean;
|
|
12
12
|
export declare const isMyBankConnectionsTabVisible: (currentTenant: CurrentTenant | undefined, userRoleMap?: RoleMap) => boolean;
|
|
13
13
|
export declare const isRemindersSectionVisibleOnSettingsPage: (reminderNotificationSettings: ReminderNotificationSettingsData) => boolean;
|
|
14
14
|
export declare const isMonthEndNotificationsSectionVisibleOnSettingsPage: (monthEndInsightsNotificationSettings: MonthEndInsightsNotificationSettingsData, signedInUseEmail: string) => boolean;
|
|
15
|
-
export declare const isNotificationsTabVisible: (notificationSettings: NotificationSettingsData,
|
|
15
|
+
export declare const isNotificationsTabVisible: (notificationSettings: NotificationSettingsData, signedInUseEmail: string, currentTenant: CurrentTenant | undefined) => boolean;
|
|
@@ -4,7 +4,7 @@ exports.isNotificationsTabVisible = exports.isMonthEndNotificationsSectionVisibl
|
|
|
4
4
|
const tenantSelector_1 = require("../../entity/tenant/tenantSelector");
|
|
5
5
|
const userRoleType_1 = require("../../entity/userRole/userRoleType");
|
|
6
6
|
const vendorListSelector_1 = require("../vendorList/vendorListSelector");
|
|
7
|
-
const isAccountingTabVisible = (userRole,
|
|
7
|
+
const isAccountingTabVisible = (userRole, currentTenant, userRoleMap) => {
|
|
8
8
|
if (currentTenant == null) {
|
|
9
9
|
return false;
|
|
10
10
|
}
|
|
@@ -13,7 +13,7 @@ const isAccountingTabVisible = (userRole, isDebitCardFlagEnabled, currentTenant,
|
|
|
13
13
|
(0, userRoleType_1.hasBillPayAccessible)(currentTenant, userRoleMap) ||
|
|
14
14
|
(0, userRoleType_1.hasReimbursementAccessible)(currentTenant, userRoleMap) ||
|
|
15
15
|
(0, userRoleType_1.hasFullOrAdminLevelAccess)(userRole)) &&
|
|
16
|
-
(0, tenantSelector_1.isTenantBankingOnly)(
|
|
16
|
+
(0, tenantSelector_1.isTenantBankingOnly)(currentTenant) === false &&
|
|
17
17
|
(0, tenantSelector_1.isTenantCardsOnly)(currentTenant) === false);
|
|
18
18
|
}
|
|
19
19
|
else {
|
|
@@ -21,7 +21,7 @@ const isAccountingTabVisible = (userRole, isDebitCardFlagEnabled, currentTenant,
|
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
23
|
exports.isAccountingTabVisible = isAccountingTabVisible;
|
|
24
|
-
const isApprovalRulesTabVisible = (userRole,
|
|
24
|
+
const isApprovalRulesTabVisible = (userRole, currentTenant, userRoleMap) => {
|
|
25
25
|
var _a, _b;
|
|
26
26
|
if (currentTenant == null || userRoleMap == null) {
|
|
27
27
|
return false;
|
|
@@ -33,7 +33,7 @@ const isApprovalRulesTabVisible = (userRole, isDebitCardFlagEnabled, currentTena
|
|
|
33
33
|
(0, userRoleType_1.hasReimbursementAccessible)(currentTenant, userRoleMap) ||
|
|
34
34
|
((isBillPayTOSAccepted || isReimbursementTOSAccepted) &&
|
|
35
35
|
(0, userRoleType_1.hasFullOrAdminLevelAccess)(userRole))) &&
|
|
36
|
-
(0, tenantSelector_1.isTenantBankingOnly)(
|
|
36
|
+
(0, tenantSelector_1.isTenantBankingOnly)(currentTenant) === false &&
|
|
37
37
|
(0, tenantSelector_1.isTenantCardsOnly)(currentTenant) === false);
|
|
38
38
|
}
|
|
39
39
|
else {
|
|
@@ -97,14 +97,13 @@ const isCompanyDetailsTabVisible = (userRole, currentTenant, userRoleMap) => {
|
|
|
97
97
|
}
|
|
98
98
|
};
|
|
99
99
|
exports.isCompanyDetailsTabVisible = isCompanyDetailsTabVisible;
|
|
100
|
-
const isIntegrationsTabVisible = (userRole,
|
|
100
|
+
const isIntegrationsTabVisible = (userRole, currentTenant) => {
|
|
101
101
|
if (currentTenant == null) {
|
|
102
102
|
return false;
|
|
103
103
|
}
|
|
104
104
|
if ((0, exports.isSettingsVisible)(currentTenant)) {
|
|
105
105
|
return ((0, userRoleType_1.hasFullOrAdminLevelAccess)(userRole) &&
|
|
106
|
-
!((0, tenantSelector_1.isTenantBankingOnly)(
|
|
107
|
-
(0, tenantSelector_1.isTenantCardsOnly)(currentTenant)));
|
|
106
|
+
!((0, tenantSelector_1.isTenantBankingOnly)(currentTenant) || (0, tenantSelector_1.isTenantCardsOnly)(currentTenant)));
|
|
108
107
|
}
|
|
109
108
|
else {
|
|
110
109
|
return false;
|
|
@@ -146,14 +145,14 @@ const isMonthEndNotificationsSectionVisibleOnSettingsPage = (monthEndInsightsNot
|
|
|
146
145
|
monthEndInsightsNotificationSettings.recipientEmailIds.includes(signedInUseEmail));
|
|
147
146
|
};
|
|
148
147
|
exports.isMonthEndNotificationsSectionVisibleOnSettingsPage = isMonthEndNotificationsSectionVisibleOnSettingsPage;
|
|
149
|
-
const isNotificationsTabVisible = (notificationSettings,
|
|
148
|
+
const isNotificationsTabVisible = (notificationSettings, signedInUseEmail, currentTenant) => {
|
|
150
149
|
if (currentTenant == null) {
|
|
151
150
|
return false;
|
|
152
151
|
}
|
|
153
152
|
const { reminderNotificationSettings, monthEndInsightsNotificationSettings } = notificationSettings;
|
|
154
153
|
return (((0, exports.isRemindersSectionVisibleOnSettingsPage)(reminderNotificationSettings) ||
|
|
155
154
|
(0, exports.isMonthEndNotificationsSectionVisibleOnSettingsPage)(monthEndInsightsNotificationSettings, signedInUseEmail)) &&
|
|
156
|
-
(0, tenantSelector_1.isTenantBankingOnly)(
|
|
155
|
+
(0, tenantSelector_1.isTenantBankingOnly)(currentTenant) === false &&
|
|
157
156
|
(0, tenantSelector_1.isTenantCardsOnly)(currentTenant) === false);
|
|
158
157
|
};
|
|
159
158
|
exports.isNotificationsTabVisible = isNotificationsTabVisible;
|
|
@@ -48,7 +48,7 @@ const getReviewPageBillDetail = (state, billId) => {
|
|
|
48
48
|
let file;
|
|
49
49
|
let contactDetails = [];
|
|
50
50
|
const primaryPaymentAccount = (0, paymentAccountSelector_1.getPaymentAccountsByPaymentAccountIds)(paymentAccountState, paymentAccountListState.paymentAccountIds);
|
|
51
|
-
const allDepositAccounts = (0, depositAccountListSelector_1.
|
|
51
|
+
const allDepositAccounts = (0, depositAccountListSelector_1.getAllDepostAccounts)(depositAccountState, depositAccountListState).depositAccounts;
|
|
52
52
|
const withdrawFromList = (0, setupViewSelector_1.getAllFundingAccounts)(allDepositAccounts, primaryPaymentAccount, paymentAccountListState.paymentAccountBalanceFetchStatus);
|
|
53
53
|
let fetchState = 'Not-Started';
|
|
54
54
|
let sourceBillDetailFetchState = 'Not-Started';
|
|
@@ -2,7 +2,6 @@ import { Amount } from '../../../../commonStateTypes/amount';
|
|
|
2
2
|
import { FetchState, FetchStateAndError, ID } from '../../../../commonStateTypes/common';
|
|
3
3
|
import { AmountPayload } from '../../../../entity/reimbursement/reimbursementPayload';
|
|
4
4
|
import { ZeniAPIStatus } from '../../../../responsePayload';
|
|
5
|
-
import { FundingAccount } from '../../commonSetup/setupViewSelector';
|
|
6
5
|
import { InvoiceProcessingPayload } from './editBillViewPayload';
|
|
7
6
|
import { AddBillAutoFields, BillDetailLocalData, EditBillDetailViewState, OutsideZeniPaymentLocalData } from './editBillViewState';
|
|
8
7
|
export declare const initialState: EditBillDetailViewState;
|
|
@@ -83,10 +82,6 @@ export declare const fetchEditBillDetailPage: import("@reduxjs/toolkit").ActionC
|
|
|
83
82
|
billId?: ID;
|
|
84
83
|
}, "editBillView/updateOutsideZeniPaymentLocalData">, discardOutsideZeniPaymentLocalData: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
85
84
|
billId?: ID;
|
|
86
|
-
}, "editBillView/discardOutsideZeniPaymentLocalData"
|
|
87
|
-
billId?: ID;
|
|
88
|
-
withdrawFromAccountId?: ID;
|
|
89
|
-
withdrawFromList: FundingAccount[];
|
|
90
|
-
}, "editBillView/updateWithdrawFromAccountId">;
|
|
85
|
+
}, "editBillView/discardOutsideZeniPaymentLocalData">;
|
|
91
86
|
declare const _default: import("redux").Reducer<EditBillDetailViewState>;
|
|
92
87
|
export default _default;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var _a;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.
|
|
4
|
+
exports.discardOutsideZeniPaymentLocalData = exports.updateOutsideZeniPaymentLocalData = exports.markBillForRetry = exports.waitForVendorByIdThenSaveBillUpdatetoLocalStore = exports.fetchVendorAndUpdateBillLocalData = exports.updateHomeCurrencyConversion = exports.currencyConversionValueSuccessOrFailure = exports.convertAmountToHomeCurrency = exports.updateVendorContactSuccessOrFailure = exports.updateVendorContact = exports.updateSuggestedVendorIdFromParsedInvoice = exports.updateRecommendedVendorId = exports.updateBillUploadFetchState = exports.updateAddBillAutoFields = exports.updateShowAutofill = exports.updateInternationalTransferFeeBearerPaymentMethodInLocalData = exports.waitForVendorByNameThenParsetoLocalStore = exports.waitForBillDetailThenInitializeLocalStore = exports.clearEditBillViewDetail = exports.parseInvoiceToBill = exports.updateEditBillFetchStateCompleted = exports.saveBillSuccessOrFailure = exports.saveBillDetail = exports.discardBillUpdatesInLocalStore = exports.saveBillUpdatesToLocalStore = exports.initializeBillToLocalStore = exports.fetchVendorByNameAndParseInvoice = exports.fetchBillAndInitializeLocalStore = exports.fetchEditBillDetailPage = exports.initialState = void 0;
|
|
5
5
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
6
|
const amount_1 = require("../../../../commonStateTypes/amount");
|
|
7
7
|
const helpers_1 = require("../../helpers");
|
|
@@ -14,7 +14,6 @@ exports.initialState = {
|
|
|
14
14
|
fetchState: 'Not-Started',
|
|
15
15
|
error: undefined,
|
|
16
16
|
},
|
|
17
|
-
newAddedBillPaymentAccountId: undefined,
|
|
18
17
|
};
|
|
19
18
|
const editBillView = (0, toolkit_1.createSlice)({
|
|
20
19
|
name: 'editBillView',
|
|
@@ -367,29 +366,12 @@ const editBillView = (0, toolkit_1.createSlice)({
|
|
|
367
366
|
const key = (0, billDetailViewState_1.getBillTransactionDetailKey)(action.payload.billId);
|
|
368
367
|
draft.editBillStateById[key].isBillMarkedForRetry = true;
|
|
369
368
|
},
|
|
370
|
-
updateNewAddedBillPaymentAccount(draft, action) {
|
|
371
|
-
draft.newAddedBillPaymentAccountId = action.payload;
|
|
372
|
-
},
|
|
373
|
-
updateWithdrawFromAccountId(draft, action) {
|
|
374
|
-
const { billId, withdrawFromAccountId, withdrawFromList } = action.payload;
|
|
375
|
-
if (withdrawFromAccountId != null && withdrawFromList.length > 0) {
|
|
376
|
-
const newAddedAccount = withdrawFromList.find((account) => account.id === withdrawFromAccountId);
|
|
377
|
-
if (billId != null) {
|
|
378
|
-
const billKey = (0, billDetailViewState_1.getBillTransactionDetailKey)(billId);
|
|
379
|
-
draft.editBillStateById[billKey].billDetailLocalData.paymentDetailsSection = Object.assign(Object.assign({}, draft.editBillStateById[billKey].billDetailLocalData
|
|
380
|
-
.paymentDetailsSection), { withdrawFrom: newAddedAccount });
|
|
381
|
-
}
|
|
382
|
-
else {
|
|
383
|
-
draft.newBillState.billDetailLocalData.paymentDetailsSection = Object.assign(Object.assign({}, draft.newBillState.billDetailLocalData.paymentDetailsSection), { withdrawFrom: newAddedAccount });
|
|
384
|
-
}
|
|
385
|
-
}
|
|
386
|
-
},
|
|
387
369
|
clearEditBillViewDetail(draft) {
|
|
388
370
|
Object.assign(draft, exports.initialState);
|
|
389
371
|
},
|
|
390
372
|
},
|
|
391
373
|
});
|
|
392
|
-
_a = editBillView.actions, exports.fetchEditBillDetailPage = _a.fetchEditBillDetailPage, exports.fetchBillAndInitializeLocalStore = _a.fetchBillAndInitializeLocalStore, exports.fetchVendorByNameAndParseInvoice = _a.fetchVendorByNameAndParseInvoice, exports.initializeBillToLocalStore = _a.initializeBillToLocalStore, exports.saveBillUpdatesToLocalStore = _a.saveBillUpdatesToLocalStore, exports.discardBillUpdatesInLocalStore = _a.discardBillUpdatesInLocalStore, exports.saveBillDetail = _a.saveBillDetail, exports.saveBillSuccessOrFailure = _a.saveBillSuccessOrFailure, exports.updateEditBillFetchStateCompleted = _a.updateEditBillFetchStateCompleted, exports.parseInvoiceToBill = _a.parseInvoiceToBill, exports.clearEditBillViewDetail = _a.clearEditBillViewDetail, exports.waitForBillDetailThenInitializeLocalStore = _a.waitForBillDetailThenInitializeLocalStore, exports.waitForVendorByNameThenParsetoLocalStore = _a.waitForVendorByNameThenParsetoLocalStore, exports.updateInternationalTransferFeeBearerPaymentMethodInLocalData = _a.updateInternationalTransferFeeBearerPaymentMethodInLocalData, exports.updateShowAutofill = _a.updateShowAutofill, exports.updateAddBillAutoFields = _a.updateAddBillAutoFields, exports.updateBillUploadFetchState = _a.updateBillUploadFetchState, exports.updateRecommendedVendorId = _a.updateRecommendedVendorId, exports.updateSuggestedVendorIdFromParsedInvoice = _a.updateSuggestedVendorIdFromParsedInvoice, exports.updateVendorContact = _a.updateVendorContact, exports.updateVendorContactSuccessOrFailure = _a.updateVendorContactSuccessOrFailure, exports.convertAmountToHomeCurrency = _a.convertAmountToHomeCurrency, exports.currencyConversionValueSuccessOrFailure = _a.currencyConversionValueSuccessOrFailure, exports.updateHomeCurrencyConversion = _a.updateHomeCurrencyConversion, exports.fetchVendorAndUpdateBillLocalData = _a.fetchVendorAndUpdateBillLocalData, exports.waitForVendorByIdThenSaveBillUpdatetoLocalStore = _a.waitForVendorByIdThenSaveBillUpdatetoLocalStore, exports.markBillForRetry = _a.markBillForRetry, exports.updateOutsideZeniPaymentLocalData = _a.updateOutsideZeniPaymentLocalData, exports.discardOutsideZeniPaymentLocalData = _a.discardOutsideZeniPaymentLocalData
|
|
374
|
+
_a = editBillView.actions, exports.fetchEditBillDetailPage = _a.fetchEditBillDetailPage, exports.fetchBillAndInitializeLocalStore = _a.fetchBillAndInitializeLocalStore, exports.fetchVendorByNameAndParseInvoice = _a.fetchVendorByNameAndParseInvoice, exports.initializeBillToLocalStore = _a.initializeBillToLocalStore, exports.saveBillUpdatesToLocalStore = _a.saveBillUpdatesToLocalStore, exports.discardBillUpdatesInLocalStore = _a.discardBillUpdatesInLocalStore, exports.saveBillDetail = _a.saveBillDetail, exports.saveBillSuccessOrFailure = _a.saveBillSuccessOrFailure, exports.updateEditBillFetchStateCompleted = _a.updateEditBillFetchStateCompleted, exports.parseInvoiceToBill = _a.parseInvoiceToBill, exports.clearEditBillViewDetail = _a.clearEditBillViewDetail, exports.waitForBillDetailThenInitializeLocalStore = _a.waitForBillDetailThenInitializeLocalStore, exports.waitForVendorByNameThenParsetoLocalStore = _a.waitForVendorByNameThenParsetoLocalStore, exports.updateInternationalTransferFeeBearerPaymentMethodInLocalData = _a.updateInternationalTransferFeeBearerPaymentMethodInLocalData, exports.updateShowAutofill = _a.updateShowAutofill, exports.updateAddBillAutoFields = _a.updateAddBillAutoFields, exports.updateBillUploadFetchState = _a.updateBillUploadFetchState, exports.updateRecommendedVendorId = _a.updateRecommendedVendorId, exports.updateSuggestedVendorIdFromParsedInvoice = _a.updateSuggestedVendorIdFromParsedInvoice, exports.updateVendorContact = _a.updateVendorContact, exports.updateVendorContactSuccessOrFailure = _a.updateVendorContactSuccessOrFailure, exports.convertAmountToHomeCurrency = _a.convertAmountToHomeCurrency, exports.currencyConversionValueSuccessOrFailure = _a.currencyConversionValueSuccessOrFailure, exports.updateHomeCurrencyConversion = _a.updateHomeCurrencyConversion, exports.fetchVendorAndUpdateBillLocalData = _a.fetchVendorAndUpdateBillLocalData, exports.waitForVendorByIdThenSaveBillUpdatetoLocalStore = _a.waitForVendorByIdThenSaveBillUpdatetoLocalStore, exports.markBillForRetry = _a.markBillForRetry, exports.updateOutsideZeniPaymentLocalData = _a.updateOutsideZeniPaymentLocalData, exports.discardOutsideZeniPaymentLocalData = _a.discardOutsideZeniPaymentLocalData;
|
|
393
375
|
exports.default = editBillView.reducer;
|
|
394
376
|
function doUpdateRecurringBillLocalData(billDetail, currentConfig, prevConfig) {
|
|
395
377
|
var _a, _b, _c, _d;
|
|
@@ -8,7 +8,6 @@ import { AccountBase, RecommendedAccountBase } from '../../../../entity/account/
|
|
|
8
8
|
import { BillPayInfo, BillPaymentMethod, BillStageCodeType, BillTransaction, InternationalTransferFeeBearerPaymentMethod } from '../../../../entity/billPay/billTransaction/billTransactionState';
|
|
9
9
|
import { RecurringBillState } from '../../../../entity/billPay/recurringBills/recurringBillsState';
|
|
10
10
|
import { ClassBase, RecommendedClassBase } from '../../../../entity/class/classState';
|
|
11
|
-
import { PaymentAccount } from '../../../../entity/paymentAccount/paymentAccountState';
|
|
12
11
|
import { PiLabel } from '../../../../entity/paymentInstrument/paymentInstrument';
|
|
13
12
|
import { LoggedInUser } from '../../../../entity/tenant/tenantState';
|
|
14
13
|
import { Attachment } from '../../../../entity/transaction/stateTypes/attachment';
|
|
@@ -23,7 +22,6 @@ import { ClassListSelectorView } from '../../../classList/classListSelector';
|
|
|
23
22
|
import { VendorDetailLocalData } from '../../../commonVendorView/vendorView/vendorViewState';
|
|
24
23
|
import { ActivityHistorySelectorView } from '../../commonHistoryView/commonHistorySelector';
|
|
25
24
|
import { FundingAccount } from '../../commonSetup/setupViewSelector';
|
|
26
|
-
import { PlaidConnectionDetails } from '../../plaidAccount/plaidAccountViewState';
|
|
27
25
|
import { BillActivity } from '../billDetailView/billDetailViewSelector';
|
|
28
26
|
import { AccountTypeSubConfigCodeKeyType, BillPayConfig, BillPayConfigState } from '../billPayConfig/billPayConfigState';
|
|
29
27
|
import { DuplicateBillsSelectorView } from '../billPayReview/billPayReviewSelector';
|
|
@@ -114,9 +112,6 @@ export interface EditBillDetailSelectorView extends SelectorView {
|
|
|
114
112
|
isBillMarkedForRetry?: boolean;
|
|
115
113
|
internationalWireOnboardingStatus?: AllowedValueWithCode;
|
|
116
114
|
isEligibleForRetryOBP?: boolean;
|
|
117
|
-
plaidConnectionDetails: PlaidConnectionDetails;
|
|
118
|
-
paymentAccount?: PaymentAccount;
|
|
119
|
-
newAddedBillPaymentAccountId?: ID;
|
|
120
115
|
}
|
|
121
116
|
export interface EditBillInitialDetails {
|
|
122
117
|
vendor?: Vendor;
|
|
@@ -25,7 +25,6 @@ const getCompanyView_1 = require("../../../companyView/selectorHelpers/getCompan
|
|
|
25
25
|
const commonHistorySelector_1 = require("../../commonHistoryView/commonHistorySelector");
|
|
26
26
|
const setupViewSelector_1 = require("../../commonSetup/setupViewSelector");
|
|
27
27
|
const helpers_1 = require("../../helpers");
|
|
28
|
-
const plaidAccountViewSelector_1 = require("../../plaidAccount/plaidAccountViewSelector");
|
|
29
28
|
const depositAccountListSelector_1 = require("../../zeniAccounts/depositAccountList/depositAccountListSelector");
|
|
30
29
|
const billDetailViewSelector_1 = require("../billDetailView/billDetailViewSelector");
|
|
31
30
|
const billDetailViewState_1 = require("../billDetailView/billDetailViewState");
|
|
@@ -37,7 +36,7 @@ const billPaySetupApproverViewSelector_1 = require("../billPaySetupApproverView/
|
|
|
37
36
|
const previousBillsSelector_1 = require("../previousBills/previousBillsSelector");
|
|
38
37
|
const getEditBillDetail = (state, isVendorRecommendationFeatureEnabled, isZeniAccountsEnabled, billId) => {
|
|
39
38
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5;
|
|
40
|
-
const { accountListState, accountState, bankAccountState, billDetailViewState, paymentAccountListState, billTransactionState, billPayConfigState, classListState, classState, editBillDetailViewState, paymentAccountState, vendorState, tenantState, companyState, userState, commonHistoryState, contactState, paymentInstrumentState, recurringBillState, depositAccountListState, depositAccountState, billPaySetupApproverViewState,
|
|
39
|
+
const { accountListState, accountState, bankAccountState, billDetailViewState, paymentAccountListState, billTransactionState, billPayConfigState, classListState, classState, editBillDetailViewState, paymentAccountState, vendorState, tenantState, companyState, userState, commonHistoryState, contactState, paymentInstrumentState, recurringBillState, depositAccountListState, depositAccountState, billPaySetupApproverViewState, } = state;
|
|
41
40
|
const transaction = (0, get_1.default)(billTransactionState.transactionById, billId !== null && billId !== void 0 ? billId : '', undefined);
|
|
42
41
|
let recommendations = {};
|
|
43
42
|
if (billId != null) {
|
|
@@ -86,7 +85,7 @@ const getEditBillDetail = (state, isVendorRecommendationFeatureEnabled, isZeniAc
|
|
|
86
85
|
: undefined;
|
|
87
86
|
const isCompanyZeniAccountsSetUpDone = (_g = currentCompany === null || currentCompany === void 0 ? void 0 : currentCompany.company.companyZeniAccountInfo.isZeniAccountEnabled) !== null && _g !== void 0 ? _g : false;
|
|
88
87
|
const allDepositAccounts = isZeniAccountsEnabled && isCompanyZeniAccountsSetUpDone
|
|
89
|
-
? (0, depositAccountListSelector_1.
|
|
88
|
+
? (0, depositAccountListSelector_1.getAllDepostAccounts)(depositAccountState, depositAccountListState)
|
|
90
89
|
.depositAccounts
|
|
91
90
|
: [];
|
|
92
91
|
if (allDepositAccounts.length === 0 && fromDepositAccount != null) {
|
|
@@ -325,9 +324,6 @@ const getEditBillDetail = (state, isVendorRecommendationFeatureEnabled, isZeniAc
|
|
|
325
324
|
const internationalWireOnboardingStatus = companyView === null || companyView === void 0 ? void 0 : companyView.company.company.companyBillPayInfo.internationalWireOnboardingStatus;
|
|
326
325
|
const billTransactionDetails = (0, get_1.default)(billDetailViewState.billDetailById, key, undefined);
|
|
327
326
|
const isEligibleForRetryOBP = billTransactionDetails === null || billTransactionDetails === void 0 ? void 0 : billTransactionDetails.zeniAssist.isEligibleForRetryOBP;
|
|
328
|
-
const { plaidConnectionDetails } = (0, plaidAccountViewSelector_1.getPlaidAccountDetails)(plaidAccountViewState, 'bill_pay_detail');
|
|
329
|
-
const { paymentAccount } = (0, setupViewSelector_1.getCommonSetupViewDetails)(state, companyId !== null && companyId !== void 0 ? companyId : '', 'bill_pay', 'bill_pay_detail');
|
|
330
|
-
const newAddedBillPaymentAccountId = editBillDetailViewState.newAddedBillPaymentAccountId;
|
|
331
327
|
return {
|
|
332
328
|
showVendorGptRecommendationText,
|
|
333
329
|
recommendedVendor,
|
|
@@ -379,9 +375,6 @@ const getEditBillDetail = (state, isVendorRecommendationFeatureEnabled, isZeniAc
|
|
|
379
375
|
isBillMarkedForRetry,
|
|
380
376
|
internationalWireOnboardingStatus,
|
|
381
377
|
isEligibleForRetryOBP,
|
|
382
|
-
plaidConnectionDetails,
|
|
383
|
-
paymentAccount,
|
|
384
|
-
newAddedBillPaymentAccountId,
|
|
385
378
|
};
|
|
386
379
|
};
|
|
387
380
|
exports.getEditBillDetail = getEditBillDetail;
|
|
@@ -31,7 +31,6 @@ export interface EditBillDetailViewState {
|
|
|
31
31
|
newBillState: EditBillDetail;
|
|
32
32
|
editBillStateById: Record<BillTransactionDetailKey, EditBillDetail>;
|
|
33
33
|
updateVendorContactState: FetchStateAndError;
|
|
34
|
-
newAddedBillPaymentAccountId?: ID;
|
|
35
34
|
}
|
|
36
35
|
export interface RecurringBillInstance {
|
|
37
36
|
instance: number;
|
package/lib/view/spendManagement/chargeCards/cardUserOnboarding/cardUserOnboardingSelector.js
CHANGED
|
@@ -4,17 +4,16 @@ exports.getCardUserOnboardingView = void 0;
|
|
|
4
4
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
5
5
|
const reduceFetchState_1 = require("../../../../commonStateTypes/reduceFetchState");
|
|
6
6
|
const userSelector_1 = require("../../../../entity/user/userSelector");
|
|
7
|
-
const twoFactorAuthentication_1 = require("../../../twoFactorAuthentication/twoFactorAuthentication");
|
|
8
7
|
const twoFactorAuthenticationSelector_1 = require("../../../twoFactorAuthentication/twoFactorAuthenticationSelector");
|
|
9
8
|
exports.getCardUserOnboardingView = (0, toolkit_1.createSelector)((state) => state, (state) => state.cardUserOnboardingState, (state) => state.settingsViewState, (state) => state.tenantState, (state) => state.userState, (state, cardUserOnboardingState, settingsViewState, tenantState, userState) => {
|
|
10
|
-
var _a
|
|
11
|
-
const twoFAView = (
|
|
9
|
+
var _a;
|
|
10
|
+
const twoFAView = (0, twoFactorAuthenticationSelector_1.getTwoFactorAuthenticationView)(state);
|
|
12
11
|
const updateStatus = (0, reduceFetchState_1.reduceAllFetchState)([
|
|
13
12
|
settingsViewState.profile.updateStatus,
|
|
14
13
|
cardUserOnboardingState.sendOtpStatus,
|
|
15
14
|
cardUserOnboardingState.cardUserOnboardingActivationWaitStatus,
|
|
16
15
|
]);
|
|
17
|
-
const userId = (
|
|
16
|
+
const userId = (_a = tenantState.loggedInUser) === null || _a === void 0 ? void 0 : _a.userId;
|
|
18
17
|
if (userId == null) {
|
|
19
18
|
throw new Error(`User not logged in`);
|
|
20
19
|
}
|