@zeniai/client-epic-state 5.0.97 → 5.0.98-betaJK2

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.
Files changed (91) hide show
  1. package/lib/entity/approvalRule/approvalRuleConflict.d.ts +56 -0
  2. package/lib/entity/approvalRule/approvalRuleConflict.js +77 -0
  3. package/lib/entity/approvalRule/approvalRulePayload.d.ts +34 -5
  4. package/lib/entity/approvalRule/approvalRulePayload.js +145 -10
  5. package/lib/entity/approvalRule/approvalRuleSelector.d.ts +25 -1
  6. package/lib/entity/approvalRule/approvalRuleSelector.js +40 -0
  7. package/lib/entity/approvalRule/approvalRuleState.d.ts +59 -7
  8. package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
  9. package/lib/entity/snackbar/snackbarTypes.js +3 -0
  10. package/lib/entity/task/taskPayload.d.ts +1 -0
  11. package/lib/entity/task/taskPayload.js +1 -0
  12. package/lib/entity/task/taskReducer.d.ts +5 -1
  13. package/lib/entity/task/taskReducer.js +8 -2
  14. package/lib/entity/task/taskState.d.ts +1 -0
  15. package/lib/epic.d.ts +5 -1
  16. package/lib/epic.js +5 -1
  17. package/lib/esm/entity/approvalRule/approvalRuleConflict.js +74 -0
  18. package/lib/esm/entity/approvalRule/approvalRulePayload.js +145 -10
  19. package/lib/esm/entity/approvalRule/approvalRuleSelector.js +35 -0
  20. package/lib/esm/entity/snackbar/snackbarTypes.js +3 -0
  21. package/lib/esm/entity/task/taskPayload.js +1 -0
  22. package/lib/esm/entity/task/taskReducer.js +7 -1
  23. package/lib/esm/epic.js +5 -1
  24. package/lib/esm/index.js +9 -7
  25. package/lib/esm/view/spendManagement/billPay/billPayReview/billPayReviewSelector.js +14 -0
  26. package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/billPaySetupApproverViewReducer.js +109 -12
  27. package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/epic/deleteBillPayApprovalRuleEpic.js +10 -2
  28. package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/epic/fetchBillPaySetupApproverViewEpic.js +8 -4
  29. package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/epic/initializeBillPaySetupApproverViewUpdateDataEpic.js +11 -7
  30. package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/epic/reorderBillPayApprovalRulesEpic.js +54 -0
  31. package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/epic/saveBillPaySetupApproverViewUpdatesEpic.js +13 -4
  32. package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/types/commonPayload.js +140 -16
  33. package/lib/esm/view/spendManagement/billPay/editBillView/editBillViewSelector.js +60 -4
  34. package/lib/esm/view/spendManagement/billPay/editBillView/epics/fetchEditBillDetailPageEpic.js +8 -2
  35. package/lib/esm/view/spendManagement/reimbursement/editRemiView/epics/fetchEditRemiDetailPageEpic.js +5 -1
  36. package/lib/esm/view/spendManagement/reimbursement/remiSetupApproverView/epic/deleteRemiApprovalRuleEpic.js +10 -2
  37. package/lib/esm/view/spendManagement/reimbursement/remiSetupApproverView/epic/fetchRemiSetupApproverViewEpic.js +8 -2
  38. package/lib/esm/view/spendManagement/reimbursement/remiSetupApproverView/epic/initializeRemiSetupApproverViewUpdateDataEpic.js +11 -7
  39. package/lib/esm/view/spendManagement/reimbursement/remiSetupApproverView/epic/reorderRemiApprovalRulesEpic.js +61 -0
  40. package/lib/esm/view/spendManagement/reimbursement/remiSetupApproverView/epic/saveRemiSetupApproverViewUpdatesEpic.js +13 -4
  41. package/lib/esm/view/spendManagement/reimbursement/remiSetupApproverView/remiSetupApproverViewReducer.js +80 -11
  42. package/lib/esm/view/taskManager/taskDetailView/epics/createSubTaskEpic.js +80 -0
  43. package/lib/esm/view/taskManager/taskDetailView/epics/fetchSubTasksEpic.js +36 -0
  44. package/lib/esm/view/taskManager/taskDetailView/epics/fetchTaskDetailEpic.js +13 -0
  45. package/lib/esm/view/taskManager/taskDetailView/taskDetailReducer.js +56 -2
  46. package/lib/esm/view/taskManager/taskDetailView/taskDetailSelector.js +19 -8
  47. package/lib/index.d.ts +11 -9
  48. package/lib/index.js +33 -19
  49. package/lib/view/companyTaskManagerView/companyTaskManagerViewReducer.d.ts +2 -2
  50. package/lib/view/companyView/types/cockpitTypes.d.ts +1 -1
  51. package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
  52. package/lib/view/spendManagement/billPay/billPayReview/billPayReviewSelector.d.ts +7 -0
  53. package/lib/view/spendManagement/billPay/billPayReview/billPayReviewSelector.js +14 -0
  54. package/lib/view/spendManagement/billPay/billPaySetupApproverView/billPaySetupApproverViewReducer.d.ts +14 -3
  55. package/lib/view/spendManagement/billPay/billPaySetupApproverView/billPaySetupApproverViewReducer.js +110 -13
  56. package/lib/view/spendManagement/billPay/billPaySetupApproverView/billPaySetupApproverViewState.d.ts +16 -0
  57. package/lib/view/spendManagement/billPay/billPaySetupApproverView/epic/deleteBillPayApprovalRuleEpic.js +10 -2
  58. package/lib/view/spendManagement/billPay/billPaySetupApproverView/epic/fetchBillPaySetupApproverViewEpic.js +8 -4
  59. package/lib/view/spendManagement/billPay/billPaySetupApproverView/epic/initializeBillPaySetupApproverViewUpdateDataEpic.js +10 -6
  60. package/lib/view/spendManagement/billPay/billPaySetupApproverView/epic/reorderBillPayApprovalRulesEpic.d.ts +23 -0
  61. package/lib/view/spendManagement/billPay/billPaySetupApproverView/epic/reorderBillPayApprovalRulesEpic.js +58 -0
  62. package/lib/view/spendManagement/billPay/billPaySetupApproverView/epic/saveBillPaySetupApproverViewUpdatesEpic.js +12 -3
  63. package/lib/view/spendManagement/billPay/billPaySetupApproverView/types/commonPayload.d.ts +59 -1
  64. package/lib/view/spendManagement/billPay/billPaySetupApproverView/types/commonPayload.js +142 -17
  65. package/lib/view/spendManagement/billPay/billPaySetupApproverView/types/commonState.d.ts +31 -5
  66. package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.d.ts +8 -1
  67. package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.js +60 -4
  68. package/lib/view/spendManagement/billPay/editBillView/epics/fetchEditBillDetailPageEpic.js +8 -2
  69. package/lib/view/spendManagement/reimbursement/editRemiView/epics/fetchEditRemiDetailPageEpic.js +5 -1
  70. package/lib/view/spendManagement/reimbursement/remiSetupApproverView/epic/deleteRemiApprovalRuleEpic.js +10 -2
  71. package/lib/view/spendManagement/reimbursement/remiSetupApproverView/epic/fetchRemiSetupApproverViewEpic.js +8 -2
  72. package/lib/view/spendManagement/reimbursement/remiSetupApproverView/epic/initializeRemiSetupApproverViewUpdateDataEpic.js +10 -6
  73. package/lib/view/spendManagement/reimbursement/remiSetupApproverView/epic/reorderRemiApprovalRulesEpic.d.ts +14 -0
  74. package/lib/view/spendManagement/reimbursement/remiSetupApproverView/epic/reorderRemiApprovalRulesEpic.js +65 -0
  75. package/lib/view/spendManagement/reimbursement/remiSetupApproverView/epic/saveRemiSetupApproverViewUpdatesEpic.js +12 -3
  76. package/lib/view/spendManagement/reimbursement/remiSetupApproverView/remiSetupApproverViewReducer.d.ts +14 -3
  77. package/lib/view/spendManagement/reimbursement/remiSetupApproverView/remiSetupApproverViewReducer.js +81 -12
  78. package/lib/view/spendManagement/reimbursement/remiSetupApproverView/remiSetupApproverViewState.d.ts +12 -0
  79. package/lib/view/taskManager/taskDetailView/epics/createSubTaskEpic.d.ts +9 -0
  80. package/lib/view/taskManager/taskDetailView/epics/createSubTaskEpic.js +84 -0
  81. package/lib/view/taskManager/taskDetailView/epics/fetchSubTasksEpic.d.ts +8 -0
  82. package/lib/view/taskManager/taskDetailView/epics/fetchSubTasksEpic.js +40 -0
  83. package/lib/view/taskManager/taskDetailView/epics/fetchTaskDetailEpic.d.ts +2 -1
  84. package/lib/view/taskManager/taskDetailView/epics/fetchTaskDetailEpic.js +13 -0
  85. package/lib/view/taskManager/taskDetailView/taskDetail.d.ts +13 -0
  86. package/lib/view/taskManager/taskDetailView/taskDetailReducer.d.ts +14 -2
  87. package/lib/view/taskManager/taskDetailView/taskDetailReducer.js +57 -3
  88. package/lib/view/taskManager/taskDetailView/taskDetailSelector.d.ts +2 -1
  89. package/lib/view/taskManager/taskDetailView/taskDetailSelector.js +17 -6
  90. package/lib/view/taskManager/taskListView/taskList.d.ts +3 -3
  91. package/package.json +1 -1
