@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,38 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createSlice } from '@reduxjs/toolkit';
|
|
2
2
|
import { toMonthYearPeriodId } from '../../../commonStateTypes/timePeriod';
|
|
3
|
-
import { MIN_MANUAL_TRANSACTION_SEARCH_LENGTH, } from '../types/missingReceiptsViewState';
|
|
4
|
-
export const getCompletedTransactionsCacheKey = (periodId, sortKey, sortOrder, subTab) => `completed-${subTab}-${sortKey}-${sortOrder === 'ascending' ? 'asc' : 'desc'}-${periodId}`;
|
|
5
|
-
export const initialBulkUploadState = {
|
|
6
|
-
batchDetailsById: {},
|
|
7
|
-
batchDetailsPaginationState: { fetchState: 'Not-Started', error: undefined },
|
|
8
|
-
batchListByPeriod: {},
|
|
9
|
-
batchListFetchState: { fetchState: 'Not-Started', error: undefined },
|
|
10
|
-
batchStatusById: {},
|
|
11
|
-
completedSubTab: 'all',
|
|
12
|
-
completedTransactionsByPeriod: {},
|
|
13
|
-
confirmMatchStatus: { fetchState: 'Not-Started', error: undefined },
|
|
14
|
-
currentBatchId: undefined,
|
|
15
|
-
currentResultsTab: 'unmatched',
|
|
16
|
-
failedBatchDetailIds: [],
|
|
17
|
-
manualSearchUiResetKey: 0,
|
|
18
|
-
manualSearch: {
|
|
19
|
-
fetchState: { fetchState: 'Not-Started', error: undefined },
|
|
20
|
-
isLoadingMore: false,
|
|
21
|
-
nextPageToken: null,
|
|
22
|
-
pageSize: 25,
|
|
23
|
-
results: [],
|
|
24
|
-
searchQuery: '',
|
|
25
|
-
totalCount: 0,
|
|
26
|
-
},
|
|
27
|
-
phase: 'idle',
|
|
28
|
-
sortKey: 'date',
|
|
29
|
-
sortOrder: 'descending',
|
|
30
|
-
uploadProgress: 0,
|
|
31
|
-
uploadStatus: { fetchState: 'Not-Started', error: undefined },
|
|
32
|
-
};
|
|
33
3
|
export const initialState = {
|
|
34
|
-
bulkUpload: initialBulkUploadState,
|
|
35
|
-
pendingMissingReceiptsTabNavigation: null,
|
|
36
4
|
uploadReceiptStatusById: {},
|
|
37
5
|
refreshStatus: {
|
|
38
6
|
fetchState: 'Not-Started',
|
|
@@ -51,8 +19,6 @@ export const initialState = {
|
|
|
51
19
|
return this.fetchState == 'Completed';
|
|
52
20
|
},
|
|
53
21
|
};
|
|
54
|
-
/** Epic trigger only; batch-details fetch is handled in epics. */
|
|
55
|
-
export const fetchBulkUploadBatchDetails = createAction('expenseAutomationMissingReceiptsView/fetchBulkUploadBatchDetails');
|
|
56
22
|
const expenseAutomationMissingReceiptsView = createSlice({
|
|
57
23
|
name: 'expenseAutomationMissingReceiptsView',
|
|
58
24
|
initialState,
|
|
@@ -154,404 +120,7 @@ const expenseAutomationMissingReceiptsView = createSlice({
|
|
|
154
120
|
clearExpenseAutomationMissingReceiptsView(draft) {
|
|
155
121
|
Object.assign(draft, initialState);
|
|
156
122
|
},
|
|
157
|
-
// -- Bulk Upload Actions --
|
|
158
|
-
bulkUploadReceipts: {
|
|
159
|
-
reducer(draft) {
|
|
160
|
-
draft.bulkUpload.phase = 'uploading';
|
|
161
|
-
draft.bulkUpload.uploadProgress = 0;
|
|
162
|
-
draft.bulkUpload.uploadStatus = {
|
|
163
|
-
fetchState: 'In-Progress',
|
|
164
|
-
error: undefined,
|
|
165
|
-
};
|
|
166
|
-
},
|
|
167
|
-
prepare(files) {
|
|
168
|
-
return { payload: { files } };
|
|
169
|
-
},
|
|
170
|
-
},
|
|
171
|
-
updateBulkUploadProgress(draft, action) {
|
|
172
|
-
draft.bulkUpload.uploadProgress = action.payload;
|
|
173
|
-
},
|
|
174
|
-
bulkUploadReceiptsSuccess(draft, action) {
|
|
175
|
-
draft.bulkUpload.currentBatchId = action.payload.batchId;
|
|
176
|
-
draft.bulkUpload.uploadProgress = 100;
|
|
177
|
-
draft.bulkUpload.uploadStatus = {
|
|
178
|
-
fetchState: 'Completed',
|
|
179
|
-
error: undefined,
|
|
180
|
-
};
|
|
181
|
-
draft.bulkUpload.phase = 'matching';
|
|
182
|
-
},
|
|
183
|
-
bulkUploadReceiptsFailure(draft, action) {
|
|
184
|
-
draft.bulkUpload.uploadStatus = {
|
|
185
|
-
fetchState: 'Error',
|
|
186
|
-
error: action.payload.error,
|
|
187
|
-
};
|
|
188
|
-
draft.bulkUpload.phase = 'idle';
|
|
189
|
-
},
|
|
190
|
-
bulkUploadAutomatchingTimedOut: {
|
|
191
|
-
reducer(draft, action) {
|
|
192
|
-
if (draft.bulkUpload.phase !== 'matching' ||
|
|
193
|
-
draft.bulkUpload.currentBatchId !== action.payload.batchId) {
|
|
194
|
-
return;
|
|
195
|
-
}
|
|
196
|
-
draft.bulkUpload.phase = 'completed';
|
|
197
|
-
},
|
|
198
|
-
prepare(batchId) {
|
|
199
|
-
return { payload: { batchId } };
|
|
200
|
-
},
|
|
201
|
-
},
|
|
202
|
-
pusherBatchStatusUpdate(draft, action) {
|
|
203
|
-
const batchStatus = action.payload;
|
|
204
|
-
draft.bulkUpload.batchStatusById[batchStatus.batchId] = batchStatus;
|
|
205
|
-
/**
|
|
206
|
-
* Auto-matching banner (`phase === 'matching'`) must clear when the server reports this
|
|
207
|
-
* upload batch is done — otherwise the Missing tab keeps MatchingProgressBanner until
|
|
208
|
-
* batch-details APIs run; EmailUploadBanner should show again for the next upload.
|
|
209
|
-
*/
|
|
210
|
-
if (batchStatus.status === 'completed' &&
|
|
211
|
-
draft.bulkUpload.phase === 'matching' &&
|
|
212
|
-
draft.bulkUpload.currentBatchId === batchStatus.batchId) {
|
|
213
|
-
draft.bulkUpload.phase = 'completed';
|
|
214
|
-
}
|
|
215
|
-
},
|
|
216
|
-
requestMissingReceiptsTabNavigation(draft, action) {
|
|
217
|
-
draft.pendingMissingReceiptsTabNavigation = action.payload.tab;
|
|
218
|
-
},
|
|
219
|
-
clearMissingReceiptsTabNavigation(draft) {
|
|
220
|
-
draft.pendingMissingReceiptsTabNavigation = null;
|
|
221
|
-
},
|
|
222
|
-
fetchBulkUploadBatchDetailsSuccess(draft, action) {
|
|
223
|
-
const details = action.payload;
|
|
224
|
-
draft.bulkUpload.batchDetailsById[details.batchId] = details;
|
|
225
|
-
draft.bulkUpload.phase = 'completed';
|
|
226
|
-
},
|
|
227
|
-
fetchBulkUploadBatchDetailsFailure: {
|
|
228
|
-
reducer(draft) {
|
|
229
|
-
draft.bulkUpload.phase = 'completed';
|
|
230
|
-
},
|
|
231
|
-
prepare(payload) {
|
|
232
|
-
return { payload };
|
|
233
|
-
},
|
|
234
|
-
},
|
|
235
|
-
storeBatchDetails(draft, action) {
|
|
236
|
-
const details = action.payload;
|
|
237
|
-
draft.bulkUpload.batchDetailsById[details.batchId] = details;
|
|
238
|
-
/**
|
|
239
|
-
* Multi-batch fetch paths use `storeBatchDetails` (not `fetchBulkUploadBatchDetailsSuccess`).
|
|
240
|
-
* Without this, `phase` stays `matching` after upload forever and the Unmatched tab keeps
|
|
241
|
-
* showing the skeleton (`bulkUploadPhase === 'matching'` in web-components).
|
|
242
|
-
*/
|
|
243
|
-
if (draft.bulkUpload.phase === 'matching' &&
|
|
244
|
-
draft.bulkUpload.currentBatchId === details.batchId) {
|
|
245
|
-
draft.bulkUpload.phase = 'completed';
|
|
246
|
-
}
|
|
247
|
-
},
|
|
248
|
-
batchDetailFetchFailed(draft, action) {
|
|
249
|
-
const { batchId } = action.payload;
|
|
250
|
-
if (!draft.bulkUpload.failedBatchDetailIds.includes(batchId)) {
|
|
251
|
-
draft.bulkUpload.failedBatchDetailIds.push(batchId);
|
|
252
|
-
}
|
|
253
|
-
if (draft.bulkUpload.phase === 'matching' &&
|
|
254
|
-
draft.bulkUpload.currentBatchId === batchId) {
|
|
255
|
-
draft.bulkUpload.phase = 'completed';
|
|
256
|
-
}
|
|
257
|
-
},
|
|
258
|
-
setInitialBatchDetailsLoading(draft) {
|
|
259
|
-
draft.bulkUpload.batchDetailsPaginationState = {
|
|
260
|
-
fetchState: 'In-Progress',
|
|
261
|
-
error: undefined,
|
|
262
|
-
};
|
|
263
|
-
},
|
|
264
|
-
fetchMoreBatchDetails(draft) {
|
|
265
|
-
draft.bulkUpload.batchDetailsPaginationState = {
|
|
266
|
-
fetchState: 'In-Progress',
|
|
267
|
-
error: undefined,
|
|
268
|
-
};
|
|
269
|
-
},
|
|
270
|
-
fetchMoreBatchDetailsComplete(draft) {
|
|
271
|
-
draft.bulkUpload.batchDetailsPaginationState = {
|
|
272
|
-
fetchState: 'Completed',
|
|
273
|
-
error: undefined,
|
|
274
|
-
};
|
|
275
|
-
const currentId = draft.bulkUpload.currentBatchId;
|
|
276
|
-
const currentDetails = currentId != null
|
|
277
|
-
? draft.bulkUpload.batchDetailsById[currentId]
|
|
278
|
-
: undefined;
|
|
279
|
-
if (draft.bulkUpload.phase === 'matching' &&
|
|
280
|
-
currentId != null &&
|
|
281
|
-
currentDetails?.status === 'completed') {
|
|
282
|
-
draft.bulkUpload.phase = 'completed';
|
|
283
|
-
}
|
|
284
|
-
},
|
|
285
|
-
fetchMoreBatchDetailsFailure(draft, action) {
|
|
286
|
-
draft.bulkUpload.batchDetailsPaginationState = {
|
|
287
|
-
fetchState: 'Error',
|
|
288
|
-
error: action.payload.error,
|
|
289
|
-
};
|
|
290
|
-
},
|
|
291
|
-
fetchBulkUploadBatches: {
|
|
292
|
-
reducer(draft, action) {
|
|
293
|
-
if (action.payload.invalidateBatchDetailsCache === true) {
|
|
294
|
-
draft.bulkUpload.batchDetailsById = {};
|
|
295
|
-
draft.bulkUpload.failedBatchDetailIds = [];
|
|
296
|
-
}
|
|
297
|
-
draft.bulkUpload.batchListFetchState = {
|
|
298
|
-
fetchState: 'In-Progress',
|
|
299
|
-
error: undefined,
|
|
300
|
-
};
|
|
301
|
-
},
|
|
302
|
-
prepare(input) {
|
|
303
|
-
const fetchOptions = input ?? {};
|
|
304
|
-
return {
|
|
305
|
-
payload: {
|
|
306
|
-
cacheOverride: fetchOptions.cacheOverride === true,
|
|
307
|
-
invalidateBatchDetailsCache: fetchOptions.invalidateBatchDetailsCache === true,
|
|
308
|
-
},
|
|
309
|
-
};
|
|
310
|
-
},
|
|
311
|
-
},
|
|
312
|
-
fetchBulkUploadBatchesSuccess(draft, action) {
|
|
313
|
-
const periodId = toMonthYearPeriodId(action.payload.selectedPeriod);
|
|
314
|
-
draft.bulkUpload.batchListByPeriod[periodId] = action.payload.batchList;
|
|
315
|
-
draft.bulkUpload.batchListFetchState = {
|
|
316
|
-
fetchState: 'Completed',
|
|
317
|
-
error: undefined,
|
|
318
|
-
};
|
|
319
|
-
/**
|
|
320
|
-
* When the multi-batch-details epic has nothing to fetch (e.g. list rows not `completed`
|
|
321
|
-
* yet, or details already present), `phase` can stay `matching` even though we already
|
|
322
|
-
* have completed details for `currentBatchId` (from polling / Pusher). Sync so the UI can
|
|
323
|
-
* dismiss the Unmatched skeleton.
|
|
324
|
-
*/
|
|
325
|
-
const currentId = draft.bulkUpload.currentBatchId;
|
|
326
|
-
if (draft.bulkUpload.phase === 'matching' && currentId != null) {
|
|
327
|
-
const existing = draft.bulkUpload.batchDetailsById[currentId];
|
|
328
|
-
if (existing?.status === 'completed') {
|
|
329
|
-
draft.bulkUpload.phase = 'completed';
|
|
330
|
-
}
|
|
331
|
-
}
|
|
332
|
-
},
|
|
333
|
-
fetchBulkUploadBatchesFailure(draft, action) {
|
|
334
|
-
draft.bulkUpload.batchListFetchState = {
|
|
335
|
-
fetchState: 'Error',
|
|
336
|
-
error: action.payload.error,
|
|
337
|
-
};
|
|
338
|
-
},
|
|
339
|
-
confirmBulkUploadMatch: {
|
|
340
|
-
reducer(draft) {
|
|
341
|
-
draft.bulkUpload.confirmMatchStatus = {
|
|
342
|
-
fetchState: 'In-Progress',
|
|
343
|
-
error: undefined,
|
|
344
|
-
};
|
|
345
|
-
},
|
|
346
|
-
prepare(batchId, attachmentId, transactionId, transactionType, fileName) {
|
|
347
|
-
return {
|
|
348
|
-
payload: {
|
|
349
|
-
batchId,
|
|
350
|
-
attachmentId,
|
|
351
|
-
transactionId,
|
|
352
|
-
transactionType,
|
|
353
|
-
fileName,
|
|
354
|
-
},
|
|
355
|
-
};
|
|
356
|
-
},
|
|
357
|
-
},
|
|
358
|
-
confirmBulkUploadMatchSuccess(draft, action) {
|
|
359
|
-
const { batchId, attachmentId, transactionId } = action.payload;
|
|
360
|
-
draft.bulkUpload.confirmMatchStatus = {
|
|
361
|
-
fetchState: 'Completed',
|
|
362
|
-
error: undefined,
|
|
363
|
-
};
|
|
364
|
-
const details = draft.bulkUpload.batchDetailsById[batchId];
|
|
365
|
-
if (details != null) {
|
|
366
|
-
const file = details.files.find((batchFile) => batchFile.attachmentId === attachmentId);
|
|
367
|
-
if (file != null) {
|
|
368
|
-
const originalStatus = file.status;
|
|
369
|
-
file.status = 'exact_match';
|
|
370
|
-
file.matchedTransactionId = transactionId;
|
|
371
|
-
file.candidates = undefined;
|
|
372
|
-
details.summary.matched += 1;
|
|
373
|
-
if (originalStatus === 'no_match') {
|
|
374
|
-
details.summary.noMatch = Math.max(0, details.summary.noMatch - 1);
|
|
375
|
-
}
|
|
376
|
-
else if (originalStatus === 'possible_matches') {
|
|
377
|
-
details.summary.possibleMatches = Math.max(0, details.summary.possibleMatches - 1);
|
|
378
|
-
}
|
|
379
|
-
}
|
|
380
|
-
}
|
|
381
|
-
draft.bulkUpload.manualSearch = initialBulkUploadState.manualSearch;
|
|
382
|
-
draft.bulkUpload.manualSearchUiResetKey += 1;
|
|
383
|
-
},
|
|
384
|
-
confirmBulkUploadMatchFailure(draft, action) {
|
|
385
|
-
draft.bulkUpload.confirmMatchStatus = {
|
|
386
|
-
fetchState: 'Error',
|
|
387
|
-
error: action.payload.error,
|
|
388
|
-
};
|
|
389
|
-
},
|
|
390
|
-
setBulkUploadResultsTab(draft, action) {
|
|
391
|
-
draft.bulkUpload.currentResultsTab = action.payload;
|
|
392
|
-
},
|
|
393
|
-
setBulkUploadCompletedSubTab(draft, action) {
|
|
394
|
-
draft.bulkUpload.completedSubTab = action.payload;
|
|
395
|
-
},
|
|
396
|
-
setBulkUploadSortConfig(draft, action) {
|
|
397
|
-
draft.bulkUpload.sortKey = action.payload.sortKey;
|
|
398
|
-
draft.bulkUpload.sortOrder = action.payload.sortOrder;
|
|
399
|
-
},
|
|
400
|
-
clearBulkUpload(draft) {
|
|
401
|
-
Object.assign(draft.bulkUpload, initialBulkUploadState);
|
|
402
|
-
draft.pendingMissingReceiptsTabNavigation = null;
|
|
403
|
-
},
|
|
404
|
-
searchTransactionsForManualMatch: {
|
|
405
|
-
reducer(draft, action) {
|
|
406
|
-
const { query, pageToken } = action.payload;
|
|
407
|
-
const isLoadMore = pageToken != null;
|
|
408
|
-
const trimmed = query.trim();
|
|
409
|
-
/**
|
|
410
|
-
* Cleared or too-short query: no API (see epic). Reset fully (no In-Progress).
|
|
411
|
-
* Only bump `manualSearchUiResetKey` when clearing a real search — not when the UI
|
|
412
|
-
* dispatches `""` on every keystroke while length is below MIN (web-components always sends
|
|
413
|
-
* `onSearch("")` in that case), or ReceiptCard remounts and the input loses focus.
|
|
414
|
-
*/
|
|
415
|
-
if (!isLoadMore &&
|
|
416
|
-
trimmed.length < MIN_MANUAL_TRANSACTION_SEARCH_LENGTH) {
|
|
417
|
-
const hadActiveSearch = draft.bulkUpload.manualSearch.searchQuery.trim().length >=
|
|
418
|
-
MIN_MANUAL_TRANSACTION_SEARCH_LENGTH ||
|
|
419
|
-
draft.bulkUpload.manualSearch.results.length > 0;
|
|
420
|
-
draft.bulkUpload.manualSearch = initialBulkUploadState.manualSearch;
|
|
421
|
-
if (hadActiveSearch) {
|
|
422
|
-
draft.bulkUpload.manualSearchUiResetKey += 1;
|
|
423
|
-
}
|
|
424
|
-
return;
|
|
425
|
-
}
|
|
426
|
-
draft.bulkUpload.manualSearch.searchQuery = query;
|
|
427
|
-
if (isLoadMore) {
|
|
428
|
-
draft.bulkUpload.manualSearch.isLoadingMore = true;
|
|
429
|
-
}
|
|
430
|
-
else {
|
|
431
|
-
draft.bulkUpload.manualSearch.isLoadingMore = false;
|
|
432
|
-
draft.bulkUpload.manualSearch.results = [];
|
|
433
|
-
draft.bulkUpload.manualSearch.nextPageToken = null;
|
|
434
|
-
draft.bulkUpload.manualSearch.totalCount = 0;
|
|
435
|
-
draft.bulkUpload.manualSearch.fetchState = {
|
|
436
|
-
fetchState: 'In-Progress',
|
|
437
|
-
error: undefined,
|
|
438
|
-
};
|
|
439
|
-
}
|
|
440
|
-
},
|
|
441
|
-
prepare(query, pageToken) {
|
|
442
|
-
return { payload: { query, pageToken: pageToken ?? undefined } };
|
|
443
|
-
},
|
|
444
|
-
},
|
|
445
|
-
searchTransactionsForManualMatchSuccess(draft, action) {
|
|
446
|
-
const { append, nextPageToken, results, totalCount } = action.payload;
|
|
447
|
-
if (append) {
|
|
448
|
-
const merged = [...draft.bulkUpload.manualSearch.results, ...results];
|
|
449
|
-
const byId = new Map(merged.map((result) => [result.transactionId, result]));
|
|
450
|
-
draft.bulkUpload.manualSearch.results = Array.from(byId.values());
|
|
451
|
-
}
|
|
452
|
-
else {
|
|
453
|
-
draft.bulkUpload.manualSearch.results = results;
|
|
454
|
-
}
|
|
455
|
-
draft.bulkUpload.manualSearch.nextPageToken = nextPageToken;
|
|
456
|
-
draft.bulkUpload.manualSearch.totalCount = totalCount;
|
|
457
|
-
draft.bulkUpload.manualSearch.isLoadingMore = false;
|
|
458
|
-
draft.bulkUpload.manualSearch.fetchState = {
|
|
459
|
-
fetchState: 'Completed',
|
|
460
|
-
error: undefined,
|
|
461
|
-
};
|
|
462
|
-
},
|
|
463
|
-
searchTransactionsForManualMatchFailure(draft, action) {
|
|
464
|
-
draft.bulkUpload.manualSearch.isLoadingMore = false;
|
|
465
|
-
draft.bulkUpload.manualSearch.fetchState = {
|
|
466
|
-
fetchState: 'Error',
|
|
467
|
-
error: action.payload.error,
|
|
468
|
-
};
|
|
469
|
-
},
|
|
470
|
-
clearManualSearchResults(draft) {
|
|
471
|
-
draft.bulkUpload.manualSearch = initialBulkUploadState.manualSearch;
|
|
472
|
-
draft.bulkUpload.manualSearchUiResetKey += 1;
|
|
473
|
-
},
|
|
474
|
-
acknowledgeBulkUploadConfirmMatchComplete(draft) {
|
|
475
|
-
draft.bulkUpload.confirmMatchStatus = {
|
|
476
|
-
fetchState: 'Not-Started',
|
|
477
|
-
error: undefined,
|
|
478
|
-
};
|
|
479
|
-
},
|
|
480
|
-
// -- Completed Transactions Actions --
|
|
481
|
-
fetchCompletedTransactions: {
|
|
482
|
-
reducer(draft, action) {
|
|
483
|
-
const { pageToken } = action.payload;
|
|
484
|
-
if (pageToken != null) {
|
|
485
|
-
const periods = draft.bulkUpload.completedTransactionsByPeriod;
|
|
486
|
-
for (const entry of Object.values(periods)) {
|
|
487
|
-
if (entry.nextPageToken === pageToken) {
|
|
488
|
-
entry.fetchState = {
|
|
489
|
-
fetchState: 'In-Progress',
|
|
490
|
-
error: undefined,
|
|
491
|
-
};
|
|
492
|
-
break;
|
|
493
|
-
}
|
|
494
|
-
}
|
|
495
|
-
}
|
|
496
|
-
},
|
|
497
|
-
prepare(pageToken, cacheOverride) {
|
|
498
|
-
return { payload: { pageToken, cacheOverride } };
|
|
499
|
-
},
|
|
500
|
-
},
|
|
501
|
-
fetchCompletedTransactionsSuccess(draft, action) {
|
|
502
|
-
const { transactionIds, nextPageToken, totalCount, selectedPeriod, isInitialLoad, } = action.payload;
|
|
503
|
-
const periodId = toMonthYearPeriodId(selectedPeriod);
|
|
504
|
-
const cacheKey = getCompletedTransactionsCacheKey(periodId, draft.bulkUpload.sortKey, draft.bulkUpload.sortOrder, draft.bulkUpload.completedSubTab);
|
|
505
|
-
if (isInitialLoad) {
|
|
506
|
-
draft.bulkUpload.completedTransactionsByPeriod[cacheKey] = {
|
|
507
|
-
transactionIds,
|
|
508
|
-
nextPageToken,
|
|
509
|
-
totalCount,
|
|
510
|
-
fetchState: { fetchState: 'Completed', error: undefined },
|
|
511
|
-
};
|
|
512
|
-
}
|
|
513
|
-
else {
|
|
514
|
-
const existing = draft.bulkUpload.completedTransactionsByPeriod[cacheKey];
|
|
515
|
-
if (existing != null) {
|
|
516
|
-
existing.transactionIds.push(...transactionIds);
|
|
517
|
-
existing.nextPageToken = nextPageToken;
|
|
518
|
-
existing.totalCount = totalCount;
|
|
519
|
-
existing.fetchState = { fetchState: 'Completed', error: undefined };
|
|
520
|
-
}
|
|
521
|
-
else {
|
|
522
|
-
draft.bulkUpload.completedTransactionsByPeriod[cacheKey] = {
|
|
523
|
-
transactionIds,
|
|
524
|
-
nextPageToken,
|
|
525
|
-
totalCount,
|
|
526
|
-
fetchState: { fetchState: 'Completed', error: undefined },
|
|
527
|
-
};
|
|
528
|
-
}
|
|
529
|
-
}
|
|
530
|
-
},
|
|
531
|
-
fetchCompletedTransactionsFailure(draft, action) {
|
|
532
|
-
const periodId = toMonthYearPeriodId(action.payload.selectedPeriod);
|
|
533
|
-
const cacheKey = getCompletedTransactionsCacheKey(periodId, draft.bulkUpload.sortKey, draft.bulkUpload.sortOrder, draft.bulkUpload.completedSubTab);
|
|
534
|
-
const existing = draft.bulkUpload.completedTransactionsByPeriod[cacheKey];
|
|
535
|
-
if (existing != null) {
|
|
536
|
-
existing.fetchState = {
|
|
537
|
-
fetchState: 'Error',
|
|
538
|
-
error: action.payload.error,
|
|
539
|
-
};
|
|
540
|
-
}
|
|
541
|
-
else {
|
|
542
|
-
draft.bulkUpload.completedTransactionsByPeriod[cacheKey] = {
|
|
543
|
-
fetchState: { fetchState: 'Error', error: action.payload.error },
|
|
544
|
-
nextPageToken: null,
|
|
545
|
-
totalCount: 0,
|
|
546
|
-
transactionIds: [],
|
|
547
|
-
};
|
|
548
|
-
}
|
|
549
|
-
},
|
|
550
123
|
},
|
|
551
124
|
});
|
|
552
|
-
export const { fetchMissingReceipts, fetchMissingReceiptsSuccess, fetchMissingReceiptsFailure, uploadMissingReceiptSuccess, updateMissingReceiptUploadState, updateMissingReceiptsUIState, markMissingReceiptAsDone, clearExpenseAutomationMissingReceiptsView,
|
|
553
|
-
// Bulk Upload
|
|
554
|
-
bulkUploadReceipts, updateBulkUploadProgress, bulkUploadReceiptsSuccess, bulkUploadReceiptsFailure, bulkUploadAutomatchingTimedOut, pusherBatchStatusUpdate, requestMissingReceiptsTabNavigation, clearMissingReceiptsTabNavigation, fetchBulkUploadBatchDetailsSuccess, fetchBulkUploadBatchDetailsFailure, storeBatchDetails, batchDetailFetchFailed, setInitialBatchDetailsLoading, fetchMoreBatchDetails, fetchMoreBatchDetailsComplete, fetchMoreBatchDetailsFailure, fetchBulkUploadBatches, fetchBulkUploadBatchesSuccess, fetchBulkUploadBatchesFailure, confirmBulkUploadMatch, confirmBulkUploadMatchSuccess, confirmBulkUploadMatchFailure, setBulkUploadResultsTab, setBulkUploadCompletedSubTab, setBulkUploadSortConfig, clearBulkUpload, searchTransactionsForManualMatch, searchTransactionsForManualMatchSuccess, searchTransactionsForManualMatchFailure, clearManualSearchResults, acknowledgeBulkUploadConfirmMatchComplete,
|
|
555
|
-
// Completed Transactions
|
|
556
|
-
fetchCompletedTransactions, fetchCompletedTransactionsSuccess, fetchCompletedTransactionsFailure, } = expenseAutomationMissingReceiptsView.actions;
|
|
125
|
+
export const { fetchMissingReceipts, fetchMissingReceiptsSuccess, fetchMissingReceiptsFailure, uploadMissingReceiptSuccess, updateMissingReceiptUploadState, updateMissingReceiptsUIState, markMissingReceiptAsDone, clearExpenseAutomationMissingReceiptsView, } = expenseAutomationMissingReceiptsView.actions;
|
|
557
126
|
export default expenseAutomationMissingReceiptsView.reducer;
|
|
@@ -36,7 +36,6 @@ export const initialTransactionTabViewState = {
|
|
|
36
36
|
transactionIdsBySelectedPeriod: {},
|
|
37
37
|
selectedCheckBoxTransactionIds: [],
|
|
38
38
|
transactionIdsWithUnsavedData: [],
|
|
39
|
-
uploadReceiptStatusById: {},
|
|
40
39
|
selectedTransactionId: undefined,
|
|
41
40
|
selectedTransactionLineId: undefined,
|
|
42
41
|
};
|
|
@@ -700,27 +699,6 @@ const expenseAutomationTransactionsView = createSlice({
|
|
|
700
699
|
clearExpenseAutomationTransactionsView(draft) {
|
|
701
700
|
Object.assign(draft, initialState);
|
|
702
701
|
},
|
|
703
|
-
updateTransactionCategorizationUploadReceiptState: {
|
|
704
|
-
reducer(draft, action) {
|
|
705
|
-
const { transactionId, fetchStatus, selectedTab } = action.payload;
|
|
706
|
-
draft.transactionCategorizationView[selectedTab].uploadReceiptStatusById[transactionId] = fetchStatus;
|
|
707
|
-
},
|
|
708
|
-
prepare(selectedTab, transactionId, fetchStatus) {
|
|
709
|
-
return { payload: { selectedTab, transactionId, fetchStatus } };
|
|
710
|
-
},
|
|
711
|
-
},
|
|
712
|
-
uploadTransactionCategorizationReceiptSuccess: {
|
|
713
|
-
reducer(draft, action) {
|
|
714
|
-
const { transactionPayload, selectedTab } = action.payload;
|
|
715
|
-
draft.transactionCategorizationView[selectedTab].uploadReceiptStatusById[transactionPayload.transaction_id] = {
|
|
716
|
-
fetchState: 'Completed',
|
|
717
|
-
error: undefined,
|
|
718
|
-
};
|
|
719
|
-
},
|
|
720
|
-
prepare(selectedTab, transactionPayload, updateType = 'merge') {
|
|
721
|
-
return { payload: { selectedTab, transactionPayload, updateType } };
|
|
722
|
-
},
|
|
723
|
-
},
|
|
724
702
|
syncTransactionCategorizationFromDetailSave: {
|
|
725
703
|
prepare(transactionId, updatedTransaction, pendingReviewLineIds, uncategorizedIncomeExpense, isUncategorizedExpenseCategoryEnabled) {
|
|
726
704
|
return {
|
|
@@ -792,5 +770,5 @@ const expenseAutomationTransactionsView = createSlice({
|
|
|
792
770
|
},
|
|
793
771
|
},
|
|
794
772
|
});
|
|
795
|
-
export const { fetchTransactionCategorization, updateTransactionCategorizationUIState, initializeTransactionCategorizationViewLocalData, saveTransactionCategorizationLocalData, fetchTransactionCategorizationFailure, saveTransactionCategorization, updateTransactionCategorization, updateCurrentSelectedTransactionCategorizationTab, updateTransactionCategorizationSaveStatus, markTransactionAsNotMiscategorized, updateStatusForTransactionNotMiscategorizedUpdateForCategorization, updateSelectedVendorForTransaction, updateSelectedCustomerForTransaction, setAllItemsToCategoryClassInLocalDataForCategorization, updateTotalCountForTransactionCategorization, fetchTransactionCategorizationSuccess, resetOtherTabsFetchState, fetchTransactionCategorizationView, updateSelectedCheckboxTransactionIds, clearExpenseAutomationTransactionsViewPerTabView, clearExpenseAutomationTransactionsView, setEntityRecommendationForLineIdsForCategorization, updateSelectedTransactionId, syncTransactionCategorizationFromDetailSave, backgroundRefetchReviewTab,
|
|
773
|
+
export const { fetchTransactionCategorization, updateTransactionCategorizationUIState, initializeTransactionCategorizationViewLocalData, saveTransactionCategorizationLocalData, fetchTransactionCategorizationFailure, saveTransactionCategorization, updateTransactionCategorization, updateCurrentSelectedTransactionCategorizationTab, updateTransactionCategorizationSaveStatus, markTransactionAsNotMiscategorized, updateStatusForTransactionNotMiscategorizedUpdateForCategorization, updateSelectedVendorForTransaction, updateSelectedCustomerForTransaction, setAllItemsToCategoryClassInLocalDataForCategorization, updateTotalCountForTransactionCategorization, fetchTransactionCategorizationSuccess, resetOtherTabsFetchState, fetchTransactionCategorizationView, updateSelectedCheckboxTransactionIds, clearExpenseAutomationTransactionsViewPerTabView, clearExpenseAutomationTransactionsView, setEntityRecommendationForLineIdsForCategorization, updateSelectedTransactionId, syncTransactionCategorizationFromDetailSave, backgroundRefetchReviewTab, } = expenseAutomationTransactionsView.actions;
|
|
796
774
|
export default expenseAutomationTransactionsView.reducer;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { reduceAnyFetchState } from '../../../commonStateTypes/reduceFetchState';
|
|
2
1
|
import { toMonthYearPeriodId } from '../../../commonStateTypes/timePeriod';
|
|
3
2
|
import { getAccountBase } from '../../../entity/account/accountSelector';
|
|
4
3
|
import { getClassById } from '../../../entity/class/classSelector';
|
|
@@ -7,7 +6,7 @@ import { getUserByUserId } from '../../../entity/user/userSelector';
|
|
|
7
6
|
import { getVendorByVendorId } from '../../../entity/vendor/vendorSelector';
|
|
8
7
|
import { getAllSteps } from '../selectorTypes/expenseAutomationViewSelectorTypes';
|
|
9
8
|
export function getExpenseAutomationFluxAnalysisView(state) {
|
|
10
|
-
const { expenseAutomationFluxAnalysisViewState, monthEndCloseChecksState
|
|
9
|
+
const { expenseAutomationFluxAnalysisViewState, monthEndCloseChecksState } = state;
|
|
11
10
|
const { fetchState, error, refreshStatus, uiState, reviewOperatingExpenseIdsByPeriod, selectedSectionIdsByPeriod, groupsBySelectedPeriod, fluxAnalysisEntities, bulkReviewStatus, currency, totalBalancesAndVariance, } = expenseAutomationFluxAnalysisViewState;
|
|
12
11
|
const fetchStateAndError = {
|
|
13
12
|
fetchState,
|
|
@@ -92,17 +91,10 @@ export function getExpenseAutomationFluxAnalysisView(state) {
|
|
|
92
91
|
},
|
|
93
92
|
};
|
|
94
93
|
const completionStatus = fluxCompletionStatus != null ? fluxCompletionStatus : 'incomplete';
|
|
95
|
-
const monthEndFetchState = monthYearPeriodId != null
|
|
96
|
-
? (monthEndCloseChecksViewState.monthEndCloseChecksViewByTenantId[currentTenant.tenantId]?.[monthYearPeriodId] ?? { fetchState: 'Not-Started', error: undefined })
|
|
97
|
-
: { fetchState: 'Not-Started', error: undefined };
|
|
98
|
-
const reducedFetchStatus = reduceAnyFetchState([
|
|
99
|
-
fetchStateAndError,
|
|
100
|
-
monthEndFetchState,
|
|
101
|
-
]);
|
|
102
94
|
return {
|
|
103
95
|
sections,
|
|
104
96
|
totalBalancesAndVariance,
|
|
105
|
-
fetchStatus:
|
|
97
|
+
fetchStatus: fetchStateAndError,
|
|
106
98
|
bulkReviewStatus,
|
|
107
99
|
reviewOperatingExpensesIds,
|
|
108
100
|
selectedSectionIds,
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import omit from 'lodash/omit';
|
|
2
|
-
import orderBy from 'lodash/orderBy';
|
|
3
|
-
import { reduceAnyFetchState } from '../../../commonStateTypes/reduceFetchState';
|
|
4
2
|
import { toMonthYearPeriodId } from '../../../commonStateTypes/timePeriod';
|
|
5
3
|
import { getAccountIdsForTypes } from '../../../entity/account/accountSelector';
|
|
6
4
|
import { getJEScheduledTransactionByJEScheduleTransactionKey, } from '../../../entity/jeSchedules/jeSchedulesSelector';
|
|
@@ -12,48 +10,10 @@ import { filterNestedAccountHierarchyById } from '../../scheduleView/scheduleDet
|
|
|
12
10
|
import { getAccountLabelForScheduleType, getAccountsTypesForScheduleList, } from '../../scheduleView/scheduleListView/scheduleListHelper';
|
|
13
11
|
import { getAllSteps } from '../selectorTypes/expenseAutomationViewSelectorTypes';
|
|
14
12
|
import { getJEAccountSettingsView } from './jeAccountSettingsViewSelector';
|
|
15
|
-
function getJEScheduleSortAccessor(sortKey) {
|
|
16
|
-
switch (sortKey) {
|
|
17
|
-
case 'vendor':
|
|
18
|
-
return (s) => s.vendor.name?.toLowerCase();
|
|
19
|
-
case 'category':
|
|
20
|
-
return (s) => s.jeDebit.account?.accountName?.toLowerCase();
|
|
21
|
-
case 'class':
|
|
22
|
-
return (s) => s.jeDebit.accountingClass?.className?.toLowerCase();
|
|
23
|
-
case 'depCategory':
|
|
24
|
-
return (s) => s.jeCredit.account?.accountName?.toLowerCase();
|
|
25
|
-
case 'scheduleCategory':
|
|
26
|
-
return (s) => s.jeScheduleType;
|
|
27
|
-
case 'startMonth':
|
|
28
|
-
return (s) => s.startDate?.valueOf();
|
|
29
|
-
case 'type':
|
|
30
|
-
return (s) => s.baseTransaction.typeOfTransaction;
|
|
31
|
-
case 'amortizationPeriod':
|
|
32
|
-
return (s) => s.period;
|
|
33
|
-
case 'jePostingDate':
|
|
34
|
-
return (s) => s.dayOfPostingDate;
|
|
35
|
-
case 'remainingMonths':
|
|
36
|
-
return (s) => s.period;
|
|
37
|
-
case 'runningBalance':
|
|
38
|
-
return (s) => s.balanceAsOfToday?.amount;
|
|
39
|
-
case 'totalAmount':
|
|
40
|
-
return (s) => s.baseTransaction.amount.amount;
|
|
41
|
-
case 'transactionDate':
|
|
42
|
-
return (s) => s.baseTransaction.date.valueOf();
|
|
43
|
-
case 'memo':
|
|
44
|
-
return (s) => s.baseTransaction.memo?.toLowerCase();
|
|
45
|
-
default:
|
|
46
|
-
return (s) => s.startDate?.valueOf();
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
function sortJEScheduledTransactions(transactions, sortKey, sortOrder) {
|
|
50
|
-
const accessor = getJEScheduleSortAccessor(sortKey);
|
|
51
|
-
return orderBy(transactions, [accessor], [sortOrder === 'ascending' ? 'asc' : 'desc']);
|
|
52
|
-
}
|
|
53
13
|
export function getExpenseAutomationJESchedulesView(state) {
|
|
54
14
|
const jeScheduledTransaction = [];
|
|
55
15
|
const failedJeScheduledTransaction = [];
|
|
56
|
-
const { accountState, accountListState, classState, classListState, expenseAutomationJESchedulesViewState, expenseAutomationViewState, monthEndCloseChecksState,
|
|
16
|
+
const { accountState, accountListState, classState, classListState, expenseAutomationJESchedulesViewState, expenseAutomationViewState, monthEndCloseChecksState, } = state;
|
|
57
17
|
const { jeScheduleTransactionKeysByPeriod, failedJeScheduleTransactionKeysByPeriod, jeScheduleLocalDataById, postStatusById, ignoreStatusById, uiState, error, fetchState, refreshStatus, } = expenseAutomationJESchedulesViewState;
|
|
58
18
|
const accountSettingsView = getJEAccountSettingsView(state);
|
|
59
19
|
const currentTenant = getCurrentTenant(state);
|
|
@@ -99,33 +59,18 @@ export function getExpenseAutomationJESchedulesView(state) {
|
|
|
99
59
|
const jeScheduleDetails = getJEScheduledTransactionByJEScheduleTransactionKey(jeScheduleKey, state);
|
|
100
60
|
failedJeScheduledTransaction.push(jeScheduleDetails);
|
|
101
61
|
});
|
|
102
|
-
const
|
|
103
|
-
const
|
|
104
|
-
const ongoingSchedules = sortJEScheduledTransactions(jeScheduledTransaction.filter((schedule) => schedule.status.code === 'ongoing'), sortKey, sortOrder);
|
|
105
|
-
const completedSchedules = sortJEScheduledTransactions(jeScheduledTransaction.filter((schedule) => schedule.status.code === 'completed' ||
|
|
106
|
-
schedule.status.code === 'marked_as_completed'), sortKey, sortOrder);
|
|
107
|
-
const unsortedResolveSchedules = [];
|
|
62
|
+
const draftSchedules = jeScheduledTransaction.filter((schedule) => schedule.status.code === 'draft');
|
|
63
|
+
const resolveSchedules = [];
|
|
108
64
|
failedJeScheduledTransaction.forEach((schedule) => {
|
|
109
65
|
schedule.scheduledJournalEntry.forEach((journalEntry) => {
|
|
110
|
-
|
|
111
|
-
...schedule,
|
|
112
|
-
scheduledJournalEntry: journalEntry,
|
|
113
|
-
});
|
|
66
|
+
resolveSchedules.push({ ...schedule, scheduledJournalEntry: journalEntry });
|
|
114
67
|
});
|
|
115
68
|
});
|
|
116
|
-
const resolveSchedules = sortJEScheduledTransactions(unsortedResolveSchedules, sortKey, sortOrder);
|
|
117
69
|
const allSteps = monthYearPeriodId != null
|
|
118
70
|
? getAllSteps(monthEndCloseChecksState, monthYearPeriodId, currentTenant.tenantId)
|
|
119
71
|
: [];
|
|
120
72
|
const jeCompletionStatus = allSteps.find((step) => step.step === 'je_schedules')?.completionStatus;
|
|
121
73
|
const completionStatus = jeCompletionStatus != null ? jeCompletionStatus : 'incomplete';
|
|
122
|
-
const monthEndFetchState = monthYearPeriodId != null
|
|
123
|
-
? (monthEndCloseChecksViewState.monthEndCloseChecksViewByTenantId[currentTenant.tenantId]?.[monthYearPeriodId] ?? { fetchState: 'Not-Started', error: undefined })
|
|
124
|
-
: { fetchState: 'Not-Started', error: undefined };
|
|
125
|
-
const reducedFetchStatus = reduceAnyFetchState([
|
|
126
|
-
{ fetchState, error },
|
|
127
|
-
monthEndFetchState,
|
|
128
|
-
]);
|
|
129
74
|
return {
|
|
130
75
|
uncategorizedAccounts,
|
|
131
76
|
allDepreciationAccountList: filteredDepAccounts,
|
|
@@ -134,17 +79,15 @@ export function getExpenseAutomationJESchedulesView(state) {
|
|
|
134
79
|
allAccountList: filteredAccounts,
|
|
135
80
|
accountListNestedAccountHierarchy,
|
|
136
81
|
allClassList: allClasses,
|
|
137
|
-
completedSchedules,
|
|
138
82
|
draftSchedules,
|
|
139
|
-
ongoingSchedules,
|
|
140
83
|
resolveSchedules: resolveSchedules,
|
|
141
84
|
accountSettingsView,
|
|
142
85
|
postStatusById: postStatusById,
|
|
143
86
|
ignoreStatusById: ignoreStatusById,
|
|
144
|
-
fetchState:
|
|
87
|
+
fetchState: fetchState,
|
|
145
88
|
jeScheduleLocalDataById: jeScheduleLocalDataById,
|
|
146
89
|
uiState: uiState,
|
|
147
|
-
error:
|
|
90
|
+
error: error,
|
|
148
91
|
refreshStatus,
|
|
149
92
|
completionStatus,
|
|
150
93
|
};
|