@zeniai/client-epic-state 4.15.34 → 4.15.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonPayloadTypes/recommendationPayload.d.ts +1 -0
- package/lib/commonStateTypes/timePeriod.d.ts +1 -1
- package/lib/commonStateTypes/timePeriod.js +2 -2
- package/lib/commonStateTypes/viewAndReport/agingReportStateTypes.js +1 -1
- package/lib/commonStateTypes/viewAndReport/viewAndReport.d.ts +2 -2
- package/lib/commonStateTypes/viewAndReport/viewAndReport.js +1 -0
- package/lib/configureStore.js +2 -1
- package/lib/entity/account/accountState.d.ts +1 -1
- package/lib/entity/accountGroup/accountGroupState.d.ts +1 -1
- package/lib/entity/accountRecon/accountReconPayload.d.ts +70 -0
- package/lib/entity/accountRecon/accountReconPayload.js +125 -0
- package/lib/entity/accountRecon/accountReconReducer.d.ts +16 -0
- package/lib/entity/accountRecon/accountReconReducer.js +71 -0
- package/lib/entity/accountRecon/accountReconSelector.d.ts +28 -0
- package/lib/entity/accountRecon/accountReconSelector.js +44 -0
- package/lib/entity/accountRecon/accountReconState.d.ts +70 -0
- package/lib/entity/accountRecon/accountReconState.js +28 -0
- package/lib/entity/class/classReducer.d.ts +4 -4
- package/lib/entity/class/classState.d.ts +1 -1
- package/lib/entity/company/companyReducer.js +0 -1
- package/lib/entity/customer/customerPayload.d.ts +1 -1
- package/lib/entity/customer/customerPayload.js +16 -6
- package/lib/entity/forecast/forecastState.d.ts +1 -1
- package/lib/entity/sectionAccountsView/sectionAccountsView.d.ts +1 -1
- package/lib/entity/sectionClassesViewV2/sectionClassesView.d.ts +1 -1
- package/lib/entity/sectionClassesViewV2/sectionClassesViewReducer.d.ts +2 -2
- package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.js +4 -0
- package/lib/entity/task/taskState.d.ts +1 -1
- package/lib/entity/tenant/clearAllEpic.d.ts +4 -2
- package/lib/entity/tenant/clearAllEpic.js +4 -0
- package/lib/entity/tenant/tenantReducer.js +0 -1
- package/lib/entity/transaction/payloadTypes/customerTransactionPayload.d.ts +1 -1
- package/lib/entity/transaction/payloadTypes/customerTransactionPayload.js +1 -2
- package/lib/entity/transaction/payloadTypes/reconciliationTransactionPayloads.d.ts +35 -0
- package/lib/entity/transaction/payloadTypes/reconciliationTransactionPayloads.js +53 -0
- package/lib/entity/transaction/payloadTypes/transactionPayload.d.ts +2 -0
- package/lib/entity/transaction/payloadTypes/transactionPayload.js +9 -6
- package/lib/entity/transaction/payloadTypes/vendorTransactionPayload.d.ts +9 -1
- package/lib/entity/transaction/payloadTypes/vendorTransactionPayload.js +23 -2
- package/lib/entity/transaction/stateTypes/reconciliationTransaction.d.ts +32 -0
- package/lib/entity/transaction/stateTypes/reconciliationTransaction.js +10 -0
- package/lib/entity/transaction/stateTypes/transaction.d.ts +3 -1
- package/lib/entity/transaction/stateTypes/transactionType.d.ts +1 -1
- package/lib/entity/transaction/stateTypes/transactionType.js +1 -1
- package/lib/entity/transaction/stateTypes/vendorTransaction.d.ts +5 -0
- package/lib/entity/transaction/stateTypes/vendorTransaction.js +5 -1
- package/lib/entity/transaction/toSupportedTransaction.js +6 -1
- package/lib/entity/transaction/transactionReducer.d.ts +17 -0
- package/lib/entity/transaction/transactionReducer.js +47 -2
- package/lib/entity/transaction/transactionSelector.d.ts +2 -0
- package/lib/entity/transaction/transactionSelector.js +5 -0
- package/lib/entity/transaction/transactionState.d.ts +6 -4
- package/lib/entity/vendorExpense/vendorExpenseReducer.js +0 -1
- package/lib/entity/vendorExpense/vendorExpenseSelector.d.ts +2 -2
- package/lib/epic.d.ts +6 -1
- package/lib/epic.js +6 -1
- package/lib/index.d.ts +22 -13
- package/lib/index.js +56 -27
- package/lib/init.d.ts +2 -1
- package/lib/init.js +9 -2
- package/lib/reducer.d.ts +7 -1
- package/lib/reducer.js +6 -0
- package/lib/view/accountList/accountListReducer.js +1 -3
- package/lib/view/accountMappingView/accountMappingReducer.js +0 -1
- package/lib/view/apAgingView/apAgingDetail/apAgingDetailReducer.js +1 -2
- package/lib/view/auditReportView/auditReportViewState.d.ts +1 -1
- package/lib/view/balanceSheet/balanceSheetReducer.js +1 -6
- package/lib/view/bankAccountView/bankAccountViewReducer.js +0 -1
- package/lib/view/billPayCard/billPayCardSelector.d.ts +1 -1
- package/lib/view/cardBalance/cardBalanceSelector.d.ts +1 -1
- package/lib/view/cashBalance/cashBalanceSelector.d.ts +1 -1
- package/lib/view/cashFlow/cashFlowReducer.js +1 -4
- package/lib/view/cashInCashOut/cashInCashOutSelector.d.ts +1 -1
- package/lib/view/cashPosition/cashPositionReducer.js +0 -1
- package/lib/view/cashPosition/cashPositionSelector.d.ts +1 -1
- package/lib/view/commonVendorView/vendorView/epics/fetchAndUpdateVendorRecommendationsEpic.js +1 -3
- package/lib/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewReducer.d.ts +2 -2
- package/lib/view/companyView/companyViewReducer.js +1 -10
- package/lib/view/dashboard/dashboardEpic.js +0 -2
- package/lib/view/dashboard/dashboardReducer.d.ts +2 -2
- package/lib/view/expenseAutomationView/epics/accountRecon/fetchReconciliationViewEpic.d.ts +15 -0
- package/lib/view/expenseAutomationView/epics/accountRecon/fetchReconciliationViewEpic.js +118 -0
- package/lib/view/expenseAutomationView/epics/accountRecon/initialiseLocalDataForSelectedAccountIdEpic.d.ts +10 -0
- package/lib/view/expenseAutomationView/epics/accountRecon/initialiseLocalDataForSelectedAccountIdEpic.js +49 -0
- package/lib/view/expenseAutomationView/epics/accountRecon/saveReconciliationDetailEpic.d.ts +14 -0
- package/lib/view/expenseAutomationView/epics/accountRecon/saveReconciliationDetailEpic.js +169 -0
- package/lib/view/expenseAutomationView/epics/accountRecon/saveReconciliationReviewEpic.d.ts +9 -0
- package/lib/view/expenseAutomationView/epics/accountRecon/saveReconciliationReviewEpic.js +154 -0
- package/lib/view/expenseAutomationView/epics/accountRecon/updateReconcileTabLocalDataEpic.d.ts +6 -0
- package/lib/view/expenseAutomationView/epics/accountRecon/updateReconcileTabLocalDataEpic.js +110 -0
- package/lib/view/expenseAutomationView/epics/common/fetchAllExpenseAutomationTabsEpic.d.ts +2 -1
- package/lib/view/expenseAutomationView/epics/common/fetchAllExpenseAutomationTabsEpic.js +24 -10
- package/lib/view/expenseAutomationView/epics/common/refreshExpenseAutomationCurrentTabEpic.d.ts +2 -1
- package/lib/view/expenseAutomationView/epics/common/refreshExpenseAutomationCurrentTabEpic.js +14 -0
- package/lib/view/expenseAutomationView/epics/transactionCategorization/updateTransactionCategorizationEpic.js +32 -5
- package/lib/view/expenseAutomationView/expenseAutomationViewReducer.d.ts +2 -2
- package/lib/view/expenseAutomationView/expenseAutomationViewReducer.js +1 -5
- package/lib/view/expenseAutomationView/expenseAutomationViewSelector.js +17 -2
- package/lib/view/expenseAutomationView/expenseAutomationViewState.d.ts +2 -2
- package/lib/view/expenseAutomationView/expenseAutomationViewState.js +1 -1
- package/lib/view/expenseAutomationView/helpers/reconciliationHelpers.d.ts +7 -0
- package/lib/view/expenseAutomationView/helpers/reconciliationHelpers.js +18 -0
- package/lib/view/expenseAutomationView/helpers/saveTransactionHelper.js +111 -35
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.js +84 -10
- package/lib/view/expenseAutomationView/payload/reconciliationPayload.d.ts +28 -0
- package/lib/view/expenseAutomationView/payload/reconciliationPayload.js +51 -0
- package/lib/view/expenseAutomationView/reducers/reconciliationViewReducer.d.ts +66 -0
- package/lib/view/expenseAutomationView/reducers/reconciliationViewReducer.js +384 -0
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.d.ts +12 -1
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.js +66 -7
- package/lib/view/expenseAutomationView/selectorTypes/expenseAutomationViewSelectorTypes.d.ts +2 -0
- package/lib/view/expenseAutomationView/selectorTypes/expenseAutomationViewSelectorTypes.js +1 -1
- package/lib/view/expenseAutomationView/selectorTypes/reconciliationViewSelectorTypes.d.ts +51 -0
- package/lib/view/expenseAutomationView/selectorTypes/reconciliationViewSelectorTypes.js +7 -0
- package/lib/view/expenseAutomationView/selectors/reconciliationViewSelector.d.ts +5 -0
- package/lib/view/expenseAutomationView/selectors/reconciliationViewSelector.js +250 -0
- package/lib/view/expenseAutomationView/types/reconciliationViewState.d.ts +103 -0
- package/lib/view/expenseAutomationView/types/reconciliationViewState.js +38 -0
- package/lib/view/expenseAutomationView/types/transactionsViewState.d.ts +10 -0
- package/lib/view/financeStatement/financeStatementReducer.d.ts +1 -1
- package/lib/view/financeStatement/financeStatementReducer.js +1 -4
- package/lib/view/globalMerchantView/globalMerchantViewReducer.d.ts +2 -2
- package/lib/view/netBurnOrIncome/netBurnOrIncomeReducer.js +3 -10
- package/lib/view/netBurnOrIncomeClassesView/netBurnOrIncomeClassesViewReducer.js +1 -6
- package/lib/view/netBurnOrIncomeStoryCard/netBurnOrIncomeStoryCardReducer.js +0 -1
- package/lib/view/onboardingView/cockpitView/onboardingCockpitViewReducer.js +0 -3
- package/lib/view/opEx/opExForTimeFrameEpic.js +1 -1
- package/lib/view/opEx/opExReducer.js +4 -14
- package/lib/view/opExByVendor/opExByVendorReducer.js +1 -3
- package/lib/view/opExClassesView/opExClassesViewReducer.js +1 -6
- package/lib/view/people/fetchPeopleEpic.js +1 -3
- package/lib/view/people/invitePeopleEpic.js +1 -3
- package/lib/view/people/inviteZeniPeopleEpic.js +1 -3
- package/lib/view/people/peopleReducer.js +0 -1
- package/lib/view/people/peopleSaveUpdatesEpic.js +1 -1
- package/lib/view/profitAndLoss/profitAndLossReducer.js +1 -6
- package/lib/view/profitAndLossClassesView/profitAndLossClassesViewReducer.js +1 -6
- package/lib/view/recommendation/recommendationReducer.js +1 -4
- package/lib/view/reimbursementCard/reimbursementCardSelector.d.ts +1 -1
- package/lib/view/reportUIOptions/updateReportUIOptionThisPeriodEpic.js +1 -3
- package/lib/view/revenue/revenueReducer.js +3 -10
- package/lib/view/revenueClassesView/revenueClassesViewReducer.js +1 -6
- package/lib/view/scheduleView/scheduleListView/scheduleListTypes.d.ts +1 -1
- package/lib/view/settingsView/settingsViewReducer.js +0 -1
- package/lib/view/spendManagement/billPay/billList/billListReducer.js +0 -1
- package/lib/view/spendManagement/billPay/billPayConfig/billPayConfigPayload.d.ts +5 -1
- package/lib/view/spendManagement/billPay/billPayConfig/billPayConfigState.js +0 -6
- package/lib/view/spendManagement/billPay/billsBulkActionView/epics/validateBillsBulkActionEpic.ts.js +4 -3
- package/lib/view/spendManagement/billPay/editBillView/epics/fetchBillAndInitializeLocalStoreEpic.js +1 -3
- package/lib/view/spendManagement/billPay/editBillView/epics/saveBillDetailEpic.d.ts +2 -1
- package/lib/view/spendManagement/plaidAccount/epic/plaidConnection/establishPlaidConnectionEpic.js +11 -3
- package/lib/view/spendManagement/plaidAccount/plaidAccountViewReducer.d.ts +2 -1
- package/lib/view/spendManagement/plaidAccount/plaidAccountViewReducer.js +3 -1
- package/lib/view/spendManagement/plaidAccount/plaidAccountViewState.d.ts +1 -1
- package/lib/view/spendManagement/reimbursement/editRemiView/epics/fetchRecommendationsAndUpdateMerchantRecommendationsEpic.js +2 -6
- package/lib/view/spendManagement/reimbursement/editRemiView/epics/fetchRemiAndInitializeLocalStoreEpic.js +1 -3
- package/lib/view/spendManagement/reimbursement/remiListView/remiListReducer.js +0 -1
- package/lib/view/spendManagement/zeniAccounts/expressPay/epics/fetchExpressPayInitialDetailsEpic.d.ts +2 -2
- package/lib/view/spendManagement/zeniAccounts/expressPay/epics/fetchExpressPayInitialDetailsEpic.js +7 -7
- package/lib/view/spendManagement/zeniAccounts/expressPay/expressPaySelector.d.ts +2 -2
- package/lib/view/spendManagement/zeniAccounts/expressPay/expressPaySelector.js +5 -4
- package/lib/view/spendManagement/zeniAccounts/expressPay/expressPayState.d.ts +2 -2
- package/lib/view/spendManagement/zeniAccounts/zeniAccountsConfig/zeniAccountsConfigPayload.d.ts +14 -0
- package/lib/view/spendManagement/zeniAccounts/zeniAccountsConfig/zeniAccountsConfigPayload.js +78 -1
- package/lib/view/spendManagement/zeniAccounts/zeniAccountsConfig/zeniAccountsConfigReducer.js +3 -1
- package/lib/view/spendManagement/zeniAccounts/zeniAccountsConfig/zeniAccountsConfigSelector.d.ts +2 -1
- package/lib/view/spendManagement/zeniAccounts/zeniAccountsConfig/zeniAccountsConfigSelector.js +2 -1
- package/lib/view/spendManagement/zeniAccounts/zeniAccountsConfig/zeniAccountsConfigState.d.ts +9 -0
- package/lib/view/subscriptionView/subscriptionViewReducer.js +0 -1
- package/lib/view/subscriptionView/types/subscriptionTypes.js +0 -1
- package/lib/view/taskManager/taskListView/epics/dragNDropTasksEpic.js +1 -3
- package/lib/view/tasksCard/fetchTasksCardEpic.js +1 -2
- package/lib/view/tasksCard/tasksCardSelector.d.ts +1 -1
- package/lib/view/tasksCard/tasksCardSelector.js +1 -1
- package/lib/view/topEx/topExSelector.d.ts +1 -1
- package/lib/view/transactionDetail/epics/saveTransactionHelper.js +45 -15
- package/lib/view/transactionDetail/epics/updateTransactionDetailEpic.js +22 -4
- package/lib/view/transactionDetail/transactionDetailLocalDataHelper.js +69 -13
- package/lib/view/transactionDetail/transactionDetailReducer.d.ts +11 -2
- package/lib/view/transactionDetail/transactionDetailReducer.js +51 -21
- package/lib/view/transactionDetail/transactionDetailState.d.ts +1 -0
- package/lib/view/transactionDetail/transactionDetailTypes.d.ts +8 -0
- package/lib/view/transactionList/transactionListByEntitySelector.js +0 -2
- package/lib/view/transactionList/transactionListReducer.js +4 -6
- package/lib/view/trendWithTransactions/trendWithTransactionsReducer.js +0 -1
- package/lib/view/userFinancialAccount/userFinancialAccountReducer.js +1 -3
- package/lib/view/vendorReviewView/vendorGlobalReviewView/vendorGlobalReviewViewState.d.ts +1 -1
- package/lib/zeniAPI.d.ts +1 -0
- package/package.json +9 -3
package/lib/view/spendManagement/billPay/editBillView/epics/fetchBillAndInitializeLocalStoreEpic.js
CHANGED
|
@@ -10,9 +10,7 @@ const operators_1 = require("rxjs/operators");
|
|
|
10
10
|
const billDetailViewReducer_1 = require("../../billDetailView/billDetailViewReducer");
|
|
11
11
|
const billDetailViewState_1 = require("../../billDetailView/billDetailViewState");
|
|
12
12
|
const editBillViewReducer_1 = require("../editBillViewReducer");
|
|
13
|
-
const fetchBillAndInitializeLocalStoreEpic = (actions$,
|
|
14
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
15
|
-
state$) => actions$.pipe((0, operators_1.filter)(editBillViewReducer_1.fetchBillAndInitializeLocalStore.match), (0, operators_1.mergeMap)((action) => {
|
|
13
|
+
const fetchBillAndInitializeLocalStoreEpic = (actions$, state$) => actions$.pipe((0, operators_1.filter)(editBillViewReducer_1.fetchBillAndInitializeLocalStore.match), (0, operators_1.mergeMap)((action) => {
|
|
16
14
|
const { billId, cacheOverride, isShowDeletedBillsEnabled, hasZeniAssistAccess, } = action.payload;
|
|
17
15
|
const state = state$.value;
|
|
18
16
|
const billDetailActions = [];
|
|
@@ -10,13 +10,14 @@ import { openSnackbar } from '../../../../../entity/snackbar/snackbarReducer';
|
|
|
10
10
|
import { TransactionWithAccountAndClassLinePayload } from '../../../../../entity/transaction/payloadTypes/transactionLinePayload';
|
|
11
11
|
import { RootState } from '../../../../../reducer';
|
|
12
12
|
import { ZeniAPI } from '../../../../../zeniAPI';
|
|
13
|
+
import { ZeniAccountPaymentMethod } from '../../../zeniAccounts/zeniAccountsConfig/zeniAccountsConfigState';
|
|
13
14
|
import { BillPayConfig, BillPaymentConfigCodeType, BillPaymentSubConfigCodeType } from '../../billPayConfig/billPayConfigState';
|
|
14
15
|
import { saveBillDetail, saveBillSuccessOrFailure } from '../editBillViewReducer';
|
|
15
16
|
import { EditBillDetail } from '../editBillViewState';
|
|
16
17
|
export type ActionType = ReturnType<typeof saveBillDetail> | ReturnType<typeof updateBillTransaction> | ReturnType<typeof openSnackbar> | ReturnType<typeof saveBillSuccessOrFailure> | ReturnType<typeof updateRecurringBillConfigs> | ReturnType<typeof updateRecurringBills>;
|
|
17
18
|
export declare const saveBillDetailEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => import("rxjs").Observable<ActionType>;
|
|
18
19
|
export declare function prepareSaveBillPayload(accountState: AccountState, billTransactionState: BillTransactionState, paymentAccountState: PaymentAccountState, recurringBillState: RecurringBillState, billDetail: EditBillDetail, billStageCode: BillStageCodeType, isForMarkAsPaid: boolean, isApproverMarkingAsPaid: boolean): Partial<SaveBillPayload>;
|
|
19
|
-
export declare const getBillPaymentMethodTypePayload: (paymentType?: BillPayConfig) => BillPaymentMethodTypePayload;
|
|
20
|
+
export declare const getBillPaymentMethodTypePayload: (paymentType?: BillPayConfig | ZeniAccountPaymentMethod) => BillPaymentMethodTypePayload;
|
|
20
21
|
interface BillPaymentMethodTypePayload {
|
|
21
22
|
code: BillPaymentConfigCodeType | null;
|
|
22
23
|
name: string;
|
package/lib/view/spendManagement/plaidAccount/epic/plaidConnection/establishPlaidConnectionEpic.js
CHANGED
|
@@ -14,14 +14,16 @@ const paymentAccountListReducer_1 = require("../../../zeniAccounts/paymentAccoun
|
|
|
14
14
|
const plaidAccountViewReducer_1 = require("../../plaidAccountViewReducer");
|
|
15
15
|
const establishPlaidConnectionEpic = (actions$, state, zeniAPI) => actions$.pipe((0, operators_1.filter)(plaidAccountViewReducer_1.establishPlaidConnection.match), (0, operators_1.mergeMap)((action) => {
|
|
16
16
|
var _a, _b;
|
|
17
|
-
const { publicToken, companyId, setupViewType, linkTokenType, plaidAccountKeyType, } = action.payload;
|
|
17
|
+
const { publicToken, companyId, setupViewType, linkTokenType, plaidAccountKeyType, zeniMappedAccountId, } = action.payload;
|
|
18
18
|
const requestPayload = {
|
|
19
19
|
public_token: publicToken,
|
|
20
20
|
};
|
|
21
|
+
const queryPayload = {};
|
|
21
22
|
const userId = (_b = (_a = state.value.tenantState.loggedInUser) === null || _a === void 0 ? void 0 : _a.userId) !== null && _b !== void 0 ? _b : '';
|
|
22
23
|
//setupViewType not passed means this is a user account
|
|
23
24
|
if (linkTokenType !== 'link_external_account') {
|
|
24
|
-
if (setupViewType == null
|
|
25
|
+
if (setupViewType == null &&
|
|
26
|
+
plaidAccountKeyType !== 'expense_automation_reconcile') {
|
|
25
27
|
requestPayload.is_user_account = true;
|
|
26
28
|
}
|
|
27
29
|
else if (plaidAccountKeyType === 'bill_pay_setup') {
|
|
@@ -39,9 +41,15 @@ const establishPlaidConnectionEpic = (actions$, state, zeniAPI) => actions$.pipe
|
|
|
39
41
|
else if (plaidAccountKeyType === 'billing_setup') {
|
|
40
42
|
requestPayload.is_primary_for_onboarding = true;
|
|
41
43
|
}
|
|
44
|
+
else if (plaidAccountKeyType === 'expense_automation_reconcile') {
|
|
45
|
+
queryPayload.zeni_mapped_account_id = zeniMappedAccountId !== null && zeniMappedAccountId !== void 0 ? zeniMappedAccountId : '';
|
|
46
|
+
}
|
|
42
47
|
}
|
|
48
|
+
const queryString = Object.entries(queryPayload).length > 0
|
|
49
|
+
? `?query=${JSON.stringify(queryPayload)}`
|
|
50
|
+
: '';
|
|
43
51
|
return zeniAPI
|
|
44
|
-
.postAndGetJSON(`${zeniAPI.apiEndPoints.payMicroServiceBaseUrl}/1.0/plaid/public-token`, requestPayload)
|
|
52
|
+
.postAndGetJSON(`${zeniAPI.apiEndPoints.payMicroServiceBaseUrl}/1.0/plaid/public-token${queryString}`, requestPayload)
|
|
45
53
|
.pipe((0, operators_1.mergeMap)((response) => {
|
|
46
54
|
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
47
55
|
const paymentAccount = response.data.payment_accounts[0];
|
|
@@ -61,12 +61,13 @@ export declare const getPaymentAccounts: import("@reduxjs/toolkit").ActionCreato
|
|
|
61
61
|
error: ZeniAPIStatus<Record<string, unknown>>;
|
|
62
62
|
linkTokenType: PlaidLinkTokenType;
|
|
63
63
|
plaidAccountKeyType: PlaidAccountKeyType;
|
|
64
|
-
}, "plaidAccountView/getPlaidLinkTokenFailure", never, never>, establishPlaidConnection: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[publicToken: string, companyId: string, plaidAccountKeyType: PlaidAccountKeyType, setupViewType?: "billing" | "bill_pay" | "reimbursement" | "zeni_accounts" | "charge_cards" | undefined, linkTokenType?: PlaidLinkTokenType | undefined], {
|
|
64
|
+
}, "plaidAccountView/getPlaidLinkTokenFailure", never, never>, establishPlaidConnection: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[publicToken: string, companyId: string, plaidAccountKeyType: PlaidAccountKeyType, setupViewType?: "billing" | "bill_pay" | "reimbursement" | "zeni_accounts" | "charge_cards" | undefined, linkTokenType?: PlaidLinkTokenType | undefined, zeniMappedAccountId?: string | undefined], {
|
|
65
65
|
publicToken: string;
|
|
66
66
|
companyId: string;
|
|
67
67
|
setupViewType: "billing" | "bill_pay" | "reimbursement" | "zeni_accounts" | "charge_cards" | undefined;
|
|
68
68
|
linkTokenType: PlaidLinkTokenType;
|
|
69
69
|
plaidAccountKeyType: PlaidAccountKeyType;
|
|
70
|
+
zeniMappedAccountId: string | undefined;
|
|
70
71
|
}, "plaidAccountView/establishPlaidConnection", never, never>, establishPlaidConnectionSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[linkTokenType: PlaidLinkTokenType, plaidAccountKeyType: PlaidAccountKeyType], {
|
|
71
72
|
linkTokenType: PlaidLinkTokenType;
|
|
72
73
|
plaidAccountKeyType: PlaidAccountKeyType;
|
|
@@ -14,6 +14,7 @@ exports.initialState = {
|
|
|
14
14
|
user_reimbursement_account: plaidAccountViewState_1.initialPlaidAccountState,
|
|
15
15
|
external_account: plaidAccountViewState_1.initialPlaidAccountState,
|
|
16
16
|
billing_setup: plaidAccountViewState_1.initialPlaidAccountState,
|
|
17
|
+
expense_automation_reconcile: plaidAccountViewState_1.initialPlaidAccountState,
|
|
17
18
|
};
|
|
18
19
|
const plaidAccountView = (0, toolkit_1.createSlice)({
|
|
19
20
|
name: 'plaidAccountView',
|
|
@@ -264,7 +265,7 @@ const plaidAccountView = (0, toolkit_1.createSlice)({
|
|
|
264
265
|
error: undefined,
|
|
265
266
|
} });
|
|
266
267
|
},
|
|
267
|
-
prepare(publicToken, companyId, plaidAccountKeyType, setupViewType, linkTokenType) {
|
|
268
|
+
prepare(publicToken, companyId, plaidAccountKeyType, setupViewType, linkTokenType, zeniMappedAccountId) {
|
|
268
269
|
return {
|
|
269
270
|
payload: {
|
|
270
271
|
publicToken,
|
|
@@ -272,6 +273,7 @@ const plaidAccountView = (0, toolkit_1.createSlice)({
|
|
|
272
273
|
setupViewType,
|
|
273
274
|
linkTokenType: linkTokenType !== null && linkTokenType !== void 0 ? linkTokenType : 'link_account',
|
|
274
275
|
plaidAccountKeyType,
|
|
276
|
+
zeniMappedAccountId,
|
|
275
277
|
},
|
|
276
278
|
};
|
|
277
279
|
},
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FetchStateAndError, ID } from '../../../commonStateTypes/common';
|
|
2
2
|
import { ZeniDate } from '../../../zeniDayJS';
|
|
3
3
|
export type PlaidLinkTokenType = 'link_account' | 'update_account' | 'link_account_no_microdeposit' | 'link_external_account';
|
|
4
|
-
export type PlaidAccountKeyType = 'spend_management_setup' | 'bill_pay_setup' | 'reimbursement_setup' | 'account_setup' | 'charge_card_setup' | 'user_reimbursement_account' | 'external_account' | 'billing_setup';
|
|
4
|
+
export type PlaidAccountKeyType = 'spend_management_setup' | 'bill_pay_setup' | 'reimbursement_setup' | 'account_setup' | 'charge_card_setup' | 'user_reimbursement_account' | 'external_account' | 'billing_setup' | 'expense_automation_reconcile';
|
|
5
5
|
export type PlaidConnectionDetails = Record<PlaidLinkTokenType, {
|
|
6
6
|
linkToken?: string;
|
|
7
7
|
expiration?: ZeniDate;
|
|
@@ -6,9 +6,7 @@ const operators_1 = require("rxjs/operators");
|
|
|
6
6
|
const recommendationReducer_1 = require("../../../../recommendation/recommendationReducer");
|
|
7
7
|
const recommendationSelector_1 = require("../../../../recommendation/recommendationSelector");
|
|
8
8
|
const editRemiViewReducer_1 = require("../editRemiViewReducer");
|
|
9
|
-
const fetchRecommendationsAndUpdateMerchantRecommendationsEpic = (actions$,
|
|
10
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
11
|
-
state$) => actions$.pipe((0, operators_1.filter)(editRemiViewReducer_1.fetchRecommendationsAndUpdateMerchantRecommendations.match), (0, operators_1.mergeMap)((action) => {
|
|
9
|
+
const fetchRecommendationsAndUpdateMerchantRecommendationsEpic = (actions$, state$) => actions$.pipe((0, operators_1.filter)(editRemiViewReducer_1.fetchRecommendationsAndUpdateMerchantRecommendations.match), (0, operators_1.mergeMap)((action) => {
|
|
12
10
|
const { cacheOverride, lineId, reimbursementId, merchantId, merchantName } = action.payload;
|
|
13
11
|
const state = state$.value;
|
|
14
12
|
const reimbursement = reimbursementId != null
|
|
@@ -67,9 +65,7 @@ state$) => actions$.pipe((0, operators_1.filter)(editRemiViewReducer_1.fetchReco
|
|
|
67
65
|
return (0, rxjs_1.from)(merchantRecommendationActions);
|
|
68
66
|
}));
|
|
69
67
|
exports.fetchRecommendationsAndUpdateMerchantRecommendationsEpic = fetchRecommendationsAndUpdateMerchantRecommendationsEpic;
|
|
70
|
-
const waitForMerchantRecommendationFetchThenUpdateRecommendationInMerchantEpic = (actions$,
|
|
71
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
72
|
-
state$) => actions$.pipe((0, operators_1.filter)(editRemiViewReducer_1.waitForMerchantRecommendationFetchThenUpdateRecommendationInMerchant.match),
|
|
68
|
+
const waitForMerchantRecommendationFetchThenUpdateRecommendationInMerchantEpic = (actions$, state$) => actions$.pipe((0, operators_1.filter)(editRemiViewReducer_1.waitForMerchantRecommendationFetchThenUpdateRecommendationInMerchant.match),
|
|
73
69
|
//used concatMap here, as with mergeMap it was triggering below flow for first completed recommendations (in case of multi receipts)
|
|
74
70
|
(0, operators_1.concatMap)((action) => {
|
|
75
71
|
const { reimbursementId } = action.payload;
|
|
@@ -9,9 +9,7 @@ const rxjs_1 = require("rxjs");
|
|
|
9
9
|
const operators_1 = require("rxjs/operators");
|
|
10
10
|
const remiDetailViewReducer_1 = require("../../remiDetailView/remiDetailViewReducer");
|
|
11
11
|
const editRemiViewReducer_1 = require("../editRemiViewReducer");
|
|
12
|
-
const fetchRemiAndInitializeLocalStoreEpic = (actions$,
|
|
13
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
14
|
-
state$) => actions$.pipe((0, operators_1.filter)(editRemiViewReducer_1.fetchRemiAndInitializeLocalStore.match), (0, operators_1.mergeMap)((action) => {
|
|
12
|
+
const fetchRemiAndInitializeLocalStoreEpic = (actions$, state$) => actions$.pipe((0, operators_1.filter)(editRemiViewReducer_1.fetchRemiAndInitializeLocalStore.match), (0, operators_1.mergeMap)((action) => {
|
|
15
13
|
const { reimbursementId, cacheOverride, isShowDeletedReimbursementEnabled, } = action.payload;
|
|
16
14
|
const state = state$.value;
|
|
17
15
|
const remiDetailActions = [];
|
|
@@ -173,7 +173,6 @@ function doUpdateRemiList(draft, payload, tab) {
|
|
|
173
173
|
const pendingApprovalTransactionIDs = payload.pending_approval_transaction_ids_for_user;
|
|
174
174
|
const start = (0, timePeriod_1.toAbsoluteDay)(payload === null || payload === void 0 ? void 0 : payload.query.start_date); // eslint-disable-line @typescript-eslint/no-non-null-assertion
|
|
175
175
|
const end = (0, timePeriod_1.toAbsoluteDay)(payload === null || payload === void 0 ? void 0 : payload.query.end_date); // eslint-disable-line @typescript-eslint/no-non-null-assertion
|
|
176
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
177
176
|
const key = (0, remiListState_1.getRemiListKey)({ start, end }, tab);
|
|
178
177
|
draft[key] = Object.assign(Object.assign({}, remiListState_1.remiListInitialState), { uiState: draft[key] != null ? draft[key].uiState : remiListState_1.remiListInitialState.uiState, fetchState: 'Completed', error: undefined, transactionIDs,
|
|
179
178
|
pendingApprovalTransactionIDs });
|
|
@@ -2,8 +2,8 @@ import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
3
|
import { RootState } from '../../../../../reducer';
|
|
4
4
|
import { fetchVendorTypeList } from '../../../../vendorTypeList/vendorTypeListReducer';
|
|
5
|
-
import { fetchBillPayConfig } from '../../../billPay/billPayConfig/billPayConfigReducer';
|
|
6
5
|
import { fetchDepositAccountList } from '../../depositAccountList/depositAccountListReducer';
|
|
6
|
+
import { fetchZeniAccountsConfig } from '../../zeniAccountsConfig/zeniAccountsConfigReducer';
|
|
7
7
|
import { fetchExpressPayInitialDetails, updateExpressPayFetchState } from '../expressPayReducer';
|
|
8
|
-
export type ActionType = ReturnType<typeof fetchExpressPayInitialDetails> | ReturnType<typeof
|
|
8
|
+
export type ActionType = ReturnType<typeof fetchExpressPayInitialDetails> | ReturnType<typeof fetchZeniAccountsConfig> | ReturnType<typeof fetchVendorTypeList> | ReturnType<typeof fetchDepositAccountList> | ReturnType<typeof updateExpressPayFetchState>;
|
|
9
9
|
export declare const fetchExpressPayInitialDetailsEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>) => Observable<ActionType>;
|
package/lib/view/spendManagement/zeniAccounts/expressPay/epics/fetchExpressPayInitialDetailsEpic.js
CHANGED
|
@@ -4,16 +4,16 @@ exports.fetchExpressPayInitialDetailsEpic = void 0;
|
|
|
4
4
|
const rxjs_1 = require("rxjs");
|
|
5
5
|
const operators_1 = require("rxjs/operators");
|
|
6
6
|
const vendorTypeListReducer_1 = require("../../../../vendorTypeList/vendorTypeListReducer");
|
|
7
|
-
const billPayConfigReducer_1 = require("../../../billPay/billPayConfig/billPayConfigReducer");
|
|
8
7
|
const depositAccountListReducer_1 = require("../../depositAccountList/depositAccountListReducer");
|
|
8
|
+
const zeniAccountsConfigReducer_1 = require("../../zeniAccountsConfig/zeniAccountsConfigReducer");
|
|
9
9
|
const expressPayReducer_1 = require("../expressPayReducer");
|
|
10
10
|
const fetchExpressPayInitialDetailsEpic = (actions$, state$) => actions$.pipe((0, operators_1.filter)(expressPayReducer_1.fetchExpressPayInitialDetails.match), (0, operators_1.mergeMap)((action) => {
|
|
11
|
-
const { cacheOverride
|
|
11
|
+
const { cacheOverride } = action.payload;
|
|
12
12
|
const state = state$.value;
|
|
13
13
|
const fetchActions = [];
|
|
14
14
|
if (cacheOverride === true) {
|
|
15
15
|
fetchActions.push((0, vendorTypeListReducer_1.fetchVendorTypeList)());
|
|
16
|
-
fetchActions.push((0,
|
|
16
|
+
fetchActions.push((0, zeniAccountsConfigReducer_1.fetchZeniAccountsConfig)());
|
|
17
17
|
fetchActions.push((0, depositAccountListReducer_1.fetchDepositAccountList)());
|
|
18
18
|
fetchActions.push((0, expressPayReducer_1.updateExpressPayFetchState)());
|
|
19
19
|
}
|
|
@@ -22,10 +22,10 @@ const fetchExpressPayInitialDetailsEpic = (actions$, state$) => actions$.pipe((0
|
|
|
22
22
|
state.vendorTypeListState.fetchState !== 'In-Progress') {
|
|
23
23
|
fetchActions.push((0, vendorTypeListReducer_1.fetchVendorTypeList)());
|
|
24
24
|
}
|
|
25
|
-
const
|
|
26
|
-
if (
|
|
27
|
-
|
|
28
|
-
fetchActions.push((0,
|
|
25
|
+
const zeniAccountsConfig = state.zeniAccountsConfigState;
|
|
26
|
+
if (zeniAccountsConfig.hasValidState() === false &&
|
|
27
|
+
zeniAccountsConfig.fetchState !== 'In-Progress') {
|
|
28
|
+
fetchActions.push((0, zeniAccountsConfigReducer_1.fetchZeniAccountsConfig)());
|
|
29
29
|
}
|
|
30
30
|
const depositAccounts = state.depositAccountListState;
|
|
31
31
|
if (depositAccounts.fetchState !== 'In-Progress' &&
|
|
@@ -5,9 +5,9 @@ import { File } from '../../../../entity/file/fileState';
|
|
|
5
5
|
import { RootState } from '../../../../reducer';
|
|
6
6
|
import { VendorViewSelectorView } from '../../../commonVendorView/vendorView/vendorViewSelector';
|
|
7
7
|
import { VendorType } from '../../../vendorTypeList/vendorTypeListPayload';
|
|
8
|
-
import { BillPayConfig } from '../../billPay/billPayConfig/billPayConfigState';
|
|
9
8
|
import { PaymentDetailsSectionView, PaymentToOption } from '../../billPay/editBillView/editBillViewSelector';
|
|
10
9
|
import { FundingAccount } from '../../commonSetup/setupViewSelector';
|
|
10
|
+
import { ZeniAccountPaymentMethod } from '../zeniAccountsConfig/zeniAccountsConfigState';
|
|
11
11
|
import { ExpressPayFormLocalData } from './expressPayState';
|
|
12
12
|
export interface ExpressPayView extends SelectorView {
|
|
13
13
|
vendorViewDetails: VendorViewSelectorView;
|
|
@@ -15,7 +15,7 @@ export interface ExpressPayView extends SelectorView {
|
|
|
15
15
|
expressPayLocalData?: ExpressPayFormLocalData;
|
|
16
16
|
paymentDetails?: PaymentDetailsSectionView;
|
|
17
17
|
paymentToOptions: PaymentToOption[];
|
|
18
|
-
allPaymentMethods:
|
|
18
|
+
allPaymentMethods: ZeniAccountPaymentMethod[];
|
|
19
19
|
withdrawFromList: FundingAccount[];
|
|
20
20
|
receiptFile?: File;
|
|
21
21
|
internationalWireOnboardingStatus?: AllowedValueWithCode;
|
|
@@ -11,18 +11,19 @@ const fileViewSelector_1 = require("../../../fileView/fileViewSelector");
|
|
|
11
11
|
const editBillViewSelector_1 = require("../../billPay/editBillView/editBillViewSelector");
|
|
12
12
|
const setupViewSelector_1 = require("../../commonSetup/setupViewSelector");
|
|
13
13
|
const depositAccountListSelector_1 = require("../depositAccountList/depositAccountListSelector");
|
|
14
|
+
const zeniAccountsConfigSelector_1 = require("../zeniAccountsConfig/zeniAccountsConfigSelector");
|
|
14
15
|
const getExpressPayView = (state) => {
|
|
15
16
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
16
17
|
const deleteFileStatusById = {};
|
|
17
18
|
const updateFileStatusById = {};
|
|
18
|
-
const { tenantState, expressPayState, vendorTypeListState, bankAccountState, paymentInstrumentState,
|
|
19
|
+
const { tenantState, expressPayState, vendorTypeListState, bankAccountState, paymentInstrumentState, vendorViewState, depositAccountState, depositAccountListState, paymentAccountListState, zeniAccountsConfigState, } = state;
|
|
19
20
|
const { currentTenantId } = tenantState;
|
|
20
21
|
const companyId = currentTenantId != null
|
|
21
22
|
? (_b = (_a = tenantState.tenantsById) === null || _a === void 0 ? void 0 : _a[currentTenantId]) === null || _b === void 0 ? void 0 : _b.companyId
|
|
22
23
|
: undefined;
|
|
23
24
|
const companyView = (0, getCompanyView_1.getCompanyView)(state, companyId !== null && companyId !== void 0 ? companyId : '', []);
|
|
24
25
|
const vendorTypeList = vendorTypeListState.vendorTypes;
|
|
25
|
-
const allPaymentMethods = (0,
|
|
26
|
+
const allPaymentMethods = (0, zeniAccountsConfigSelector_1.getZeniAccountsConfigDetail)(state).zeniAccountsConfigDetail.paymentMethods;
|
|
26
27
|
const vendorId = (_c = expressPayState.formLocalData) === null || _c === void 0 ? void 0 : _c.vendorId;
|
|
27
28
|
const vendorViewDetails = (0, vendorViewSelector_1.getVendorView)(state, vendorId);
|
|
28
29
|
const vendorLocalData = vendorId != null
|
|
@@ -53,8 +54,8 @@ const getExpressPayView = (state) => {
|
|
|
53
54
|
error: vendorTypeListState.error,
|
|
54
55
|
},
|
|
55
56
|
{
|
|
56
|
-
fetchState:
|
|
57
|
-
error:
|
|
57
|
+
fetchState: zeniAccountsConfigState.fetchState,
|
|
58
|
+
error: zeniAccountsConfigState.error,
|
|
58
59
|
},
|
|
59
60
|
{
|
|
60
61
|
fetchState: depositAccountListState.fetchState,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Amount } from '../../../../commonStateTypes/amount';
|
|
2
2
|
import { FetchStateAndError, ID } from '../../../../commonStateTypes/common';
|
|
3
3
|
import { ZeniDate } from '../../../../zeniDayJS';
|
|
4
|
-
import { BillPayConfig } from '../../billPay/billPayConfig/billPayConfigState';
|
|
5
4
|
import { FundingAccount } from '../../commonSetup/setupViewSelector';
|
|
5
|
+
import { ZeniAccountPaymentMethod } from '../zeniAccountsConfig/zeniAccountsConfigState';
|
|
6
6
|
export interface ExpressPayState extends FetchStateAndError {
|
|
7
7
|
expressPayId?: ID;
|
|
8
8
|
formLocalData?: ExpressPayFormLocalData;
|
|
@@ -12,7 +12,7 @@ export interface ExpressPayFormLocalData {
|
|
|
12
12
|
vendorId?: ID;
|
|
13
13
|
withdrawFrom?: FundingAccount;
|
|
14
14
|
paymentToAccountId?: ID;
|
|
15
|
-
paymentType?:
|
|
15
|
+
paymentType?: ZeniAccountPaymentMethod;
|
|
16
16
|
amount: Amount;
|
|
17
17
|
paymentDate: ZeniDate;
|
|
18
18
|
receiptFileId?: ID;
|
package/lib/view/spendManagement/zeniAccounts/zeniAccountsConfig/zeniAccountsConfigPayload.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { AddressPayload } from '../../../../entity/address/addressPayload';
|
|
2
2
|
import { ZeniAPIResponse } from '../../../../responsePayload';
|
|
3
|
+
import { ConfigTimelinePayload, TimelineDetail } from '../../billPay/billPayConfig/billPayConfigPayload';
|
|
4
|
+
import { BillPaymentConfigCodeType, PaymentAchSubConfigCodeType } from '../../billPay/billPayConfig/billPayConfigState';
|
|
3
5
|
import { ZeniAccountsConfig } from './zeniAccountsConfigState';
|
|
4
6
|
export interface ZeniAccountsConfigPayload {
|
|
5
7
|
apy: string | null;
|
|
@@ -7,7 +9,18 @@ export interface ZeniAccountsConfigPayload {
|
|
|
7
9
|
deposit_product_config: DepositProductConfigPayload;
|
|
8
10
|
mailing_address: AddressPayload;
|
|
9
11
|
bank_address: AddressPayload;
|
|
12
|
+
payment_processor: PaymentProcessorPayload;
|
|
13
|
+
is_us_domestic_wire_enabled: boolean;
|
|
14
|
+
is_same_day_ach_enabled: boolean;
|
|
10
15
|
}
|
|
16
|
+
export interface PaymentProcessorPayload {
|
|
17
|
+
payment_timeline: PaymentTimeline;
|
|
18
|
+
}
|
|
19
|
+
interface PaymentTimeline {
|
|
20
|
+
ach: Record<PaymentAchSubConfigCodeType, ConfigTimelineForAccTypePayload>;
|
|
21
|
+
wire: Record<'us-domestic', ConfigTimelineForAccTypePayload>;
|
|
22
|
+
}
|
|
23
|
+
export type ConfigTimelineForAccTypePayload = Record<'deposit_account', ConfigTimelinePayload>;
|
|
11
24
|
export declare const mapZeniAccountsConfigPayloadToZeniAccountsConfigState: (payload: ZeniAccountsConfigPayload) => ZeniAccountsConfig;
|
|
12
25
|
interface DepositProductConfigPayload {
|
|
13
26
|
deposit_products: DepositProductsPayload[];
|
|
@@ -17,4 +30,5 @@ interface DepositProductsPayload {
|
|
|
17
30
|
range: (number | null)[];
|
|
18
31
|
}
|
|
19
32
|
export type FetchZeniAccountsConfigResponse = ZeniAPIResponse<ZeniAccountsConfigPayload>;
|
|
33
|
+
export declare const getTimelineDetail: (paymentTimeline: PaymentTimeline, code: BillPaymentConfigCodeType, subCode: "standard" | "same-day" | "us-domestic") => TimelineDetail;
|
|
20
34
|
export {};
|
package/lib/view/spendManagement/zeniAccounts/zeniAccountsConfig/zeniAccountsConfigPayload.js
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.mapZeniAccountsConfigPayloadToZeniAccountsConfigState = void 0;
|
|
3
|
+
exports.getTimelineDetail = exports.mapZeniAccountsConfigPayloadToZeniAccountsConfigState = void 0;
|
|
4
|
+
const billPayConfigPayload_1 = require("../../billPay/billPayConfig/billPayConfigPayload");
|
|
5
|
+
const billPayConfigState_1 = require("../../billPay/billPayConfig/billPayConfigState");
|
|
4
6
|
const mapZeniAccountsConfigPayloadToZeniAccountsConfigState = (payload) => ({
|
|
5
7
|
annualPercentageYield: payload.apy != null ? payload.apy : '',
|
|
6
8
|
bankName: payload.bank_name,
|
|
7
9
|
mailingAddressId: payload.mailing_address.address_id,
|
|
8
10
|
bankAddressId: payload.bank_address.address_id,
|
|
9
11
|
depositProductConfig: mapDepositProductConfigPayloadToDepositProductConfig(payload.deposit_product_config),
|
|
12
|
+
paymentMethods: mapZeniAccountConfigPayloadToPaymentMethods(payload.payment_processor, payload.is_same_day_ach_enabled, payload.is_us_domestic_wire_enabled),
|
|
10
13
|
});
|
|
11
14
|
exports.mapZeniAccountsConfigPayloadToZeniAccountsConfigState = mapZeniAccountsConfigPayloadToZeniAccountsConfigState;
|
|
12
15
|
const mapDepositProductConfigPayloadToDepositProductConfig = (payload) => {
|
|
@@ -20,3 +23,77 @@ const mapDepositProductConfigPayloadToDepositProductConfig = (payload) => {
|
|
|
20
23
|
depositProducts: array,
|
|
21
24
|
};
|
|
22
25
|
};
|
|
26
|
+
const mapZeniAccountConfigPayloadToPaymentMethods = (paymentProcessor, isSameDayAchEnabled, isDomesticWireEnabled) => {
|
|
27
|
+
const paymentMethods = [];
|
|
28
|
+
billPayConfigState_1.BILL_PAYMENT_METHOD_CODE.forEach((code) => {
|
|
29
|
+
switch (code) {
|
|
30
|
+
case 'ach': {
|
|
31
|
+
billPayConfigState_1.PAYMENT_ACH_SUB_CODES.forEach((subCode) => {
|
|
32
|
+
billPayConfigState_1.ACCOUNT_TYPE_CODES.forEach((accType) => {
|
|
33
|
+
paymentMethods.push(mapBillPayConfigPayloadToBillPayConfig(paymentProcessor, subCode === 'standard' ? true : isSameDayAchEnabled, true, code, subCode, accType));
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
break;
|
|
37
|
+
}
|
|
38
|
+
case 'wire': {
|
|
39
|
+
billPayConfigState_1.BILL_PAYMENT_WIRE_SUB_CODES.forEach((subCode) => {
|
|
40
|
+
if (subCode === 'us-domestic') {
|
|
41
|
+
billPayConfigState_1.ACCOUNT_TYPE_CODES.forEach((accType) => {
|
|
42
|
+
paymentMethods.push(mapBillPayConfigPayloadToBillPayConfig(paymentProcessor, isDomesticWireEnabled, true, code, subCode, accType));
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
break;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
return paymentMethods;
|
|
51
|
+
};
|
|
52
|
+
const mapBillPayConfigPayloadToBillPayConfig = (paymentProcessor, isEnabled, isVerified, code, subCode, accType) => {
|
|
53
|
+
const { payment_timeline } = paymentProcessor;
|
|
54
|
+
const { minPeriod, maxPeriod } = (0, exports.getTimelineDetail)(payment_timeline, code, subCode);
|
|
55
|
+
return {
|
|
56
|
+
minPeriod: minPeriod,
|
|
57
|
+
maxPeriod: maxPeriod,
|
|
58
|
+
method: (0, billPayConfigState_1.getBillPayConfigMethodKey)(code, (0, billPayConfigState_1.toBillPaymentSubConfigCodeKeyType)((0, billPayConfigPayload_1.getBillPaymentSubConfigCodeKey)(subCode)), accType != null ? (0, billPayConfigPayload_1.getAccountTypeSubConfigCodeKey)(accType) : undefined),
|
|
59
|
+
isEnabled,
|
|
60
|
+
isVerified,
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
const getTimelineDetail = (paymentTimeline, code, subCode) => {
|
|
64
|
+
const accType = 'deposit_account';
|
|
65
|
+
let minPeriod = {
|
|
66
|
+
value: 0,
|
|
67
|
+
units: 'days',
|
|
68
|
+
};
|
|
69
|
+
let maxPeriod = {
|
|
70
|
+
value: 0,
|
|
71
|
+
units: 'days',
|
|
72
|
+
};
|
|
73
|
+
if (code === 'ach') {
|
|
74
|
+
minPeriod = {
|
|
75
|
+
value: paymentTimeline[code][(0, billPayConfigState_1.toPaymentAchSubMethodCodeType)(subCode)][accType]
|
|
76
|
+
.min.value,
|
|
77
|
+
units: paymentTimeline[code][(0, billPayConfigState_1.toPaymentAchSubMethodCodeType)(subCode)][accType]
|
|
78
|
+
.min.units,
|
|
79
|
+
};
|
|
80
|
+
maxPeriod = {
|
|
81
|
+
value: paymentTimeline[code][(0, billPayConfigState_1.toPaymentAchSubMethodCodeType)(subCode)][accType]
|
|
82
|
+
.max.value,
|
|
83
|
+
units: paymentTimeline[code][(0, billPayConfigState_1.toPaymentAchSubMethodCodeType)(subCode)][accType]
|
|
84
|
+
.max.units,
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
else if (code === 'wire') {
|
|
88
|
+
minPeriod = {
|
|
89
|
+
value: paymentTimeline[code]['us-domestic'][accType].min.value,
|
|
90
|
+
units: paymentTimeline[code]['us-domestic'][accType].min.units,
|
|
91
|
+
};
|
|
92
|
+
maxPeriod = {
|
|
93
|
+
value: paymentTimeline[code]['us-domestic'][accType].max.value,
|
|
94
|
+
units: paymentTimeline[code]['us-domestic'][accType].max.units,
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
return { minPeriod, maxPeriod };
|
|
98
|
+
};
|
|
99
|
+
exports.getTimelineDetail = getTimelineDetail;
|
package/lib/view/spendManagement/zeniAccounts/zeniAccountsConfig/zeniAccountsConfigReducer.js
CHANGED
|
@@ -13,6 +13,7 @@ exports.initialState = {
|
|
|
13
13
|
depositProductConfig: {
|
|
14
14
|
depositProducts: [{ annualPercentageYield: 0, range: [] }],
|
|
15
15
|
},
|
|
16
|
+
paymentMethods: [],
|
|
16
17
|
},
|
|
17
18
|
hasValidState() {
|
|
18
19
|
return this.fetchState == 'Completed';
|
|
@@ -29,13 +30,14 @@ const zeniAccountsConfig = (0, toolkit_1.createSlice)({
|
|
|
29
30
|
draft.error = undefined;
|
|
30
31
|
},
|
|
31
32
|
updateZeniAccountsConfigSuccess(draft, action) {
|
|
32
|
-
const { bankName, mailingAddressId, bankAddressId, depositProductConfig, annualPercentageYield, } = (0, zeniAccountsConfigPayload_1.mapZeniAccountsConfigPayloadToZeniAccountsConfigState)(action.payload);
|
|
33
|
+
const { bankName, mailingAddressId, bankAddressId, depositProductConfig, annualPercentageYield, paymentMethods, } = (0, zeniAccountsConfigPayload_1.mapZeniAccountsConfigPayloadToZeniAccountsConfigState)(action.payload);
|
|
33
34
|
draft.zeniAccountsConfig = {
|
|
34
35
|
annualPercentageYield,
|
|
35
36
|
bankName,
|
|
36
37
|
mailingAddressId,
|
|
37
38
|
bankAddressId,
|
|
38
39
|
depositProductConfig,
|
|
40
|
+
paymentMethods,
|
|
39
41
|
};
|
|
40
42
|
draft.fetchState = 'Completed';
|
|
41
43
|
draft.error = undefined;
|
package/lib/view/spendManagement/zeniAccounts/zeniAccountsConfig/zeniAccountsConfigSelector.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { SelectorView } from '../../../../commonStateTypes/viewAndReport/viewAndReport';
|
|
2
2
|
import { Address } from '../../../../entity/address/addressState';
|
|
3
3
|
import { RootState } from '../../../../reducer';
|
|
4
|
-
import { DepositProductConfig } from './zeniAccountsConfigState';
|
|
4
|
+
import { DepositProductConfig, ZeniAccountPaymentMethod } from './zeniAccountsConfigState';
|
|
5
5
|
export interface ZeniAccountsConfigSelectorView extends SelectorView {
|
|
6
6
|
zeniAccountsConfigDetail: {
|
|
7
7
|
annualPercentageYield: string;
|
|
@@ -9,6 +9,7 @@ export interface ZeniAccountsConfigSelectorView extends SelectorView {
|
|
|
9
9
|
depositProductConfig: DepositProductConfig;
|
|
10
10
|
mailingAddress?: Address;
|
|
11
11
|
bankAddress?: Address;
|
|
12
|
+
paymentMethods: ZeniAccountPaymentMethod[];
|
|
12
13
|
};
|
|
13
14
|
}
|
|
14
15
|
export declare const getZeniAccountsConfigDetail: (state: RootState) => ZeniAccountsConfigSelectorView;
|
package/lib/view/spendManagement/zeniAccounts/zeniAccountsConfig/zeniAccountsConfigSelector.js
CHANGED
|
@@ -4,7 +4,7 @@ exports.getZeniAccountsConfigDetail = void 0;
|
|
|
4
4
|
const addressSelector_1 = require("../../../../entity/address/addressSelector");
|
|
5
5
|
const getZeniAccountsConfigDetail = (state) => {
|
|
6
6
|
const { zeniAccountsConfigState, addressState } = state;
|
|
7
|
-
const { bankName, depositProductConfig, bankAddressId, mailingAddressId, annualPercentageYield, } = zeniAccountsConfigState.zeniAccountsConfig;
|
|
7
|
+
const { bankName, depositProductConfig, bankAddressId, mailingAddressId, annualPercentageYield, paymentMethods, } = zeniAccountsConfigState.zeniAccountsConfig;
|
|
8
8
|
const mailingAddress = (0, addressSelector_1.getAddressByAddressId)(addressState, mailingAddressId);
|
|
9
9
|
const bankAddress = (0, addressSelector_1.getAddressByAddressId)(addressState, bankAddressId);
|
|
10
10
|
return {
|
|
@@ -14,6 +14,7 @@ const getZeniAccountsConfigDetail = (state) => {
|
|
|
14
14
|
depositProductConfig: depositProductConfig,
|
|
15
15
|
mailingAddress,
|
|
16
16
|
bankAddress,
|
|
17
|
+
paymentMethods,
|
|
17
18
|
},
|
|
18
19
|
fetchState: zeniAccountsConfigState.fetchState,
|
|
19
20
|
error: zeniAccountsConfigState.error,
|
package/lib/view/spendManagement/zeniAccounts/zeniAccountsConfig/zeniAccountsConfigState.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { FetchedState, ID } from '../../../../commonStateTypes/common';
|
|
2
|
+
import { ConfigPeriod } from '../../billPay/billPayConfig/billPayConfigState';
|
|
2
3
|
export interface ZeniAccountsConfigState extends FetchedState {
|
|
3
4
|
zeniAccountsConfig: ZeniAccountsConfig;
|
|
4
5
|
}
|
|
@@ -8,6 +9,14 @@ export interface ZeniAccountsConfig {
|
|
|
8
9
|
mailingAddressId: ID;
|
|
9
10
|
bankAddressId: ID;
|
|
10
11
|
depositProductConfig: DepositProductConfig;
|
|
12
|
+
paymentMethods: ZeniAccountPaymentMethod[];
|
|
13
|
+
}
|
|
14
|
+
export interface ZeniAccountPaymentMethod {
|
|
15
|
+
minPeriod: ConfigPeriod;
|
|
16
|
+
maxPeriod: ConfigPeriod;
|
|
17
|
+
method: string;
|
|
18
|
+
isEnabled: boolean;
|
|
19
|
+
isVerified: boolean;
|
|
11
20
|
}
|
|
12
21
|
export interface DepositProductConfig {
|
|
13
22
|
depositProducts: DepositProduct[];
|
|
@@ -191,7 +191,6 @@ const subscriptionView = (0, toolkit_1.createSlice)({
|
|
|
191
191
|
},
|
|
192
192
|
},
|
|
193
193
|
fetchSubscriptionList: {
|
|
194
|
-
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
195
194
|
prepare(fetchFullResponse = false) {
|
|
196
195
|
return { payload: { fetchFullResponse } };
|
|
197
196
|
},
|
|
@@ -15,7 +15,6 @@ const ALL_SUBSCRIPTION_SORT_KEYS = [
|
|
|
15
15
|
'monthlyRecurringRevenue',
|
|
16
16
|
'notes',
|
|
17
17
|
];
|
|
18
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
19
18
|
const toSubscriptionSortKeyType = (v) => (0, stringToUnion_1.stringToUnion)(v, ALL_SUBSCRIPTION_SORT_KEYS);
|
|
20
19
|
exports.toSubscriptionSortKeyType = toSubscriptionSortKeyType;
|
|
21
20
|
exports.SUBSCRIPTION_STATUS_CODES = [
|
|
@@ -5,9 +5,7 @@ const rxjs_1 = require("rxjs");
|
|
|
5
5
|
const operators_1 = require("rxjs/operators");
|
|
6
6
|
const taskListReducer_1 = require("../taskListReducer");
|
|
7
7
|
const taskListViewHelpers_1 = require("../taskListViewHelpers");
|
|
8
|
-
const dragNDropTasksEpic = (actions$,
|
|
9
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
10
|
-
state$) => actions$.pipe((0, operators_1.filter)(taskListReducer_1.dragNDropTasks.match), (0, operators_1.mergeMap)((action) => {
|
|
8
|
+
const dragNDropTasksEpic = (actions$, state$) => actions$.pipe((0, operators_1.filter)(taskListReducer_1.dragNDropTasks.match), (0, operators_1.mergeMap)((action) => {
|
|
11
9
|
const { taskIds, groupId } = action.payload;
|
|
12
10
|
const state = state$.value;
|
|
13
11
|
const { groupByKey } = state.taskListState.uiState;
|
|
@@ -9,8 +9,7 @@ const fetchTasksCardEpic = (actions$, _, zeniAPI) => actions$.pipe((0, operators
|
|
|
9
9
|
.getJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/reports/task_card`)
|
|
10
10
|
.pipe((0, operators_1.mergeMap)((response) => {
|
|
11
11
|
if ((0, responsePayload_1.isSuccessResponse)(response)) {
|
|
12
|
-
return (0, rxjs_1.of)((0, tasksCardReducer_1.updateTasksCard)(response.data)
|
|
13
|
-
);
|
|
12
|
+
return (0, rxjs_1.of)((0, tasksCardReducer_1.updateTasksCard)(response.data));
|
|
14
13
|
}
|
|
15
14
|
else {
|
|
16
15
|
return (0, rxjs_1.of)((0, tasksCardReducer_1.updateTasksCardFailure)(response.status));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { RootState } from '../../reducer';
|
|
2
2
|
export declare const getTasksCardReport: (state: RootState) => {
|
|
3
|
-
reportId: "billing" | "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "revenue" | "revenue_by_classes" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "charge_cards" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "flux_analysis_operating_expense";
|
|
3
|
+
reportId: "billing" | "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "revenue" | "revenue_by_classes" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "charge_cards" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "flux_analysis_operating_expense" | "account_reconciliation";
|
|
4
4
|
reportTitle: string;
|
|
5
5
|
version: string | number | undefined;
|
|
6
6
|
status: import("../..").Status | undefined;
|
|
@@ -4,7 +4,7 @@ exports.getTasksCardReport = void 0;
|
|
|
4
4
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
5
5
|
const getTasksCardReportSelector = (0, toolkit_1.createSelector)((state) => state.tasksCardState, (tasksCardState) => {
|
|
6
6
|
const { tasks, fetchState } = tasksCardState;
|
|
7
|
-
let showCard =
|
|
7
|
+
let showCard = fetchState !== 'Completed';
|
|
8
8
|
let isMulti = false;
|
|
9
9
|
if (fetchState === 'Completed') {
|
|
10
10
|
for (const key in tasks) {
|
|
@@ -4,7 +4,7 @@ import { RootState } from '../../reducer';
|
|
|
4
4
|
import { TopExReport, TopExTimePeriodWithMetaData } from './topExSelectorTypes';
|
|
5
5
|
import { TopExState } from './topExState';
|
|
6
6
|
export declare const getTopExpenses: (accountState: AccountState, topExState: TopExState, numberOfExpenses?: number) => {
|
|
7
|
-
reportId: "billing" | "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "revenue" | "revenue_by_classes" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "charge_cards" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "flux_analysis_operating_expense";
|
|
7
|
+
reportId: "billing" | "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "revenue" | "revenue_by_classes" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "charge_cards" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "flux_analysis_operating_expense" | "account_reconciliation";
|
|
8
8
|
reportTitle: string;
|
|
9
9
|
version: string | number | undefined;
|
|
10
10
|
status: import("../..").Status | undefined;
|