@zeniai/client-epic-state 4.19.99-betaVR3 → 4.19.100
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/coaBalance/coaBalanceType.d.ts +0 -2
- package/lib/commonStateTypes/coaBalance/coaBalanceType.js +0 -6
- package/lib/commonStateTypes/currencyHelper.d.ts +0 -3
- package/lib/commonStateTypes/currencyHelper.js +1 -6
- package/lib/commonStateTypes/reduceFetchState.d.ts +0 -9
- package/lib/commonStateTypes/reduceFetchState.js +0 -26
- package/lib/entity/account/accountPayload.d.ts +0 -2
- package/lib/entity/account/accountPayload.js +0 -2
- package/lib/entity/account/accountState.d.ts +0 -2
- package/lib/entity/aiCfo/aiCfoSelector.d.ts +2 -1
- package/lib/entity/billPay/billTransaction/billTransactionState.d.ts +2 -2
- package/lib/entity/customer/customerState.d.ts +2 -0
- package/lib/entity/customer/customerState.js +5 -0
- package/lib/entity/depositAccount/depositAccount.d.ts +1 -1
- package/lib/entity/depositAccount/depositAccount.js +1 -8
- 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/reimbursement/reimbursementPayload.d.ts +0 -2
- package/lib/entity/reimbursement/reimbursementPayload.js +0 -7
- package/lib/entity/reimbursement/reimbursementState.d.ts +0 -2
- package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.js +0 -1
- package/lib/entity/task/taskPayload.d.ts +0 -1
- package/lib/entity/task/taskPayload.js +0 -1
- package/lib/entity/task/taskState.d.ts +0 -1
- package/lib/entity/tenant/tenantPayload.d.ts +0 -1
- package/lib/entity/tenant/tenantReducer.js +0 -1
- 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 -3
- package/lib/entity/transaction/payloadTypes/transactionPayload.js +1 -17
- package/lib/entity/transaction/stateTypes/scheduleTransaction.d.ts +0 -1
- package/lib/entity/transaction/stateTypes/transaction.d.ts +0 -5
- package/lib/entity/transaction/stateTypes/transactionLine.d.ts +1 -1
- package/lib/epic.d.ts +1 -13
- package/lib/epic.js +1 -13
- package/lib/esm/commonStateTypes/coaBalance/coaBalanceType.js +0 -5
- package/lib/esm/commonStateTypes/currencyHelper.js +0 -5
- package/lib/esm/commonStateTypes/reduceFetchState.js +0 -25
- package/lib/esm/entity/account/accountPayload.js +0 -2
- package/lib/esm/entity/customer/customerState.js +4 -1
- package/lib/esm/entity/depositAccount/depositAccount.js +1 -8
- package/lib/esm/entity/jeSchedules/jeSchedulesPayload.js +0 -78
- package/lib/esm/entity/jeSchedules/jeSchedulesSelector.js +1 -5
- package/lib/esm/entity/reimbursement/reimbursementPayload.js +0 -7
- package/lib/esm/entity/snackbar/snackbarTypes.js +0 -1
- package/lib/esm/entity/task/taskPayload.js +0 -1
- package/lib/esm/entity/tenant/tenantReducer.js +0 -1
- 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 -17
- package/lib/esm/epic.js +1 -13
- package/lib/esm/index.js +16 -25
- package/lib/esm/reducer.js +0 -6
- package/lib/esm/view/aiCfoView/aiCfoViewReducer.js +1 -82
- package/lib/esm/view/aiCfoView/aiCfoViewSelector.js +2 -8
- package/lib/esm/view/arAgingView/arAgingReport/arAgingReducer.js +1 -1
- package/lib/esm/view/arAgingView/arAgingReport/arAgingSelector.js +1 -1
- 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/expenseAutomationView/epics/missingReceipts/uploadMissingReceiptSuccessEpic.js +5 -7
- 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/payload/missingReceiptsPayload.js +1 -189
- package/lib/esm/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +1 -17
- package/lib/esm/view/expenseAutomationView/reducers/missingReceiptsViewReducer.js +2 -433
- package/lib/esm/view/expenseAutomationView/reducers/transactionsViewReducer.js +1 -23
- 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 +5 -256
- package/lib/esm/view/expenseAutomationView/selectors/reconciliationViewSelector.js +9 -22
- package/lib/esm/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +7 -14
- package/lib/esm/view/expenseAutomationView/types/jeSchedulesViewState.js +1 -18
- package/lib/esm/view/expenseAutomationView/types/missingReceiptsViewState.js +0 -44
- package/lib/esm/view/expenseAutomationView/types/transactionsViewState.js +1 -2
- package/lib/esm/view/financeStatement/financeStatementReducer.js +8 -11
- package/lib/esm/view/financeStatement/financeStatementSelector.js +9 -24
- package/lib/esm/view/profitAndLossClassesView/profitAndLossClassesViewReducer.js +1 -6
- package/lib/esm/view/profitAndLossClassesView/profitAndLossClassesViewSelector.js +29 -2
- package/lib/esm/view/profitAndLossClassesView/profitAndLossForTimeframeClassesViewEpic.js +5 -7
- package/lib/esm/view/reportUIOptions/updateReportUIOptionCOABalancesRangeEpic.js +7 -9
- 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/taskManager/taskDetailView/taskDetailSelector.js +3 -3
- package/lib/esm/view/taskManager/taskListView/epics/bulkUpdateTaskListEpic.js +0 -1
- package/lib/esm/view/taskManager/taskListView/taskListSelector.js +1 -3
- package/lib/esm/view/transactionDetail/epics/saveTransactionHelper.js +2 -2
- package/lib/esm/view/transactionDetail/transactionDetailLocalDataHelper.js +14 -16
- package/lib/esm/view/twoFactorAuthentication/resendOtpEpic.js +16 -2
- package/lib/esm/view/userListView/fetchUserListByTypeEpic.js +0 -11
- package/lib/esm/zeniAPI.js +2 -0
- package/lib/index.d.ts +21 -31
- package/lib/index.js +34 -102
- package/lib/reducer.d.ts +0 -6
- package/lib/reducer.js +0 -6
- 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 -18
- package/lib/view/arAgingView/arAgingReport/arAgingReducer.js +2 -2
- package/lib/view/arAgingView/arAgingReport/arAgingSelector.js +5 -5
- package/lib/view/auditReportView/auditReportViewState.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/expenseAutomationView/epics/missingReceipts/uploadMissingReceiptSuccessEpic.js +5 -7
- 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/missingReceiptsPayload.d.ts +0 -118
- package/lib/view/expenseAutomationView/payload/missingReceiptsPayload.js +0 -201
- package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.d.ts +2 -2
- package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +2 -18
- package/lib/view/expenseAutomationView/reducers/missingReceiptsViewReducer.d.ts +3 -76
- package/lib/view/expenseAutomationView/reducers/missingReceiptsViewReducer.js +2 -434
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.d.ts +3 -11
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.js +2 -24
- package/lib/view/expenseAutomationView/selectorTypes/jeSchedulesSelectorTypes.d.ts +0 -2
- package/lib/view/expenseAutomationView/selectorTypes/missingReceiptsSelectorTypes.d.ts +1 -69
- package/lib/view/expenseAutomationView/selectorTypes/transactionsViewSelectorTypes.d.ts +0 -1
- package/lib/view/expenseAutomationView/selectors/fluxAnalysisViewSelector.js +2 -10
- package/lib/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +6 -63
- package/lib/view/expenseAutomationView/selectors/missingReceiptsSelector.d.ts +1 -1
- package/lib/view/expenseAutomationView/selectors/missingReceiptsSelector.js +4 -255
- package/lib/view/expenseAutomationView/selectors/reconciliationViewSelector.js +9 -22
- package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +6 -13
- package/lib/view/expenseAutomationView/types/jeSchedulesViewState.d.ts +0 -5
- package/lib/view/expenseAutomationView/types/jeSchedulesViewState.js +0 -20
- package/lib/view/expenseAutomationView/types/missingReceiptsViewState.d.ts +0 -142
- package/lib/view/expenseAutomationView/types/missingReceiptsViewState.js +1 -54
- package/lib/view/expenseAutomationView/types/transactionsViewState.d.ts +1 -2
- package/lib/view/expenseAutomationView/types/transactionsViewState.js +1 -2
- package/lib/view/financeStatement/financeStatementReducer.js +8 -11
- package/lib/view/financeStatement/financeStatementSelector.d.ts +0 -2
- package/lib/view/financeStatement/financeStatementSelector.js +9 -24
- package/lib/view/profitAndLossClassesView/profitAndLossClassesViewReducer.d.ts +2 -4
- package/lib/view/profitAndLossClassesView/profitAndLossClassesViewReducer.js +2 -7
- package/lib/view/profitAndLossClassesView/profitAndLossClassesViewSelector.js +29 -2
- package/lib/view/profitAndLossClassesView/profitAndLossClassesViewState.d.ts +0 -4
- package/lib/view/profitAndLossClassesView/profitAndLossForTimeframeClassesViewEpic.js +5 -7
- package/lib/view/reportUIOptions/updateReportUIOptionCOABalancesRangeEpic.js +6 -8
- 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/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/taskManager/taskDetailView/taskDetailSelector.js +3 -3
- package/lib/view/taskManager/taskListView/epics/bulkUpdateTaskListEpic.d.ts +0 -1
- package/lib/view/taskManager/taskListView/epics/bulkUpdateTaskListEpic.js +0 -1
- package/lib/view/taskManager/taskListView/taskListSelector.d.ts +0 -2
- package/lib/view/taskManager/taskListView/taskListSelector.js +1 -3
- package/lib/view/transactionDetail/epics/saveTransactionHelper.js +2 -2
- package/lib/view/transactionDetail/transactionDetailLocalDataHelper.js +14 -16
- package/lib/view/twoFactorAuthentication/resendOtpEpic.d.ts +1 -1
- package/lib/view/twoFactorAuthentication/resendOtpEpic.js +15 -1
- package/lib/view/userListView/fetchUserListByTypeEpic.d.ts +1 -3
- package/lib/view/userListView/fetchUserListByTypeEpic.js +0 -11
- package/lib/view/userListView/userListViewPayload.d.ts +0 -2
- package/lib/zeniAPI.js +2 -0
- package/package.json +2 -2
- package/lib/entity/userGroups/userGroupsPayload.d.ts +0 -7
- package/lib/entity/userGroups/userGroupsPayload.js +0 -10
- package/lib/entity/userGroups/userGroupsReducer.d.ts +0 -8
- package/lib/entity/userGroups/userGroupsReducer.js +0 -29
- package/lib/entity/userGroups/userGroupsSelector.d.ts +0 -4
- package/lib/entity/userGroups/userGroupsSelector.js +0 -12
- package/lib/entity/userGroups/userGroupsState.d.ts +0 -9
- package/lib/entity/userGroups/userGroupsState.js +0 -2
- package/lib/esm/entity/userGroups/userGroupsPayload.js +0 -7
- package/lib/esm/entity/userGroups/userGroupsReducer.js +0 -25
- package/lib/esm/entity/userGroups/userGroupsSelector.js +0 -8
- package/lib/esm/entity/userGroups/userGroupsState.js +0 -1
- package/lib/esm/view/aiCfoView/epics/fetchSuggestedQuestionsEpic.js +0 -29
- package/lib/esm/view/expenseAutomationView/bulkUploadTiming.js +0 -10
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/bulkUploadReceiptsEpic.js +0 -29
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/confirmBulkUploadMatchEpic.js +0 -49
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchDetailsEpic.js +0 -40
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchesEpic.js +0 -47
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchCompletedTransactionsEpic.js +0 -61
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchMoreBatchDetailsEpic.js +0 -33
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchMultipleBatchDetailsEpic.js +0 -56
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/searchTransactionsForManualMatchEpic.js +0 -77
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/watchBulkUploadBatchStatusEpic.js +0 -80
- package/lib/esm/view/expenseAutomationView/epics/transactionCategorization/uploadTransactionReceiptSuccessEpic.js +0 -24
- package/lib/esm/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelector.js +0 -317
- package/lib/esm/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelectorTypes.js +0 -9
- package/lib/esm/view/profitAndLossClassesView/profitAndLossHorizontalEnrichment.js +0 -282
- package/lib/esm/view/userGroupListView/userGroupListViewReducer.js +0 -65
- package/lib/esm/view/userGroupListView/userGroupListViewSelector.js +0 -16
- package/lib/esm/view/userGroupListView/userGroupListViewState.js +0 -1
- package/lib/tsconfig.typecheck.tsbuildinfo +0 -1
- package/lib/view/aiCfoView/epics/fetchSuggestedQuestionsEpic.d.ts +0 -8
- package/lib/view/aiCfoView/epics/fetchSuggestedQuestionsEpic.js +0 -33
- package/lib/view/expenseAutomationView/bulkUploadTiming.d.ts +0 -10
- package/lib/view/expenseAutomationView/bulkUploadTiming.js +0 -13
- package/lib/view/expenseAutomationView/epics/missingReceipts/bulkUploadReceiptsEpic.d.ts +0 -18
- package/lib/view/expenseAutomationView/epics/missingReceipts/bulkUploadReceiptsEpic.js +0 -33
- package/lib/view/expenseAutomationView/epics/missingReceipts/confirmBulkUploadMatchEpic.d.ts +0 -7
- package/lib/view/expenseAutomationView/epics/missingReceipts/confirmBulkUploadMatchEpic.js +0 -53
- package/lib/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchDetailsEpic.d.ts +0 -8
- package/lib/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchDetailsEpic.js +0 -44
- package/lib/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchesEpic.d.ts +0 -7
- package/lib/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchesEpic.js +0 -51
- package/lib/view/expenseAutomationView/epics/missingReceipts/fetchCompletedTransactionsEpic.d.ts +0 -8
- package/lib/view/expenseAutomationView/epics/missingReceipts/fetchCompletedTransactionsEpic.js +0 -65
- package/lib/view/expenseAutomationView/epics/missingReceipts/fetchMoreBatchDetailsEpic.d.ts +0 -8
- package/lib/view/expenseAutomationView/epics/missingReceipts/fetchMoreBatchDetailsEpic.js +0 -37
- package/lib/view/expenseAutomationView/epics/missingReceipts/fetchMultipleBatchDetailsEpic.d.ts +0 -9
- package/lib/view/expenseAutomationView/epics/missingReceipts/fetchMultipleBatchDetailsEpic.js +0 -61
- package/lib/view/expenseAutomationView/epics/missingReceipts/searchTransactionsForManualMatchEpic.d.ts +0 -14
- package/lib/view/expenseAutomationView/epics/missingReceipts/searchTransactionsForManualMatchEpic.js +0 -81
- package/lib/view/expenseAutomationView/epics/missingReceipts/watchBulkUploadBatchStatusEpic.d.ts +0 -25
- package/lib/view/expenseAutomationView/epics/missingReceipts/watchBulkUploadBatchStatusEpic.js +0 -86
- package/lib/view/expenseAutomationView/epics/transactionCategorization/uploadTransactionReceiptSuccessEpic.d.ts +0 -7
- package/lib/view/expenseAutomationView/epics/transactionCategorization/uploadTransactionReceiptSuccessEpic.js +0 -28
- package/lib/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelector.d.ts +0 -13
- package/lib/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelector.js +0 -321
- package/lib/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelectorTypes.d.ts +0 -111
- package/lib/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelectorTypes.js +0 -13
- package/lib/view/profitAndLossClassesView/profitAndLossHorizontalEnrichment.d.ts +0 -6
- package/lib/view/profitAndLossClassesView/profitAndLossHorizontalEnrichment.js +0 -285
- package/lib/view/userGroupListView/userGroupListViewReducer.d.ts +0 -23
- package/lib/view/userGroupListView/userGroupListViewReducer.js +0 -69
- package/lib/view/userGroupListView/userGroupListViewSelector.d.ts +0 -7
- package/lib/view/userGroupListView/userGroupListViewSelector.js +0 -20
- package/lib/view/userGroupListView/userGroupListViewState.d.ts +0 -8
- package/lib/view/userGroupListView/userGroupListViewState.js +0 -2
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { UserGroupPayload } from './userGroupsPayload';
|
|
2
|
-
import { UserGroupsState } from './userGroupsState';
|
|
3
|
-
export declare const initialState: UserGroupsState;
|
|
4
|
-
export declare const updateAllUserGroups: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
5
|
-
userGroups: UserGroupPayload[];
|
|
6
|
-
}, "userGroups/updateAllUserGroups">, removeUserGroup: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "userGroups/removeUserGroup">, clearAllUserGroups: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"userGroups/clearAllUserGroups">;
|
|
7
|
-
declare const _default: import("redux").Reducer<UserGroupsState>;
|
|
8
|
-
export default _default;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var _a;
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.clearAllUserGroups = exports.removeUserGroup = exports.updateAllUserGroups = exports.initialState = void 0;
|
|
5
|
-
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
|
-
const userGroupsPayload_1 = require("./userGroupsPayload");
|
|
7
|
-
exports.initialState = {
|
|
8
|
-
userGroupByUserGroupId: {},
|
|
9
|
-
};
|
|
10
|
-
const userGroups = (0, toolkit_1.createSlice)({
|
|
11
|
-
name: 'userGroups',
|
|
12
|
-
initialState: exports.initialState,
|
|
13
|
-
reducers: {
|
|
14
|
-
updateAllUserGroups(draft, action) {
|
|
15
|
-
action.payload.userGroups.forEach((payload) => {
|
|
16
|
-
const userGroup = (0, userGroupsPayload_1.mapUserGroupPayloadToUserGroup)(payload);
|
|
17
|
-
draft.userGroupByUserGroupId[userGroup.userGroupId] = userGroup;
|
|
18
|
-
});
|
|
19
|
-
},
|
|
20
|
-
removeUserGroup(draft, action) {
|
|
21
|
-
delete draft.userGroupByUserGroupId[action.payload];
|
|
22
|
-
},
|
|
23
|
-
clearAllUserGroups(draft) {
|
|
24
|
-
Object.assign(draft, exports.initialState);
|
|
25
|
-
},
|
|
26
|
-
},
|
|
27
|
-
});
|
|
28
|
-
_a = userGroups.actions, exports.updateAllUserGroups = _a.updateAllUserGroups, exports.removeUserGroup = _a.removeUserGroup, exports.clearAllUserGroups = _a.clearAllUserGroups;
|
|
29
|
-
exports.default = userGroups.reducer;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { ID } from '../../commonStateTypes/common';
|
|
2
|
-
import { UserGroup, UserGroupsState } from './userGroupsState';
|
|
3
|
-
export declare function getUserGroupsByUserGroupIds(userGroupsState: UserGroupsState, userGroupIds: ID[]): UserGroup[];
|
|
4
|
-
export declare function getUserGroupByUserGroupId(userGroupsState: UserGroupsState, userGroupId: ID): UserGroup | undefined;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getUserGroupsByUserGroupIds = getUserGroupsByUserGroupIds;
|
|
4
|
-
exports.getUserGroupByUserGroupId = getUserGroupByUserGroupId;
|
|
5
|
-
function getUserGroupsByUserGroupIds(userGroupsState, userGroupIds) {
|
|
6
|
-
return userGroupIds
|
|
7
|
-
.map((id) => getUserGroupByUserGroupId(userGroupsState, id))
|
|
8
|
-
.filter((value) => value != null);
|
|
9
|
-
}
|
|
10
|
-
function getUserGroupByUserGroupId(userGroupsState, userGroupId) {
|
|
11
|
-
return userGroupsState.userGroupByUserGroupId[userGroupId] ?? undefined;
|
|
12
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { createSlice } from '@reduxjs/toolkit';
|
|
2
|
-
import { mapUserGroupPayloadToUserGroup, } from './userGroupsPayload';
|
|
3
|
-
export const initialState = {
|
|
4
|
-
userGroupByUserGroupId: {},
|
|
5
|
-
};
|
|
6
|
-
const userGroups = createSlice({
|
|
7
|
-
name: 'userGroups',
|
|
8
|
-
initialState,
|
|
9
|
-
reducers: {
|
|
10
|
-
updateAllUserGroups(draft, action) {
|
|
11
|
-
action.payload.userGroups.forEach((payload) => {
|
|
12
|
-
const userGroup = mapUserGroupPayloadToUserGroup(payload);
|
|
13
|
-
draft.userGroupByUserGroupId[userGroup.userGroupId] = userGroup;
|
|
14
|
-
});
|
|
15
|
-
},
|
|
16
|
-
removeUserGroup(draft, action) {
|
|
17
|
-
delete draft.userGroupByUserGroupId[action.payload];
|
|
18
|
-
},
|
|
19
|
-
clearAllUserGroups(draft) {
|
|
20
|
-
Object.assign(draft, initialState);
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
});
|
|
24
|
-
export const { updateAllUserGroups, removeUserGroup, clearAllUserGroups } = userGroups.actions;
|
|
25
|
-
export default userGroups.reducer;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export function getUserGroupsByUserGroupIds(userGroupsState, userGroupIds) {
|
|
2
|
-
return userGroupIds
|
|
3
|
-
.map((id) => getUserGroupByUserGroupId(userGroupsState, id))
|
|
4
|
-
.filter((value) => value != null);
|
|
5
|
-
}
|
|
6
|
-
export function getUserGroupByUserGroupId(userGroupsState, userGroupId) {
|
|
7
|
-
return userGroupsState.userGroupByUserGroupId[userGroupId] ?? undefined;
|
|
8
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { of } from 'rxjs';
|
|
2
|
-
import { catchError, filter, mergeMap } from 'rxjs/operators';
|
|
3
|
-
import { createZeniAPIStatus, isSuccessResponse } from '../../../responsePayload';
|
|
4
|
-
import { fetchSuggestedQuestions, fetchSuggestedQuestionsFailure, fetchSuggestedQuestionsSuccess, } from '../aiCfoViewReducer';
|
|
5
|
-
/** GET {aiCfoMicroServiceBaseUrl}/1.0/suggested-questions?page_context=... */
|
|
6
|
-
export const fetchSuggestedQuestionsEpic = (actions$, _state$, zeniAPI) => actions$.pipe(filter(fetchSuggestedQuestions.match),
|
|
7
|
-
// mergeMap (not switchMap): each page_context is keyed separately in Redux; switchMap
|
|
8
|
-
// would cancel in-flight HTTP for context A when B is requested, leaving A stuck In-Progress.
|
|
9
|
-
mergeMap((action) => {
|
|
10
|
-
const { pageContext } = action.payload;
|
|
11
|
-
const query = new URLSearchParams({ page_context: pageContext });
|
|
12
|
-
const url = `${zeniAPI.apiEndPoints.aiCfoMicroServiceBaseUrl}/1.0/suggested-questions?${query.toString()}`;
|
|
13
|
-
return zeniAPI.getJSON(url).pipe(mergeMap((response) => {
|
|
14
|
-
if (isSuccessResponse(response) && response.data != null) {
|
|
15
|
-
return of(fetchSuggestedQuestionsSuccess({
|
|
16
|
-
pageContext: response.data.page_context,
|
|
17
|
-
generatedAt: response.data.generated_at,
|
|
18
|
-
suggestedQuestions: response.data.suggested_questions,
|
|
19
|
-
}));
|
|
20
|
-
}
|
|
21
|
-
return of(fetchSuggestedQuestionsFailure({
|
|
22
|
-
pageContext,
|
|
23
|
-
error: response.status,
|
|
24
|
-
}));
|
|
25
|
-
}), catchError((error) => of(fetchSuggestedQuestionsFailure({
|
|
26
|
-
pageContext,
|
|
27
|
-
error: createZeniAPIStatus('Unexpected Error', 'Fetch suggested questions REST API call failed', error instanceof Error ? { message: error.message } : undefined),
|
|
28
|
-
}))));
|
|
29
|
-
}));
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* After upload API success, hold the bar at 100% this long before transitioning to matching,
|
|
3
|
-
* so the fill animation can complete without an abrupt swap to the auto-matching banner.
|
|
4
|
-
*/
|
|
5
|
-
export const BULK_UPLOAD_BAR_COMPLETE_HOLD_MS = 400;
|
|
6
|
-
/**
|
|
7
|
-
* Max wall-clock wait for Pusher + batch-details resolution after upload. If exceeded, we stop
|
|
8
|
-
* fallback polling, clear the automatching banner (`phase` → completed), and refresh batch list.
|
|
9
|
-
*/
|
|
10
|
-
export const BULK_UPLOAD_AUTOMATCHING_TIMEOUT_MS = 300000;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { concat, of, timer } from 'rxjs';
|
|
2
|
-
import { catchError, filter, mergeMap, switchMap } from 'rxjs/operators';
|
|
3
|
-
import { createZeniAPIStatus, isSuccessResponse, } from '../../../../responsePayload';
|
|
4
|
-
import { BULK_UPLOAD_BAR_COMPLETE_HOLD_MS } from '../../bulkUploadTiming';
|
|
5
|
-
import { bulkUploadReceipts, bulkUploadReceiptsFailure, bulkUploadReceiptsSuccess, updateBulkUploadProgress, } from '../../reducers/missingReceiptsViewReducer';
|
|
6
|
-
export const bulkUploadReceiptsEpic = (actions$, _state$, zeniAPI) => actions$.pipe(filter(bulkUploadReceipts.match), switchMap((action) => {
|
|
7
|
-
const { files } = action.payload;
|
|
8
|
-
const formData = new FormData();
|
|
9
|
-
for (const file of files) {
|
|
10
|
-
formData.append('files', file, file.name);
|
|
11
|
-
}
|
|
12
|
-
return zeniAPI
|
|
13
|
-
.postFormData(`${zeniAPI.apiEndPoints.communicationAgentMicroServiceBaseUrl}/1.0/receipts/bulk-upload`, formData)
|
|
14
|
-
.pipe(mergeMap((response) => {
|
|
15
|
-
if (isSuccessResponse(response) && response.data != null) {
|
|
16
|
-
const batchId = String(response.data.batch_id ?? '').trim();
|
|
17
|
-
if (batchId === '') {
|
|
18
|
-
return of(bulkUploadReceiptsFailure({
|
|
19
|
-
error: createZeniAPIStatus('Unexpected Error', 'Bulk upload succeeded but batch_id was missing or empty.'),
|
|
20
|
-
}));
|
|
21
|
-
}
|
|
22
|
-
return concat(of(updateBulkUploadProgress(100)), timer(BULK_UPLOAD_BAR_COMPLETE_HOLD_MS).pipe(mergeMap(() => of(bulkUploadReceiptsSuccess({ batchId })))));
|
|
23
|
-
}
|
|
24
|
-
return of(bulkUploadReceiptsFailure({ error: response.status }));
|
|
25
|
-
}), catchError((error) => of(bulkUploadReceiptsFailure({
|
|
26
|
-
error: createZeniAPIStatus('Unexpected Error', 'Bulk upload receipts API call errored out: ' +
|
|
27
|
-
JSON.stringify(error)),
|
|
28
|
-
}))));
|
|
29
|
-
}));
|
package/lib/esm/view/expenseAutomationView/epics/missingReceipts/confirmBulkUploadMatchEpic.js
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { from } from 'rxjs';
|
|
2
|
-
import { catchError, exhaustMap, filter, mergeMap } from 'rxjs/operators';
|
|
3
|
-
import { openSnackbar } from '../../../../entity/snackbar/snackbarReducer';
|
|
4
|
-
import { createZeniAPIStatus, isSuccessResponse, } from '../../../../responsePayload';
|
|
5
|
-
import { confirmBulkUploadMatch, confirmBulkUploadMatchFailure, confirmBulkUploadMatchSuccess, } from '../../reducers/missingReceiptsViewReducer';
|
|
6
|
-
export const confirmBulkUploadMatchEpic = (actions$, _state$, zeniAPI) => actions$.pipe(filter(confirmBulkUploadMatch.match), exhaustMap((action) => {
|
|
7
|
-
const { batchId, attachmentId, transactionId, transactionType, fileName } = action.payload;
|
|
8
|
-
return zeniAPI
|
|
9
|
-
.postAndGetJSON(`${zeniAPI.apiEndPoints.communicationAgentMicroServiceBaseUrl}/1.0/receipts/manual-match`, {
|
|
10
|
-
attachment_id: attachmentId,
|
|
11
|
-
transaction_id: transactionId,
|
|
12
|
-
transaction_type: transactionType,
|
|
13
|
-
file_name: fileName,
|
|
14
|
-
})
|
|
15
|
-
.pipe(mergeMap((response) => {
|
|
16
|
-
if (isSuccessResponse(response)) {
|
|
17
|
-
return from([
|
|
18
|
-
confirmBulkUploadMatchSuccess({
|
|
19
|
-
batchId,
|
|
20
|
-
attachmentId,
|
|
21
|
-
transactionId,
|
|
22
|
-
}),
|
|
23
|
-
openSnackbar({
|
|
24
|
-
messageSection: 'receipt_match',
|
|
25
|
-
messageText: 'success',
|
|
26
|
-
type: 'success',
|
|
27
|
-
}),
|
|
28
|
-
]);
|
|
29
|
-
}
|
|
30
|
-
return from([
|
|
31
|
-
confirmBulkUploadMatchFailure({ error: response.status }),
|
|
32
|
-
openSnackbar({
|
|
33
|
-
messageSection: 'receipt_match',
|
|
34
|
-
messageText: 'failed',
|
|
35
|
-
type: 'error',
|
|
36
|
-
}),
|
|
37
|
-
]);
|
|
38
|
-
}), catchError((error) => from([
|
|
39
|
-
confirmBulkUploadMatchFailure({
|
|
40
|
-
error: createZeniAPIStatus('Unexpected Error', 'Confirm bulk upload match errored out: ' +
|
|
41
|
-
JSON.stringify(error)),
|
|
42
|
-
}),
|
|
43
|
-
openSnackbar({
|
|
44
|
-
messageSection: 'receipt_match',
|
|
45
|
-
messageText: 'failed',
|
|
46
|
-
type: 'error',
|
|
47
|
-
}),
|
|
48
|
-
])));
|
|
49
|
-
}));
|
package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchDetailsEpic.js
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { EMPTY, from, of } from 'rxjs';
|
|
2
|
-
import { catchError, filter, mergeMap } from 'rxjs/operators';
|
|
3
|
-
import { updateTransactions } from '../../../../entity/transaction/transactionReducer';
|
|
4
|
-
import { createZeniAPIStatus, isSuccessResponse, } from '../../../../responsePayload';
|
|
5
|
-
import { extractTransactionPayloadsFromBatchFiles, isBatchDetailsApiStatusCompleted, shouldFetchBatchDetailsForBatchId, toBatchDetails, } from '../../payload/missingReceiptsPayload';
|
|
6
|
-
import { fetchBulkUploadBatchDetails, fetchBulkUploadBatchDetailsFailure, fetchBulkUploadBatchDetailsSuccess, fetchBulkUploadBatches, } from '../../reducers/missingReceiptsViewReducer';
|
|
7
|
-
export const fetchBulkUploadBatchDetailsEpic = (actions$, state$, zeniAPI) => actions$.pipe(filter(fetchBulkUploadBatchDetails.match), mergeMap(() => {
|
|
8
|
-
const bulkUpload = state$.value.expenseAutomationMissingReceiptsViewState.bulkUpload;
|
|
9
|
-
const { currentBatchId } = bulkUpload;
|
|
10
|
-
if (currentBatchId == null) {
|
|
11
|
-
return of(fetchBulkUploadBatchDetailsFailure({
|
|
12
|
-
error: createZeniAPIStatus('Unexpected Error', 'No current batch ID available'),
|
|
13
|
-
}));
|
|
14
|
-
}
|
|
15
|
-
if (!shouldFetchBatchDetailsForBatchId(bulkUpload.batchStatusById, bulkUpload.batchListByPeriod, currentBatchId)) {
|
|
16
|
-
return EMPTY;
|
|
17
|
-
}
|
|
18
|
-
return zeniAPI
|
|
19
|
-
.getJSON(`${zeniAPI.apiEndPoints.communicationAgentMicroServiceBaseUrl}/1.0/batches/${currentBatchId}`)
|
|
20
|
-
.pipe(mergeMap((response) => {
|
|
21
|
-
if (!isSuccessResponse(response) ||
|
|
22
|
-
response.data == null ||
|
|
23
|
-
!isBatchDetailsApiStatusCompleted(response.data.status)) {
|
|
24
|
-
if (isSuccessResponse(response) && response.data != null) {
|
|
25
|
-
return EMPTY;
|
|
26
|
-
}
|
|
27
|
-
return of(fetchBulkUploadBatchDetailsFailure({ error: response.status }));
|
|
28
|
-
}
|
|
29
|
-
const actions = [];
|
|
30
|
-
const transactionPayloads = extractTransactionPayloadsFromBatchFiles(response.data.files);
|
|
31
|
-
if (transactionPayloads.length > 0) {
|
|
32
|
-
actions.push(updateTransactions(transactionPayloads, (value) => value.transaction_id));
|
|
33
|
-
}
|
|
34
|
-
actions.push(fetchBulkUploadBatchDetailsSuccess(toBatchDetails(response.data, zeniAPI.apiEndPoints.fileMicroServiceBaseUrl)));
|
|
35
|
-
actions.push(fetchBulkUploadBatches({ cacheOverride: true }));
|
|
36
|
-
return from(actions);
|
|
37
|
-
}), catchError((error) => of(fetchBulkUploadBatchDetailsFailure({
|
|
38
|
-
error: createZeniAPIStatus('Unexpected Error', 'Fetch batch details errored out: ' + JSON.stringify(error)),
|
|
39
|
-
}))));
|
|
40
|
-
}));
|
package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchesEpic.js
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { of } from 'rxjs';
|
|
2
|
-
import { catchError, filter, mergeMap, switchMap } from 'rxjs/operators';
|
|
3
|
-
import { convertToPeriod, toMonthYearPeriodId, } from '../../../../commonStateTypes/timePeriod';
|
|
4
|
-
import { getCurrentTenant } from '../../../../entity/tenant/tenantSelector';
|
|
5
|
-
import { createZeniAPIStatus, isSuccessResponse, } from '../../../../responsePayload';
|
|
6
|
-
import { toBatchListItem, } from '../../payload/missingReceiptsPayload';
|
|
7
|
-
import { fetchBulkUploadBatches, fetchBulkUploadBatchesFailure, fetchBulkUploadBatchesSuccess, } from '../../reducers/missingReceiptsViewReducer';
|
|
8
|
-
export const fetchBulkUploadBatchesEpic = (actions$, state$, zeniAPI) => actions$.pipe(filter(fetchBulkUploadBatches.match), switchMap((action) => {
|
|
9
|
-
const { cacheOverride } = action.payload;
|
|
10
|
-
const state = state$.value;
|
|
11
|
-
const { expenseAutomationViewState: { selectedPeriodByTenantId }, expenseAutomationMissingReceiptsViewState: { bulkUpload }, } = state;
|
|
12
|
-
const currentTenant = getCurrentTenant(state);
|
|
13
|
-
const selectedPeriod = selectedPeriodByTenantId[currentTenant.tenantId];
|
|
14
|
-
const periodId = toMonthYearPeriodId(selectedPeriod);
|
|
15
|
-
const existingBatches = bulkUpload.batchListByPeriod[periodId] ?? [];
|
|
16
|
-
if (cacheOverride !== true && existingBatches.length > 0) {
|
|
17
|
-
return of(fetchBulkUploadBatchesSuccess({
|
|
18
|
-
batchList: existingBatches,
|
|
19
|
-
selectedPeriod,
|
|
20
|
-
}));
|
|
21
|
-
}
|
|
22
|
-
const period = convertToPeriod(selectedPeriod);
|
|
23
|
-
const queryParam = {
|
|
24
|
-
start_date: period.start,
|
|
25
|
-
end_date: period.end,
|
|
26
|
-
sort_order: 'desc',
|
|
27
|
-
};
|
|
28
|
-
return zeniAPI
|
|
29
|
-
.getJSON(`${zeniAPI.apiEndPoints.communicationAgentMicroServiceBaseUrl}/1.0/batches?query=${encodeURIComponent(JSON.stringify(queryParam))}`)
|
|
30
|
-
.pipe(mergeMap((response) => {
|
|
31
|
-
if (isSuccessResponse(response) && response.data != null) {
|
|
32
|
-
/** Full list (all statuses) for UI; batch-details epics filter to `completed` only. */
|
|
33
|
-
return of(fetchBulkUploadBatchesSuccess({
|
|
34
|
-
batchList: response.data.batches.map(toBatchListItem),
|
|
35
|
-
selectedPeriod,
|
|
36
|
-
}));
|
|
37
|
-
}
|
|
38
|
-
return of(fetchBulkUploadBatchesFailure({
|
|
39
|
-
error: response.status,
|
|
40
|
-
selectedPeriod,
|
|
41
|
-
}));
|
|
42
|
-
}), catchError((error) => of(fetchBulkUploadBatchesFailure({
|
|
43
|
-
error: createZeniAPIStatus('Unexpected Error', 'Fetch bulk upload batches errored out: ' +
|
|
44
|
-
JSON.stringify(error)),
|
|
45
|
-
selectedPeriod,
|
|
46
|
-
}))));
|
|
47
|
-
}));
|
package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchCompletedTransactionsEpic.js
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { from, of } from 'rxjs';
|
|
2
|
-
import { catchError, filter, mergeMap, switchMap } from 'rxjs/operators';
|
|
3
|
-
import { convertToPeriod, toMonthYearPeriodId, } from '../../../../commonStateTypes/timePeriod';
|
|
4
|
-
import { getCurrentTenant } from '../../../../entity/tenant/tenantSelector';
|
|
5
|
-
import { updateTransactions } from '../../../../entity/transaction/transactionReducer';
|
|
6
|
-
import { createZeniAPIStatus, isSuccessResponse, } from '../../../../responsePayload';
|
|
7
|
-
import { fetchCompletedTransactions, fetchCompletedTransactionsFailure, fetchCompletedTransactionsSuccess, getCompletedTransactionsCacheKey, } from '../../reducers/missingReceiptsViewReducer';
|
|
8
|
-
export const fetchCompletedTransactionsEpic = (actions$, state$, zeniAPI) => actions$.pipe(filter(fetchCompletedTransactions.match), switchMap((action) => {
|
|
9
|
-
const state = state$.value;
|
|
10
|
-
const { expenseAutomationViewState: { selectedPeriodByTenantId }, expenseAutomationMissingReceiptsViewState: { bulkUpload }, } = state;
|
|
11
|
-
const currentTenant = getCurrentTenant(state);
|
|
12
|
-
const selectedPeriod = selectedPeriodByTenantId[currentTenant.tenantId];
|
|
13
|
-
const periodId = toMonthYearPeriodId(selectedPeriod);
|
|
14
|
-
const isInitialLoad = action.payload.pageToken == null;
|
|
15
|
-
const cacheKey = getCompletedTransactionsCacheKey(periodId, bulkUpload.sortKey, bulkUpload.sortOrder, bulkUpload.completedSubTab);
|
|
16
|
-
const existingData = bulkUpload.completedTransactionsByPeriod[cacheKey];
|
|
17
|
-
if (isInitialLoad &&
|
|
18
|
-
action.payload.cacheOverride !== true &&
|
|
19
|
-
existingData != null &&
|
|
20
|
-
existingData.transactionIds.length > 0) {
|
|
21
|
-
return from([]);
|
|
22
|
-
}
|
|
23
|
-
const period = convertToPeriod(selectedPeriod);
|
|
24
|
-
const queryPayload = {
|
|
25
|
-
start_date: period.start,
|
|
26
|
-
end_date: period.end,
|
|
27
|
-
sort_by: bulkUpload.sortKey,
|
|
28
|
-
sort_order: bulkUpload.sortOrder === 'ascending' ? 'asc' : 'desc',
|
|
29
|
-
page_token: action.payload.pageToken ?? null,
|
|
30
|
-
page_size: 25,
|
|
31
|
-
};
|
|
32
|
-
if (bulkUpload.completedSubTab !== 'all') {
|
|
33
|
-
queryPayload.match_type = bulkUpload.completedSubTab;
|
|
34
|
-
}
|
|
35
|
-
const encodedQuery = encodeURIComponent(JSON.stringify(queryPayload));
|
|
36
|
-
return zeniAPI
|
|
37
|
-
.getJSON(`${zeniAPI.apiEndPoints.communicationAgentMicroServiceBaseUrl}/1.0/receipt-agent/transactions/completed?query=${encodedQuery}`)
|
|
38
|
-
.pipe(mergeMap((response) => {
|
|
39
|
-
if (isSuccessResponse(response) && response.data != null) {
|
|
40
|
-
const transactionIds = response.data.transactions.map((t) => t.transaction_id);
|
|
41
|
-
const updateActions = [];
|
|
42
|
-
updateActions.push(updateTransactions(response.data.transactions, (value) => value.transaction_id));
|
|
43
|
-
updateActions.push(fetchCompletedTransactionsSuccess({
|
|
44
|
-
isInitialLoad,
|
|
45
|
-
transactionIds,
|
|
46
|
-
nextPageToken: response.data.next_page_token,
|
|
47
|
-
totalCount: response.data.total_count,
|
|
48
|
-
selectedPeriod,
|
|
49
|
-
}));
|
|
50
|
-
return from(updateActions);
|
|
51
|
-
}
|
|
52
|
-
return of(fetchCompletedTransactionsFailure({
|
|
53
|
-
error: response.status,
|
|
54
|
-
selectedPeriod,
|
|
55
|
-
}));
|
|
56
|
-
}), catchError((error) => of(fetchCompletedTransactionsFailure({
|
|
57
|
-
error: createZeniAPIStatus('Unexpected Error', 'Fetch completed transactions errored: ' +
|
|
58
|
-
JSON.stringify(error)),
|
|
59
|
-
selectedPeriod,
|
|
60
|
-
}))));
|
|
61
|
-
}));
|
package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchMoreBatchDetailsEpic.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { concat, of } from 'rxjs';
|
|
2
|
-
import { catchError, exhaustMap, filter } from 'rxjs/operators';
|
|
3
|
-
import { toMonthYearPeriodId } from '../../../../commonStateTypes/timePeriod';
|
|
4
|
-
import { getCurrentTenant } from '../../../../entity/tenant/tenantSelector';
|
|
5
|
-
import { createZeniAPIStatus } from '../../../../responsePayload';
|
|
6
|
-
import { filterBatchListItemsForBatchDetailsFetch } from '../../payload/missingReceiptsPayload';
|
|
7
|
-
import { fetchMoreBatchDetails, fetchMoreBatchDetailsComplete, fetchMoreBatchDetailsFailure, } from '../../reducers/missingReceiptsViewReducer';
|
|
8
|
-
import { fetchBatchDetailsByIds } from './fetchMultipleBatchDetailsEpic';
|
|
9
|
-
const MORE_BATCH_PAGE_SIZE = 5;
|
|
10
|
-
export const fetchMoreBatchDetailsEpic = (actions$, state$, zeniAPI) => actions$.pipe(filter(fetchMoreBatchDetails.match),
|
|
11
|
-
/** One page at a time — avoids duplicate loads if IO + scroll fallback both fire. */
|
|
12
|
-
exhaustMap(() => {
|
|
13
|
-
const state = state$.value;
|
|
14
|
-
const { expenseAutomationViewState: { selectedPeriodByTenantId }, expenseAutomationMissingReceiptsViewState: { bulkUpload }, } = state;
|
|
15
|
-
const currentTenant = getCurrentTenant(state);
|
|
16
|
-
const selectedPeriod = selectedPeriodByTenantId[currentTenant.tenantId];
|
|
17
|
-
if (selectedPeriod == null) {
|
|
18
|
-
return of(fetchMoreBatchDetailsComplete());
|
|
19
|
-
}
|
|
20
|
-
const periodId = toMonthYearPeriodId(selectedPeriod);
|
|
21
|
-
const batchList = bulkUpload.batchListByPeriod[periodId] ?? [];
|
|
22
|
-
const failedIds = new Set(bulkUpload.failedBatchDetailIds);
|
|
23
|
-
const unfetchedBatches = filterBatchListItemsForBatchDetailsFetch(batchList).filter((batch) => bulkUpload.batchDetailsById[batch.batchId] == null &&
|
|
24
|
-
!failedIds.has(batch.batchId));
|
|
25
|
-
const unfetchedBatchIds = unfetchedBatches.map((batch) => batch.batchId);
|
|
26
|
-
if (unfetchedBatchIds.length === 0) {
|
|
27
|
-
return of(fetchMoreBatchDetailsComplete());
|
|
28
|
-
}
|
|
29
|
-
const nextPage = unfetchedBatchIds.slice(0, MORE_BATCH_PAGE_SIZE);
|
|
30
|
-
return concat(fetchBatchDetailsByIds(nextPage, zeniAPI), of(fetchMoreBatchDetailsComplete())).pipe(catchError((error) => of(fetchMoreBatchDetailsFailure({
|
|
31
|
-
error: createZeniAPIStatus('Unexpected Error', 'Fetch more batch details errored out: ' + JSON.stringify(error)),
|
|
32
|
-
}))));
|
|
33
|
-
}));
|
package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchMultipleBatchDetailsEpic.js
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { EMPTY, concat, from, of } from 'rxjs';
|
|
2
|
-
import { catchError, filter, mergeMap } from 'rxjs/operators';
|
|
3
|
-
import { updateTransactions } from '../../../../entity/transaction/transactionReducer';
|
|
4
|
-
import { createZeniAPIStatus, isSuccessResponse, } from '../../../../responsePayload';
|
|
5
|
-
import { extractTransactionPayloadsFromBatchFiles, filterBatchListItemsForBatchDetailsFetch, isBatchDetailsApiStatusCompleted, shouldFetchBatchDetailsForBatchId, toBatchDetails, } from '../../payload/missingReceiptsPayload';
|
|
6
|
-
import { batchDetailFetchFailed, fetchBulkUploadBatchDetails, fetchBulkUploadBatchesSuccess, fetchMoreBatchDetailsComplete, setInitialBatchDetailsLoading, storeBatchDetails, } from '../../reducers/missingReceiptsViewReducer';
|
|
7
|
-
const INITIAL_BATCH_PAGE_SIZE = 5;
|
|
8
|
-
export function fetchBatchDetailsByIds(batchIds, zeniAPI) {
|
|
9
|
-
if (batchIds.length === 0) {
|
|
10
|
-
return EMPTY;
|
|
11
|
-
}
|
|
12
|
-
return from(batchIds).pipe(mergeMap((batchId) => zeniAPI
|
|
13
|
-
.getJSON(`${zeniAPI.apiEndPoints.communicationAgentMicroServiceBaseUrl}/1.0/batches/${batchId}`)
|
|
14
|
-
.pipe(mergeMap((response) => {
|
|
15
|
-
if (!isSuccessResponse(response) ||
|
|
16
|
-
response.data == null ||
|
|
17
|
-
!isBatchDetailsApiStatusCompleted(response.data.status)) {
|
|
18
|
-
return EMPTY;
|
|
19
|
-
}
|
|
20
|
-
const actions = [];
|
|
21
|
-
const transactionPayloads = extractTransactionPayloadsFromBatchFiles(response.data.files);
|
|
22
|
-
if (transactionPayloads.length > 0) {
|
|
23
|
-
actions.push(updateTransactions(transactionPayloads, (value) => value.transaction_id));
|
|
24
|
-
}
|
|
25
|
-
actions.push(storeBatchDetails(toBatchDetails(response.data, zeniAPI.apiEndPoints.fileMicroServiceBaseUrl)));
|
|
26
|
-
return from(actions);
|
|
27
|
-
}), catchError((error) => {
|
|
28
|
-
console.error(`Failed to fetch batch details for ${batchId}:`, createZeniAPIStatus('Unexpected Error', 'Fetch batch details errored out: ' + JSON.stringify(error)));
|
|
29
|
-
return of(batchDetailFetchFailed({ batchId }));
|
|
30
|
-
})), 5));
|
|
31
|
-
}
|
|
32
|
-
export const fetchMultipleBatchDetailsEpic = (actions$, state$, zeniAPI) => actions$.pipe(filter(fetchBulkUploadBatchesSuccess.match), mergeMap((action) => {
|
|
33
|
-
const batchList = action.payload.batchList;
|
|
34
|
-
const { batchDetailsById } = state$.value.expenseAutomationMissingReceiptsViewState.bulkUpload;
|
|
35
|
-
/** Only completed list rows may trigger batch-details API; preserve platform order. */
|
|
36
|
-
const completedBatchesMissingDetails = filterBatchListItemsForBatchDetailsFetch(batchList).filter((batch) => batchDetailsById[batch.batchId] == null);
|
|
37
|
-
const completedBatchIds = completedBatchesMissingDetails.map((batch) => batch.batchId);
|
|
38
|
-
const batchIdsToFetch = completedBatchIds.slice(0, INITIAL_BATCH_PAGE_SIZE);
|
|
39
|
-
if (batchIdsToFetch.length === 0) {
|
|
40
|
-
/**
|
|
41
|
-
* List refresh can complete while no row is `completed` yet (multi-fetch skips), or
|
|
42
|
-
* `currentBatchId` may not appear in the filtered list but still needs `GET /batches/:id`.
|
|
43
|
-
* Fall back to the single-batch-details epic so `phase` and details can resolve.
|
|
44
|
-
*/
|
|
45
|
-
const bulkUpload = state$.value.expenseAutomationMissingReceiptsViewState.bulkUpload;
|
|
46
|
-
const currentId = bulkUpload.currentBatchId;
|
|
47
|
-
if (currentId != null &&
|
|
48
|
-
bulkUpload.phase === 'matching' &&
|
|
49
|
-
bulkUpload.batchDetailsById[currentId] == null &&
|
|
50
|
-
shouldFetchBatchDetailsForBatchId(bulkUpload.batchStatusById, bulkUpload.batchListByPeriod, currentId)) {
|
|
51
|
-
return of(fetchBulkUploadBatchDetails());
|
|
52
|
-
}
|
|
53
|
-
return EMPTY;
|
|
54
|
-
}
|
|
55
|
-
return concat(of(setInitialBatchDetailsLoading()), fetchBatchDetailsByIds(batchIdsToFetch, zeniAPI), of(fetchMoreBatchDetailsComplete()));
|
|
56
|
-
}));
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import { EMPTY, from, merge, of } from 'rxjs';
|
|
2
|
-
import { catchError, debounceTime, filter, mergeMap, switchMap, } from 'rxjs/operators';
|
|
3
|
-
import { convertToPeriod } from '../../../../commonStateTypes/timePeriod';
|
|
4
|
-
import { getCurrentTenant } from '../../../../entity/tenant/tenantSelector';
|
|
5
|
-
import { updateTransactions } from '../../../../entity/transaction/transactionReducer';
|
|
6
|
-
import { createZeniAPIStatus, isSuccessResponse, } from '../../../../responsePayload';
|
|
7
|
-
import { supportedTransactionPayloadToManualSearchResult } from '../../payload/missingReceiptsPayload';
|
|
8
|
-
import { searchTransactionsForManualMatch, searchTransactionsForManualMatchFailure, searchTransactionsForManualMatchSuccess, } from '../../reducers/missingReceiptsViewReducer';
|
|
9
|
-
import { toTransactionsSortKey } from '../../types/transactionsViewState';
|
|
10
|
-
/**
|
|
11
|
-
* `auto_categorized` for manual transaction search (Unmatched).
|
|
12
|
-
* Backend contract TBD — align with `fetchTransactionCategorizationEpic` (`selectedTab === 'autoCategorized'`)
|
|
13
|
-
* when the expense-automation API documents the intended filter for this flow.
|
|
14
|
-
*/
|
|
15
|
-
export const MANUAL_TRANSACTION_SEARCH_AUTO_CATEGORIZED = false;
|
|
16
|
-
export const searchTransactionsForManualMatchEpic = (actions$, state$, zeniAPI) => {
|
|
17
|
-
const searchActions$ = actions$.pipe(filter(searchTransactionsForManualMatch.match));
|
|
18
|
-
const pagination$ = searchActions$.pipe(filter((action) => action.payload.pageToken != null));
|
|
19
|
-
/**
|
|
20
|
-
* No API for empty or 1-char queries; immediate merge so switchMap cancels any in-flight HTTP.
|
|
21
|
-
*/
|
|
22
|
-
const newSearchTooShortOrClear$ = searchActions$.pipe(filter((action) => action.payload.pageToken == null &&
|
|
23
|
-
action.payload.query.trim().length < 2));
|
|
24
|
-
const newSearchDebounced$ = searchActions$.pipe(filter((action) => action.payload.pageToken == null &&
|
|
25
|
-
action.payload.query.trim().length >= 2), debounceTime(300));
|
|
26
|
-
return merge(pagination$, newSearchTooShortOrClear$, newSearchDebounced$).pipe(switchMap((action) => {
|
|
27
|
-
const { query, pageToken } = action.payload;
|
|
28
|
-
if (pageToken == null && query.trim().length < 2) {
|
|
29
|
-
return EMPTY;
|
|
30
|
-
}
|
|
31
|
-
const state = state$.value;
|
|
32
|
-
const { expenseAutomationViewState: { selectedPeriodByTenantId }, expenseAutomationMissingReceiptsViewState: { bulkUpload: { manualSearch, sortKey, sortOrder }, }, } = state;
|
|
33
|
-
const currentTenant = getCurrentTenant(state);
|
|
34
|
-
const selectedPeriod = selectedPeriodByTenantId[currentTenant.tenantId];
|
|
35
|
-
if (selectedPeriod == null) {
|
|
36
|
-
return of(searchTransactionsForManualMatchFailure({
|
|
37
|
-
error: createZeniAPIStatus('Unexpected Error', 'Manual search requires a selected accounting period.'),
|
|
38
|
-
}));
|
|
39
|
-
}
|
|
40
|
-
const period = convertToPeriod(selectedPeriod);
|
|
41
|
-
const queryParam = {
|
|
42
|
-
start_date: period.start,
|
|
43
|
-
end_date: period.end,
|
|
44
|
-
auto_categorized: MANUAL_TRANSACTION_SEARCH_AUTO_CATEGORIZED,
|
|
45
|
-
sort_by: toTransactionsSortKey(sortKey),
|
|
46
|
-
sort_order: sortOrder === 'ascending' ? 'asc' : 'desc',
|
|
47
|
-
page_token: pageToken ?? null,
|
|
48
|
-
page_size: manualSearch.pageSize,
|
|
49
|
-
search_text: query,
|
|
50
|
-
};
|
|
51
|
-
return zeniAPI
|
|
52
|
-
.getJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/expense-automation/transactions?query=${encodeURIComponent(JSON.stringify(queryParam))}`)
|
|
53
|
-
.pipe(mergeMap((response) => {
|
|
54
|
-
if (isSuccessResponse(response) && response.data != null) {
|
|
55
|
-
const { transactions, next_page_token, total_count } = response.data;
|
|
56
|
-
const append = pageToken != null;
|
|
57
|
-
const results = transactions.map(supportedTransactionPayloadToManualSearchResult);
|
|
58
|
-
const actionsOut = [
|
|
59
|
-
updateTransactions(transactions, (value) => value.transaction_id, 'merge'),
|
|
60
|
-
searchTransactionsForManualMatchSuccess({
|
|
61
|
-
append,
|
|
62
|
-
nextPageToken: next_page_token ?? null,
|
|
63
|
-
results,
|
|
64
|
-
totalCount: total_count,
|
|
65
|
-
}),
|
|
66
|
-
];
|
|
67
|
-
return from(actionsOut);
|
|
68
|
-
}
|
|
69
|
-
return of(searchTransactionsForManualMatchFailure({
|
|
70
|
-
error: response.status,
|
|
71
|
-
}));
|
|
72
|
-
}), catchError((error) => of(searchTransactionsForManualMatchFailure({
|
|
73
|
-
error: createZeniAPIStatus('Unexpected Error', 'Search transactions for manual match errored: ' +
|
|
74
|
-
JSON.stringify(error)),
|
|
75
|
-
}))));
|
|
76
|
-
}));
|
|
77
|
-
};
|