@@ -32,6 +32,7 @@ const ALL_SNACKBAR_MESSAGE_SECTIONS = [
32
32
  'reimbursement_approval_update',
33
33
  'reimbursement_duplicate_approval_update',
34
34
  'reimbursement_approval_delete',
35
+ 'reimbursement_approval_reorder',
35
36
  'reimbursement_create_mileage',
36
37
  'reimbursement_update_mileage',
37
38
  'reimbursement_accept_term',
@@ -45,6 +46,7 @@ const ALL_SNACKBAR_MESSAGE_SECTIONS = [
45
46
  'bill_pay_approval_update',
46
47
  'bill_pay_duplicate_approval_update',
47
48
  'bill_pay_approval_delete',
49
+ 'bill_pay_approval_reorder',
48
50
  'bill_pay_updated',
49
51
  'bill_pay_deleted',
50
52
  'bill_pay_cancelled_deleted',
@@ -217,6 +219,7 @@ const ALL_SNACKBAR_MESSAGE_SECTIONS = [
217
219
  'credit_agent_update_profile',
218
220
  'credit_agent_save_macro',
219
221
  'credit_agent_schedule_cron',
222
+ 'create_sub_task',
220
223
  ];
221
224
  export const toSnackbarMessageSection = (v) => stringToUnion(v, ALL_SNACKBAR_MESSAGE_SECTIONS);
222
225
  // Keeping this different from the message type, since we may not have messages in all instances
@@ -52,4 +52,5 @@ export const mapTaskPayloadToTask = (payload) => ({
52
52
  ? convertMinutesToHHMM(payload.time_spent)
53
53
  : convertMinutesToHHMM(0),
54
54
  groupAssignees: payload.group_assignees ?? [],
55
+ subTasksIds: payload.subtasks ?? [],
55
56
  });
@@ -20,10 +20,16 @@ const task = createSlice({
20
20
  removeTask(draft, action) {
21
21
  delete draft.taskByID[action.payload];
22
22
  },
23
+ appendSubTaskId(draft, action) {
24
+ const parentTask = draft.taskByID[action.payload.parentTaskId];
25
+ if (parentTask != null) {
26
+ parentTask.subTasksIds.push(action.payload.subTaskId);
27
+ }
28
+ },
23
29
  clearAllTasks(draft) {
24
30
  draft.taskByID = {};
25
31
  },
26
32
  },
27
33
  });
28
- export const { updateTasks, updateTask, removeTask, clearAllTasks } = task.actions;
34
+ export const { updateTasks, updateTask, removeTask, appendSubTaskId, clearAllTasks, } = task.actions;
29
35
  export default task.reducer;
package/lib/esm/epic.js CHANGED
@@ -349,6 +349,7 @@ import { fetchBillListPerTabEpic, } from './view/spendManagement/billPay/billLis
349
349
  import { fetchBillPayConfigEpic, } from './view/spendManagement/billPay/billPayConfig/fetchBillPayConfigEpic';
350
350
  import { fetchDuplicateBillPayReviewEpic, } from './view/spendManagement/billPay/billPayReview/fetchDuplicateBillEpic';
351
351
  import { deleteBillPayApprovalRuleEpic, } from './view/spendManagement/billPay/billPaySetupApproverView/epic/deleteBillPayApprovalRuleEpic';
352
+ import { reorderBillPayApprovalRulesEpic, } from './view/spendManagement/billPay/billPaySetupApproverView/epic/reorderBillPayApprovalRulesEpic';
352
353
  import { fetchBillPayApproversDetailsEpic, } from './view/spendManagement/billPay/billPaySetupApproverView/epic/fetchBillPayApproversDetailsEpic';
353
354
  import { fetchBillPayApproversListEpic, } from './view/spendManagement/billPay/billPaySetupApproverView/epic/fetchBillPayApproversListEpic';
354
355
  import { fetchBillPaySetupApproverViewEpic, } from './view/spendManagement/billPay/billPaySetupApproverView/epic/fetchBillPaySetupApproverViewEpic';
@@ -473,6 +474,7 @@ import { fetchRemiDetailEpic, } from './view/spendManagement/reimbursement/remiD
473
474
  import { fetchRemiListEpic, } from './view/spendManagement/reimbursement/remiListView/fetchRemiListEpic';
474
475
  import { fetchRemiListPerTabEpic, } from './view/spendManagement/reimbursement/remiListView/fetchRemiListPerTabEpic';
475
476
  import { deleteRemiApprovalRuleEpic, } from './view/spendManagement/reimbursement/remiSetupApproverView/epic/deleteRemiApprovalRuleEpic';
477
+ import { reorderRemiApprovalRulesEpic, } from './view/spendManagement/reimbursement/remiSetupApproverView/epic/reorderRemiApprovalRulesEpic';
476
478
  import { fetchRemiApproversDetailsEpic, } from './view/spendManagement/reimbursement/remiSetupApproverView/epic/fetchRemiApproversDetailsEpic';
477
479
  import { fetchRemiApproversListEpic, } from './view/spendManagement/reimbursement/remiSetupApproverView/epic/fetchRemiApproversListEpic';
478
480
  import { fetchRemiSetupApproverViewEpic, } from './view/spendManagement/reimbursement/remiSetupApproverView/epic/fetchRemiSetupApproverViewEpic';
@@ -542,6 +544,8 @@ import { fetchTaskDetailEpic, } from './view/taskManager/taskDetailView/epics/fe
542
544
  import { fetchTaskDetailPageEpic, } from './view/taskManager/taskDetailView/epics/fetchTaskDetailPageEpic';
543
545
  import { fetchTaskHistoryEpic, } from './view/taskManager/taskDetailView/epics/fetchTaskHistoryEpic';
544
546
  import { initializeTaskToLocalStoreEpic, } from './view/taskManager/taskDetailView/epics/initializeTaskToLocalStoreEpic';
547
+ import { createSubTaskEpic, } from './view/taskManager/taskDetailView/epics/createSubTaskEpic';
548
+ import { fetchSubTasksEpic, } from './view/taskManager/taskDetailView/epics/fetchSubTasksEpic';
545
549
  import { saveTaskDetailEpic, } from './view/taskManager/taskDetailView/epics/saveTaskDetailEpic';
546
550
  import { snoozeTaskEpic, } from './view/taskManager/taskDetailView/epics/snoozeTaskEpic';
547
551
  import { unsnoozeTaskEpic, } from './view/taskManager/taskDetailView/epics/unsnoozeTaskEpic';
@@ -607,7 +611,7 @@ import { fetchZeniAccStatementPageEpic, } from './view/zeniAccStatementList/fetc
607
611
  import { fetchZeniAccountsPromoCardEpic, } from './view/zeniAccountsPromoCard/zeniAccountsPromoCardEpic';
608
612
  import { approveOAuthConsentEpic, } from './view/zeniOAuthView/epics/approveOAuthConsentEpic';
609
613
  // Note: Please maintain strict alphabetical order
610
- const combinedEpics = combineEpics(acceptBillPayTermsEpic, acceptBillPayUpdatedTermsEpic, acceptChargeCardTermsEpic, acceptEmployeeRemiTermsEpic, acceptMasterTOSEpic, acceptRemiTermsEpic, acceptTreasuryTermsEpic, acceptZeniAccountTermsEpic, addCardPaymentSourceEpic, approveOAuthConsentEpic, approveOrRejectBillEpic, approveOrRejectBillsBulkActionEpic, approveOrRejectRemiEpic, approveOrRejectRemisBulkActionEpic, approveVendorGlobalReviewEpic, archiveTaskEpic, backgroundRefetchReviewTabEpic, bulkUpdateTaskListEpic, cancelAiAccountantOnboardingEpic, cancelAndDeleteBillEpic, cancelAndDeleteRemiEpic, cancelOrDeleteBillsBulkActionEpic, cancelOrDeleteRemisBulkActionEpic, cancelScheduleAccruedJournalEntryEpic, changeZeniPersonRolesEpic, checkDepositEpic, clearAllEpic, closeChargeCardEpic, closeChargeCardsEpic, companyManagementSavePendingUpdatesEpic, companyManagementSaveUpdatesEpic, confirmCardSetupIntentEpic, convertAmountToHomeCurrencyEpic, createAddressEpic, createAutoTransferRuleEpic, createBankAccountEpic, createCardSetupIntentEpic, createCheckingAccountEpic, createCompanyAddressEpic, createCompanyOfficersEpic, createCompanyUserAddressEpic, createGlobalMerchantEpic, createInternationalBankAccountEpic, createNewSchedulesAccruedEpic, createNewSchedulesEpic, createNewTaskGroupEpic, createPaymentInstrumentEpic, createSessionAndSubmitEpic, createSessionEpic, createTagEpic, createTaskFromTaskGroupTemplateEpic, createTransferEntryEpic, createUserBankAccountEpic, deleteAccountStatementEpic, deleteAutoTransferRuleEpic, excludeAccountFromReconciliationEpic, includeAccountInReconciliationEpic, deleteBankAccountEpic, deleteBillEpic, deleteChatSessionEpic, deleteConnectionEpic, deleteBillPayApprovalRuleEpic, deleteFileEpic, deleteFileListEpic, deleteInternationalBankAccountEpic, deletePaymentInstrumentEpic, deletePersonEpic, deleteRemiApprovalRuleEpic, deleteRemiEpic, deleteScheduleAccruedDetailEpic, deleteScheduleDetailEpic, deleteTagEpic, deleteTaskEpic, snoozeTaskEpic, unsnoozeTaskEpic, deleteTaskGroupEpic, deleteTransactionAttachmentEpic, deleteUserBankAccountEpic, doMagicLinkSignInEpic, doSignInEpic, doSignOutEpic, sendEmailMagicLinkToUserEpic, sessionHeartbeatEpic, verifyDeviceWithTwoFAEpic, downloadAccountingProviderAttachmentEpic, dragNDropTasksEpic, enableChargeCardAutoPayEpic, enableSetupEpic, establishOnboardingPlaidConnectionEpic, establishPlaidConnectionEpic, expressInterestChargeCardEpic, fetchAccountListEpic, fetchAccountListForAccountTypesEpic, fetchAccountSettingsListForAccountTypesEpic, fetchAccruedScheduleListEpic, fetchActiveTenantEpic, fetchAddressEpic, fetchAiAccountantCustomersEpic, fetchAiAccountantJobsEpic, fetchAllCockpitViewsEpic, fetchAllExpenseAutomationTabsEpic, fetchAllPeopleRequiredViewsEpic, fetchAllTagsEpic, fetchAllTaskGroupsEpic, fetchAllTenantsEpic, fetchAndUpdateVendorRecommendationsEpic, fetchAggregatedReportEpic, fetchApAgingDetailEpic, fetchApAgingEpic, fetchArAgingDetailEpic, fetchArAgingEpic, fetchAuditReportGroupViewEpic, fetchAuditRuleGroupViewEpic, fetchAutoTransferReviewDetailEpic, fetchAutoTransferRuleHistoryEpic, fetchAutoTransferRulesEpic, fetchBalanceSheetEpic, fetchBalanceSheetForTimeframeEpic, fetchBankAccountsListEpic, fetchBankConnectionsViewEpic, fetchBankCountryNameByIbanEpic, fetchBankNameByRoutingEpic, fetchBankNameBySwiftEpic, fetchBillAndInitializeLocalStoreEpic, fetchBillDetailEpic, fetchBillingAccountsListEpic, fetchBillListEpic, fetchBillListPerTabEpic, fetchBillPayApproversDetailsEpic, fetchBillPayApproversListEpic, fetchBillPayCardEpic, fetchBillPayConfigEpic, fetchBillPaySetupApproverViewEpic, fetchBillPaySetupViewEpic, fetchCardBalanceEpic, archiveCardPolicyEpic, createCardPolicyTemplatesEpic, extractPolicyDocumentEpic, policyRecommendationFromUploadEpic, policyDocumentExtractionToRecommendationBridgeEpic, fetchCardPolicyDetailEpic, fetchCardPolicyListEpic, fetchCardPolicyMccCategoriesEpic, fetchCardPolicyVendorOptionsEpic, fetchCardProfilesEpic, updateCardPolicyEpic, fetchCashbackDetailEpic, fetchCashBalanceEpic, fetchCashFlowEpic, fetchCashFlowForTimeframeEpic, fetchCashInCashOutEpic, fetchCashManagementSettingsEpic, saveAutoSweepSettingsEpic, fetchCashManagementBannerEpic, fetchCashManagementOverviewPageEpic, fetchCashManagementRecommendationEpic, fetchRecentTransferEpic, fetchCashPositionEpic, fetchChargeCardConfigEpic, fetchChargeCardDetailEpic, fetchChargeCardDetailPageEpic, fetchChargeCardListEpic, fetchChargeCardListPageEpic, fetchChargeCardPaymentPageEpic, fetchChargeCardRepaymentDetailEpic, fetchChargeCardPaymentHistoryEpic, fetchChargeCardSetupViewEpic, fetchChargeCardStatementListEpic, fetchChargeCardTransactionAttachmentsEpic, fetchChargeCardTransactionListEpic, fetchChargeCardTransactionStatisticsEpic, fetchChargeCardsRecurringExpensesEpic, fetchChatHistoryEpic, fetchChatSessionsForUserEpic, fetchClassListEpic, fetchCollaborationAuthTokenEpic, fetchCockpitContextEpic, fetchCompanyBillingAddressEpic, fetchCompanyConfigEpic, fetchCompanyHealthMetricConfigEpic, fetchCompanyHealthMetricViewEpic, fetchCompanyManagementViewEpic, fetchCompanyMetaDataEpic, fetchCompanyMonthEndReportHistoricDataEpic, fetchCompanyMonthEndReportHistoricDatesEpic, fetchCompanyMonthEndReportTemplatesEpic, fetchCompanyMonthEndReportViewEpic, fetchCompanyOnboardingViewEpic, fetchCompanyPassportViewEpic, fetchCompanyPortfolioViewEpic, fetchCompanyTaskManagerViewEpic, fetchTaskManagerMetricsEpic, updateCompanyTaskManagerViewFiltersEpic, fetchCreditAccountEpic, fetchCreditAccountRepaymentEpic, fetchCreditAgentMacroEpic, fetchCurrencyConversionValueEpic, fetchDashboardEpic, fetchDashboardLayoutEpic, fetchDebitCardSummaryEpic, fetchDepositAccountDetailEpic, fetchDepositAccountEpic, fetchDepositAccountHistoryEpic, fetchDepositAccountLimitEpic, fetchDepositAccountListEpic, fetchDepositAccountListForCardsEpic, fetchDepositAccountTransactionListEpic, fetchDownloadSchedulesEpic, fetchDuplicateBillPayReviewEpic, fetchDuplicateReimbursementEpic, fetchEditBillDetailPageEpic, fetchEditRemiDetailPageEpic, fetchEligibleActionsForBillEpic, fetchEntityAutoCompleteEpic, fetchEntityHistoryEpic, fetchEntityRecommendationsByTransactionIdEpic, fetchEntityRecommendationsForLineUpdateEpic, fetchExcludedResourcesEpic, fetchExpenseAutomationFluxAnalysisViewEpic, fetchExpenseAutomationInitializeTransactionCategorizationViewLocalDataEpic, fetchExpenseAutomationJeSchedulesEpic, fetchExpenseAutomationJESchedulesPageEpic, fetchExpenseAutomationMarkTransactionAsNotMiscategorizedEpic, fetchExpenseAutomationMissingReceiptsEpic, bulkUploadReceiptsEpic, confirmBulkUploadMatchEpic, fetchBulkUploadBatchDetailsEpic, fetchMultipleBatchDetailsEpic, fetchMoreBatchDetailsEpic, fetchBulkUploadBatchesEpic, fetchCompletedTransactionsEpic, refetchCompletedTransactionsOnBulkUploadSortEpic, refreshBatchDetailsForBatchIdEpic, bulkUploadAutomatchingTimeoutEpic, bulkUploadMatchResultToastEpic, syncTabsAfterAutomatchEpic, pollBulkUploadBatchStatusEpic, pusherBatchStatusCompletionEpic, restoreBulkUploadAutomatchingOnMountEpic, searchTransactionsForManualMatchEpic, fetchExpenseAutomationReconciliationsViewEpic, fetchExpenseAutomationSaveTransactionCategorizationEpic, fetchExpenseAutomationTransactionCategorizationEpic, fetchExpenseAutomationTransactionCategorizationViewEpic, fetchExpenseAutomationUpdateTransactionCategorizationEpic, fetchExpenseTrendEpic, fetchExpressPayInitialDetailsEpic, fetchExternalConnectionsEpic, fetchFileEpic, fetchFileListEpic, fetchFinanceStatementEpic, fetchForecastListEpic, initiateReportsClassViewRefetchingEpic, reportsResyncEpic, fetchGlobalMerchantAutoCompleteViewEpic, fetchGlobalMerchantRecommendationEpic, fetchIncomeTrendEpic, fetchInsightsCardEpic, fetchInternationalWireDynamicFormEpic, fetchIntlVerificationFormEpic, fetchIssueCardPageEpic, seedAiCardCreationFormDraftEpic, seedAiCardPolicyFormDraftEpic, applyExtractedPolicyToDraftEpic, fetchMagicLinkBankNameByRoutingEpic, fetchMagicLinkBankNameBySwiftEpic, fetchMagicLinkBillEpic, fetchMagicLinkTenantEpic, fetchManagementViewEpic, fetchMerchantListEpic, fetchMonthClosePerformanceTrendEpic, fetchMonthEndCloseChecksEpic, fetchMyProfileEpic, fetchMyProfileViewEpic, fetchNetBurnOrIncomeClassesViewEpic, fetchNetBurnOrIncomeEpic, fetchNetBurnOrIncomeForTimeframeClassesViewEpic, fetchNetBurnOrIncomeForTimeframeEpic, fetchNetBurnOrIncomeStoryCardEpic, fetchNetBurnOrIncomeWithForecastEpic, fetchNotificationSettingsEpic, fetchNotificationSettingsViewEpic, fetchNotificationUnreadCountEpic, fetchNotificationViewEpic, fetchRegisteredInterestsEpic, fetchOnboardingCompletedCompaniesEpic, fetchOnboardingCustomerSetupViewEpic, fetchOnboardingCustomerViewEpic, fetchOnboardingViewEpic, fetchOpExByVendorEpic, fetchOpExByVendorReportForTimeframeEpic, fetchOpExByVendorReportSummaryEpic, fetchOpExClassesViewEpic, fetchOpExEpic, fetchOpExForTimeframeClassesViewEpic, fetchOpExReportForTimeframeEpic, fetchOpExWithForecastEpic, fetchOwnerListEpic, fetchParentSubsidiaryManagementViewEpic, fetchPaymentAccountBalanceEpic, fetchPaymentAccountListEpic, fetchPaymentSourcesEpic, fetchPeopleEpic, fetchPeoplePageEpic, fetchPortfolioViewEpic, fetchPreviousBillsEpic, fetchProfitAndLossClassesViewEpic, fetchProfitAndLossEpic, fetchProfitAndLossForTimeframeClassesViewEpic, fetchProfitAndLossForTimeframeProjectViewEpic, fetchProfitAndLossForTimeframeEpic, fetchProfitAndLossProjectViewEpic, fetchProjectListEpic, fetchQBOConnectionPoolEpic, fetchRecommendationByEntityIdEpic, fetchRecommendationByEntityNameEpic, fetchRecommendationForAccountSettingsEpic, fetchRecommendationForAccountTypeEpic, fetchRecommendationsAndUpdateMerchantRecommendationsEpic, fetchRecommendedTransactionRowIndexEpic, fetchReferralsEpic, fetchReimbursementCardEpic, fetchReimbursementConfigEpic, fetchRemiAndInitializeLocalStoreEpic, fetchRemiApproversDetailsEpic, fetchRemiApproversListEpic, fetchRemiDetailEpic, fetchRemiListEpic, fetchRemiListPerTabEpic, fetchRemiSetupApproverViewEpic, fetchRemiSetupViewEpic, fetchRevenueClassesViewEpic, fetchRevenueEpic, fetchRevenueForTimeframeClassesViewEpic, fetchRevenueForTimeframeEpic, fetchRevenueWithForecastEpic, fetchReviewCompanyViewEpic, fetchReviewTransferDetailEpic, fetchRewardsPlanEpic, fetchScheduleAccruedDetailsEpic, fetchScheduleAccruedDetailsPageEpic, fetchScheduleDetailsEpic, fetchScheduleDetailsPageEpic, fetchScheduleListEpic, fetchSchedulesAccountEpic, fetchSubscriptionAddOnsEpic, fetchSubscriptionCouponsEpic, fetchSubscriptionCreateEstimateEpic, fetchSubscriptionDetailsEpic, fetchSubscriptionListEpic, fetchSubscriptionPlansEpic, fetchSubscriptionSummaryForTenantEpic, fetchSubscriptionUpdateEstimateEpic, fetchSubscriptionViewEpic, fetchSuggestedQuestionsEpic, fetchTaskDetailEpic, fetchTaskDetailPageEpic, fetchTaskGroupTemplatesEpic, fetchTaskHistoryEpic, fetchTaskListEpic, fetchTaskListPageEpic, fetchTasksCardEpic, fetchTopExEpic, fetchTransactionActivityLogEpic, fetchTransactionDetailEpic, fetchTransactionListByAccountEpic, fetchTransactionListByClassEpic, fetchTransactionListByProjectEpic, fetchTransactionListByEntityEpic, fetchTransactionsForEntityEpic, fetchTransactionsListByCategoryTypeEpic, fetchTransferAccountsEpic, fetchTreasuryDetailEpic, fetchTreasuryFundsEpic, fetchTreasuryHistoryEpic, fetchTreasurySetupViewEpic, fetchTreasuryStatementListEpic, fetchTreasuryTaxLetterListEpic, fetchTreasuryTransactionListEpic, updatePortfolioAllocationEpic, fetchPortfolioAllocationEpic, fetchTrendForEntityEpic, fetchUserDetailEpic, fetchUserFinancialAccountEpic, fetchUserListByTypeEpic, fetchUserRoleConfigEpic, fetchVendor1099TypeListEpic, fetchVendorAndUpdateBillLocalDataEpic, fetchVendorByNameAndParseInvoiceEpic, fetchVendorDetailsEpic, fetchVendorEpic, fetchVendorFirstReviewAttachmentsEpic, fetchVendorFirstReviewViewEpic, fetchVendorGlobalReviewViewEpic, fetchVendorsFiling1099AllEpic, fetchVendorsFiling1099DownloadEpic, fetchVendorsFiling1099ListEpic, fetchVendorsListEpic, fetchVendorsTabVendorDetailPageViewEpic, fetchVendorsTabVendorDetailsEpic, fetchVendorsTabVendorEpic, fetchVendorTabViewEpic, fetchVendorTypeListEpic, fetchZeniAccountListEpic, fetchZeniAccountsConfigEpic, fetchZeniAccountSetupViewEpic, fetchZeniAccountsPromoCardEpic, fetchZeniAccStatementListEpic, fetchZeniAccStatementPageEpic, fetchZeniUsersEpic, getOnboardingEmailGroupEpic, getOnboardingPlaidLinkTokenEpic, getPaymentAccountsEpic, getPlaidLinkTokenEpic, ignoreExpenseAutomationJEScheduleEpic, improveUsingZeniGPTEpic, initialiseExpenseAutomationReconciliationLocalDataForSelectedAccountIdEpic, initializeAccountMappingViewEpic, initializeAccountSettingsViewEpic, initializeBillPaySetupApproverViewUpdateDataEpic, initializeBillToLocalStoreEpic, initializeCardUserOnboardingLocalDataEpic, initializeCompanyHealthMetricViewLocalDataEpic, initializeDynamicFormEpic, initializeEditPersonEpic, initializeExpenseAutomationJeScheduleLocalDataEpic, initializeInternationalWireLocalDataEpic, initializeIntlVerificationFormEpic, initializeMyProfileLocalDataEpic, initializeOnboardingCustomerViewUpdateDataEpic, initializeRemiSetupApproverViewUpdateDataEpic, initializeRemiToLocalStoreEpic, initializeScheduleAccruedDetailLocalDataEpic, initializeScheduleDetailLocalDataEpic, initializeSubscriptionLocalDataEpic, initializeTaskToLocalStoreEpic, initializeTransactionDetailLocalDataEpic, initializeVendorAddressEpic, initiateChargeCardRepaymentEpic, invitePeopleEpic, inviteZeniPeopleEpic, issueChargeCardEpic, lockChargeCardEpic, lockChargeCardsEpic, markAsCompleteScheduleDetailEpic, markTransactionAsNotMiscategorizedEpic, notifyMeForFeatureEpic, parallelFetchAccountTransactionListEpic, parallelFetchClassTransactionListEpic, parallelFetchProjectTransactionListEpic, parallelFetchEntityTransactionListEpic, parallelFetchTransactionListByCategoryTypeEpic, parseInvoiceToBillEpic, parseReceiptsToRemiEpic, peopleSaveUpdatesEpic, pushToastNotificationEpic, refreshExpenseAutomationCurrentTabEpic, refreshIntegrationsDataEpic, rejectVendorGlobalReviewEpic, resendCardInviteEpic, resendInviteEpic, resendOtpEpic, resendVerifyDeviceOTPEpic, resendReferralInviteEpic, resetTransactionVendorLocalDataEpic, resetVendorDetailLocalDataEpic, resetVendorsTabVendorDetailLocalDataEpic, retryBankAccountConnectionEpic, retryBankAccountConnectionForOnboardingEpic, retryExpenseAutomationJEScheduleEpic, retryOrRefundBillEpic, validateBillsBulkActionEpic, reviewDraftRemisBulkActionEpic, reviewExpenseAutomationFluxAnalysisViewEpic, revokeCardInviteEpic, revokeChargeCardsInviteEpic, saveAccountMappingViewEpic, saveAccountSettingsViewEpic, saveAPIKeyConnectionEpic, saveBillDetailEpic, saveBillPaySetupApproverViewUpdatesEpic, saveCardOnboardingUserDetailsEpic, saveCompanyBillingAddressEpic, saveCompanyHealthMetricByIdEpic, saveCompanyMonthEndReportEpic, saveCompanyPassportDetailsEpic, saveConnectorCredentialsEpic, saveCreditAgentMacroEpic, saveExpenseAutomationReconciliationDetailsEpic, saveExpenseAutomationReconciliationReviewEpic, saveExternalConnectionEpic, saveMagicLinkBankAccountEpic, saveNewAddressEpic, saveNotificationSettingsEpic, saveOAuthConnectionEpic, saveOnboardingCustomerCompletedStatusEpic, saveOnboardingCustomerNotesEpic, saveOnboardingCustomerViewUpdatesEpic, saveRealTimeApprovalEpic, saveReasonForAuditRuleEpic, saveRemiDetailEpic, saveRemiSetupApproverViewUpdatesEpic, saveScheduleAccruedDetailsEpic, saveScheduleDetailsEpic, saveSubscriptionNotesUpdatesEpic, saveSubscriptionUpdatesEpic, saveTaskDetailEpic, saveTransactionDetailEpic, saveTransactionVendorEpic, saveVendorDetailsViewEpic, saveVendorEpic, saveVendorFirstReviewViewEpic, saveVendorsTabVendorEpic, scheduleTenantCreditScoreCronEpic, sendCompanyMonthEndReportEpic, sendOnboardingCustomerViewInviteEpic, sendOtpEpic, sendReferralInviteEpic, statementCloseDayEpic, stopSubmitEpic, stopSubmitQuestionEpic, submitDraftBillsBulkActionEpic, submitDraftRemisBulkActionEpic, submitExpressPayEpic, submitIntlVerificationEpic, submitQuestionEpic, toggleReportUIOptionForecastModeEpic, transferMoneyEpic, treasuryTransferMoneyEpic, triggerAiAccountantJobEpic, triggerReviewTabRefetchEpic, unlinkPaymentAccountEpic, unlockChargeCardEpic, unlockChargeCardsEpic, updateAccruedJESchedulesEpic, updateAddressEpic, updateAmountsInScheduleAccruedDetailEpic, updateAmountsInScheduleDetailEpic, updateAutoTransferRuleEpic, updateBusinessVerificationDetailsEpic, updateCardProfileEpic, updateChargeCardDetailEpic, updateChargeCardLimitEpic, updateChargeCardNameEpic, updateChargeCardsLimitEpic, updateAccountingClassesEnabledEpic, dismissCapitalizationOnboardingEpic, updateCapitalizationThresholdEpic, updateCompanyDetailsEpic, updateCompanyOfficerEpic, updateCompanyPassportLocalStoreDataEpic, updateDashboardLayoutEpic, updateDebitCardPinAttemptEpic, updateDepositAccountEpic, updateExpenseAutomationReconciliationBalanceLocalDataEpic, updateFileNameEpic, updateFilesMetadataEpic, updateJESchedulesEpic, updateMappedCashAccountEpic, updateMileageDetailsEpic, updateMyProfileEpic, updateNetBurnOrIncomeStoryCardSettingsEpic, updateNotificationViewAllNotificationsStatusEpic, updateNotificationViewNotificationStatusEpic, updateOnboardingCustomerViewCompleteStatusEpic, updateOnboardingCustomerViewDashboardLoadedEpic, updateOnboardingCustomerViewEpic, updateOnboardingCustomerViewLocalStoreDataEpic, updateOnboardingPaymentAccountLoginStatusEpic, updateOnboardingPaymentAccountStatusEpic, updatePaymentAccountEpic, updatePaymentAccountLoginStatusEpic, updatePaymentAccountStatusEpic, updatePhysicalChargeCardAttemptEpic, updatePrimaryContactEpic, updatePrimaryFundingAccountEpic, updateQBOConnectionPoolExternalConnectionEpic, updateReferViewedEpic, updateRemiSetupViewLocalStoreDataEpic, updateReportUIOptionCOABalancesRangeEpic, updateReportUIOptionIsCompareModeEpic, updateReportUIOptionIsCompareModeOnEpic, updateReportUIOptionThisPeriodEpic, updateReportUIOptionTimeFrameEpic, updateSectionAccountsViewEpic, updateSectionClassesViewEpicV2, updateSectionProjectViewEpic, updateSelectedVendorForCreateFlowEpic, updateSetupViewLocalStoreDataEpic, updateTaskFromListViewEpic, updateTaskGroupNameEpic, fetchCannedResponsesEpic, saveCannedResponseEpic, deleteCannedResponseEpic, updateTransactionDetailEpic, updateTreasuryPromoIntroClosedByOutsideClickEpic, updateTreasuryPromoRemindMeLaterClickedEpic, updateTreasuryVideoViewedEpic, updateVendorContactEpic, uploadAccountStatementEpic, uploadMissingAttachmentSuccessEpic, uploadMissingReceiptSuccessEpic, uploadTransactionReceiptSuccessEpic, vendorFiling1099UploadDetailsSaveEpic, verifyOtpEpic, verifyUserEpic, waitForBillDetailThenInitializeLocalStoreEpic, waitForForecastListThenFetchNetBurnOrIncomeWithForecastEpic, waitForForecastListThenFetchOpExWithForecastEpic, waitForForecastListThenFetchRevenueWithForecastEpic, waitForMerchantRecommendationFetchThenUpdateRecommendationInMerchantEpic, waitForVendorByIdThenSaveBillUpdatetoLocalStoreEpic, waitForVendorByNameThenParsetoLocalStoreEpic, waitForVendorByNameThenUpdateBillDetailEpic, waitForVendorRecommendationFetchThenUpdateRecommendationInBillEpic, wiseRedirectEpic);
614
+ const combinedEpics = combineEpics(acceptBillPayTermsEpic, acceptBillPayUpdatedTermsEpic, acceptChargeCardTermsEpic, acceptEmployeeRemiTermsEpic, acceptMasterTOSEpic, acceptRemiTermsEpic, acceptTreasuryTermsEpic, acceptZeniAccountTermsEpic, addCardPaymentSourceEpic, approveOAuthConsentEpic, approveOrRejectBillEpic, approveOrRejectBillsBulkActionEpic, approveOrRejectRemiEpic, approveOrRejectRemisBulkActionEpic, approveVendorGlobalReviewEpic, archiveTaskEpic, backgroundRefetchReviewTabEpic, bulkUpdateTaskListEpic, cancelAiAccountantOnboardingEpic, cancelAndDeleteBillEpic, cancelAndDeleteRemiEpic, cancelOrDeleteBillsBulkActionEpic, cancelOrDeleteRemisBulkActionEpic, cancelScheduleAccruedJournalEntryEpic, changeZeniPersonRolesEpic, checkDepositEpic, clearAllEpic, closeChargeCardEpic, closeChargeCardsEpic, companyManagementSavePendingUpdatesEpic, companyManagementSaveUpdatesEpic, confirmCardSetupIntentEpic, convertAmountToHomeCurrencyEpic, createAddressEpic, createAutoTransferRuleEpic, createBankAccountEpic, createCardSetupIntentEpic, createCheckingAccountEpic, createCompanyAddressEpic, createCompanyOfficersEpic, createCompanyUserAddressEpic, createGlobalMerchantEpic, createInternationalBankAccountEpic, createNewSchedulesAccruedEpic, createNewSchedulesEpic, createNewTaskGroupEpic, createPaymentInstrumentEpic, createSessionAndSubmitEpic, createSessionEpic, createTagEpic, createTaskFromTaskGroupTemplateEpic, createTransferEntryEpic, createUserBankAccountEpic, deleteAccountStatementEpic, deleteAutoTransferRuleEpic, excludeAccountFromReconciliationEpic, includeAccountInReconciliationEpic, deleteBankAccountEpic, deleteBillEpic, deleteChatSessionEpic, deleteConnectionEpic, deleteBillPayApprovalRuleEpic, reorderBillPayApprovalRulesEpic, deleteFileEpic, deleteFileListEpic, deleteInternationalBankAccountEpic, deletePaymentInstrumentEpic, deletePersonEpic, deleteRemiApprovalRuleEpic, reorderRemiApprovalRulesEpic, deleteRemiEpic, deleteScheduleAccruedDetailEpic, deleteScheduleDetailEpic, deleteTagEpic, deleteTaskEpic, snoozeTaskEpic, unsnoozeTaskEpic, deleteTaskGroupEpic, deleteTransactionAttachmentEpic, deleteUserBankAccountEpic, doMagicLinkSignInEpic, doSignInEpic, doSignOutEpic, sendEmailMagicLinkToUserEpic, sessionHeartbeatEpic, verifyDeviceWithTwoFAEpic, downloadAccountingProviderAttachmentEpic, dragNDropTasksEpic, enableChargeCardAutoPayEpic, enableSetupEpic, establishOnboardingPlaidConnectionEpic, establishPlaidConnectionEpic, expressInterestChargeCardEpic, fetchAccountListEpic, fetchAccountListForAccountTypesEpic, fetchAccountSettingsListForAccountTypesEpic, fetchAccruedScheduleListEpic, fetchActiveTenantEpic, fetchAddressEpic, fetchAiAccountantCustomersEpic, fetchAiAccountantJobsEpic, fetchAllCockpitViewsEpic, fetchAllExpenseAutomationTabsEpic, fetchAllPeopleRequiredViewsEpic, fetchAllTagsEpic, fetchAllTaskGroupsEpic, fetchAllTenantsEpic, fetchAndUpdateVendorRecommendationsEpic, fetchAggregatedReportEpic, fetchApAgingDetailEpic, fetchApAgingEpic, fetchArAgingDetailEpic, fetchArAgingEpic, fetchAuditReportGroupViewEpic, fetchAuditRuleGroupViewEpic, fetchAutoTransferReviewDetailEpic, fetchAutoTransferRuleHistoryEpic, fetchAutoTransferRulesEpic, fetchBalanceSheetEpic, fetchBalanceSheetForTimeframeEpic, fetchBankAccountsListEpic, fetchBankConnectionsViewEpic, fetchBankCountryNameByIbanEpic, fetchBankNameByRoutingEpic, fetchBankNameBySwiftEpic, fetchBillAndInitializeLocalStoreEpic, fetchBillDetailEpic, fetchBillingAccountsListEpic, fetchBillListEpic, fetchBillListPerTabEpic, fetchBillPayApproversDetailsEpic, fetchBillPayApproversListEpic, fetchBillPayCardEpic, fetchBillPayConfigEpic, fetchBillPaySetupApproverViewEpic, fetchBillPaySetupViewEpic, fetchCardBalanceEpic, archiveCardPolicyEpic, createCardPolicyTemplatesEpic, extractPolicyDocumentEpic, policyRecommendationFromUploadEpic, policyDocumentExtractionToRecommendationBridgeEpic, fetchCardPolicyDetailEpic, fetchCardPolicyListEpic, fetchCardPolicyMccCategoriesEpic, fetchCardPolicyVendorOptionsEpic, fetchCardProfilesEpic, updateCardPolicyEpic, fetchCashbackDetailEpic, fetchCashBalanceEpic, fetchCashFlowEpic, fetchCashFlowForTimeframeEpic, fetchCashInCashOutEpic, fetchCashManagementSettingsEpic, saveAutoSweepSettingsEpic, fetchCashManagementBannerEpic, fetchCashManagementOverviewPageEpic, fetchCashManagementRecommendationEpic, fetchRecentTransferEpic, fetchCashPositionEpic, fetchChargeCardConfigEpic, fetchChargeCardDetailEpic, fetchChargeCardDetailPageEpic, fetchChargeCardListEpic, fetchChargeCardListPageEpic, fetchChargeCardPaymentPageEpic, fetchChargeCardRepaymentDetailEpic, fetchChargeCardPaymentHistoryEpic, fetchChargeCardSetupViewEpic, fetchChargeCardStatementListEpic, fetchChargeCardTransactionAttachmentsEpic, fetchChargeCardTransactionListEpic, fetchChargeCardTransactionStatisticsEpic, fetchChargeCardsRecurringExpensesEpic, fetchChatHistoryEpic, fetchChatSessionsForUserEpic, fetchClassListEpic, fetchCollaborationAuthTokenEpic, fetchCockpitContextEpic, fetchCompanyBillingAddressEpic, fetchCompanyConfigEpic, fetchCompanyHealthMetricConfigEpic, fetchCompanyHealthMetricViewEpic, fetchCompanyManagementViewEpic, fetchCompanyMetaDataEpic, fetchCompanyMonthEndReportHistoricDataEpic, fetchCompanyMonthEndReportHistoricDatesEpic, fetchCompanyMonthEndReportTemplatesEpic, fetchCompanyMonthEndReportViewEpic, fetchCompanyOnboardingViewEpic, fetchCompanyPassportViewEpic, fetchCompanyPortfolioViewEpic, fetchCompanyTaskManagerViewEpic, fetchTaskManagerMetricsEpic, updateCompanyTaskManagerViewFiltersEpic, fetchCreditAccountEpic, fetchCreditAccountRepaymentEpic, fetchCreditAgentMacroEpic, fetchCurrencyConversionValueEpic, fetchDashboardEpic, fetchDashboardLayoutEpic, fetchDebitCardSummaryEpic, fetchDepositAccountDetailEpic, fetchDepositAccountEpic, fetchDepositAccountHistoryEpic, fetchDepositAccountLimitEpic, fetchDepositAccountListEpic, fetchDepositAccountListForCardsEpic, fetchDepositAccountTransactionListEpic, fetchDownloadSchedulesEpic, fetchDuplicateBillPayReviewEpic, fetchDuplicateReimbursementEpic, fetchEditBillDetailPageEpic, fetchEditRemiDetailPageEpic, fetchEligibleActionsForBillEpic, fetchEntityAutoCompleteEpic, fetchEntityHistoryEpic, fetchEntityRecommendationsByTransactionIdEpic, fetchEntityRecommendationsForLineUpdateEpic, fetchExcludedResourcesEpic, fetchExpenseAutomationFluxAnalysisViewEpic, fetchExpenseAutomationInitializeTransactionCategorizationViewLocalDataEpic, fetchExpenseAutomationJeSchedulesEpic, fetchExpenseAutomationJESchedulesPageEpic, fetchExpenseAutomationMarkTransactionAsNotMiscategorizedEpic, fetchExpenseAutomationMissingReceiptsEpic, bulkUploadReceiptsEpic, confirmBulkUploadMatchEpic, fetchBulkUploadBatchDetailsEpic, fetchMultipleBatchDetailsEpic, fetchMoreBatchDetailsEpic, fetchBulkUploadBatchesEpic, fetchCompletedTransactionsEpic, refetchCompletedTransactionsOnBulkUploadSortEpic, refreshBatchDetailsForBatchIdEpic, bulkUploadAutomatchingTimeoutEpic, bulkUploadMatchResultToastEpic, syncTabsAfterAutomatchEpic, pollBulkUploadBatchStatusEpic, pusherBatchStatusCompletionEpic, restoreBulkUploadAutomatchingOnMountEpic, searchTransactionsForManualMatchEpic, fetchExpenseAutomationReconciliationsViewEpic, fetchExpenseAutomationSaveTransactionCategorizationEpic, fetchExpenseAutomationTransactionCategorizationEpic, fetchExpenseAutomationTransactionCategorizationViewEpic, fetchExpenseAutomationUpdateTransactionCategorizationEpic, fetchExpenseTrendEpic, fetchExpressPayInitialDetailsEpic, fetchExternalConnectionsEpic, fetchFileEpic, fetchFileListEpic, fetchFinanceStatementEpic, fetchForecastListEpic, initiateReportsClassViewRefetchingEpic, reportsResyncEpic, fetchGlobalMerchantAutoCompleteViewEpic, fetchGlobalMerchantRecommendationEpic, fetchIncomeTrendEpic, fetchInsightsCardEpic, fetchInternationalWireDynamicFormEpic, fetchIntlVerificationFormEpic, fetchIssueCardPageEpic, seedAiCardCreationFormDraftEpic, seedAiCardPolicyFormDraftEpic, applyExtractedPolicyToDraftEpic, fetchMagicLinkBankNameByRoutingEpic, fetchMagicLinkBankNameBySwiftEpic, fetchMagicLinkBillEpic, fetchMagicLinkTenantEpic, fetchManagementViewEpic, fetchMerchantListEpic, fetchMonthClosePerformanceTrendEpic, fetchMonthEndCloseChecksEpic, fetchMyProfileEpic, fetchMyProfileViewEpic, fetchNetBurnOrIncomeClassesViewEpic, fetchNetBurnOrIncomeEpic, fetchNetBurnOrIncomeForTimeframeClassesViewEpic, fetchNetBurnOrIncomeForTimeframeEpic, fetchNetBurnOrIncomeStoryCardEpic, fetchNetBurnOrIncomeWithForecastEpic, fetchNotificationSettingsEpic, fetchNotificationSettingsViewEpic, fetchNotificationUnreadCountEpic, fetchNotificationViewEpic, fetchRegisteredInterestsEpic, fetchOnboardingCompletedCompaniesEpic, fetchOnboardingCustomerSetupViewEpic, fetchOnboardingCustomerViewEpic, fetchOnboardingViewEpic, fetchOpExByVendorEpic, fetchOpExByVendorReportForTimeframeEpic, fetchOpExByVendorReportSummaryEpic, fetchOpExClassesViewEpic, fetchOpExEpic, fetchOpExForTimeframeClassesViewEpic, fetchOpExReportForTimeframeEpic, fetchOpExWithForecastEpic, fetchOwnerListEpic, fetchParentSubsidiaryManagementViewEpic, fetchPaymentAccountBalanceEpic, fetchPaymentAccountListEpic, fetchPaymentSourcesEpic, fetchPeopleEpic, fetchPeoplePageEpic, fetchPortfolioViewEpic, fetchPreviousBillsEpic, fetchProfitAndLossClassesViewEpic, fetchProfitAndLossEpic, fetchProfitAndLossForTimeframeClassesViewEpic, fetchProfitAndLossForTimeframeProjectViewEpic, fetchProfitAndLossForTimeframeEpic, fetchProfitAndLossProjectViewEpic, fetchProjectListEpic, fetchQBOConnectionPoolEpic, fetchRecommendationByEntityIdEpic, fetchRecommendationByEntityNameEpic, fetchRecommendationForAccountSettingsEpic, fetchRecommendationForAccountTypeEpic, fetchRecommendationsAndUpdateMerchantRecommendationsEpic, fetchRecommendedTransactionRowIndexEpic, fetchReferralsEpic, fetchReimbursementCardEpic, fetchReimbursementConfigEpic, fetchRemiAndInitializeLocalStoreEpic, fetchRemiApproversDetailsEpic, fetchRemiApproversListEpic, fetchRemiDetailEpic, fetchRemiListEpic, fetchRemiListPerTabEpic, fetchRemiSetupApproverViewEpic, fetchRemiSetupViewEpic, fetchRevenueClassesViewEpic, fetchRevenueEpic, fetchRevenueForTimeframeClassesViewEpic, fetchRevenueForTimeframeEpic, fetchRevenueWithForecastEpic, fetchReviewCompanyViewEpic, fetchReviewTransferDetailEpic, fetchRewardsPlanEpic, fetchScheduleAccruedDetailsEpic, fetchScheduleAccruedDetailsPageEpic, fetchScheduleDetailsEpic, fetchScheduleDetailsPageEpic, fetchScheduleListEpic, fetchSchedulesAccountEpic, fetchSubscriptionAddOnsEpic, fetchSubscriptionCouponsEpic, fetchSubscriptionCreateEstimateEpic, fetchSubscriptionDetailsEpic, fetchSubscriptionListEpic, fetchSubscriptionPlansEpic, fetchSubscriptionSummaryForTenantEpic, fetchSubscriptionUpdateEstimateEpic, fetchSubscriptionViewEpic, fetchSuggestedQuestionsEpic, fetchTaskDetailEpic, fetchTaskDetailPageEpic, fetchTaskGroupTemplatesEpic, fetchTaskHistoryEpic, fetchTaskListEpic, fetchTaskListPageEpic, fetchTasksCardEpic, fetchTopExEpic, fetchTransactionActivityLogEpic, fetchTransactionDetailEpic, fetchTransactionListByAccountEpic, fetchTransactionListByClassEpic, fetchTransactionListByProjectEpic, fetchTransactionListByEntityEpic, fetchTransactionsForEntityEpic, fetchTransactionsListByCategoryTypeEpic, fetchTransferAccountsEpic, fetchTreasuryDetailEpic, fetchTreasuryFundsEpic, fetchTreasuryHistoryEpic, fetchTreasurySetupViewEpic, fetchTreasuryStatementListEpic, fetchTreasuryTaxLetterListEpic, fetchTreasuryTransactionListEpic, updatePortfolioAllocationEpic, fetchPortfolioAllocationEpic, fetchTrendForEntityEpic, fetchUserDetailEpic, fetchUserFinancialAccountEpic, fetchUserListByTypeEpic, fetchUserRoleConfigEpic, fetchVendor1099TypeListEpic, fetchVendorAndUpdateBillLocalDataEpic, fetchVendorByNameAndParseInvoiceEpic, fetchVendorDetailsEpic, fetchVendorEpic, fetchVendorFirstReviewAttachmentsEpic, fetchVendorFirstReviewViewEpic, fetchVendorGlobalReviewViewEpic, fetchVendorsFiling1099AllEpic, fetchVendorsFiling1099DownloadEpic, fetchVendorsFiling1099ListEpic, fetchVendorsListEpic, fetchVendorsTabVendorDetailPageViewEpic, fetchVendorsTabVendorDetailsEpic, fetchVendorsTabVendorEpic, fetchVendorTabViewEpic, fetchVendorTypeListEpic, fetchZeniAccountListEpic, fetchZeniAccountsConfigEpic, fetchZeniAccountSetupViewEpic, fetchZeniAccountsPromoCardEpic, fetchZeniAccStatementListEpic, fetchZeniAccStatementPageEpic, fetchZeniUsersEpic, getOnboardingEmailGroupEpic, getOnboardingPlaidLinkTokenEpic, getPaymentAccountsEpic, getPlaidLinkTokenEpic, ignoreExpenseAutomationJEScheduleEpic, improveUsingZeniGPTEpic, initialiseExpenseAutomationReconciliationLocalDataForSelectedAccountIdEpic, initializeAccountMappingViewEpic, initializeAccountSettingsViewEpic, initializeBillPaySetupApproverViewUpdateDataEpic, initializeBillToLocalStoreEpic, initializeCardUserOnboardingLocalDataEpic, initializeCompanyHealthMetricViewLocalDataEpic, initializeDynamicFormEpic, initializeEditPersonEpic, initializeExpenseAutomationJeScheduleLocalDataEpic, initializeInternationalWireLocalDataEpic, initializeIntlVerificationFormEpic, initializeMyProfileLocalDataEpic, initializeOnboardingCustomerViewUpdateDataEpic, initializeRemiSetupApproverViewUpdateDataEpic, initializeRemiToLocalStoreEpic, initializeScheduleAccruedDetailLocalDataEpic, initializeScheduleDetailLocalDataEpic, initializeSubscriptionLocalDataEpic, initializeTaskToLocalStoreEpic, initializeTransactionDetailLocalDataEpic, initializeVendorAddressEpic, initiateChargeCardRepaymentEpic, invitePeopleEpic, inviteZeniPeopleEpic, issueChargeCardEpic, lockChargeCardEpic, lockChargeCardsEpic, markAsCompleteScheduleDetailEpic, markTransactionAsNotMiscategorizedEpic, notifyMeForFeatureEpic, parallelFetchAccountTransactionListEpic, parallelFetchClassTransactionListEpic, parallelFetchProjectTransactionListEpic, parallelFetchEntityTransactionListEpic, parallelFetchTransactionListByCategoryTypeEpic, parseInvoiceToBillEpic, parseReceiptsToRemiEpic, peopleSaveUpdatesEpic, pushToastNotificationEpic, refreshExpenseAutomationCurrentTabEpic, refreshIntegrationsDataEpic, rejectVendorGlobalReviewEpic, resendCardInviteEpic, resendInviteEpic, resendOtpEpic, resendVerifyDeviceOTPEpic, resendReferralInviteEpic, resetTransactionVendorLocalDataEpic, resetVendorDetailLocalDataEpic, resetVendorsTabVendorDetailLocalDataEpic, retryBankAccountConnectionEpic, retryBankAccountConnectionForOnboardingEpic, retryExpenseAutomationJEScheduleEpic, retryOrRefundBillEpic, validateBillsBulkActionEpic, reviewDraftRemisBulkActionEpic, reviewExpenseAutomationFluxAnalysisViewEpic, revokeCardInviteEpic, revokeChargeCardsInviteEpic, saveAccountMappingViewEpic, saveAccountSettingsViewEpic, saveAPIKeyConnectionEpic, saveBillDetailEpic, saveBillPaySetupApproverViewUpdatesEpic, saveCardOnboardingUserDetailsEpic, saveCompanyBillingAddressEpic, saveCompanyHealthMetricByIdEpic, saveCompanyMonthEndReportEpic, saveCompanyPassportDetailsEpic, saveConnectorCredentialsEpic, saveCreditAgentMacroEpic, saveExpenseAutomationReconciliationDetailsEpic, saveExpenseAutomationReconciliationReviewEpic, saveExternalConnectionEpic, saveMagicLinkBankAccountEpic, saveNewAddressEpic, saveNotificationSettingsEpic, saveOAuthConnectionEpic, saveOnboardingCustomerCompletedStatusEpic, saveOnboardingCustomerNotesEpic, saveOnboardingCustomerViewUpdatesEpic, saveRealTimeApprovalEpic, saveReasonForAuditRuleEpic, saveRemiDetailEpic, saveRemiSetupApproverViewUpdatesEpic, saveScheduleAccruedDetailsEpic, saveScheduleDetailsEpic, saveSubscriptionNotesUpdatesEpic, saveSubscriptionUpdatesEpic, createSubTaskEpic, fetchSubTasksEpic, saveTaskDetailEpic, saveTransactionDetailEpic, saveTransactionVendorEpic, saveVendorDetailsViewEpic, saveVendorEpic, saveVendorFirstReviewViewEpic, saveVendorsTabVendorEpic, scheduleTenantCreditScoreCronEpic, sendCompanyMonthEndReportEpic, sendOnboardingCustomerViewInviteEpic, sendOtpEpic, sendReferralInviteEpic, statementCloseDayEpic, stopSubmitEpic, stopSubmitQuestionEpic, submitDraftBillsBulkActionEpic, submitDraftRemisBulkActionEpic, submitExpressPayEpic, submitIntlVerificationEpic, submitQuestionEpic, toggleReportUIOptionForecastModeEpic, transferMoneyEpic, treasuryTransferMoneyEpic, triggerAiAccountantJobEpic, triggerReviewTabRefetchEpic, unlinkPaymentAccountEpic, unlockChargeCardEpic, unlockChargeCardsEpic, updateAccruedJESchedulesEpic, updateAddressEpic, updateAmountsInScheduleAccruedDetailEpic, updateAmountsInScheduleDetailEpic, updateAutoTransferRuleEpic, updateBusinessVerificationDetailsEpic, updateCardProfileEpic, updateChargeCardDetailEpic, updateChargeCardLimitEpic, updateChargeCardNameEpic, updateChargeCardsLimitEpic, updateAccountingClassesEnabledEpic, dismissCapitalizationOnboardingEpic, updateCapitalizationThresholdEpic, updateCompanyDetailsEpic, updateCompanyOfficerEpic, updateCompanyPassportLocalStoreDataEpic, updateDashboardLayoutEpic, updateDebitCardPinAttemptEpic, updateDepositAccountEpic, updateExpenseAutomationReconciliationBalanceLocalDataEpic, updateFileNameEpic, updateFilesMetadataEpic, updateJESchedulesEpic, updateMappedCashAccountEpic, updateMileageDetailsEpic, updateMyProfileEpic, updateNetBurnOrIncomeStoryCardSettingsEpic, updateNotificationViewAllNotificationsStatusEpic, updateNotificationViewNotificationStatusEpic, updateOnboardingCustomerViewCompleteStatusEpic, updateOnboardingCustomerViewDashboardLoadedEpic, updateOnboardingCustomerViewEpic, updateOnboardingCustomerViewLocalStoreDataEpic, updateOnboardingPaymentAccountLoginStatusEpic, updateOnboardingPaymentAccountStatusEpic, updatePaymentAccountEpic, updatePaymentAccountLoginStatusEpic, updatePaymentAccountStatusEpic, updatePhysicalChargeCardAttemptEpic, updatePrimaryContactEpic, updatePrimaryFundingAccountEpic, updateQBOConnectionPoolExternalConnectionEpic, updateReferViewedEpic, updateRemiSetupViewLocalStoreDataEpic, updateReportUIOptionCOABalancesRangeEpic, updateReportUIOptionIsCompareModeEpic, updateReportUIOptionIsCompareModeOnEpic, updateReportUIOptionThisPeriodEpic, updateReportUIOptionTimeFrameEpic, updateSectionAccountsViewEpic, updateSectionClassesViewEpicV2, updateSectionProjectViewEpic, updateSelectedVendorForCreateFlowEpic, updateSetupViewLocalStoreDataEpic, updateTaskFromListViewEpic, updateTaskGroupNameEpic, fetchCannedResponsesEpic, saveCannedResponseEpic, deleteCannedResponseEpic, updateTransactionDetailEpic, updateTreasuryPromoIntroClosedByOutsideClickEpic, updateTreasuryPromoRemindMeLaterClickedEpic, updateTreasuryVideoViewedEpic, updateVendorContactEpic, uploadAccountStatementEpic, uploadMissingAttachmentSuccessEpic, uploadMissingReceiptSuccessEpic, uploadTransactionReceiptSuccessEpic, vendorFiling1099UploadDetailsSaveEpic, verifyOtpEpic, verifyUserEpic, waitForBillDetailThenInitializeLocalStoreEpic, waitForForecastListThenFetchNetBurnOrIncomeWithForecastEpic, waitForForecastListThenFetchOpExWithForecastEpic, waitForForecastListThenFetchRevenueWithForecastEpic, waitForMerchantRecommendationFetchThenUpdateRecommendationInMerchantEpic, waitForVendorByIdThenSaveBillUpdatetoLocalStoreEpic, waitForVendorByNameThenParsetoLocalStoreEpic, waitForVendorByNameThenUpdateBillDetailEpic, waitForVendorRecommendationFetchThenUpdateRecommendationInBillEpic, wiseRedirectEpic);
611
615
  const rootEpic = (action$, store$, dependencies) => combinedEpics(action$, store$, dependencies).pipe(map(identity), catchError((error, source) => {
612
616
  console.error(error);
613
617
  return source;
package/lib/esm/index.js CHANGED
@@ -33,6 +33,8 @@ import { getAccountGroupKey, toAccountGroupType, } from './entity/accountGroup/a
33
33
  import { getAccountReconByAccountIdAndSelectedPeriod, } from './entity/accountRecon/accountReconSelector';
34
34
  import { getAddressByAddressId } from './entity/address/addressSelector';
35
35
  import { toAttributeOrRoleTypeStrict, toAttributeTypeStrict, toRoleTypeStrict, } from './entity/approvalRule/approvalRuleState';
36
+ import { getAmountCriteria, getApprovalRulesByEntityType, getDepartmentCriteria, getFallbackApprovalRule, getVendorCriteria, } from './entity/approvalRule/approvalRuleSelector';
37
+ import { detectRuleOverlap, } from './entity/approvalRule/approvalRuleConflict';
36
38
  import { toOutsideZeniPaymentModeType, } from './entity/billPay/billTransaction/billTransactionState';
37
39
  import { toRecurringBillFrequency, toRecurringBillFrequencyStrict, } from './entity/billPay/recurringBills/recurringBillsState';
38
40
  import { toCardAddressType, toCardType, toCreditLimitFrequencyCodeType, toShippingAddressType, } from './entity/chargeCard/chargeCard';
@@ -278,7 +280,7 @@ import { getInternationalSubConfigCodeKey } from './view/spendManagement/billPay
278
280
  import { BILL_NEW_PAYMENT_METHODS, LOCAL_CURRENCY_INTERNATIONAL_METHOD_SUBTEXT, NEW_INTERNATIONAL_METHOD_SUBTEXT, SWIFT_OUR_INTERNATIONAL_METHOD_SUBTEXT, } from './view/spendManagement/billPay/billPayConfig/billPayConfigState';
279
281
  import { clearBillPayReview, fetchDuplicateBill, } from './view/spendManagement/billPay/billPayReview/billPayReviewReducer';
280
282
  import { getReviewPageBillDetail, } from './view/spendManagement/billPay/billPayReview/billPayReviewSelector';
281
- import { clearBillPaySetupApproverView, clearBillPaySetupApproverViewUpdateData, deleteBillPayApprovalRule, fetchBillPayApproversDetails, fetchBillPayApproversList, fetchBillPaySetupApproverView, initializeBillPaySetupApproverViewUpdateData, saveBillPaySetupApproverViewUpdateData, saveBillPaySetupApproverViewUpdates, setListeningToPusherEvent as setBillsSetupApproverViewListeningToPusherEvent, } from './view/spendManagement/billPay/billPaySetupApproverView/billPaySetupApproverViewReducer';
283
+ import { clearBillPaySetupApproverView, clearBillPaySetupApproverViewUpdateData, deleteBillPayApprovalRule, fetchBillPayApproversDetails, fetchBillPayApproversList, fetchBillPaySetupApproverView, initializeBillPaySetupApproverViewUpdateData, reorderBillPayApprovalRules, saveBillPaySetupApproverViewUpdateData, saveBillPaySetupApproverViewUpdates, setListeningToPusherEvent as setBillsSetupApproverViewListeningToPusherEvent, } from './view/spendManagement/billPay/billPaySetupApproverView/billPaySetupApproverViewReducer';
282
284
  import { getBillPaySetupApproverUpdateDataView, getBillPaySetupApproverView, } from './view/spendManagement/billPay/billPaySetupApproverView/billPaySetupApproverViewSelector';
283
285
  import { acceptBillPayTerms, acceptBillPayUpdatedTerms, clearBillPaySetupView, fetchBillPaySetupView, } from './view/spendManagement/billPay/billPaySetupView/billPaySetupViewReducer';
284
286
  import { getBillPayBusinessVerificationDetails, getBillPaySetupViewDetails, } from './view/spendManagement/billPay/billPaySetupView/billPaySetupViewSelector';
@@ -336,7 +338,7 @@ import { getRemiDownloadList, } from './view/spendManagement/reimbursement/remiL
336
338
  import { fetchRemiList, fetchRemiListPerTab, updateRemiDetailSaveRemiCode, updateRemiListDownloadUIState, updateFilterResult as updateRemiListFilterResult, updateSearchResult as updateRemiListSearchResult, updateSubTab as updateRemiListSubTab, updateTab as updateRemiListTab, updateRemiListUIState, } from './view/spendManagement/reimbursement/remiListView/remiListReducer';
337
339
  import { getRemiList, } from './view/spendManagement/reimbursement/remiListView/remiListSelector';
338
340
  import { REIMBURSEMENT_FILTER_CATEGORIES, REIMBURSEMENT_FILTER_CATEGORIES_RESTRICTED, toRemiSubTabType, toRemiSubTabTypeStrict, toRemiTabType, toRemiTabTypeStrict, } from './view/spendManagement/reimbursement/remiListView/remiListState';
339
- import { clearRemiSetupApproverView, clearRemiSetupApproverViewUpdateData, deleteRemiApprovalRule, fetchRemiApproversDetails, fetchRemiApproversList, fetchRemiSetupApproverView, initializeRemiSetupApproverViewUpdateData, saveRemiSetupApproverViewUpdateData, saveRemiSetupApproverViewUpdates, setListeningToPusherEvent as setRemiSetupApproverViewListeningToPusherEvent, } from './view/spendManagement/reimbursement/remiSetupApproverView/remiSetupApproverViewReducer';
341
+ import { clearRemiSetupApproverView, clearRemiSetupApproverViewUpdateData, deleteRemiApprovalRule, fetchRemiApproversDetails, fetchRemiApproversList, fetchRemiSetupApproverView, initializeRemiSetupApproverViewUpdateData, reorderRemiApprovalRules, saveRemiSetupApproverViewUpdateData, saveRemiSetupApproverViewUpdates, setListeningToPusherEvent as setRemiSetupApproverViewListeningToPusherEvent, } from './view/spendManagement/reimbursement/remiSetupApproverView/remiSetupApproverViewReducer';
340
342
  import { getRemiSetupApproverUpdateDataView, getRemiSetupApproverView, } from './view/spendManagement/reimbursement/remiSetupApproverView/remiSetupApproverViewSelector';
341
343
  import { acceptEmployeeRemiTerms, acceptRemiTerms, clearRemiSetupView, fetchRemiSetupView, saveRemiSetupViewDataInLocalStore, updateMileageDetails, } from './view/spendManagement/reimbursement/remiSetupView/remiSetupViewReducer';
342
344
  import { getRemiBusinessVerificationDetails, getRemiSetupViewDetails, } from './view/spendManagement/reimbursement/remiSetupView/remiSetupViewSelector';
@@ -372,7 +374,7 @@ import { getAllTags } from './view/tagView/tagViewSelector';
372
374
  import { deleteCannedResponse, fetchCannedResponses, saveCannedResponse, } from './view/taskManager/cannedResponsesView/cannedResponsesReducer';
373
375
  import { getCannedResponsesView } from './view/taskManager/cannedResponsesView/cannedResponsesSelector';
374
376
  import { initialTaskDetail, initialTaskDetailLocalData, } from './view/taskManager/taskDetailView/taskDetail';
375
- import { archiveTask, deleteTask, discardTaskUpdatesInLocalStore, fetchTaskDetailPage, saveTaskDetail, saveTaskUpdatesToLocalStore, snoozeTask, unsnoozeTask, } from './view/taskManager/taskDetailView/taskDetailReducer';
377
+ import { archiveTask, createSubTask, deleteTask, discardTaskUpdatesInLocalStore, fetchSubTasks, fetchTaskDetailPage, resetSubTaskCreateStatus, saveTaskDetail, saveTaskUpdatesToLocalStore, snoozeTask, unsnoozeTask, } from './view/taskManager/taskDetailView/taskDetailReducer';
376
378
  import { allTaskPriority, allTaskStatus, getTaskDetail, } from './view/taskManager/taskDetailView/taskDetailSelector';
377
379
  import { createTaskFromTaskGroupTemplate } from './view/taskManager/taskGroupTemplateView/taskGroupTemplateViewReducer';
378
380
  import { createNewTaskGroup, deleteTaskGroup, fetchAllTaskGroups, updateTaskGroupName, } from './view/taskManager/taskGroupView/taskGroupViewReducer';
@@ -575,9 +577,9 @@ export { getUserFinancialAccount };
575
577
  export { fetchRemiSetupView, updateMileageDetails, saveRemiSetupViewDataInLocalStore, acceptRemiTerms, acceptEmployeeRemiTerms, clearRemiSetupView, getRemiSetupViewDetails, getRemiBusinessVerificationDetails, };
576
578
  export { VERIFIED_PAYMENT_ACCOUNT_PROVIDER_VERIFICATION_STATUS, };
577
579
  export { isSuccessResponse, isInvalidSessionError, isAccessDeniedError, };
578
- export { toAttributeTypeStrict, toAttributeOrRoleTypeStrict, toRoleTypeStrict, };
579
- export { getBillPaySetupApproverView, getBillPaySetupApproverUpdateDataView, fetchBillPaySetupApproverView, fetchBillPayApproversDetails, fetchBillPayApproversList, deleteBillPayApprovalRule, saveBillPaySetupApproverViewUpdateData, saveBillPaySetupApproverViewUpdates, setBillsSetupApproverViewListeningToPusherEvent, initializeBillPaySetupApproverViewUpdateData, clearBillPaySetupApproverViewUpdateData, clearBillPaySetupApproverView, };
580
- export { getRemiSetupApproverView, getRemiSetupApproverUpdateDataView, fetchRemiSetupApproverView, fetchRemiApproversList, fetchRemiApproversDetails, deleteRemiApprovalRule, saveRemiSetupApproverViewUpdateData, saveRemiSetupApproverViewUpdates, initializeRemiSetupApproverViewUpdateData, setRemiSetupApproverViewListeningToPusherEvent, clearRemiSetupApproverViewUpdateData, clearRemiSetupApproverView, };
580
+ export { getAmountCriteria, getApprovalRulesByEntityType, getDepartmentCriteria, getFallbackApprovalRule, getVendorCriteria, toAttributeTypeStrict, toAttributeOrRoleTypeStrict, toRoleTypeStrict, detectRuleOverlap, };
581
+ export { getBillPaySetupApproverView, getBillPaySetupApproverUpdateDataView, fetchBillPaySetupApproverView, fetchBillPayApproversDetails, fetchBillPayApproversList, deleteBillPayApprovalRule, reorderBillPayApprovalRules, saveBillPaySetupApproverViewUpdateData, saveBillPaySetupApproverViewUpdates, setBillsSetupApproverViewListeningToPusherEvent, initializeBillPaySetupApproverViewUpdateData, clearBillPaySetupApproverViewUpdateData, clearBillPaySetupApproverView, };
582
+ export { getRemiSetupApproverView, getRemiSetupApproverUpdateDataView, fetchRemiSetupApproverView, fetchRemiApproversList, fetchRemiApproversDetails, deleteRemiApprovalRule, reorderRemiApprovalRules, saveRemiSetupApproverViewUpdateData, saveRemiSetupApproverViewUpdates, initializeRemiSetupApproverViewUpdateData, setRemiSetupApproverViewListeningToPusherEvent, clearRemiSetupApproverViewUpdateData, clearRemiSetupApproverView, };
581
583
  export { getRemiDetailView, checkApproveRejectBtnShowForRemi, };
582
584
  export { saveRealTimeApproval, updateIsEditModeRealTimeApprovals, };
583
585
  export { deleteRemi, fetchRemiDetail, cancelAndDeleteRemi, approveOrRejectRemi, clearRemiDetailView, fetchDuplicateReimbursement, clearDuplicateReimbursementDetail, removeDuplicateReimbursementByLineId, };
@@ -625,7 +627,7 @@ export { fetchGlobalMerchantRecommendation, createGlobalMerchant, updateCreateGl
625
627
  export { approveVendorGlobalReview, rejectVendorGlobalReview, fetchVendorGlobalReviewView, updateSelectedGlobalMerchant, updateVendorGlobalReviewViewUIState, getVendorGlobalReviewView, getTenantMerchantByMerchantId, toVendorGlobalReviewColumnSortKeyType, updateVendorGlobalReviewViewLocalData, };
626
628
  export { fetchArAging, updateArAgingUIState, fetchArAgingDetail, updateArAgingDetailUIState, getArAgingReport, getArAgingDetailForCustomer, updateArAgingNodeCollapseState, };
627
629
  export { toRecurringBillFrequency, toRecurringBillFrequencyStrict, };
628
- export { getTaskGroupById, getAllTasks, fetchTaskListPage, getTaskDetail, fetchTaskDetailPage, saveTaskUpdatesToLocalStore, saveTaskDetail, archiveTask, fetchCannedResponses, saveCannedResponse, deleteCannedResponse, getCannedResponsesView, updateTaskListSearchText, updateTaskListUIState, allTaskStatus, allTaskPriority, updateTaskFilters, TASK_LIST_FILTER_CATEGORIES, TASK_LIST_GROUP_BY_CATEGORIES, deleteTask, discardTaskUpdatesInLocalStore, bulkUpdateTaskList, createNewTaskGroup, initiateTaskListLocalData, deleteTaskGroup, updateTaskListLocalData, dragNDropTasks, updateTaskGroupName, toTaskListGroupByKeyType, toTaskListGroupByKeyTypeStrict, getTaskUpdates, fetchAllTaskGroups, initialTaskDetail, getDueDateValueFromDueDateGroupId, toPriorityCodeType, toTaskStatusCodeType, toDueDateGroupKeyType, updateTaskFromListView, updateTaskListTab, removeTaskFromList, snoozeTask, unsnoozeTask, convertHHMMStrToMinutes, initialTaskDetailLocalData, ALL_TASK_LIST_TABS, };
630
+ export { getTaskGroupById, getAllTasks, fetchTaskListPage, getTaskDetail, fetchTaskDetailPage, saveTaskUpdatesToLocalStore, saveTaskDetail, createSubTask, resetSubTaskCreateStatus, fetchSubTasks, archiveTask, fetchCannedResponses, saveCannedResponse, deleteCannedResponse, getCannedResponsesView, updateTaskListSearchText, updateTaskListUIState, allTaskStatus, allTaskPriority, updateTaskFilters, TASK_LIST_FILTER_CATEGORIES, TASK_LIST_GROUP_BY_CATEGORIES, deleteTask, discardTaskUpdatesInLocalStore, bulkUpdateTaskList, createNewTaskGroup, initiateTaskListLocalData, deleteTaskGroup, updateTaskListLocalData, dragNDropTasks, updateTaskGroupName, toTaskListGroupByKeyType, toTaskListGroupByKeyTypeStrict, getTaskUpdates, fetchAllTaskGroups, initialTaskDetail, getDueDateValueFromDueDateGroupId, toPriorityCodeType, toTaskStatusCodeType, toDueDateGroupKeyType, updateTaskFromListView, updateTaskListTab, removeTaskFromList, snoozeTask, unsnoozeTask, convertHHMMStrToMinutes, initialTaskDetailLocalData, ALL_TASK_LIST_TABS, };
629
631
  export { getAllTags, fetchTagList, createTag, deleteTag, };
630
632
  export { getAllCardsAndBankPaymentMethods, createCardSetupIntent, confirmCardSetupIntent, addCardPaymentSource, fetchPaymentSources, resetCardPaymentErrorStatuses, clearCardPaymentView, };
631
633
  export { getAuditReportGroupViewSelectorView, getAuditRuleGroupViewSelectorView, getUserFromAllUsers, fetchAuditRuleGroupView, fetchAuditReportGroupView, saveReasonForAuditRule, clearAuditReportGroupViewByCompanyId, };
@@ -52,6 +52,12 @@ export const getReviewPageBillDetail = (state, billId) => {
52
52
  let recurringConfig;
53
53
  let billPayInfo;
54
54
  let isBillMarkedForRetry = false;
55
+ // Bill-level accounting class id. Approval Rules 3.0 'department'
56
+ // criteria match against this. Sourced from BillTransaction so
57
+ // any selector that needs it (e.g. creator-as-approver lookup)
58
+ // can read it off the view rather than reaching into
59
+ // 'state.billTransactionState' itself.
60
+ let classId;
55
61
  const zeniAssistRetryStatus = billId != null
56
62
  ? billDetailViewState.billDetailById[key].zeniAssist.retryStatus
57
63
  : undefined;
@@ -62,6 +68,13 @@ export const getReviewPageBillDetail = (state, billId) => {
62
68
  transaction?.billPayInfo.isCollectToAccountInfoFromVendorContact ?? false;
63
69
  isRecurring = transaction?.isRecurring ?? false;
64
70
  billPayInfo = transaction?.billPayInfo;
71
+ // Normalise empty-string to undefined so downstream readers
72
+ // treat "no class" uniformly regardless of whether the wire
73
+ // used '' or omitted the field.
74
+ classId =
75
+ transaction?.classId != null && transaction.classId !== ''
76
+ ? transaction.classId
77
+ : undefined;
65
78
  if (isRecurring &&
66
79
  transaction?.recurringBillConfigId != null &&
67
80
  transaction.recurringBillInstance != null) {
@@ -178,5 +191,6 @@ export const getReviewPageBillDetail = (state, billId) => {
178
191
  zeniAssistRetryStatus,
179
192
  billPayInfo,
180
193
  outsideZeniPaymentInfo,
194
+ classId,
181
195
  };
182
196
  };
@@ -13,6 +13,7 @@ export const initialState = {
13
13
  newApprovalRuleId: undefined,
14
14
  approvalRulesDeleteStatusById: {},
15
15
  billPaySetupApproverViewUpdateData: undefined,
16
+ reorderStatus: { fetchState: 'Not-Started', error: undefined },
16
17
  hasValidState() {
17
18
  return this.fetchState === 'Completed';
18
19
  },
@@ -26,8 +27,13 @@ const billPaySetupApproverView = createSlice({
26
27
  draft.fetchState = 'In-Progress';
27
28
  draft.error = undefined;
28
29
  },
29
- prepare(cacheOverride = false, includeUserRoles = true) {
30
- return { payload: { cacheOverride, includeUserRoles } };
30
+ // Approval Rules 3.0 `useV3` arrives from the screen connector
31
+ // ('approval_rule_v3_config' dynamic config) and picks the v1
32
+ // vs v2 endpoint in the fetch epic. Required (no default) so a
33
+ // missing screen-connector wire surfaces at compile time rather
34
+ // than silently falling back to v1 on a v3 tenant.
35
+ prepare(cacheOverride = false, includeUserRoles = true, useV3) {
36
+ return { payload: { cacheOverride, includeUserRoles, useV3 } };
31
37
  },
32
38
  },
33
39
  fetchBillPaySetupApproverViewSuccess: {
@@ -112,8 +118,12 @@ const billPaySetupApproverView = createSlice({
112
118
  error: undefined,
113
119
  };
114
120
  },
115
- prepare(approvalRuleId) {
116
- return { payload: { approvalRuleId } };
121
+ // Approval Rules 3.0 — `useV3` flows from the screen connector
122
+ // ('approval_rule_v3_config' dynamic config) so the delete epic
123
+ // can pick the v1 vs v2 endpoint. Required (no default) so a
124
+ // missing connector wire surfaces at compile time.
125
+ prepare(approvalRuleId, useV3) {
126
+ return { payload: { approvalRuleId, useV3 } };
117
127
  },
118
128
  },
119
129
  deleteBillPayApprovalRuleSuccess: {
@@ -145,13 +155,100 @@ const billPaySetupApproverView = createSlice({
145
155
  };
146
156
  },
147
157
  },
148
- saveBillPaySetupApproverViewUpdates(draft) {
149
- if (draft.billPaySetupApproverViewUpdateData != null) {
150
- draft.billPaySetupApproverViewUpdateData.updateStatus = {
151
- fetchState: 'In-Progress',
152
- error: undefined,
153
- };
154
- }
158
+ /**
159
+ * Approval Rules 3.0 list-page drag-and-drop reorder.
160
+ *
161
+ * The trigger action carries the desired ordering as an ID list.
162
+ * The reducer optimistically replaces 'approvalRuleIds' so the
163
+ * list page renders the new order immediately; the epic then
164
+ * fires the PUT and either confirms (success — pulls updated
165
+ * priorities from the response) or recovers (failure — refetches
166
+ * the view so we don't strand a stale local order).
167
+ */
168
+ reorderBillPayApprovalRules: {
169
+ reducer(draft, action) {
170
+ const { approvalRuleIds } = action.payload;
171
+ const wasReorderInFlight = draft.reorderStatus.fetchState === 'In-Progress';
172
+ draft.reorderStatus = { fetchState: 'In-Progress', error: undefined };
173
+ // Stash the pre-reorder order so 'Failure' can restore it
174
+ // synchronously. The epic's refetch on failure remains as a
175
+ // safety net (covers cases where the server's truth has
176
+ // drifted from the local snapshot), but the snappy UX path
177
+ // is the in-memory rollback.
178
+ //
179
+ // Only capture a fresh snapshot when no reorder is already in
180
+ // flight. If a second drag fires before the first PUT lands,
181
+ // the existing snapshot already holds the last server-backed
182
+ // order; overwriting it with the first reorder's optimistic
183
+ // result would mean a Failure rolls back to an uncommitted
184
+ // intermediate order instead of the last good list.
185
+ if (!wasReorderInFlight) {
186
+ draft.reorderRollbackIds = draft.approvalRuleIds;
187
+ }
188
+ // Optimistic: render new order immediately. On failure, the
189
+ // reducer restores 'reorderRollbackIds' and the epic refetch
190
+ // reconciles any drift.
191
+ draft.approvalRuleIds = approvalRuleIds;
192
+ },
193
+ // Approval Rules 3.0 — `useV3` required so a missing wire
194
+ // surfaces at compile time. The reorder epic always hits the
195
+ // v2 endpoint (v1 has no reorder route), but the payload still
196
+ // carries the flag for the failure-path refetch which needs it.
197
+ prepare(approvalRuleIds, useV3) {
198
+ return { payload: { approvalRuleIds, useV3 } };
199
+ },
200
+ },
201
+ reorderBillPayApprovalRulesSuccess: {
202
+ reducer(draft, action) {
203
+ const { approvalRuleIds } = action.payload;
204
+ draft.reorderStatus = { fetchState: 'Completed', error: undefined };
205
+ // The API response is authoritative — overwrite with the
206
+ // server's reported order in case it normalised anything.
207
+ draft.approvalRuleIds = approvalRuleIds;
208
+ // Reorder succeeded — discard the snapshot so the next
209
+ // reorder starts from this committed order.
210
+ draft.reorderRollbackIds = undefined;
211
+ },
212
+ prepare(approvalRuleIds) {
213
+ return { payload: { approvalRuleIds } };
214
+ },
215
+ },
216
+ reorderBillPayApprovalRulesFailure: {
217
+ reducer(draft, action) {
218
+ const { status } = action.payload;
219
+ draft.reorderStatus = { fetchState: 'Error', error: status };
220
+ // Restore the snapshot taken on the trigger reducer before
221
+ // the optimistic mutation. The epic still fires a refetch
222
+ // alongside the failure action for cross-tab drift recovery,
223
+ // but locally the user sees their last good order instantly.
224
+ if (draft.reorderRollbackIds != null) {
225
+ draft.approvalRuleIds = draft.reorderRollbackIds;
226
+ draft.reorderRollbackIds = undefined;
227
+ }
228
+ },
229
+ prepare(status) {
230
+ return { payload: { status } };
231
+ },
232
+ },
233
+ saveBillPaySetupApproverViewUpdates: {
234
+ // Approval Rules 3.0 — `useV3` is sourced from the
235
+ // `approval_rule_v3_config` dynamic config in the screen
236
+ // connector. The reducer doesn't read it (the field only
237
+ // matters in the save epic), but it must be declared so the
238
+ // action's payload type is correctly inferred for downstream
239
+ // consumers.
240
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
241
+ reducer(draft, _action) {
242
+ if (draft.billPaySetupApproverViewUpdateData != null) {
243
+ draft.billPaySetupApproverViewUpdateData.updateStatus = {
244
+ fetchState: 'In-Progress',
245
+ error: undefined,
246
+ };
247
+ }
248
+ },
249
+ prepare(useV3) {
250
+ return { payload: { useV3 } };
251
+ },
155
252
  },
156
253
  saveBillPaySetupApproverViewUpdatesSuccess: {
157
254
  reducer(draft, action) {
@@ -240,5 +337,5 @@ const billPaySetupApproverView = createSlice({
240
337
  },
241
338
  },
242
339
  });
243
- export const { fetchBillPaySetupApproverView, fetchBillPaySetupApproverViewSuccess, fetchBillPaySetupApproverViewFailure, fetchBillPayApproversDetails, fetchBillPayApproversList, fetchBillPayApproversListSuccess, fetchBillPayApproversListFailure, deleteBillPayApprovalRule, deleteBillPayApprovalRuleSuccess, deleteBillPayApprovalRuleFailure, saveBillPaySetupApproverViewUpdates, saveBillPaySetupApproverViewUpdatesSuccess, saveBillPaySetupApproverViewUpdatesFailure, initializeBillPaySetupApproverViewUpdateData, saveBillPaySetupApproverViewUpdateData, clearBillPaySetupApproverViewUpdateData, setListeningToPusherEvent, clearBillPaySetupApproverView, } = billPaySetupApproverView.actions;
340
+ export const { fetchBillPaySetupApproverView, fetchBillPaySetupApproverViewSuccess, fetchBillPaySetupApproverViewFailure, fetchBillPayApproversDetails, fetchBillPayApproversList, fetchBillPayApproversListSuccess, fetchBillPayApproversListFailure, deleteBillPayApprovalRule, deleteBillPayApprovalRuleSuccess, deleteBillPayApprovalRuleFailure, reorderBillPayApprovalRules, reorderBillPayApprovalRulesSuccess, reorderBillPayApprovalRulesFailure, saveBillPaySetupApproverViewUpdates, saveBillPaySetupApproverViewUpdatesSuccess, saveBillPaySetupApproverViewUpdatesFailure, initializeBillPaySetupApproverViewUpdateData, saveBillPaySetupApproverViewUpdateData, clearBillPaySetupApproverViewUpdateData, setListeningToPusherEvent, clearBillPaySetupApproverView, } = billPaySetupApproverView.actions;
244
341
  export default billPaySetupApproverView.reducer;
@@ -6,9 +6,17 @@ import { updateAllUsers } from '../../../../../entity/user/userReducer';
6
6
  import { createZeniAPIStatus, isSuccessResponse, } from '../../../../../responsePayload';
7
7
  import { deleteBillPayApprovalRule, deleteBillPayApprovalRuleFailure, deleteBillPayApprovalRuleSuccess, } from '../billPaySetupApproverViewReducer';
8
8
  export const deleteBillPayApprovalRuleEpic = (actions$, _state$, zeniAPI) => actions$.pipe(filter(deleteBillPayApprovalRule.match), switchMap((action) => {
9
- const { approvalRuleId } = action.payload;
9
+ const { approvalRuleId, useV3 } = action.payload;
10
+ // Approval Rules 3.0 — flag-gated endpoint selection.
11
+ // Explicit `=== true` keeps `strict-boolean-expressions` happy
12
+ // when RTK's payload type widens to `any` in some configs.
13
+ const endpoint = useV3 === true
14
+ ? `${zeniAPI.apiEndPoints.approvalMicroServiceBaseUrl}/1.0/bill-pay/approval-rules-v2`
15
+ : `${zeniAPI.apiEndPoints.approvalMicroServiceBaseUrl}/1.0/bill-pay/approval-rules`;
10
16
  return zeniAPI
11
- .deleteAndGetJSON(`${zeniAPI.apiEndPoints.approvalMicroServiceBaseUrl}/1.0/bill-pay/approval-rules`, { approval_rule_id: approvalRuleId })
17
+ .deleteAndGetJSON(endpoint, {
18
+ approval_rule_id: approvalRuleId,
19
+ })
12
20
  .pipe(mergeMap((response) => {
13
21
  if (isSuccessResponse(response) && response.data != null) {
14
22
  const approvalRuleIds = response.data.approval_rules.map((approvalRule) => approvalRule.approval_rule_id);
@@ -6,7 +6,7 @@ import { updateAllUsers } from '../../../../../entity/user/userReducer';
6
6
  import { createZeniAPIStatus, isSuccessResponse, } from '../../../../../responsePayload';
7
7
  import { fetchBillPaySetupApproverView, fetchBillPaySetupApproverViewFailure, fetchBillPaySetupApproverViewSuccess, } from '../billPaySetupApproverViewReducer';
8
8
  export const fetchBillPaySetupApproverViewEpic = (actions$, state$, zeniAPI) => actions$.pipe(filter(fetchBillPaySetupApproverView.match), switchMap((action) => {
9
- const { cacheOverride } = action.payload;
9
+ const { cacheOverride, useV3 } = action.payload;
10
10
  const { billPaySetupApproverViewState, approvalRuleState } = state$.value;
11
11
  const approvalRules = getApprovalRulesByIds(approvalRuleState, billPaySetupApproverViewState.approvalRuleIds);
12
12
  if (cacheOverride === true ||
@@ -14,9 +14,13 @@ export const fetchBillPaySetupApproverViewEpic = (actions$, state$, zeniAPI) =>
14
14
  billPaySetupApproverViewState.approvalRuleIds.length ||
15
15
  (billPaySetupApproverViewState.hasValidState() === false &&
16
16
  billPaySetupApproverViewState.fetchState !== 'In-Progress')) {
17
- return zeniAPI
18
- .getJSON(`${zeniAPI.apiEndPoints.approvalMicroServiceBaseUrl}/1.0/bill-pay/approval-rules`)
19
- .pipe(mergeMap((response) => {
17
+ // Approval Rules 3.0 — flag-gated endpoint selection.
18
+ // Explicit `=== true` keeps `strict-boolean-expressions` happy
19
+ // when RTK's payload type widens to `any` in some configs.
20
+ const endpoint = useV3 === true
21
+ ? `${zeniAPI.apiEndPoints.approvalMicroServiceBaseUrl}/1.0/bill-pay/approval-rules-v2`
22
+ : `${zeniAPI.apiEndPoints.approvalMicroServiceBaseUrl}/1.0/bill-pay/approval-rules`;
23
+ return zeniAPI.getJSON(endpoint).pipe(mergeMap((response) => {
20
24
  if (isSuccessResponse(response) && response.data != null) {
21
25
  const approvalRuleIds = response.data.approval_rules.map((approvalRule) => approvalRule.approval_rule_id);
22
26
  const actions = [
@@ -1,6 +1,6 @@
1
1
  import { from } from 'rxjs';
2
2
  import { filter, mergeMap } from 'rxjs/operators';
3
- import { getApprovalRuleById } from '../../../../../entity/approvalRule/approvalRuleSelector';
3
+ import { getAmountCriteria, getApprovalRuleById, getDepartmentCriteria, getVendorCriteria, } from '../../../../../entity/approvalRule/approvalRuleSelector';
4
4
  import { clearBillPaySetupApproverViewUpdateData, initializeBillPaySetupApproverViewUpdateData, saveBillPaySetupApproverViewUpdateData, } from '../billPaySetupApproverViewReducer';
5
5
  export const initializeBillPaySetupApproverViewUpdateDataEpic = (actions$, state$) => actions$.pipe(filter(initializeBillPaySetupApproverViewUpdateData.match), mergeMap((action) => {
6
6
  const { approvalRuleId } = action.payload;
@@ -8,16 +8,20 @@ export const initializeBillPaySetupApproverViewUpdateDataEpic = (actions$, state
8
8
  if (approvalRuleId != null) {
9
9
  const approvalRule = getApprovalRuleById(state$.value.approvalRuleState, approvalRuleId);
10
10
  if (approvalRule != null) {
11
- const criteria = approvalRule.criteria[0];
12
- const range = criteria?.range;
13
11
  const billPaySetupApproverViewUpdateData = {
14
12
  approvalRuleId,
15
13
  steps: approvalRule.steps,
16
14
  criteria: {
17
- rangeType: criteria?.rangeType,
18
- rangeEntity: criteria?.rangeEntity,
19
- range,
15
+ amount: getAmountCriteria(approvalRule.criteria),
16
+ vendor: getVendorCriteria(approvalRule.criteria),
17
+ department: getDepartmentCriteria(approvalRule.criteria),
20
18
  },
19
+ // Approval Rules 3.0 — seed rule-level fields so the form can
20
+ // round-trip them on edit. Each may be undefined on legacy rules.
21
+ name: approvalRule.name,
22
+ description: approvalRule.description,
23
+ separationOfDuties: approvalRule.separationOfDuties,
24
+ isFallback: approvalRule.isFallback,
21
25
  };
22
26
  fetchActions.push(clearBillPaySetupApproverViewUpdateData(), saveBillPaySetupApproverViewUpdateData(billPaySetupApproverViewUpdateData));
23
27
  }
@@ -25,7 +29,7 @@ export const initializeBillPaySetupApproverViewUpdateDataEpic = (actions$, state
25
29
  else {
26
30
  const billPaySetupApproverViewCreateData = {
27
31
  steps: [],
28
- criteria: undefined,
32
+ criteria: {},
29
33
  };
30
34
  fetchActions.push(clearBillPaySetupApproverViewUpdateData(), saveBillPaySetupApproverViewUpdateData(billPaySetupApproverViewCreateData));
31
35
  }
@@ -0,0 +1,54 @@
1
+ import { from } from 'rxjs';
2
+ import { catchError, filter, mergeMap, switchMap } from 'rxjs/operators';
3
+ import { updateApprovalRules } from '../../../../../entity/approvalRule/approvalRuleReducer';
4
+ import { openSnackbar } from '../../../../../entity/snackbar/snackbarReducer';
5
+ import { createZeniAPIStatus, isSuccessResponse, } from '../../../../../responsePayload';
6
+ import { fetchBillPaySetupApproverView, reorderBillPayApprovalRules, reorderBillPayApprovalRulesFailure, reorderBillPayApprovalRulesSuccess, } from '../billPaySetupApproverViewReducer';
7
+ export const reorderBillPayApprovalRulesEpic = (actions$, _state$, zeniAPI) => actions$.pipe(filter(reorderBillPayApprovalRules.match), switchMap((action) => {
8
+ const { approvalRuleIds, useV3 } = action.payload;
9
+ // Approval Rules 3.0 — flag-gated endpoint selection. Mirrors
10
+ // the pattern used by delete + fetch epics: the v3 dev host
11
+ // until the production base URL ships the v2 reorder route.
12
+ const endpoint = `${zeniAPI.apiEndPoints.approvalMicroServiceBaseUrl}/1.0/bill-pay/approval-rules-v2/reorder`;
13
+ return zeniAPI
14
+ .putAndGetJSON(endpoint, {
15
+ rule_ids: approvalRuleIds,
16
+ })
17
+ .pipe(mergeMap((response) => {
18
+ if (isSuccessResponse(response) && response.data != null) {
19
+ const serverOrderedIds = response.data.approval_rules.map((approvalRule) => approvalRule.approval_rule_id);
20
+ const actions = [
21
+ updateApprovalRules(response.data.approval_rules),
22
+ reorderBillPayApprovalRulesSuccess(serverOrderedIds),
23
+ openSnackbar({
24
+ messageSection: `bill_pay_approval_reorder`,
25
+ messageText: 'success',
26
+ type: 'success',
27
+ }),
28
+ ];
29
+ return from(actions);
30
+ }
31
+ else {
32
+ const recovery = [
33
+ reorderBillPayApprovalRulesFailure(response.status),
34
+ openSnackbar({
35
+ messageSection: `bill_pay_approval_reorder`,
36
+ messageText: 'failed',
37
+ type: 'error',
38
+ }),
39
+ // Refetch to revert the optimistic order to server truth.
40
+ fetchBillPaySetupApproverView(true, true, useV3),
41
+ ];
42
+ return from(recovery);
43
+ }
44
+ }), catchError((error) => from([
45
+ reorderBillPayApprovalRulesFailure(createZeniAPIStatus('Unexpected Error', 'Reorder Bill Pay Approval Rules errored out' +
46
+ JSON.stringify(error))),
47
+ openSnackbar({
48
+ messageSection: `bill_pay_approval_reorder`,
49
+ messageText: 'failed',
50
+ type: 'error',
51
+ }),
52
+ fetchBillPaySetupApproverView(true, true, useV3),
53
+ ])));
54
+ }));
@@ -5,15 +5,24 @@ import { openSnackbar } from '../../../../../entity/snackbar/snackbarReducer';
5
5
  import { updateAllUsers } from '../../../../../entity/user/userReducer';
6
6
  import { createZeniAPIStatus, isSuccessResponse, } from '../../../../../responsePayload';
7
7
  import { saveBillPaySetupApproverViewUpdates, saveBillPaySetupApproverViewUpdatesFailure, saveBillPaySetupApproverViewUpdatesSuccess, } from '../billPaySetupApproverViewReducer';
8
- import { toApprovalChangableInfoPayload } from '../types/commonPayload';
9
- export const saveBillPaySetupApproverViewUpdatesEpic = (actions$, state$, zeniAPI) => actions$.pipe(filter(saveBillPaySetupApproverViewUpdates.match), switchMap(() => {
8
+ import { toApprovalChangableInfoPayload, toApprovalChangableInfoPayloadV1, } from '../types/commonPayload';
9
+ export const saveBillPaySetupApproverViewUpdatesEpic = (actions$, state$, zeniAPI) => actions$.pipe(filter(saveBillPaySetupApproverViewUpdates.match), switchMap((action) => {
10
10
  const { billPaySetupApproverViewState } = state$.value;
11
11
  const billPaySetupApproverViewUpdateData = billPaySetupApproverViewState.billPaySetupApproverViewUpdateData;
12
12
  if (billPaySetupApproverViewUpdateData != null &&
13
13
  billPaySetupApproverViewUpdateData.data != null) {
14
- const payload = toApprovalChangableInfoPayload(billPaySetupApproverViewUpdateData.data);
14
+ // Approval Rules 3.0 — gate URL + write-side payload mapper on
15
+ // the `approval_rule_v3_config` dynamic config. `useV3` arrives
16
+ // on the action payload from the screen connector.
17
+ const { useV3 } = action.payload;
18
+ const payload = useV3
19
+ ? toApprovalChangableInfoPayload(billPaySetupApproverViewUpdateData.data)
20
+ : toApprovalChangableInfoPayloadV1(billPaySetupApproverViewUpdateData.data);
21
+ const endpoint = useV3
22
+ ? `${zeniAPI.apiEndPoints.approvalMicroServiceBaseUrl}/1.0/bill-pay/approval-rules-v2`
23
+ : `${zeniAPI.apiEndPoints.approvalMicroServiceBaseUrl}/1.0/bill-pay/approval-rules`;
15
24
  return zeniAPI
16
- .postAndGetJSON(`${zeniAPI.apiEndPoints.approvalMicroServiceBaseUrl}/1.0/bill-pay/approval-rules`, payload)
25
+ .postAndGetJSON(endpoint, payload)
17
26
  .pipe(mergeMap((response) => {
18
27
  if (isSuccessResponse(response) && response.data != null) {
19
28
  const approvalRuleIds = response.data.approval_rules.map((approvalRule) => approvalRule.approval_rule_id);