@zeniai/client-epic-state 4.20.9-betaRR12 → 4.20.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonStateTypes/animations.d.ts +1 -1
- package/lib/commonStateTypes/animations.js +0 -3
- package/lib/commonStateTypes/viewAndReport/viewAndReport.d.ts +2 -2
- package/lib/commonStateTypes/viewAndReport/viewAndReport.js +0 -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 +2 -7
- 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 +1 -1
- package/lib/entity/accountRecon/accountReconPayload.js +2 -4
- package/lib/entity/aiCfo/aiCfoSelector.d.ts +2 -1
- package/lib/entity/billPay/billTransaction/billTransactionState.d.ts +2 -2
- package/lib/entity/class/classReducer.d.ts +4 -4
- package/lib/entity/class/classState.d.ts +1 -1
- package/lib/entity/forecast/forecastState.d.ts +1 -1
- package/lib/entity/jeSchedules/jeSchedulesPayload.d.ts +0 -38
- package/lib/entity/jeSchedules/jeSchedulesPayload.js +0 -78
- package/lib/entity/jeSchedules/jeSchedulesSelector.d.ts +1 -4
- package/lib/entity/jeSchedules/jeSchedulesSelector.js +1 -5
- package/lib/entity/jeSchedules/jeSchedulesState.d.ts +0 -37
- package/lib/entity/sectionAccountsView/sectionAccountsView.d.ts +1 -1
- package/lib/entity/sectionClassesViewV2/sectionClassesView.d.ts +1 -1
- package/lib/entity/sectionClassesViewV2/sectionClassesViewReducer.d.ts +2 -2
- package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.js +0 -6
- package/lib/entity/tenant/tenantPayload.d.ts +0 -1
- package/lib/entity/tenant/tenantReducer.d.ts +2 -5
- package/lib/entity/tenant/tenantReducer.js +2 -9
- package/lib/entity/tenant/tenantSelector.d.ts +0 -1
- package/lib/entity/tenant/tenantSelector.js +1 -9
- package/lib/entity/tenant/tenantState.d.ts +0 -1
- package/lib/entity/transaction/payloadTypes/scheduleTransactionPayload.d.ts +1 -4
- package/lib/entity/transaction/payloadTypes/scheduleTransactionPayload.js +0 -1
- package/lib/entity/transaction/payloadTypes/transactionPayload.d.ts +0 -9
- package/lib/entity/transaction/payloadTypes/transactionPayload.js +1 -79
- package/lib/entity/transaction/stateTypes/scheduleTransaction.d.ts +0 -1
- package/lib/entity/transaction/stateTypes/transaction.d.ts +0 -11
- package/lib/entity/transaction/stateTypes/transactionLine.d.ts +1 -1
- package/lib/epic.d.ts +1 -12
- package/lib/epic.js +1 -12
- package/lib/esm/commonStateTypes/animations.js +0 -3
- package/lib/esm/commonStateTypes/viewAndReport/viewAndReport.js +0 -1
- package/lib/esm/entity/account/accountReducer.js +1 -6
- package/lib/esm/entity/accountRecon/accountReconPayload.js +2 -4
- package/lib/esm/entity/jeSchedules/jeSchedulesPayload.js +0 -78
- package/lib/esm/entity/jeSchedules/jeSchedulesSelector.js +1 -5
- package/lib/esm/entity/snackbar/snackbarTypes.js +0 -6
- package/lib/esm/entity/tenant/tenantReducer.js +1 -8
- package/lib/esm/entity/tenant/tenantSelector.js +0 -7
- package/lib/esm/entity/transaction/payloadTypes/scheduleTransactionPayload.js +0 -1
- package/lib/esm/entity/transaction/payloadTypes/transactionPayload.js +1 -79
- package/lib/esm/epic.js +1 -12
- package/lib/esm/index.js +13 -16
- package/lib/esm/reducer.js +0 -3
- package/lib/esm/view/aiCfoView/aiCfoViewReducer.js +1 -82
- package/lib/esm/view/aiCfoView/aiCfoViewSelector.js +2 -8
- package/lib/esm/view/classList/fetchClassListEpic.js +2 -9
- package/lib/esm/view/commonVendorView/vendorView/vendorViewSelector.js +5 -18
- package/lib/esm/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewSelector.js +2 -6
- package/lib/esm/view/companyTaskManagerView/companyTaskManagerViewReducer.js +1 -19
- package/lib/esm/view/companyTaskManagerView/companyTaskManagerViewSelector.js +1 -3
- package/lib/esm/view/companyView/companyViewReducer.js +1 -26
- package/lib/esm/view/companyView/types/companyPassport/companyPassportViewState.js +0 -4
- package/lib/esm/view/expenseAutomationView/epics/accountRecon/fetchReconciliationViewEpic.js +9 -4
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +2 -2
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/bulkUploadReceiptsEpic.js +2 -2
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/watchBulkUploadBatchStatusEpic.js +1 -2
- package/lib/esm/view/expenseAutomationView/expenseAutomationViewSelector.js +1 -0
- package/lib/esm/view/expenseAutomationView/helpers/saveTransactionHelper.js +2 -2
- package/lib/esm/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.js +2 -2
- package/lib/esm/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +1 -21
- package/lib/esm/view/expenseAutomationView/reducers/reconciliationViewReducer.js +3 -167
- package/lib/esm/view/expenseAutomationView/selectorTypes/reconciliationViewSelectorTypes.js +2 -1
- package/lib/esm/view/expenseAutomationView/selectors/fluxAnalysisViewSelector.js +2 -10
- package/lib/esm/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +6 -63
- package/lib/esm/view/expenseAutomationView/selectors/missingReceiptsSelector.js +4 -12
- package/lib/esm/view/expenseAutomationView/selectors/reconciliationViewSelector.js +9 -136
- package/lib/esm/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +5 -15
- package/lib/esm/view/expenseAutomationView/types/jeSchedulesViewState.js +1 -24
- package/lib/esm/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelector.js +0 -3
- package/lib/esm/view/spendManagement/billPay/billList/billListSelector.js +0 -10
- package/lib/esm/view/spendManagement/billPay/billList/billListState.js +0 -1
- package/lib/esm/view/spendManagement/billPay/billPayReview/billPayReviewSelector.js +3 -7
- package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/billPaySetupApproverViewSelector.js +5 -5
- package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/epic/fetchBillPayApproversDetailsEpic.js +2 -7
- package/lib/esm/view/spendManagement/billPay/editBillView/editBillViewSelector.js +6 -13
- package/lib/esm/view/spendManagement/chargeCards/chargeCardList/chargeCardList.js +0 -1
- package/lib/esm/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.js +0 -2
- package/lib/esm/view/spendManagement/reimbursement/editRemiView/editRemiViewSelector.js +4 -7
- package/lib/esm/view/spendManagement/reimbursement/remiListView/remiListSelector.js +0 -12
- package/lib/esm/view/spendManagement/reimbursement/remiListView/remiListState.js +0 -1
- package/lib/esm/view/spendManagement/treasury/treasuryList/epics/fetchTreasuryDetailEpic.js +2 -2
- package/lib/esm/view/spendManagement/treasury/treasuryList/treasuryDetailReducer.js +1 -2
- package/lib/esm/view/taskManager/taskDetailView/taskDetailSelector.js +2 -2
- package/lib/esm/view/transactionDetail/epics/saveTransactionHelper.js +2 -2
- package/lib/esm/view/transactionDetail/transactionDetailLocalDataHelper.js +14 -16
- package/lib/esm/view/transactionDetail/transactionDetailSelector.js +2 -9
- package/lib/index.d.ts +19 -26
- package/lib/index.js +32 -62
- package/lib/reducer.d.ts +0 -3
- package/lib/reducer.js +0 -3
- package/lib/tsconfig.typecheck.tsbuildinfo +1 -1
- package/lib/view/aiCfoView/aiCfoViewPayload.d.ts +0 -7
- package/lib/view/aiCfoView/aiCfoViewReducer.d.ts +1 -15
- package/lib/view/aiCfoView/aiCfoViewReducer.js +2 -83
- package/lib/view/aiCfoView/aiCfoViewSelector.d.ts +1 -4
- package/lib/view/aiCfoView/aiCfoViewSelector.js +2 -9
- package/lib/view/aiCfoView/aiCfoViewState.d.ts +1 -15
- package/lib/view/auditReportView/auditReportViewState.d.ts +2 -2
- 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/cashInCashOut/cashInCashOutSelector.d.ts +1 -1
- package/lib/view/cashPosition/cashPositionSelector.d.ts +1 -1
- package/lib/view/classList/fetchClassListEpic.d.ts +1 -1
- package/lib/view/classList/fetchClassListEpic.js +1 -8
- package/lib/view/commonVendorView/vendorView/vendorViewSelector.d.ts +0 -1
- package/lib/view/commonVendorView/vendorView/vendorViewSelector.js +5 -18
- package/lib/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewSelector.d.ts +0 -1
- package/lib/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewSelector.js +2 -6
- package/lib/view/companyTaskManagerView/companyTaskManagerViewReducer.d.ts +2 -2
- package/lib/view/companyTaskManagerView/companyTaskManagerViewReducer.js +2 -20
- package/lib/view/companyTaskManagerView/companyTaskManagerViewSelector.d.ts +1 -4
- package/lib/view/companyTaskManagerView/companyTaskManagerViewSelector.js +1 -3
- package/lib/view/companyTaskManagerView/companyTaskManagerViewState.d.ts +1 -9
- package/lib/view/companyView/companyViewReducer.d.ts +1 -6
- package/lib/view/companyView/companyViewReducer.js +2 -28
- package/lib/view/companyView/types/companyPassport/companyPassportViewState.d.ts +0 -1
- package/lib/view/companyView/types/companyPassport/companyPassportViewState.js +0 -4
- package/lib/view/dashboard/dashboardReducer.d.ts +2 -2
- package/lib/view/expenseAutomationView/epics/accountRecon/fetchReconciliationViewEpic.js +9 -4
- package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +2 -2
- package/lib/view/expenseAutomationView/epics/missingReceipts/bulkUploadReceiptsEpic.js +1 -1
- package/lib/view/expenseAutomationView/epics/missingReceipts/watchBulkUploadBatchStatusEpic.js +1 -2
- package/lib/view/expenseAutomationView/expenseAutomationViewSelector.js +1 -0
- package/lib/view/expenseAutomationView/helpers/saveTransactionHelper.js +2 -2
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.js +2 -2
- package/lib/view/expenseAutomationView/payload/jeSchedulesPayload.d.ts +1 -1
- package/lib/view/expenseAutomationView/payload/reconciliationPayload.d.ts +0 -45
- package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.d.ts +2 -2
- package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +2 -22
- package/lib/view/expenseAutomationView/reducers/reconciliationViewReducer.d.ts +4 -18
- package/lib/view/expenseAutomationView/reducers/reconciliationViewReducer.js +4 -168
- package/lib/view/expenseAutomationView/selectorTypes/jeSchedulesSelectorTypes.d.ts +0 -2
- package/lib/view/expenseAutomationView/selectorTypes/reconciliationViewSelectorTypes.d.ts +2 -7
- package/lib/view/expenseAutomationView/selectorTypes/reconciliationViewSelectorTypes.js +2 -2
- package/lib/view/expenseAutomationView/selectors/fluxAnalysisViewSelector.js +2 -10
- package/lib/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +6 -63
- package/lib/view/expenseAutomationView/selectors/missingReceiptsSelector.js +4 -12
- package/lib/view/expenseAutomationView/selectors/reconciliationViewSelector.js +9 -136
- package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +3 -13
- package/lib/view/expenseAutomationView/types/jeSchedulesViewState.d.ts +0 -8
- package/lib/view/expenseAutomationView/types/jeSchedulesViewState.js +0 -27
- package/lib/view/expenseAutomationView/types/reconciliationViewState.d.ts +0 -14
- package/lib/view/financeStatement/financeStatementReducer.d.ts +1 -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 +0 -3
- package/lib/view/reimbursementCard/reimbursementCardSelector.d.ts +1 -1
- package/lib/view/reportsResync/reportsResyncReducer.d.ts +2 -2
- package/lib/view/scheduleView/scheduleListView/scheduleListTypes.d.ts +1 -1
- package/lib/view/spendManagement/billPay/billList/billListSelector.js +0 -10
- package/lib/view/spendManagement/billPay/billList/billListState.d.ts +1 -1
- package/lib/view/spendManagement/billPay/billList/billListState.js +0 -1
- package/lib/view/spendManagement/billPay/billPayReview/billPayReviewSelector.js +3 -7
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/billPaySetupApproverViewSelector.js +5 -5
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/epic/fetchBillPayApproversDetailsEpic.js +2 -7
- package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.js +6 -13
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetail.d.ts +1 -1
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardList.d.ts +1 -1
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardList.js +0 -1
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.js +0 -2
- package/lib/view/spendManagement/reimbursement/editRemiView/editRemiViewSelector.js +3 -6
- package/lib/view/spendManagement/reimbursement/remiListView/remiListSelector.d.ts +0 -1
- package/lib/view/spendManagement/reimbursement/remiListView/remiListSelector.js +0 -12
- package/lib/view/spendManagement/reimbursement/remiListView/remiListState.d.ts +1 -1
- package/lib/view/spendManagement/reimbursement/remiListView/remiListState.js +0 -1
- package/lib/view/spendManagement/treasury/treasuryList/epics/fetchTreasuryDetailEpic.js +2 -2
- package/lib/view/spendManagement/treasury/treasuryList/treasuryDetailReducer.d.ts +1 -2
- package/lib/view/spendManagement/treasury/treasuryList/treasuryDetailReducer.js +1 -2
- package/lib/view/taskManager/taskDetailView/taskDetailSelector.js +2 -2
- package/lib/view/tasksCard/tasksCardSelector.d.ts +1 -1
- package/lib/view/topEx/topExSelector.d.ts +1 -1
- package/lib/view/transactionDetail/epics/saveTransactionHelper.js +2 -2
- package/lib/view/transactionDetail/transactionDetailLocalDataHelper.js +14 -16
- package/lib/view/transactionDetail/transactionDetailSelector.d.ts +0 -1
- package/lib/view/transactionDetail/transactionDetailSelector.js +2 -9
- package/package.json +1 -1
- package/lib/common/aiCfo/aiCfoSuggestedQuestionsPageContext.d.ts +0 -19
- package/lib/common/aiCfo/aiCfoSuggestedQuestionsPageContext.js +0 -2
- package/lib/esm/common/aiCfo/aiCfoSuggestedQuestionsPageContext.js +0 -1
- package/lib/esm/view/aiCfoView/epics/fetchSuggestedQuestionsEpic.js +0 -29
- package/lib/esm/view/companyTaskManagerView/epics/fetchTaskManagerMetricsEpic.js +0 -17
- package/lib/esm/view/companyView/epic/companyPassport/updateAccountingClassesEnabledEpic.js +0 -61
- package/lib/esm/view/expenseAutomationView/epics/accountRecon/excludeAccountFromReconciliationEpic.js +0 -44
- package/lib/esm/view/expenseAutomationView/epics/accountRecon/includeAccountInReconciliationEpic.js +0 -44
- package/lib/esm/view/spendManagement/autotransferRules/autoTransferRulesPayload.js +0 -26
- package/lib/esm/view/spendManagement/autotransferRules/autoTransferRulesReducer.js +0 -199
- package/lib/esm/view/spendManagement/autotransferRules/autoTransferRulesSelector.js +0 -52
- package/lib/esm/view/spendManagement/autotransferRules/autoTransferRulesState.js +0 -1
- package/lib/esm/view/spendManagement/autotransferRules/epics/createAutoTransferRuleEpic.js +0 -100
- package/lib/esm/view/spendManagement/autotransferRules/epics/deleteAutoTransferRuleEpic.js +0 -48
- package/lib/esm/view/spendManagement/autotransferRules/epics/fetchAutoTransferReviewDetailEpic.js +0 -36
- package/lib/esm/view/spendManagement/autotransferRules/epics/fetchAutoTransferRuleHistory.js +0 -45
- package/lib/esm/view/spendManagement/autotransferRules/epics/fetchAutoTransferRulesEpic.js +0 -50
- package/lib/esm/view/spendManagement/autotransferRules/epics/updateAutoTransferRuleEpic.js +0 -69
- package/lib/view/aiCfoView/epics/fetchSuggestedQuestionsEpic.d.ts +0 -8
- package/lib/view/aiCfoView/epics/fetchSuggestedQuestionsEpic.js +0 -33
- package/lib/view/companyTaskManagerView/epics/fetchTaskManagerMetricsEpic.d.ts +0 -7
- package/lib/view/companyTaskManagerView/epics/fetchTaskManagerMetricsEpic.js +0 -21
- package/lib/view/companyView/epic/companyPassport/updateAccountingClassesEnabledEpic.d.ts +0 -10
- package/lib/view/companyView/epic/companyPassport/updateAccountingClassesEnabledEpic.js +0 -65
- 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
- package/lib/view/spendManagement/autotransferRules/autoTransferRulesPayload.d.ts +0 -75
- package/lib/view/spendManagement/autotransferRules/autoTransferRulesPayload.js +0 -30
- package/lib/view/spendManagement/autotransferRules/autoTransferRulesReducer.d.ts +0 -50
- package/lib/view/spendManagement/autotransferRules/autoTransferRulesReducer.js +0 -206
- package/lib/view/spendManagement/autotransferRules/autoTransferRulesSelector.d.ts +0 -24
- package/lib/view/spendManagement/autotransferRules/autoTransferRulesSelector.js +0 -61
- package/lib/view/spendManagement/autotransferRules/autoTransferRulesState.d.ts +0 -38
- package/lib/view/spendManagement/autotransferRules/autoTransferRulesState.js +0 -2
- package/lib/view/spendManagement/autotransferRules/epics/createAutoTransferRuleEpic.d.ts +0 -12
- package/lib/view/spendManagement/autotransferRules/epics/createAutoTransferRuleEpic.js +0 -106
- package/lib/view/spendManagement/autotransferRules/epics/deleteAutoTransferRuleEpic.d.ts +0 -8
- package/lib/view/spendManagement/autotransferRules/epics/deleteAutoTransferRuleEpic.js +0 -52
- package/lib/view/spendManagement/autotransferRules/epics/fetchAutoTransferReviewDetailEpic.d.ts +0 -7
- package/lib/view/spendManagement/autotransferRules/epics/fetchAutoTransferReviewDetailEpic.js +0 -40
- package/lib/view/spendManagement/autotransferRules/epics/fetchAutoTransferRuleHistory.d.ts +0 -7
- package/lib/view/spendManagement/autotransferRules/epics/fetchAutoTransferRuleHistory.js +0 -52
- package/lib/view/spendManagement/autotransferRules/epics/fetchAutoTransferRulesEpic.d.ts +0 -10
- package/lib/view/spendManagement/autotransferRules/epics/fetchAutoTransferRulesEpic.js +0 -54
- package/lib/view/spendManagement/autotransferRules/epics/updateAutoTransferRuleEpic.d.ts +0 -8
- package/lib/view/spendManagement/autotransferRules/epics/updateAutoTransferRuleEpic.js +0 -73
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import { from, of } from 'rxjs';
|
|
2
|
-
import { catchError, filter, mergeMap, switchMap } from 'rxjs/operators';
|
|
3
|
-
import { openSnackbar } from '../../../../entity/snackbar/snackbarReducer';
|
|
4
|
-
import { createZeniAPIStatus, isSuccessResponse, } from '../../../../responsePayload';
|
|
5
|
-
import { mapPayloadToAutoTransferRule, } from '../autoTransferRulesPayload';
|
|
6
|
-
import { updateAutoTransferRule, updateAutoTransferRuleFailure, updateAutoTransferRuleSuccess, } from '../autoTransferRulesReducer';
|
|
7
|
-
import { mapAutoTransferRuleLocalDataToPayload } from './createAutoTransferRuleEpic';
|
|
8
|
-
export const updateAutoTransferRuleEpic = (actions$, state$, zeniAPI) => actions$.pipe(filter(updateAutoTransferRule.match), switchMap((action) => {
|
|
9
|
-
const { ruleId, pauseRule, resumeRule } = action.payload;
|
|
10
|
-
const requestBody = mapAutoTransferRuleLocalDataToPayload(state$.value.autotransferRulesState.ruleUpdateLocalData, pauseRule, resumeRule);
|
|
11
|
-
return zeniAPI
|
|
12
|
-
.putAndGetJSON(`${zeniAPI.apiEndPoints.bankingMicroServiceBaseUrl}/1.0/rules/transfer/auto/${ruleId}`, requestBody)
|
|
13
|
-
.pipe(mergeMap((response) => {
|
|
14
|
-
if (isSuccessResponse(response) && response.data != null) {
|
|
15
|
-
const rule = mapPayloadToAutoTransferRule(response.data.auto_transfer_rule);
|
|
16
|
-
const isPauseOrResumeOnly = Object.keys(requestBody).length === 1 &&
|
|
17
|
-
'is_active' in requestBody;
|
|
18
|
-
const messageSection = isPauseOrResumeOnly
|
|
19
|
-
? requestBody.is_active === false
|
|
20
|
-
? 'auto_transfer_rule_pause'
|
|
21
|
-
: 'auto_transfer_rule_resume'
|
|
22
|
-
: 'auto_transfer_rule_update';
|
|
23
|
-
const actions = [
|
|
24
|
-
updateAutoTransferRuleSuccess({ rule }),
|
|
25
|
-
openSnackbar({
|
|
26
|
-
messageSection,
|
|
27
|
-
messageText: 'success',
|
|
28
|
-
type: 'success',
|
|
29
|
-
variables: [
|
|
30
|
-
{
|
|
31
|
-
variableName: '__ruleName__',
|
|
32
|
-
variableValue: rule.ruleType === 'minimum_balance'
|
|
33
|
-
? 'Maintain a Minimum Balance'
|
|
34
|
-
: rule.ruleType === 'recurring'
|
|
35
|
-
? 'Make a Recurring Transfer'
|
|
36
|
-
: 'Distribute Balance by Percentage',
|
|
37
|
-
},
|
|
38
|
-
],
|
|
39
|
-
}),
|
|
40
|
-
];
|
|
41
|
-
return from(actions);
|
|
42
|
-
}
|
|
43
|
-
else {
|
|
44
|
-
return from([
|
|
45
|
-
updateAutoTransferRuleFailure({
|
|
46
|
-
ruleId,
|
|
47
|
-
fetchState: 'Error',
|
|
48
|
-
error: response.status,
|
|
49
|
-
}),
|
|
50
|
-
openSnackbar({
|
|
51
|
-
messageSection: 'auto_transfer_rule_update',
|
|
52
|
-
messageText: 'failed',
|
|
53
|
-
type: 'error',
|
|
54
|
-
variables: [
|
|
55
|
-
{
|
|
56
|
-
variableName: '_api-error_',
|
|
57
|
-
variableValue: response.status.message,
|
|
58
|
-
},
|
|
59
|
-
],
|
|
60
|
-
}),
|
|
61
|
-
]);
|
|
62
|
-
}
|
|
63
|
-
}), catchError((error) => of(updateAutoTransferRuleFailure({
|
|
64
|
-
ruleId,
|
|
65
|
-
fetchState: 'Error',
|
|
66
|
-
error: createZeniAPIStatus('Unexpected Error', 'Update auto transfer rule REST API call errored out ' +
|
|
67
|
-
JSON.stringify(error)),
|
|
68
|
-
}))));
|
|
69
|
-
}));
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
-
import { Observable } from 'rxjs';
|
|
3
|
-
import { RootState } from '../../../reducer';
|
|
4
|
-
import { ZeniAPI } from '../../../zeniAPI';
|
|
5
|
-
import { fetchSuggestedQuestions, fetchSuggestedQuestionsFailure, fetchSuggestedQuestionsSuccess } from '../aiCfoViewReducer';
|
|
6
|
-
export type ActionType = ReturnType<typeof fetchSuggestedQuestions> | ReturnType<typeof fetchSuggestedQuestionsSuccess> | ReturnType<typeof fetchSuggestedQuestionsFailure>;
|
|
7
|
-
/** GET {aiCfoMicroServiceBaseUrl}/1.0/suggested-questions?page_context=... */
|
|
8
|
-
export declare const fetchSuggestedQuestionsEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.fetchSuggestedQuestionsEpic = void 0;
|
|
4
|
-
const rxjs_1 = require("rxjs");
|
|
5
|
-
const operators_1 = require("rxjs/operators");
|
|
6
|
-
const responsePayload_1 = require("../../../responsePayload");
|
|
7
|
-
const aiCfoViewReducer_1 = require("../aiCfoViewReducer");
|
|
8
|
-
/** GET {aiCfoMicroServiceBaseUrl}/1.0/suggested-questions?page_context=... */
|
|
9
|
-
const fetchSuggestedQuestionsEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(aiCfoViewReducer_1.fetchSuggestedQuestions.match),
|
|
10
|
-
// mergeMap (not switchMap): each page_context is keyed separately in Redux; switchMap
|
|
11
|
-
// would cancel in-flight HTTP for context A when B is requested, leaving A stuck In-Progress.
|
|
12
|
-
(0, operators_1.mergeMap)((action) => {
|
|
13
|
-
const { pageContext } = action.payload;
|
|
14
|
-
const query = new URLSearchParams({ page_context: pageContext });
|
|
15
|
-
const url = `${zeniAPI.apiEndPoints.aiCfoMicroServiceBaseUrl}/1.0/suggested-questions?${query.toString()}`;
|
|
16
|
-
return zeniAPI.getJSON(url).pipe((0, operators_1.mergeMap)((response) => {
|
|
17
|
-
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
18
|
-
return (0, rxjs_1.of)((0, aiCfoViewReducer_1.fetchSuggestedQuestionsSuccess)({
|
|
19
|
-
pageContext: response.data.page_context,
|
|
20
|
-
generatedAt: response.data.generated_at,
|
|
21
|
-
suggestedQuestions: response.data.suggested_questions,
|
|
22
|
-
}));
|
|
23
|
-
}
|
|
24
|
-
return (0, rxjs_1.of)((0, aiCfoViewReducer_1.fetchSuggestedQuestionsFailure)({
|
|
25
|
-
pageContext,
|
|
26
|
-
error: response.status,
|
|
27
|
-
}));
|
|
28
|
-
}), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, aiCfoViewReducer_1.fetchSuggestedQuestionsFailure)({
|
|
29
|
-
pageContext,
|
|
30
|
-
error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Fetch suggested questions REST API call failed', error instanceof Error ? { message: error.message } : undefined),
|
|
31
|
-
}))));
|
|
32
|
-
}));
|
|
33
|
-
exports.fetchSuggestedQuestionsEpic = fetchSuggestedQuestionsEpic;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
-
import { Observable } from 'rxjs';
|
|
3
|
-
import { RootState } from '../../../reducer';
|
|
4
|
-
import { ZeniAPI } from '../../../zeniAPI';
|
|
5
|
-
import { fetchTaskManagerMetrics, updateTaskManagerMetrics, updateTaskManagerMetricsOnFailure } from '../companyTaskManagerViewReducer';
|
|
6
|
-
export type ActionType = ReturnType<typeof fetchTaskManagerMetrics> | ReturnType<typeof updateTaskManagerMetrics> | ReturnType<typeof updateTaskManagerMetricsOnFailure>;
|
|
7
|
-
export declare const fetchTaskManagerMetricsEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.fetchTaskManagerMetricsEpic = void 0;
|
|
4
|
-
const rxjs_1 = require("rxjs");
|
|
5
|
-
const operators_1 = require("rxjs/operators");
|
|
6
|
-
const responsePayload_1 = require("../../../responsePayload");
|
|
7
|
-
const companyTaskManagerViewReducer_1 = require("../companyTaskManagerViewReducer");
|
|
8
|
-
const fetchTaskManagerMetricsEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(companyTaskManagerViewReducer_1.fetchTaskManagerMetrics.match), (0, operators_1.switchMap)(() => {
|
|
9
|
-
const query = JSON.stringify({ is_filter_by_logged_in_user: true });
|
|
10
|
-
return zeniAPI
|
|
11
|
-
.getJSON(`${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/cockpit-panels/tasks-es-metrics?query=${encodeURIComponent(query)}`)
|
|
12
|
-
.pipe((0, operators_1.mergeMap)((response) => {
|
|
13
|
-
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
14
|
-
return (0, rxjs_1.of)((0, companyTaskManagerViewReducer_1.updateTaskManagerMetrics)(response.data.summary));
|
|
15
|
-
}
|
|
16
|
-
else {
|
|
17
|
-
return (0, rxjs_1.of)((0, companyTaskManagerViewReducer_1.updateTaskManagerMetricsOnFailure)());
|
|
18
|
-
}
|
|
19
|
-
}), (0, operators_1.catchError)(() => (0, rxjs_1.of)((0, companyTaskManagerViewReducer_1.updateTaskManagerMetricsOnFailure)())));
|
|
20
|
-
}));
|
|
21
|
-
exports.fetchTaskManagerMetricsEpic = fetchTaskManagerMetricsEpic;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
-
import { Observable } from 'rxjs';
|
|
3
|
-
import { updateCompanies } from '../../../../entity/company/companyReducer';
|
|
4
|
-
import { openSnackbar } from '../../../../entity/snackbar/snackbarReducer';
|
|
5
|
-
import { updateTenantAccountingClassesEnabled } from '../../../../entity/tenant/tenantReducer';
|
|
6
|
-
import { RootState } from '../../../../reducer';
|
|
7
|
-
import { ZeniAPI } from '../../../../zeniAPI';
|
|
8
|
-
import { updateAccountingClassesEnabled, updateAccountingClassesEnabledFailure, updateAccountingClassesEnabledSuccess } from '../../companyViewReducer';
|
|
9
|
-
export type ActionType = ReturnType<typeof updateCompanies> | ReturnType<typeof updateTenantAccountingClassesEnabled> | ReturnType<typeof openSnackbar> | ReturnType<typeof updateAccountingClassesEnabled> | ReturnType<typeof updateAccountingClassesEnabledSuccess> | ReturnType<typeof updateAccountingClassesEnabledFailure>;
|
|
10
|
-
export declare const updateAccountingClassesEnabledEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.updateAccountingClassesEnabledEpic = void 0;
|
|
4
|
-
const rxjs_1 = require("rxjs");
|
|
5
|
-
const operators_1 = require("rxjs/operators");
|
|
6
|
-
const companyReducer_1 = require("../../../../entity/company/companyReducer");
|
|
7
|
-
const snackbarReducer_1 = require("../../../../entity/snackbar/snackbarReducer");
|
|
8
|
-
const tenantReducer_1 = require("../../../../entity/tenant/tenantReducer");
|
|
9
|
-
const responsePayload_1 = require("../../../../responsePayload");
|
|
10
|
-
const companyViewReducer_1 = require("../../companyViewReducer");
|
|
11
|
-
const updateAccountingClassesEnabledEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(companyViewReducer_1.updateAccountingClassesEnabled.match), (0, operators_1.switchMap)((action) => {
|
|
12
|
-
const { companyId, enabled } = action.payload;
|
|
13
|
-
const tenantId = Object.values(state$.value.tenantState.tenantsById).find((t) => t.companyId === companyId)?.tenantId;
|
|
14
|
-
return zeniAPI
|
|
15
|
-
.putAndGetJSON(`${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/companies/${companyId}`, { is_accounting_classes_enabled: enabled })
|
|
16
|
-
.pipe((0, operators_1.mergeMap)((response) => {
|
|
17
|
-
const companies = response.data?.companies ?? [];
|
|
18
|
-
if ((0, responsePayload_1.isSuccessResponse)(response) && companies.length > 0) {
|
|
19
|
-
const actions = [
|
|
20
|
-
(0, companyReducer_1.updateCompanies)({
|
|
21
|
-
payload: companies,
|
|
22
|
-
schema: {},
|
|
23
|
-
}),
|
|
24
|
-
];
|
|
25
|
-
if (tenantId != null) {
|
|
26
|
-
actions.push((0, tenantReducer_1.updateTenantAccountingClassesEnabled)({
|
|
27
|
-
enabled,
|
|
28
|
-
tenantId,
|
|
29
|
-
}));
|
|
30
|
-
}
|
|
31
|
-
actions.push((0, companyViewReducer_1.updateAccountingClassesEnabledSuccess)());
|
|
32
|
-
actions.push((0, snackbarReducer_1.openSnackbar)({
|
|
33
|
-
messageSection: 'accounting_classes_enabled_update',
|
|
34
|
-
messageText: 'success',
|
|
35
|
-
type: 'success',
|
|
36
|
-
}));
|
|
37
|
-
return (0, rxjs_1.from)(actions);
|
|
38
|
-
}
|
|
39
|
-
else {
|
|
40
|
-
return (0, rxjs_1.from)([
|
|
41
|
-
(0, companyViewReducer_1.updateAccountingClassesEnabledFailure)({
|
|
42
|
-
status: response.status,
|
|
43
|
-
}),
|
|
44
|
-
(0, snackbarReducer_1.openSnackbar)({
|
|
45
|
-
messageSection: 'accounting_classes_enabled_update',
|
|
46
|
-
messageText: 'failed',
|
|
47
|
-
type: 'error',
|
|
48
|
-
}),
|
|
49
|
-
]);
|
|
50
|
-
}
|
|
51
|
-
}), (0, operators_1.catchError)((error) => (0, rxjs_1.from)([
|
|
52
|
-
(0, companyViewReducer_1.updateAccountingClassesEnabledFailure)({
|
|
53
|
-
status: (0, responsePayload_1.createZeniAPIStatus)('Unexpected error', 'Update Accounting Classes Enabled errored out' +
|
|
54
|
-
(error instanceof Error
|
|
55
|
-
? error.message
|
|
56
|
-
: JSON.stringify(error))),
|
|
57
|
-
}),
|
|
58
|
-
(0, snackbarReducer_1.openSnackbar)({
|
|
59
|
-
messageSection: 'accounting_classes_enabled_update',
|
|
60
|
-
messageText: 'failed',
|
|
61
|
-
type: 'error',
|
|
62
|
-
}),
|
|
63
|
-
])));
|
|
64
|
-
}));
|
|
65
|
-
exports.updateAccountingClassesEnabledEpic = updateAccountingClassesEnabledEpic;
|
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;
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import { Amount } from '../../../commonStateTypes/amount';
|
|
2
|
-
import { ZeniAPIResponse } from '../../../responsePayload';
|
|
3
|
-
import { ZeniDate } from '../../../zeniDayJS';
|
|
4
|
-
import { FundingAccount } from '../commonSetup/setupViewSelector';
|
|
5
|
-
import { TreasuryAccount } from '../treasury/treasuryTransferMoney/treasuryTransferMoneyState';
|
|
6
|
-
import { AutoTransferRule } from './autoTransferRulesState';
|
|
7
|
-
export type AutoTransferRuleType = 'minimum_balance' | 'recurring' | 'percentage_of_balance';
|
|
8
|
-
export type AutoTransferRuleFrequency = 'daily' | 'weekly' | 'monthly';
|
|
9
|
-
export interface DestinationBankAccountMetadataPayload {
|
|
10
|
-
account_id: string;
|
|
11
|
-
account_type: string;
|
|
12
|
-
percentage: number;
|
|
13
|
-
}
|
|
14
|
-
export interface AutoTransferRulePayload {
|
|
15
|
-
amount: number;
|
|
16
|
-
auto_transfer_rule_id: string;
|
|
17
|
-
create_time: string;
|
|
18
|
-
created_by_user_id: string;
|
|
19
|
-
currency_code: string;
|
|
20
|
-
currency_symbol: string;
|
|
21
|
-
destination_bank_account_id: string | null;
|
|
22
|
-
destination_bank_account_metadata: DestinationBankAccountMetadataPayload[] | null;
|
|
23
|
-
destination_bank_account_type: string;
|
|
24
|
-
frequency: AutoTransferRuleFrequency;
|
|
25
|
-
is_active: boolean;
|
|
26
|
-
is_deleted: boolean;
|
|
27
|
-
last_run_time: string | null;
|
|
28
|
-
last_run_transaction_metadata: unknown | null;
|
|
29
|
-
next_transfer_date: string;
|
|
30
|
-
rule_type: AutoTransferRuleType;
|
|
31
|
-
source_bank_account_id: string;
|
|
32
|
-
source_bank_account_type: string;
|
|
33
|
-
update_time: string;
|
|
34
|
-
}
|
|
35
|
-
interface AutoTransferRulesPayload {
|
|
36
|
-
auto_transfer_rules: AutoTransferRulePayload[];
|
|
37
|
-
}
|
|
38
|
-
export type FetchAutoTransferRulesResponse = ZeniAPIResponse<AutoTransferRulesPayload>;
|
|
39
|
-
export interface AutoTransferRuleRequestBody {
|
|
40
|
-
amount?: number;
|
|
41
|
-
currency_code?: string;
|
|
42
|
-
currency_symbol?: string;
|
|
43
|
-
destination_bank_account_id?: string;
|
|
44
|
-
destination_bank_account_metadata?: DestinationBankAccountMetadataPayload[];
|
|
45
|
-
destination_bank_account_type?: string;
|
|
46
|
-
first_transfer_date?: string;
|
|
47
|
-
frequency?: AutoTransferRuleFrequency;
|
|
48
|
-
is_active?: boolean;
|
|
49
|
-
next_transfer_date?: string;
|
|
50
|
-
rule_type?: AutoTransferRuleType;
|
|
51
|
-
source_bank_account_id?: string;
|
|
52
|
-
source_bank_account_type?: string;
|
|
53
|
-
}
|
|
54
|
-
export interface AutoTransferRuleLocalData {
|
|
55
|
-
amount?: Amount;
|
|
56
|
-
destinationAccount?: FundingAccount | TreasuryAccount;
|
|
57
|
-
destinationAccountWithPercentAllocation?: {
|
|
58
|
-
account: FundingAccount | TreasuryAccount;
|
|
59
|
-
percentage: number;
|
|
60
|
-
}[];
|
|
61
|
-
firstTransferDate?: ZeniDate;
|
|
62
|
-
frequency?: AutoTransferRuleFrequency;
|
|
63
|
-
ruleType?: AutoTransferRuleType;
|
|
64
|
-
sourceAccount?: FundingAccount | TreasuryAccount;
|
|
65
|
-
}
|
|
66
|
-
interface CreateAutoTransferRulesPayload {
|
|
67
|
-
auto_transfer_rule: AutoTransferRulePayload;
|
|
68
|
-
}
|
|
69
|
-
export type CreateAutoTransferRulesResponse = ZeniAPIResponse<CreateAutoTransferRulesPayload>;
|
|
70
|
-
interface DeleteAutoTransferRulePayload {
|
|
71
|
-
message: string;
|
|
72
|
-
}
|
|
73
|
-
export type DeleteAutoTransferRuleResponse = ZeniAPIResponse<DeleteAutoTransferRulePayload>;
|
|
74
|
-
export declare const mapPayloadToAutoTransferRule: (payload: AutoTransferRulePayload) => AutoTransferRule;
|
|
75
|
-
export {};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.mapPayloadToAutoTransferRule = void 0;
|
|
4
|
-
const zeniDayJS_1 = require("../../../zeniDayJS");
|
|
5
|
-
const mapPayloadToAutoTransferRule = (payload) => ({
|
|
6
|
-
amount: payload.amount,
|
|
7
|
-
autoTransferRuleId: payload.auto_transfer_rule_id,
|
|
8
|
-
createTime: payload.create_time != null ? (0, zeniDayJS_1.date)(payload.create_time) : undefined,
|
|
9
|
-
currencyCode: payload.currency_code,
|
|
10
|
-
currencySymbol: payload.currency_symbol ?? '$',
|
|
11
|
-
destinationBankAccountId: payload.destination_bank_account_id,
|
|
12
|
-
destinationBankAccountMetadata: payload.destination_bank_account_metadata?.map((m) => ({
|
|
13
|
-
accountId: m.account_id,
|
|
14
|
-
accountType: m.account_type,
|
|
15
|
-
percentage: m.percentage,
|
|
16
|
-
})) ?? undefined,
|
|
17
|
-
destinationBankAccountType: payload.destination_bank_account_type ?? undefined,
|
|
18
|
-
frequency: payload.frequency,
|
|
19
|
-
isActive: payload.is_active,
|
|
20
|
-
isDeleted: payload.is_deleted,
|
|
21
|
-
lastRunTime: payload.last_run_time,
|
|
22
|
-
nextTransferDate: payload.next_transfer_date != null
|
|
23
|
-
? (0, zeniDayJS_1.date)(payload.next_transfer_date)
|
|
24
|
-
: undefined,
|
|
25
|
-
ruleType: payload.rule_type,
|
|
26
|
-
sourceBankAccountId: payload.source_bank_account_id,
|
|
27
|
-
sourceBankAccountType: payload.source_bank_account_type,
|
|
28
|
-
updateTime: payload.update_time != null ? (0, zeniDayJS_1.date)(payload.update_time) : undefined,
|
|
29
|
-
});
|
|
30
|
-
exports.mapPayloadToAutoTransferRule = mapPayloadToAutoTransferRule;
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { FetchState, ID } from '../../../commonStateTypes/common';
|
|
2
|
-
import { ZeniAPIStatus } from '../../../responsePayload';
|
|
3
|
-
import { HistoricEventPayload } from '../commonHistoryView/commonHistoryPayload';
|
|
4
|
-
import { ReviewTransferMoneyPayload } from '../zeniAccounts/transferDetail/transferDetailPayload';
|
|
5
|
-
import { AutoTransferRuleLocalData } from './autoTransferRulesPayload';
|
|
6
|
-
import { AutoTransferRule, AutoTransferRulesState } from './autoTransferRulesState';
|
|
7
|
-
export declare const initialState: AutoTransferRulesState;
|
|
8
|
-
export declare const fetchAutoTransferRules: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[cacheOverride?: any], {
|
|
9
|
-
cacheOverride: any;
|
|
10
|
-
}, "autotransferRules/fetchAutoTransferRules", never, never>, updateAutoTransferRules: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
11
|
-
rules: AutoTransferRule[];
|
|
12
|
-
}, "autotransferRules/updateAutoTransferRules">, updateAutoTransferRulesFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
13
|
-
fetchState: FetchState;
|
|
14
|
-
error?: ZeniAPIStatus;
|
|
15
|
-
}, "autotransferRules/updateAutoTransferRulesFailure">, fetchAutoTransferReviewDetail: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"autotransferRules/fetchAutoTransferReviewDetail">, updateAutoTransferReviewDetail: import("@reduxjs/toolkit").ActionCreatorWithPayload<ReviewTransferMoneyPayload, "autotransferRules/updateAutoTransferReviewDetail">, updateAutoTransferReviewDetailFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "autotransferRules/updateAutoTransferReviewDetailFailure">, clearAutoTransferReviewDetail: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"autotransferRules/clearAutoTransferReviewDetail">, createAutoTransferRule: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"autotransferRules/createAutoTransferRule">, createAutoTransferRuleSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
16
|
-
rule: AutoTransferRule;
|
|
17
|
-
}, "autotransferRules/createAutoTransferRuleSuccess">, createAutoTransferRuleFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
18
|
-
fetchState: FetchState;
|
|
19
|
-
error?: ZeniAPIStatus;
|
|
20
|
-
}, "autotransferRules/createAutoTransferRuleFailure">, updateAutoTransferRule: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[ruleId: string, pauseRule?: boolean | undefined, resumeRule?: boolean | undefined], {
|
|
21
|
-
ruleId: string;
|
|
22
|
-
pauseRule: boolean | undefined;
|
|
23
|
-
resumeRule: boolean | undefined;
|
|
24
|
-
}, "autotransferRules/updateAutoTransferRule", never, never>, updateAutoTransferRuleSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
25
|
-
rule: AutoTransferRule;
|
|
26
|
-
}, "autotransferRules/updateAutoTransferRuleSuccess">, updateAutoTransferRuleFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
27
|
-
fetchState: FetchState;
|
|
28
|
-
ruleId: ID;
|
|
29
|
-
error?: ZeniAPIStatus;
|
|
30
|
-
}, "autotransferRules/updateAutoTransferRuleFailure">, deleteAutoTransferRule: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[ruleId: string], {
|
|
31
|
-
ruleId: string;
|
|
32
|
-
}, "autotransferRules/deleteAutoTransferRule", never, never>, deleteAutoTransferRuleSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
33
|
-
ruleId: ID;
|
|
34
|
-
}, "autotransferRules/deleteAutoTransferRuleSuccess">, deleteAutoTransferRuleFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
35
|
-
fetchState: FetchState;
|
|
36
|
-
ruleId: ID;
|
|
37
|
-
error?: ZeniAPIStatus;
|
|
38
|
-
}, "autotransferRules/deleteAutoTransferRuleFailure">, fetchAutoTransferRuleHistory: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[ruleId: string, cacheOverride?: any], {
|
|
39
|
-
ruleId: string;
|
|
40
|
-
cacheOverride: any;
|
|
41
|
-
}, "autotransferRules/fetchAutoTransferRuleHistory", never, never>, updateAutoTransferRuleHistory: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
42
|
-
historicEventsPayload: HistoricEventPayload[];
|
|
43
|
-
ruleId: ID;
|
|
44
|
-
}, "autotransferRules/updateAutoTransferRuleHistory">, updateAutoTransferRuleHistoryFetchStatus: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
45
|
-
fetchState: FetchState;
|
|
46
|
-
ruleId: ID;
|
|
47
|
-
error?: ZeniAPIStatus;
|
|
48
|
-
}, "autotransferRules/updateAutoTransferRuleHistoryFetchStatus">, updateRuleLocalData: import("@reduxjs/toolkit").ActionCreatorWithPayload<AutoTransferRuleLocalData, "autotransferRules/updateRuleLocalData">, clearRuleUpdateLocalData: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"autotransferRules/clearRuleUpdateLocalData">, clearAutoTransferRules: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"autotransferRules/clearAutoTransferRules">;
|
|
49
|
-
declare const _default: import("redux").Reducer<AutoTransferRulesState>;
|
|
50
|
-
export default _default;
|