@zeniai/client-epic-state 4.20.3-betaRD21 → 4.20.3-betaRD3
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/subAccountView/reportBySubAccountPayload.d.ts +2 -0
- package/lib/commonStateTypes/coaBalance/coaBalancesFilterProjectView.d.ts +13 -0
- package/lib/commonStateTypes/coaBalance/coaBalancesFilterProjectView.js +9 -0
- package/lib/commonStateTypes/common.d.ts +1 -1
- package/lib/commonStateTypes/projectView/projectViewParentID.d.ts +5 -0
- package/lib/commonStateTypes/projectView/projectViewParentID.js +2 -0
- package/lib/commonStateTypes/viewAndReport/reportIDHelper.d.ts +1 -0
- package/lib/commonStateTypes/viewAndReport/reportIDHelper.js +3 -1
- package/lib/commonStateTypes/viewAndReport/viewAndReport.d.ts +2 -2
- package/lib/commonStateTypes/viewAndReport/viewAndReport.js +1 -1
- package/lib/entity/account/accountPayload.d.ts +0 -2
- package/lib/entity/account/accountReducer.d.ts +2 -5
- package/lib/entity/account/accountReducer.js +7 -10
- package/lib/entity/account/accountSelector.d.ts +7 -0
- package/lib/entity/account/accountSelector.js +4 -2
- package/lib/entity/account/accountState.d.ts +3 -1
- package/lib/entity/account/accountState.js +4 -1
- package/lib/entity/account/pickAndMergeForecastAccountReport.d.ts +1 -0
- package/lib/entity/account/subAccountSelector.d.ts +2 -0
- package/lib/entity/account/subAccountSelector.js +2 -0
- package/lib/entity/accountGroup/accountGroupSelector.d.ts +22 -0
- package/lib/entity/accountGroup/accountGroupState.d.ts +1 -1
- package/lib/entity/billPay/billTransaction/billTransactionState.d.ts +2 -2
- package/lib/entity/chargeCard/chargeCard.d.ts +1 -1
- package/lib/entity/class/classReducer.d.ts +4 -4
- package/lib/entity/class/classState.d.ts +1 -1
- package/lib/entity/depositAccountTransaction/depositAccountTransaction.d.ts +1 -1
- package/lib/entity/entityApprovalStatus/entityApprovalStatusState.d.ts +2 -2
- package/lib/entity/forecast/forecastState.d.ts +1 -1
- package/lib/entity/jeSchedules/jeSchedulesTypes.d.ts +1 -1
- package/lib/entity/project/projectPayload.d.ts +13 -0
- package/lib/entity/project/projectPayload.js +30 -0
- package/lib/entity/project/projectReducer.d.ts +10 -0
- package/lib/entity/project/projectReducer.js +31 -0
- package/lib/entity/project/projectSelector.d.ts +5 -0
- package/lib/entity/project/projectSelector.js +12 -0
- package/lib/entity/project/projectState.d.ts +13 -0
- package/lib/entity/project/projectState.js +2 -0
- package/lib/entity/sectionAccountsView/sectionAccountsView.d.ts +1 -1
- package/lib/entity/sectionClassesViewV2/sectionClassesView.d.ts +1 -1
- package/lib/entity/sectionClassesViewV2/sectionClassesViewReducer.d.ts +2 -2
- package/lib/entity/sectionProjectView/sectionProjectView.d.ts +10 -0
- package/lib/entity/sectionProjectView/sectionProjectView.js +6 -0
- package/lib/entity/sectionProjectView/sectionProjectViewEpic.d.ts +6 -0
- package/lib/entity/sectionProjectView/sectionProjectViewEpic.js +56 -0
- package/lib/entity/sectionProjectView/sectionProjectViewHelper.d.ts +9 -0
- package/lib/entity/sectionProjectView/sectionProjectViewHelper.js +13 -0
- package/lib/entity/sectionProjectView/sectionProjectViewReducer.d.ts +15 -0
- package/lib/entity/sectionProjectView/sectionProjectViewReducer.js +50 -0
- package/lib/entity/sectionProjectView/sectionProjectViewSelector.d.ts +11 -0
- package/lib/entity/sectionProjectView/sectionProjectViewSelector.js +103 -0
- package/lib/entity/sectionProjectView/sectionProjectViewSelectorTypes.d.ts +16 -0
- package/lib/entity/sectionProjectView/sectionProjectViewSelectorTypes.js +2 -0
- package/lib/entity/sectionProjectView/sectionProjectViewState.d.ts +4 -0
- package/lib/entity/sectionProjectView/sectionProjectViewState.js +2 -0
- package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/tenant/clearAllEpic.d.ts +5 -4
- package/lib/entity/tenant/clearAllEpic.js +6 -4
- package/lib/entity/tenant/tenantPayload.d.ts +1 -0
- package/lib/entity/tenant/tenantReducer.js +1 -0
- package/lib/entity/tenant/tenantSelector.d.ts +1 -0
- package/lib/entity/tenant/tenantSelector.js +9 -1
- package/lib/entity/tenant/tenantState.d.ts +1 -0
- package/lib/entity/transaction/payloadTypes/transactionPayload.js +0 -1
- package/lib/entity/userRole/userRoleType.d.ts +2 -2
- package/lib/epic.d.ts +4 -3
- package/lib/epic.js +4 -3
- package/lib/esm/commonStateTypes/coaBalance/coaBalancesFilterProjectView.js +5 -0
- package/lib/esm/commonStateTypes/projectView/projectViewParentID.js +1 -0
- package/lib/esm/commonStateTypes/viewAndReport/reportIDHelper.js +1 -0
- package/lib/esm/commonStateTypes/viewAndReport/viewAndReport.js +1 -1
- package/lib/esm/entity/account/accountReducer.js +6 -9
- package/lib/esm/entity/account/accountSelector.js +4 -2
- package/lib/esm/entity/account/accountState.js +4 -1
- package/lib/esm/entity/account/subAccountSelector.js +2 -0
- package/lib/esm/entity/project/projectPayload.js +26 -0
- package/lib/esm/entity/project/projectReducer.js +27 -0
- package/lib/esm/entity/project/projectSelector.js +8 -0
- package/lib/esm/entity/project/projectState.js +1 -0
- package/lib/esm/entity/sectionProjectView/sectionProjectView.js +3 -0
- package/lib/esm/entity/sectionProjectView/sectionProjectViewEpic.js +52 -0
- package/lib/esm/entity/sectionProjectView/sectionProjectViewHelper.js +9 -0
- package/lib/esm/entity/sectionProjectView/sectionProjectViewReducer.js +46 -0
- package/lib/esm/entity/sectionProjectView/sectionProjectViewSelector.js +96 -0
- package/lib/esm/entity/sectionProjectView/sectionProjectViewSelectorTypes.js +1 -0
- package/lib/esm/entity/sectionProjectView/sectionProjectViewState.js +1 -0
- package/lib/esm/entity/tenant/clearAllEpic.js +6 -4
- package/lib/esm/entity/tenant/tenantReducer.js +1 -0
- package/lib/esm/entity/tenant/tenantSelector.js +7 -0
- package/lib/esm/entity/transaction/payloadTypes/transactionPayload.js +0 -1
- package/lib/esm/epic.js +4 -3
- package/lib/esm/index.js +11 -15
- package/lib/esm/reducer.js +9 -6
- package/lib/esm/view/expenseAutomationView/epics/accountRecon/fetchReconciliationViewEpic.js +9 -4
- package/lib/esm/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +1 -5
- package/lib/esm/view/expenseAutomationView/reducers/reconciliationViewReducer.js +3 -163
- package/lib/esm/view/expenseAutomationView/selectorTypes/reconciliationViewSelectorTypes.js +2 -1
- package/lib/esm/view/expenseAutomationView/selectors/reconciliationViewSelector.js +0 -112
- package/lib/esm/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +6 -10
- package/lib/esm/view/expenseAutomationView/types/jeSchedulesViewState.js +0 -6
- package/lib/esm/view/financeStatement/financeStatementSelector.js +12 -1
- package/lib/esm/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelector.js +2 -4
- package/lib/esm/view/profitAndLossProjectView/profitAndLossForTimeframeProjectViewEpic.js +45 -0
- package/lib/esm/view/profitAndLossProjectView/profitAndLossProjectViewEpic.js +30 -0
- package/lib/esm/view/profitAndLossProjectView/profitAndLossProjectViewPayload.js +1 -0
- package/lib/esm/view/profitAndLossProjectView/profitAndLossProjectViewReducer.js +113 -0
- package/lib/esm/view/profitAndLossProjectView/profitAndLossProjectViewSelector.js +66 -0
- package/lib/esm/view/profitAndLossProjectView/profitAndLossProjectViewSelectorTypes.js +1 -0
- package/lib/esm/view/profitAndLossProjectView/profitAndLossProjectViewState.js +1 -0
- package/lib/esm/view/reportsResync/reportsClassViewRefetchingEpic.js +4 -0
- package/lib/index.d.ts +14 -16
- package/lib/index.js +45 -65
- package/lib/reducer.d.ts +9 -6
- package/lib/reducer.js +9 -6
- package/lib/tsconfig.typecheck.tsbuildinfo +1 -1
- package/lib/view/auditReportView/auditReportViewState.d.ts +1 -1
- package/lib/view/billPayCard/billPayCardSelector.d.ts +1 -1
- package/lib/view/cardBalance/cardBalanceSelector.d.ts +2 -1
- package/lib/view/cashBalance/cashBalanceSelector.d.ts +2 -1
- package/lib/view/cashInCashOut/cashInCashOutSelector.d.ts +1 -1
- package/lib/view/cashPosition/cashPositionSelector.d.ts +1 -1
- package/lib/view/companyView/types/cockpitTypes.d.ts +5 -6
- package/lib/view/dashboard/dashboardReducer.d.ts +2 -2
- package/lib/view/expenseAutomationView/epics/accountRecon/fetchReconciliationViewEpic.js +9 -4
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
- package/lib/view/expenseAutomationView/payload/reconciliationPayload.d.ts +0 -33
- package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +1 -5
- package/lib/view/expenseAutomationView/reducers/reconciliationViewReducer.d.ts +4 -18
- package/lib/view/expenseAutomationView/reducers/reconciliationViewReducer.js +4 -164
- package/lib/view/expenseAutomationView/selectorTypes/reconciliationViewSelectorTypes.d.ts +2 -6
- package/lib/view/expenseAutomationView/selectorTypes/reconciliationViewSelectorTypes.js +2 -2
- package/lib/view/expenseAutomationView/selectors/reconciliationViewSelector.js +0 -112
- package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +5 -9
- package/lib/view/expenseAutomationView/types/jeSchedulesViewState.d.ts +0 -3
- package/lib/view/expenseAutomationView/types/jeSchedulesViewState.js +1 -8
- package/lib/view/expenseAutomationView/types/missingReceiptsViewState.d.ts +1 -1
- package/lib/view/expenseAutomationView/types/reconciliationViewState.d.ts +0 -13
- package/lib/view/financeStatement/financeStatementReducer.d.ts +1 -1
- package/lib/view/financeStatement/financeStatementSelector.d.ts +2 -0
- package/lib/view/financeStatement/financeStatementSelector.js +12 -1
- package/lib/view/globalMerchantView/globalMerchantViewReducer.d.ts +2 -2
- package/lib/view/onboardingView/cockpitView/types/onboardingCockpitViewTypes.d.ts +1 -1
- package/lib/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelector.js +2 -4
- package/lib/view/profitAndLossProjectView/profitAndLossForTimeframeProjectViewEpic.d.ts +8 -0
- package/lib/view/profitAndLossProjectView/profitAndLossForTimeframeProjectViewEpic.js +49 -0
- package/lib/view/profitAndLossProjectView/profitAndLossProjectViewEpic.d.ts +6 -0
- package/lib/view/profitAndLossProjectView/profitAndLossProjectViewEpic.js +34 -0
- package/lib/view/profitAndLossProjectView/profitAndLossProjectViewPayload.d.ts +33 -0
- package/lib/view/profitAndLossProjectView/profitAndLossProjectViewPayload.js +2 -0
- package/lib/view/profitAndLossProjectView/profitAndLossProjectViewReducer.d.ts +33 -0
- package/lib/view/profitAndLossProjectView/profitAndLossProjectViewReducer.js +117 -0
- package/lib/view/profitAndLossProjectView/profitAndLossProjectViewSelector.d.ts +9 -0
- package/lib/view/profitAndLossProjectView/profitAndLossProjectViewSelector.js +70 -0
- package/lib/view/profitAndLossProjectView/profitAndLossProjectViewSelectorTypes.d.ts +18 -0
- package/lib/view/profitAndLossProjectView/profitAndLossProjectViewSelectorTypes.js +2 -0
- package/lib/view/profitAndLossProjectView/profitAndLossProjectViewState.d.ts +22 -0
- package/lib/view/profitAndLossProjectView/profitAndLossProjectViewState.js +2 -0
- package/lib/view/reimbursementCard/reimbursementCardSelector.d.ts +1 -1
- package/lib/view/reportsResync/reportsClassViewRefetchingEpic.d.ts +2 -1
- package/lib/view/reportsResync/reportsClassViewRefetchingEpic.js +4 -0
- package/lib/view/reportsResync/reportsResyncReducer.d.ts +2 -2
- package/lib/view/reviewCompanyView/reviewCompanyViewState.d.ts +1 -1
- package/lib/view/spendManagement/billPay/billList/billListReducer.d.ts +1 -1
- package/lib/view/spendManagement/billPay/billList/billListState.d.ts +1 -1
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetail.d.ts +1 -1
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailReducer.d.ts +4 -4
- package/lib/view/spendManagement/reimbursement/remiListView/remiListReducer.d.ts +1 -1
- package/lib/view/spendManagement/reimbursement/remiListView/remiListState.d.ts +3 -3
- package/lib/view/subscriptionView/types/subscriptionTypes.d.ts +1 -1
- package/lib/view/tasksCard/tasksCardSelector.d.ts +1 -1
- package/lib/view/topEx/topExSelector.d.ts +1 -1
- package/package.json +1 -1
- package/lib/entity/aiAccountantCustomer/aiAccountantCustomerPayload.d.ts +0 -44
- package/lib/entity/aiAccountantCustomer/aiAccountantCustomerPayload.js +0 -55
- package/lib/entity/aiAccountantCustomer/aiAccountantCustomerReducer.d.ts +0 -10
- package/lib/entity/aiAccountantCustomer/aiAccountantCustomerReducer.js +0 -51
- package/lib/entity/aiAccountantCustomer/aiAccountantCustomerSelector.d.ts +0 -48
- package/lib/entity/aiAccountantCustomer/aiAccountantCustomerSelector.js +0 -66
- package/lib/entity/aiAccountantCustomer/aiAccountantCustomerState.d.ts +0 -52
- package/lib/entity/aiAccountantCustomer/aiAccountantCustomerState.js +0 -37
- package/lib/esm/entity/aiAccountantCustomer/aiAccountantCustomerPayload.js +0 -49
- package/lib/esm/entity/aiAccountantCustomer/aiAccountantCustomerReducer.js +0 -47
- package/lib/esm/entity/aiAccountantCustomer/aiAccountantCustomerSelector.js +0 -62
- package/lib/esm/entity/aiAccountantCustomer/aiAccountantCustomerState.js +0 -31
- package/lib/esm/view/aiAccountantView/aiAccountantViewPayload.js +0 -2
- package/lib/esm/view/aiAccountantView/aiAccountantViewReducer.js +0 -149
- package/lib/esm/view/aiAccountantView/aiAccountantViewSelector.js +0 -72
- package/lib/esm/view/aiAccountantView/aiAccountantViewState.js +0 -11
- package/lib/esm/view/aiAccountantView/epics/cancelAiAccountantOnboardingEpic.js +0 -46
- package/lib/esm/view/aiAccountantView/epics/fetchAiAccountantCustomersEpic.js +0 -27
- package/lib/esm/view/aiAccountantView/epics/fetchAiAccountantJobsEpic.js +0 -47
- package/lib/esm/view/aiAccountantView/epics/triggerAiAccountantJobEpic.js +0 -52
- package/lib/esm/view/expenseAutomationView/epics/accountRecon/excludeAccountFromReconciliationEpic.js +0 -44
- package/lib/esm/view/expenseAutomationView/epics/accountRecon/includeAccountInReconciliationEpic.js +0 -44
- package/lib/view/aiAccountantView/aiAccountantViewPayload.d.ts +0 -31
- package/lib/view/aiAccountantView/aiAccountantViewPayload.js +0 -8
- package/lib/view/aiAccountantView/aiAccountantViewReducer.d.ts +0 -29
- package/lib/view/aiAccountantView/aiAccountantViewReducer.js +0 -153
- package/lib/view/aiAccountantView/aiAccountantViewSelector.d.ts +0 -14
- package/lib/view/aiAccountantView/aiAccountantViewSelector.js +0 -78
- package/lib/view/aiAccountantView/aiAccountantViewState.d.ts +0 -27
- package/lib/view/aiAccountantView/aiAccountantViewState.js +0 -13
- package/lib/view/aiAccountantView/epics/cancelAiAccountantOnboardingEpic.d.ts +0 -33
- package/lib/view/aiAccountantView/epics/cancelAiAccountantOnboardingEpic.js +0 -50
- package/lib/view/aiAccountantView/epics/fetchAiAccountantCustomersEpic.d.ts +0 -23
- package/lib/view/aiAccountantView/epics/fetchAiAccountantCustomersEpic.js +0 -31
- package/lib/view/aiAccountantView/epics/fetchAiAccountantJobsEpic.d.ts +0 -33
- package/lib/view/aiAccountantView/epics/fetchAiAccountantJobsEpic.js +0 -51
- package/lib/view/aiAccountantView/epics/triggerAiAccountantJobEpic.d.ts +0 -28
- package/lib/view/aiAccountantView/epics/triggerAiAccountantJobEpic.js +0 -56
- package/lib/view/expenseAutomationView/epics/accountRecon/excludeAccountFromReconciliationEpic.d.ts +0 -8
- package/lib/view/expenseAutomationView/epics/accountRecon/excludeAccountFromReconciliationEpic.js +0 -48
- package/lib/view/expenseAutomationView/epics/accountRecon/includeAccountInReconciliationEpic.d.ts +0 -9
- package/lib/view/expenseAutomationView/epics/accountRecon/includeAccountInReconciliationEpic.js +0 -48
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
-
import { openSnackbar } from '../../../entity/snackbar/snackbarReducer';
|
|
3
|
-
import { RootState } from '../../../reducer';
|
|
4
|
-
import { ZeniAPI } from '../../../zeniAPI';
|
|
5
|
-
import { cancelAiAccountantOnboarding, cancelAiAccountantOnboardingFailure, cancelAiAccountantOnboardingSuccess, fetchAiAccountantCustomers } from '../aiAccountantViewReducer';
|
|
6
|
-
export type ActionType = ReturnType<typeof cancelAiAccountantOnboarding> | ReturnType<typeof cancelAiAccountantOnboardingSuccess> | ReturnType<typeof cancelAiAccountantOnboardingFailure> | ReturnType<typeof fetchAiAccountantCustomers> | ReturnType<typeof openSnackbar>;
|
|
7
|
-
export declare const cancelAiAccountantOnboardingEpic: (actions$: ActionsObservable<ActionType>, _: StateObservable<RootState>, zeniAPI: ZeniAPI) => import("rxjs").Observable<{
|
|
8
|
-
payload: {
|
|
9
|
-
messageSection: import("../../..").SnackbarMessageSections;
|
|
10
|
-
messageText: import("../../..").SnackbarMessageSectionTexts;
|
|
11
|
-
type: import("../../..").SnackbarMessageType;
|
|
12
|
-
showStatusIcon?: boolean;
|
|
13
|
-
variables?: {
|
|
14
|
-
variableName: string;
|
|
15
|
-
variableValue: string;
|
|
16
|
-
}[];
|
|
17
|
-
};
|
|
18
|
-
type: "snackbar/openSnackbar";
|
|
19
|
-
} | {
|
|
20
|
-
payload: {
|
|
21
|
-
tenantId: string;
|
|
22
|
-
};
|
|
23
|
-
type: "aiAccountantView/cancelAiAccountantOnboardingSuccess";
|
|
24
|
-
} | {
|
|
25
|
-
payload: {
|
|
26
|
-
tenantId: string;
|
|
27
|
-
error: import("../../../responsePayload").ZeniAPIStatus<Record<string, unknown>>;
|
|
28
|
-
};
|
|
29
|
-
type: "aiAccountantView/cancelAiAccountantOnboardingFailure";
|
|
30
|
-
} | {
|
|
31
|
-
payload: undefined;
|
|
32
|
-
type: "aiAccountantView/fetchAiAccountantCustomers";
|
|
33
|
-
}>;
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.cancelAiAccountantOnboardingEpic = void 0;
|
|
4
|
-
const rxjs_1 = require("rxjs");
|
|
5
|
-
const operators_1 = require("rxjs/operators");
|
|
6
|
-
const snackbarReducer_1 = require("../../../entity/snackbar/snackbarReducer");
|
|
7
|
-
const responsePayload_1 = require("../../../responsePayload");
|
|
8
|
-
const aiAccountantViewReducer_1 = require("../aiAccountantViewReducer");
|
|
9
|
-
const cancelAiAccountantOnboardingEpic = (actions$, _, zeniAPI) => actions$.pipe((0, operators_1.filter)(aiAccountantViewReducer_1.cancelAiAccountantOnboarding.match), (0, operators_1.mergeMap)((action) => {
|
|
10
|
-
const { tenantId, companyId } = action.payload;
|
|
11
|
-
const base = `${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/cockpit-panels`;
|
|
12
|
-
const url = `${base}/ai-accountant/cancel-onboarding`;
|
|
13
|
-
return zeniAPI
|
|
14
|
-
.postAndGetJSON(url, {
|
|
15
|
-
tenant_id: tenantId,
|
|
16
|
-
company_id: companyId,
|
|
17
|
-
})
|
|
18
|
-
.pipe((0, operators_1.mergeMap)((response) => {
|
|
19
|
-
if ((0, responsePayload_1.isSuccessResponse)(response)) {
|
|
20
|
-
return (0, rxjs_1.from)([
|
|
21
|
-
(0, aiAccountantViewReducer_1.cancelAiAccountantOnboardingSuccess)(tenantId),
|
|
22
|
-
(0, aiAccountantViewReducer_1.fetchAiAccountantCustomers)(),
|
|
23
|
-
(0, snackbarReducer_1.openSnackbar)({
|
|
24
|
-
messageSection: 'common',
|
|
25
|
-
messageText: 'success',
|
|
26
|
-
type: 'success',
|
|
27
|
-
}),
|
|
28
|
-
]);
|
|
29
|
-
}
|
|
30
|
-
else {
|
|
31
|
-
return (0, rxjs_1.from)([
|
|
32
|
-
(0, aiAccountantViewReducer_1.cancelAiAccountantOnboardingFailure)(tenantId, response.status),
|
|
33
|
-
(0, snackbarReducer_1.openSnackbar)({
|
|
34
|
-
messageSection: 'common',
|
|
35
|
-
messageText: 'failed',
|
|
36
|
-
type: 'error',
|
|
37
|
-
}),
|
|
38
|
-
]);
|
|
39
|
-
}
|
|
40
|
-
}), (0, operators_1.catchError)((error) => (0, rxjs_1.from)([
|
|
41
|
-
(0, aiAccountantViewReducer_1.cancelAiAccountantOnboardingFailure)(tenantId, (0, responsePayload_1.createZeniAPIStatus)('Unexpected error', 'AI Accountant cancel onboarding failed: ' +
|
|
42
|
-
JSON.stringify(error))),
|
|
43
|
-
(0, snackbarReducer_1.openSnackbar)({
|
|
44
|
-
messageSection: 'common',
|
|
45
|
-
messageText: 'failed',
|
|
46
|
-
type: 'error',
|
|
47
|
-
}),
|
|
48
|
-
])));
|
|
49
|
-
}));
|
|
50
|
-
exports.cancelAiAccountantOnboardingEpic = cancelAiAccountantOnboardingEpic;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
-
import { updateAiAccountantCustomers as updateAiAccountantCustomerEntities } from '../../../entity/aiAccountantCustomer/aiAccountantCustomerReducer';
|
|
3
|
-
import { updateAllUsers } from '../../../entity/user/userReducer';
|
|
4
|
-
import { RootState } from '../../../reducer';
|
|
5
|
-
import { ZeniAPI } from '../../../zeniAPI';
|
|
6
|
-
import { fetchAiAccountantCustomers, updateAiAccountantCustomers, updateAiAccountantCustomersFailure } from '../aiAccountantViewReducer';
|
|
7
|
-
export type ActionType = ReturnType<typeof fetchAiAccountantCustomers> | ReturnType<typeof updateAiAccountantCustomers> | ReturnType<typeof updateAiAccountantCustomersFailure> | ReturnType<typeof updateAiAccountantCustomerEntities> | ReturnType<typeof updateAllUsers>;
|
|
8
|
-
export declare const fetchAiAccountantCustomersEpic: (actions$: ActionsObservable<ActionType>, _: StateObservable<RootState>, zeniAPI: ZeniAPI) => import("rxjs").Observable<{
|
|
9
|
-
payload: {
|
|
10
|
-
users: import("../../..").UserPayload[];
|
|
11
|
-
updateType?: import("../../..").UpdateType;
|
|
12
|
-
};
|
|
13
|
-
type: "user/updateAllUsers";
|
|
14
|
-
} | {
|
|
15
|
-
payload: import("../aiAccountantViewPayload").AiAccountantCustomerPayload[];
|
|
16
|
-
type: "aiAccountantView/updateAiAccountantCustomers";
|
|
17
|
-
} | {
|
|
18
|
-
payload: import("../../../responsePayload").ZeniAPIStatus<Record<string, unknown>>;
|
|
19
|
-
type: "aiAccountantView/updateAiAccountantCustomersFailure";
|
|
20
|
-
} | {
|
|
21
|
-
payload: import("../aiAccountantViewPayload").AiAccountantCustomerPayload[];
|
|
22
|
-
type: "aiAccountantCustomer/updateAiAccountantCustomers";
|
|
23
|
-
}>;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.fetchAiAccountantCustomersEpic = void 0;
|
|
4
|
-
const rxjs_1 = require("rxjs");
|
|
5
|
-
const operators_1 = require("rxjs/operators");
|
|
6
|
-
const aiAccountantCustomerReducer_1 = require("../../../entity/aiAccountantCustomer/aiAccountantCustomerReducer");
|
|
7
|
-
const userReducer_1 = require("../../../entity/user/userReducer");
|
|
8
|
-
const responsePayload_1 = require("../../../responsePayload");
|
|
9
|
-
const aiAccountantViewReducer_1 = require("../aiAccountantViewReducer");
|
|
10
|
-
const fetchAiAccountantCustomersEpic = (actions$, _, zeniAPI) => actions$.pipe((0, operators_1.filter)(aiAccountantViewReducer_1.fetchAiAccountantCustomers.match), (0, operators_1.switchMap)(() => {
|
|
11
|
-
const base = `${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/cockpit-panels`;
|
|
12
|
-
const url = `${base}/ai-accountant/customers`;
|
|
13
|
-
return zeniAPI
|
|
14
|
-
.getJSON(url)
|
|
15
|
-
.pipe((0, operators_1.mergeMap)((response) => {
|
|
16
|
-
if ((0, responsePayload_1.isSuccessResponse)(response)) {
|
|
17
|
-
const customers = response.data?.customers ?? [];
|
|
18
|
-
const users = response.data?.users ?? [];
|
|
19
|
-
return (0, rxjs_1.from)([
|
|
20
|
-
(0, aiAccountantCustomerReducer_1.updateAiAccountantCustomers)(customers),
|
|
21
|
-
(0, userReducer_1.updateAllUsers)({ users }),
|
|
22
|
-
(0, aiAccountantViewReducer_1.updateAiAccountantCustomers)(customers),
|
|
23
|
-
]);
|
|
24
|
-
}
|
|
25
|
-
else {
|
|
26
|
-
return (0, rxjs_1.of)((0, aiAccountantViewReducer_1.updateAiAccountantCustomersFailure)(response.status));
|
|
27
|
-
}
|
|
28
|
-
}), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, aiAccountantViewReducer_1.updateAiAccountantCustomersFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected error', 'AI Accountant customers fetch failed: ' +
|
|
29
|
-
JSON.stringify(error))))));
|
|
30
|
-
}));
|
|
31
|
-
exports.fetchAiAccountantCustomersEpic = fetchAiAccountantCustomersEpic;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
-
import { updateAiAccountantJobs as updateAiAccountantJobEntities } from '../../../entity/aiAccountantCustomer/aiAccountantCustomerReducer';
|
|
3
|
-
import { updateAllUsers } from '../../../entity/user/userReducer';
|
|
4
|
-
import { RootState } from '../../../reducer';
|
|
5
|
-
import { ZeniAPI } from '../../../zeniAPI';
|
|
6
|
-
import { fetchAiAccountantJobs, updateAiAccountantJobs, updateAiAccountantJobsFailure } from '../aiAccountantViewReducer';
|
|
7
|
-
export type ActionType = ReturnType<typeof fetchAiAccountantJobs> | ReturnType<typeof updateAiAccountantJobs> | ReturnType<typeof updateAiAccountantJobEntities> | ReturnType<typeof updateAiAccountantJobsFailure> | ReturnType<typeof updateAllUsers>;
|
|
8
|
-
export declare const fetchAiAccountantJobsEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => import("rxjs").Observable<{
|
|
9
|
-
payload: {
|
|
10
|
-
users: import("../../..").UserPayload[];
|
|
11
|
-
updateType?: import("../../..").UpdateType;
|
|
12
|
-
};
|
|
13
|
-
type: "user/updateAllUsers";
|
|
14
|
-
} | {
|
|
15
|
-
payload: {
|
|
16
|
-
tenantId: string;
|
|
17
|
-
nextPageToken: string | null;
|
|
18
|
-
};
|
|
19
|
-
type: "aiAccountantView/updateAiAccountantJobs";
|
|
20
|
-
} | {
|
|
21
|
-
payload: {
|
|
22
|
-
tenantId: string;
|
|
23
|
-
jobs: import("../aiAccountantViewPayload").AiAccountantJobPayload[];
|
|
24
|
-
append: boolean;
|
|
25
|
-
};
|
|
26
|
-
type: "aiAccountantCustomer/updateAiAccountantJobs";
|
|
27
|
-
} | {
|
|
28
|
-
payload: {
|
|
29
|
-
error: import("../../../responsePayload").ZeniAPIStatus;
|
|
30
|
-
tenantId: import("../../..").ID;
|
|
31
|
-
};
|
|
32
|
-
type: "aiAccountantView/updateAiAccountantJobsFailure";
|
|
33
|
-
}>;
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.fetchAiAccountantJobsEpic = void 0;
|
|
4
|
-
const rxjs_1 = require("rxjs");
|
|
5
|
-
const operators_1 = require("rxjs/operators");
|
|
6
|
-
const aiAccountantCustomerReducer_1 = require("../../../entity/aiAccountantCustomer/aiAccountantCustomerReducer");
|
|
7
|
-
const userReducer_1 = require("../../../entity/user/userReducer");
|
|
8
|
-
const responsePayload_1 = require("../../../responsePayload");
|
|
9
|
-
const aiAccountantViewReducer_1 = require("../aiAccountantViewReducer");
|
|
10
|
-
const fetchAiAccountantJobsEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(aiAccountantViewReducer_1.fetchAiAccountantJobs.match), (0, operators_1.switchMap)((action) => {
|
|
11
|
-
const { tenantId, fetchNextPage } = action.payload;
|
|
12
|
-
const rootState = state$.value;
|
|
13
|
-
const customerView = rootState.aiAccountantViewState.customersByTenantId[tenantId];
|
|
14
|
-
const pageToken = fetchNextPage && customerView?.jobsPageToken != null
|
|
15
|
-
? customerView.jobsPageToken
|
|
16
|
-
: null;
|
|
17
|
-
const params = new URLSearchParams({
|
|
18
|
-
page_size: '50',
|
|
19
|
-
tenant_id: tenantId,
|
|
20
|
-
});
|
|
21
|
-
if (pageToken != null) {
|
|
22
|
-
params.set('page_token', pageToken);
|
|
23
|
-
}
|
|
24
|
-
const base = `${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/cockpit-panels`;
|
|
25
|
-
const url = `${base}/ai-accountant/jobs?${params.toString()}`;
|
|
26
|
-
return zeniAPI
|
|
27
|
-
.getJSON(url)
|
|
28
|
-
.pipe((0, operators_1.mergeMap)((response) => {
|
|
29
|
-
if ((0, responsePayload_1.isSuccessResponse)(response)) {
|
|
30
|
-
const jobs = response.data?.jobs ?? [];
|
|
31
|
-
const users = response.data?.users ?? [];
|
|
32
|
-
const nextPageToken = response.data?.next_page_token ?? null;
|
|
33
|
-
return (0, rxjs_1.from)([
|
|
34
|
-
(0, userReducer_1.updateAllUsers)({ users }),
|
|
35
|
-
(0, aiAccountantCustomerReducer_1.updateAiAccountantJobs)(tenantId, jobs, fetchNextPage),
|
|
36
|
-
(0, aiAccountantViewReducer_1.updateAiAccountantJobs)(tenantId, nextPageToken),
|
|
37
|
-
]);
|
|
38
|
-
}
|
|
39
|
-
else {
|
|
40
|
-
return (0, rxjs_1.of)((0, aiAccountantViewReducer_1.updateAiAccountantJobsFailure)({
|
|
41
|
-
tenantId,
|
|
42
|
-
error: response.status,
|
|
43
|
-
}));
|
|
44
|
-
}
|
|
45
|
-
}), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, aiAccountantViewReducer_1.updateAiAccountantJobsFailure)({
|
|
46
|
-
tenantId,
|
|
47
|
-
error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected error', 'AI Accountant jobs fetch failed: ' +
|
|
48
|
-
JSON.stringify(error)),
|
|
49
|
-
}))));
|
|
50
|
-
}));
|
|
51
|
-
exports.fetchAiAccountantJobsEpic = fetchAiAccountantJobsEpic;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
-
import { openSnackbar } from '../../../entity/snackbar/snackbarReducer';
|
|
3
|
-
import { RootState } from '../../../reducer';
|
|
4
|
-
import { ZeniAPI } from '../../../zeniAPI';
|
|
5
|
-
import { fetchAiAccountantCustomers, triggerAiAccountantJob, triggerAiAccountantJobFailure, triggerAiAccountantJobSuccess } from '../aiAccountantViewReducer';
|
|
6
|
-
export type ActionType = ReturnType<typeof triggerAiAccountantJob> | ReturnType<typeof triggerAiAccountantJobSuccess> | ReturnType<typeof triggerAiAccountantJobFailure> | ReturnType<typeof fetchAiAccountantCustomers> | ReturnType<typeof openSnackbar>;
|
|
7
|
-
export declare const triggerAiAccountantJobEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => import("rxjs").Observable<{
|
|
8
|
-
payload: {
|
|
9
|
-
messageSection: import("../../..").SnackbarMessageSections;
|
|
10
|
-
messageText: import("../../..").SnackbarMessageSectionTexts;
|
|
11
|
-
type: import("../../..").SnackbarMessageType;
|
|
12
|
-
showStatusIcon?: boolean;
|
|
13
|
-
variables?: {
|
|
14
|
-
variableName: string;
|
|
15
|
-
variableValue: string;
|
|
16
|
-
}[];
|
|
17
|
-
};
|
|
18
|
-
type: "snackbar/openSnackbar";
|
|
19
|
-
} | {
|
|
20
|
-
payload: undefined;
|
|
21
|
-
type: "aiAccountantView/fetchAiAccountantCustomers";
|
|
22
|
-
} | {
|
|
23
|
-
payload: undefined;
|
|
24
|
-
type: "aiAccountantView/triggerAiAccountantJobSuccess";
|
|
25
|
-
} | {
|
|
26
|
-
payload: import("../../../responsePayload").ZeniAPIStatus<Record<string, unknown>>;
|
|
27
|
-
type: "aiAccountantView/triggerAiAccountantJobFailure";
|
|
28
|
-
}>;
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.triggerAiAccountantJobEpic = void 0;
|
|
4
|
-
const rxjs_1 = require("rxjs");
|
|
5
|
-
const operators_1 = require("rxjs/operators");
|
|
6
|
-
const snackbarReducer_1 = require("../../../entity/snackbar/snackbarReducer");
|
|
7
|
-
const responsePayload_1 = require("../../../responsePayload");
|
|
8
|
-
const aiAccountantViewReducer_1 = require("../aiAccountantViewReducer");
|
|
9
|
-
const triggerAiAccountantJobEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(aiAccountantViewReducer_1.triggerAiAccountantJob.match), (0, operators_1.mergeMap)((action) => {
|
|
10
|
-
const { operationType, startDate, endDate } = action.payload;
|
|
11
|
-
const rootState = state$.value;
|
|
12
|
-
const selectedTenantIds = rootState.aiAccountantViewState.selectedTenantIdsForJobTrigger;
|
|
13
|
-
const base = `${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/cockpit-panels`;
|
|
14
|
-
const url = `${base}/ai-accountant/jobs`;
|
|
15
|
-
return zeniAPI
|
|
16
|
-
.postAndGetJSON(url, {
|
|
17
|
-
tenant_ids: selectedTenantIds,
|
|
18
|
-
operation_type: operationType,
|
|
19
|
-
params: {
|
|
20
|
-
start_date: startDate,
|
|
21
|
-
end_date: endDate,
|
|
22
|
-
},
|
|
23
|
-
})
|
|
24
|
-
.pipe((0, operators_1.mergeMap)((response) => {
|
|
25
|
-
if ((0, responsePayload_1.isSuccessResponse)(response)) {
|
|
26
|
-
return (0, rxjs_1.from)([
|
|
27
|
-
(0, aiAccountantViewReducer_1.triggerAiAccountantJobSuccess)(),
|
|
28
|
-
(0, aiAccountantViewReducer_1.fetchAiAccountantCustomers)(),
|
|
29
|
-
(0, snackbarReducer_1.openSnackbar)({
|
|
30
|
-
messageSection: 'common',
|
|
31
|
-
messageText: 'success',
|
|
32
|
-
type: 'success',
|
|
33
|
-
}),
|
|
34
|
-
]);
|
|
35
|
-
}
|
|
36
|
-
else {
|
|
37
|
-
return (0, rxjs_1.from)([
|
|
38
|
-
(0, aiAccountantViewReducer_1.triggerAiAccountantJobFailure)(response.status),
|
|
39
|
-
(0, snackbarReducer_1.openSnackbar)({
|
|
40
|
-
messageSection: 'common',
|
|
41
|
-
messageText: 'failed',
|
|
42
|
-
type: 'error',
|
|
43
|
-
}),
|
|
44
|
-
]);
|
|
45
|
-
}
|
|
46
|
-
}), (0, operators_1.catchError)((error) => (0, rxjs_1.from)([
|
|
47
|
-
(0, aiAccountantViewReducer_1.triggerAiAccountantJobFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected error', 'AI Accountant trigger job failed: ' +
|
|
48
|
-
JSON.stringify(error))),
|
|
49
|
-
(0, snackbarReducer_1.openSnackbar)({
|
|
50
|
-
messageSection: 'common',
|
|
51
|
-
messageText: 'failed',
|
|
52
|
-
type: 'error',
|
|
53
|
-
}),
|
|
54
|
-
])));
|
|
55
|
-
}));
|
|
56
|
-
exports.triggerAiAccountantJobEpic = triggerAiAccountantJobEpic;
|
package/lib/view/expenseAutomationView/epics/accountRecon/excludeAccountFromReconciliationEpic.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
-
import { Observable } from 'rxjs';
|
|
3
|
-
import { changeAccountKey } from '../../../../entity/account/accountReducer';
|
|
4
|
-
import { RootState } from '../../../../reducer';
|
|
5
|
-
import { ZeniAPI } from '../../../../zeniAPI';
|
|
6
|
-
import { excludeAccountFromReconciliation, excludeAccountFromReconciliationFailure, excludeAccountFromReconciliationSuccess } from '../../reducers/reconciliationViewReducer';
|
|
7
|
-
export type ActionType = ReturnType<typeof excludeAccountFromReconciliation> | ReturnType<typeof changeAccountKey> | ReturnType<typeof excludeAccountFromReconciliationSuccess> | ReturnType<typeof excludeAccountFromReconciliationFailure>;
|
|
8
|
-
export declare const excludeAccountFromReconciliationEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
package/lib/view/expenseAutomationView/epics/accountRecon/excludeAccountFromReconciliationEpic.js
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.excludeAccountFromReconciliationEpic = void 0;
|
|
4
|
-
const rxjs_1 = require("rxjs");
|
|
5
|
-
const operators_1 = require("rxjs/operators");
|
|
6
|
-
const accountReducer_1 = require("../../../../entity/account/accountReducer");
|
|
7
|
-
const accountState_1 = require("../../../../entity/account/accountState");
|
|
8
|
-
const accountReconSelector_1 = require("../../../../entity/accountRecon/accountReconSelector");
|
|
9
|
-
const tenantSelector_1 = require("../../../../entity/tenant/tenantSelector");
|
|
10
|
-
const responsePayload_1 = require("../../../../responsePayload");
|
|
11
|
-
const reconciliationViewReducer_1 = require("../../reducers/reconciliationViewReducer");
|
|
12
|
-
const excludeAccountFromReconciliationEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(reconciliationViewReducer_1.excludeAccountFromReconciliation.match), (0, operators_1.mergeMap)((action) => {
|
|
13
|
-
const { accountId } = action.payload;
|
|
14
|
-
const state = state$.value;
|
|
15
|
-
const currentTenant = (0, tenantSelector_1.getCurrentTenant)(state);
|
|
16
|
-
const selectedPeriod = state.expenseAutomationViewState.selectedPeriodByTenantId[currentTenant.tenantId];
|
|
17
|
-
const reconciliationData = (0, accountReconSelector_1.getAccountReconByAccountIdAndSelectedPeriod)(state, accountId, selectedPeriod);
|
|
18
|
-
const payload = {
|
|
19
|
-
account_id: accountId,
|
|
20
|
-
bank_balance: reconciliationData?.balance?.amount ?? null,
|
|
21
|
-
cleared_balance: reconciliationData?.clearedBalance?.amount ?? null,
|
|
22
|
-
variance: reconciliationData?.variance?.amount ?? null,
|
|
23
|
-
};
|
|
24
|
-
const apiUrl = `${zeniAPI.apiEndPoints.reconciliationMicroServiceBaseUrl}/1.0/reconciliation/excluded-accounts`;
|
|
25
|
-
return zeniAPI
|
|
26
|
-
.postAndGetJSON(apiUrl, payload)
|
|
27
|
-
.pipe((0, operators_1.mergeMap)((response) => {
|
|
28
|
-
if ((0, responsePayload_1.isSuccessResponse)(response)) {
|
|
29
|
-
const newAccountKey = (0, accountState_1.getAccountKey)('excluded_account_reconciliation', accountId);
|
|
30
|
-
const oldAccountKey = (0, accountState_1.getAccountKey)('account_reconciliation', accountId);
|
|
31
|
-
return (0, rxjs_1.of)((0, reconciliationViewReducer_1.excludeAccountFromReconciliationSuccess)({
|
|
32
|
-
account: response.data?.excluded_account ?? undefined,
|
|
33
|
-
selectedPeriod,
|
|
34
|
-
}), (0, accountReducer_1.changeAccountKey)({
|
|
35
|
-
oldKey: oldAccountKey,
|
|
36
|
-
newKey: newAccountKey,
|
|
37
|
-
}));
|
|
38
|
-
}
|
|
39
|
-
else {
|
|
40
|
-
return (0, rxjs_1.of)((0, reconciliationViewReducer_1.excludeAccountFromReconciliationFailure)({
|
|
41
|
-
error: response.status,
|
|
42
|
-
}));
|
|
43
|
-
}
|
|
44
|
-
}), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, reconciliationViewReducer_1.excludeAccountFromReconciliationFailure)({
|
|
45
|
-
error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', `Exclude account from reconciliation REST API call errored out ${JSON.stringify(error)}`),
|
|
46
|
-
}))));
|
|
47
|
-
}));
|
|
48
|
-
exports.excludeAccountFromReconciliationEpic = excludeAccountFromReconciliationEpic;
|
package/lib/view/expenseAutomationView/epics/accountRecon/includeAccountInReconciliationEpic.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
-
import { Observable } from 'rxjs';
|
|
3
|
-
import { changeAccountKey } from '../../../../entity/account/accountReducer';
|
|
4
|
-
import { updateAccountRecon } from '../../../../entity/accountRecon/accountReconReducer';
|
|
5
|
-
import { RootState } from '../../../../reducer';
|
|
6
|
-
import { ZeniAPI } from '../../../../zeniAPI';
|
|
7
|
-
import { includeAccountInReconciliation, includeAccountInReconciliationFailure, includeAccountInReconciliationSuccess } from '../../reducers/reconciliationViewReducer';
|
|
8
|
-
export type ActionType = ReturnType<typeof includeAccountInReconciliation> | ReturnType<typeof includeAccountInReconciliationSuccess> | ReturnType<typeof includeAccountInReconciliationFailure> | ReturnType<typeof changeAccountKey> | ReturnType<typeof updateAccountRecon>;
|
|
9
|
-
export declare const includeAccountInReconciliationEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
package/lib/view/expenseAutomationView/epics/accountRecon/includeAccountInReconciliationEpic.js
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.includeAccountInReconciliationEpic = void 0;
|
|
4
|
-
const rxjs_1 = require("rxjs");
|
|
5
|
-
const operators_1 = require("rxjs/operators");
|
|
6
|
-
const timePeriod_1 = require("../../../../commonStateTypes/timePeriod");
|
|
7
|
-
const accountReducer_1 = require("../../../../entity/account/accountReducer");
|
|
8
|
-
const accountState_1 = require("../../../../entity/account/accountState");
|
|
9
|
-
const accountReconReducer_1 = require("../../../../entity/accountRecon/accountReconReducer");
|
|
10
|
-
const tenantSelector_1 = require("../../../../entity/tenant/tenantSelector");
|
|
11
|
-
const responsePayload_1 = require("../../../../responsePayload");
|
|
12
|
-
const reconciliationViewReducer_1 = require("../../reducers/reconciliationViewReducer");
|
|
13
|
-
const includeAccountInReconciliationEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(reconciliationViewReducer_1.includeAccountInReconciliation.match), (0, operators_1.mergeMap)((action) => {
|
|
14
|
-
const { accountId } = action.payload;
|
|
15
|
-
const state = state$.value;
|
|
16
|
-
const currentTenant = (0, tenantSelector_1.getCurrentTenant)(state);
|
|
17
|
-
const selectedPeriod = state.expenseAutomationViewState.selectedPeriodByTenantId[currentTenant.tenantId];
|
|
18
|
-
const period = (0, timePeriod_1.convertToPeriod)(selectedPeriod, true);
|
|
19
|
-
const query = JSON.stringify({
|
|
20
|
-
start_date: period.start,
|
|
21
|
-
end_date: period.end,
|
|
22
|
-
});
|
|
23
|
-
const apiUrl = `${zeniAPI.apiEndPoints.reconciliationMicroServiceBaseUrl}/1.0/reconciliation/excluded-accounts/${accountId}?query=${encodeURIComponent(query)}`;
|
|
24
|
-
return zeniAPI
|
|
25
|
-
.deleteAndGetJSON(apiUrl)
|
|
26
|
-
.pipe((0, operators_1.mergeMap)((response) => {
|
|
27
|
-
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
28
|
-
const reconciliation = response.data.reconciliation;
|
|
29
|
-
const oldAccountKey = (0, accountState_1.getAccountKey)('excluded_account_reconciliation', reconciliation.account_id);
|
|
30
|
-
const newAccountKey = (0, accountState_1.getAccountKey)('account_reconciliation', reconciliation.account_id);
|
|
31
|
-
return (0, rxjs_1.of)((0, accountReconReducer_1.updateAccountRecon)(selectedPeriod, [reconciliation]), (0, reconciliationViewReducer_1.includeAccountInReconciliationSuccess)({
|
|
32
|
-
reconciliation,
|
|
33
|
-
selectedPeriod,
|
|
34
|
-
}), (0, accountReducer_1.changeAccountKey)({
|
|
35
|
-
oldKey: oldAccountKey,
|
|
36
|
-
newKey: newAccountKey,
|
|
37
|
-
}));
|
|
38
|
-
}
|
|
39
|
-
else {
|
|
40
|
-
return (0, rxjs_1.of)((0, reconciliationViewReducer_1.includeAccountInReconciliationFailure)({
|
|
41
|
-
error: response.status,
|
|
42
|
-
}));
|
|
43
|
-
}
|
|
44
|
-
}), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, reconciliationViewReducer_1.includeAccountInReconciliationFailure)({
|
|
45
|
-
error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', `Include account in reconciliation REST API call errored out ${JSON.stringify(error)}`),
|
|
46
|
-
}))));
|
|
47
|
-
}));
|
|
48
|
-
exports.includeAccountInReconciliationEpic = includeAccountInReconciliationEpic;
|