@zeniai/client-epic-state 4.19.99-betaRD21 → 4.19.99-betaRD4

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.

Potentially problematic release.


This version of @zeniai/client-epic-state might be problematic. Click here for more details.

Files changed (107) hide show
  1. package/lib/entity/aiAccountantCustomer/aiAccountantCustomerPayload.d.ts +44 -0
  2. package/lib/entity/aiAccountantCustomer/aiAccountantCustomerPayload.js +53 -0
  3. package/lib/entity/aiAccountantCustomer/aiAccountantCustomerReducer.d.ts +10 -0
  4. package/lib/entity/aiAccountantCustomer/aiAccountantCustomerReducer.js +49 -0
  5. package/lib/entity/aiAccountantCustomer/aiAccountantCustomerSelector.d.ts +48 -0
  6. package/lib/entity/aiAccountantCustomer/aiAccountantCustomerSelector.js +66 -0
  7. package/lib/entity/aiAccountantCustomer/aiAccountantCustomerState.d.ts +52 -0
  8. package/lib/entity/aiAccountantCustomer/aiAccountantCustomerState.js +36 -0
  9. package/lib/entity/billPay/billTransaction/billTransactionState.d.ts +2 -2
  10. package/lib/entity/chargeCard/chargeCard.d.ts +1 -1
  11. package/lib/entity/depositAccountTransaction/depositAccountTransaction.d.ts +1 -1
  12. package/lib/entity/entityApprovalStatus/entityApprovalStatusState.d.ts +2 -2
  13. package/lib/entity/jeSchedules/jeSchedulesPayload.d.ts +6 -9
  14. package/lib/entity/jeSchedules/jeSchedulesPayload.js +2 -36
  15. package/lib/entity/jeSchedules/jeSchedulesSelector.d.ts +2 -4
  16. package/lib/entity/jeSchedules/jeSchedulesSelector.js +2 -5
  17. package/lib/entity/jeSchedules/jeSchedulesState.d.ts +2 -26
  18. package/lib/entity/jeSchedules/jeSchedulesTypes.d.ts +1 -1
  19. package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
  20. package/lib/entity/tenant/clearAllEpic.d.ts +3 -1
  21. package/lib/entity/tenant/clearAllEpic.js +4 -0
  22. package/lib/entity/transaction/payloadTypes/scheduleTransactionPayload.d.ts +1 -4
  23. package/lib/entity/transaction/payloadTypes/scheduleTransactionPayload.js +0 -1
  24. package/lib/entity/transaction/stateTypes/scheduleTransaction.d.ts +0 -1
  25. package/lib/entity/userRole/userRoleType.d.ts +2 -2
  26. package/lib/epic.d.ts +5 -1
  27. package/lib/epic.js +5 -1
  28. package/lib/esm/entity/aiAccountantCustomer/aiAccountantCustomerPayload.js +47 -0
  29. package/lib/esm/entity/aiAccountantCustomer/aiAccountantCustomerReducer.js +45 -0
  30. package/lib/esm/entity/aiAccountantCustomer/aiAccountantCustomerSelector.js +62 -0
  31. package/lib/esm/entity/aiAccountantCustomer/aiAccountantCustomerState.js +30 -0
  32. package/lib/esm/entity/jeSchedules/jeSchedulesPayload.js +2 -36
  33. package/lib/esm/entity/jeSchedules/jeSchedulesSelector.js +2 -5
  34. package/lib/esm/entity/tenant/clearAllEpic.js +4 -0
  35. package/lib/esm/entity/transaction/payloadTypes/scheduleTransactionPayload.js +0 -1
  36. package/lib/esm/epic.js +5 -1
  37. package/lib/esm/index.js +7 -0
  38. package/lib/esm/reducer.js +6 -0
  39. package/lib/esm/view/aiAccountantView/aiAccountantViewPayload.js +2 -0
  40. package/lib/esm/view/aiAccountantView/aiAccountantViewReducer.js +147 -0
  41. package/lib/esm/view/aiAccountantView/aiAccountantViewSelector.js +61 -0
  42. package/lib/esm/view/aiAccountantView/aiAccountantViewState.js +11 -0
  43. package/lib/esm/view/aiAccountantView/epics/cancelAiAccountantOnboardingEpic.js +26 -0
  44. package/lib/esm/view/aiAccountantView/epics/fetchAiAccountantCustomersEpic.js +27 -0
  45. package/lib/esm/view/aiAccountantView/epics/fetchAiAccountantJobsEpic.js +47 -0
  46. package/lib/esm/view/aiAccountantView/epics/triggerAiAccountantJobEpic.js +39 -0
  47. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +2 -2
  48. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/bulkUploadReceiptsEpic.js +2 -2
  49. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/watchBulkUploadBatchStatusEpic.js +3 -4
  50. package/lib/esm/view/expenseAutomationView/expenseAutomationViewSelector.js +1 -0
  51. package/lib/esm/view/expenseAutomationView/selectors/fluxAnalysisViewSelector.js +2 -10
  52. package/lib/esm/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +3 -13
  53. package/lib/esm/view/expenseAutomationView/selectors/missingReceiptsSelector.js +3 -11
  54. package/lib/esm/view/expenseAutomationView/selectors/reconciliationViewSelector.js +9 -22
  55. package/lib/esm/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +6 -12
  56. package/lib/esm/view/expenseAutomationView/types/jeSchedulesViewState.js +0 -1
  57. package/lib/esm/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelector.js +8 -3
  58. package/lib/esm/view/profitAndLossClassesView/profitAndLossHorizontalEnrichment.js +63 -144
  59. package/lib/esm/view/transactionDetail/transactionDetailSelector.js +2 -9
  60. package/lib/index.d.ts +10 -2
  61. package/lib/index.js +30 -2
  62. package/lib/reducer.d.ts +6 -0
  63. package/lib/reducer.js +6 -0
  64. package/lib/tsconfig.typecheck.tsbuildinfo +1 -1
  65. package/lib/view/aiAccountantView/aiAccountantViewPayload.d.ts +32 -0
  66. package/lib/view/aiAccountantView/aiAccountantViewPayload.js +8 -0
  67. package/lib/view/aiAccountantView/aiAccountantViewReducer.d.ts +29 -0
  68. package/lib/view/aiAccountantView/aiAccountantViewReducer.js +151 -0
  69. package/lib/view/aiAccountantView/aiAccountantViewSelector.d.ts +13 -0
  70. package/lib/view/aiAccountantView/aiAccountantViewSelector.js +67 -0
  71. package/lib/view/aiAccountantView/aiAccountantViewState.d.ts +27 -0
  72. package/lib/view/aiAccountantView/aiAccountantViewState.js +13 -0
  73. package/lib/view/aiAccountantView/epics/cancelAiAccountantOnboardingEpic.d.ts +20 -0
  74. package/lib/view/aiAccountantView/epics/cancelAiAccountantOnboardingEpic.js +30 -0
  75. package/lib/view/aiAccountantView/epics/fetchAiAccountantCustomersEpic.d.ts +23 -0
  76. package/lib/view/aiAccountantView/epics/fetchAiAccountantCustomersEpic.js +31 -0
  77. package/lib/view/aiAccountantView/epics/fetchAiAccountantJobsEpic.d.ts +33 -0
  78. package/lib/view/aiAccountantView/epics/fetchAiAccountantJobsEpic.js +51 -0
  79. package/lib/view/aiAccountantView/epics/triggerAiAccountantJobEpic.d.ts +15 -0
  80. package/lib/view/aiAccountantView/epics/triggerAiAccountantJobEpic.js +43 -0
  81. package/lib/view/companyView/types/cockpitTypes.d.ts +6 -5
  82. package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +2 -2
  83. package/lib/view/expenseAutomationView/epics/missingReceipts/bulkUploadReceiptsEpic.js +1 -1
  84. package/lib/view/expenseAutomationView/epics/missingReceipts/watchBulkUploadBatchStatusEpic.js +3 -4
  85. package/lib/view/expenseAutomationView/expenseAutomationViewSelector.js +1 -0
  86. package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
  87. package/lib/view/expenseAutomationView/payload/jeSchedulesPayload.d.ts +1 -1
  88. package/lib/view/expenseAutomationView/selectors/fluxAnalysisViewSelector.js +2 -10
  89. package/lib/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +3 -13
  90. package/lib/view/expenseAutomationView/selectors/missingReceiptsSelector.js +3 -11
  91. package/lib/view/expenseAutomationView/selectors/reconciliationViewSelector.js +9 -22
  92. package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +5 -11
  93. package/lib/view/expenseAutomationView/types/jeSchedulesViewState.d.ts +1 -1
  94. package/lib/view/expenseAutomationView/types/jeSchedulesViewState.js +0 -1
  95. package/lib/view/expenseAutomationView/types/missingReceiptsViewState.d.ts +1 -1
  96. package/lib/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelector.js +8 -3
  97. package/lib/view/profitAndLossClassesView/profitAndLossHorizontalEnrichment.js +63 -144
  98. package/lib/view/reviewCompanyView/reviewCompanyViewState.d.ts +1 -1
  99. package/lib/view/spendManagement/billPay/billList/billListReducer.d.ts +1 -1
  100. package/lib/view/spendManagement/billPay/billList/billListState.d.ts +1 -1
  101. package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailReducer.d.ts +4 -4
  102. package/lib/view/spendManagement/reimbursement/remiListView/remiListReducer.d.ts +1 -1
  103. package/lib/view/spendManagement/reimbursement/remiListView/remiListState.d.ts +3 -3
  104. package/lib/view/subscriptionView/types/subscriptionTypes.d.ts +1 -1
  105. package/lib/view/transactionDetail/transactionDetailSelector.d.ts +0 -1
  106. package/lib/view/transactionDetail/transactionDetailSelector.js +2 -9
  107. package/package.json +1 -1
@@ -0,0 +1,30 @@
1
+ import { stringToUnion } from '../../commonStateTypes/stringToUnion';
2
+ // ── Operation Type ──
3
+ const ALL_OPERATION_TYPES = [
4
+ 'onboard',
5
+ 'offboard',
6
+ 'retrain',
7
+ 'full_pipeline',
8
+ 'cancel_onboarding',
9
+ ];
10
+ export const toAiAccountantOperationType = (v) => stringToUnion(v, ALL_OPERATION_TYPES);
11
+ // ── Enrollment Status ──
12
+ const ALL_ENROLLMENT_STATUSES = [
13
+ 'active',
14
+ 'pending',
15
+ 'onboarding',
16
+ 'offboarding',
17
+ 'offboarded',
18
+ 'failed',
19
+ 'error',
20
+ ];
21
+ export const toAiAccountantEnrollmentStatus = (v) => stringToUnion(v, ALL_ENROLLMENT_STATUSES);
22
+ // ── Job Status ──
23
+ const ALL_JOB_STATUSES = [
24
+ 'queued',
25
+ 'running',
26
+ 'completed',
27
+ 'failed',
28
+ 'cancelled',
29
+ ];
30
+ export const toAiAccountantJobStatus = (v) => stringToUnion(v, ALL_JOB_STATUSES);
@@ -136,7 +136,7 @@ function toJEScheduleOtherAttributes(payload) {
136
136
  assetId: payload.asset_id ?? undefined,
137
137
  };
138
138
  }
139
- function toJEScheduleAISummaries(payload) {
139
+ function toJEScheduleAIRecommendations(payload) {
140
140
  if (payload == null) {
141
141
  return undefined;
142
142
  }
@@ -177,40 +177,8 @@ function toJEScheduleAISummaries(payload) {
177
177
  reasoning: payload.posting_date.reasoning,
178
178
  };
179
179
  }
180
- if (payload.schedule_type != null) {
181
- result.scheduleType = {
182
- confidence: payload.schedule_type.confidence,
183
- reasoning: payload.schedule_type.reasoning,
184
- };
185
- }
186
180
  return Object.keys(result).length > 0 ? result : undefined;
187
181
  }
188
- function toJEScheduleRecommendations(payload) {
189
- if (payload == null) {
190
- return undefined;
191
- }
192
- return {
193
- creditAccountConfidence: payload.credit_account_confidence,
194
- creditClassConfidence: payload.credit_class_confidence,
195
- debitAccountConfidence: payload.debit_account_confidence,
196
- debitClassConfidence: payload.debit_class_confidence,
197
- endDate: payload.end_date ?? undefined,
198
- jeCreditAccountId: payload.je_credit_account_id ?? undefined,
199
- jeCreditAccountingClassId: payload.je_credit_accounting_class_id ?? undefined,
200
- jeDebitAccountId: payload.je_debit_account_id ?? undefined,
201
- jeDebitAccountingClassId: payload.je_debit_accounting_class_id ?? undefined,
202
- jeScheduleType: payload.je_schedule_type ?? undefined,
203
- jeScheduleTypeConfidence: payload.je_schedule_type_confidence,
204
- period: payload.period ?? undefined,
205
- periodConfidence: payload.period_confidence,
206
- postingDate: payload.posting_date ?? undefined,
207
- postingDateConfidence: payload.posting_date_confidence,
208
- similarTransactions: payload.similar_transactions,
209
- startDate: payload.start_date ?? undefined,
210
- startingMonth: payload.starting_month ?? undefined,
211
- startingMonthConfidence: payload.starting_month_confidence,
212
- };
213
- }
214
182
  export function toJEScheduledTransaction(payload) {
215
183
  return {
216
184
  jeScheduleId: payload.je_schedule_id ?? undefined,
@@ -255,9 +223,7 @@ export function toJEScheduledTransaction(payload) {
255
223
  ? toJEScheduleOtherAttributes(payload.other_attributes)
256
224
  : {},
257
225
  scheduledJournalEntry: [],
258
- aiSummaries: toJEScheduleAISummaries(payload.ai_summaries),
259
- createdByUserID: payload.created_by?.user_id ?? undefined,
260
- recommendations: toJEScheduleRecommendations(payload.recommendations),
226
+ aiRecommendations: toJEScheduleAIRecommendations(payload.ai_summaries),
261
227
  };
262
228
  }
263
229
  export function toJEAccruedScheduledTransaction(payload) {
@@ -70,13 +70,12 @@ export const getJEAccruedScheduleByJEScheduleKey = (JEScheduleKey, state) => {
70
70
  export const getJEScheduledTransactionByJEScheduleTransactionKey = (jeScheduleTransactionKey, state) => {
71
71
  const { jeSchedulesState, vendorState, accountState, userState, classState, transactionState, } = state;
72
72
  const jeScheduleTransactionState = recordGet(jeSchedulesState.schedulesByTransactionKey, jeScheduleTransactionKey);
73
- const { period, updatedByUserID: updatedBy, createdByUserID: createdBy, vendorId, jeCredit, jeDebit, currencyCode, currencySymbol, balanceAsOfToday, baseTransaction, startDate, endDate, status, updatedAt, jeScheduleId, scheduledJournalEntry, dayOfPostingDate: postingDate, lastDayOfMonth, otherAttributes, jeScheduleType, aiSummaries, recommendations, } = jeScheduleTransactionState;
73
+ const { period, updatedByUserID: updatedBy, vendorId, jeCredit, jeDebit, currencyCode, currencySymbol, balanceAsOfToday, baseTransaction, startDate, endDate, status, updatedAt, jeScheduleId, scheduledJournalEntry, dayOfPostingDate: postingDate, lastDayOfMonth, otherAttributes, jeScheduleType, aiRecommendations, } = jeScheduleTransactionState;
74
74
  const vendorDetails = getVendorByVendorId(vendorState, vendorId);
75
75
  if (vendorDetails == null) {
76
76
  throw new Error(`Vendor with ${vendorId} doesn't exist`);
77
77
  }
78
78
  const userDetails = updatedBy != null ? getUserByUserId(userState, updatedBy) : undefined;
79
- const createdByUserDetails = createdBy != null ? getUserByUserId(userState, createdBy) : undefined;
80
79
  const baseTransactionObject = getScheduleTransactionById(transactionState, baseTransaction);
81
80
  if (baseTransactionObject == null) {
82
81
  throw Error('Base Schedule transaction cannot be null');
@@ -128,8 +127,6 @@ export const getJEScheduledTransactionByJEScheduleTransactionKey = (jeScheduleTr
128
127
  account: accountDebit,
129
128
  },
130
129
  scheduledJournalEntry,
131
- aiSummaries,
132
- createdByUser: createdByUserDetails,
133
- recommendations,
130
+ aiRecommendations,
134
131
  };
135
132
  };
@@ -1,5 +1,6 @@
1
1
  import { from } from 'rxjs';
2
2
  import { filter, mergeMap } from 'rxjs/operators';
3
+ import { clearAllAiAccountantCustomers } from '../../entity/aiAccountantCustomer/aiAccountantCustomerReducer';
3
4
  import { clearAiCfo } from '../../entity/aiCfo/aiCfoReducer';
4
5
  import { clearAllApprovalRules } from '../../entity/approvalRule/approvalRuleReducer';
5
6
  import { clearAllEntityApprovalStatus } from '../../entity/entityApprovalStatus/entityApprovalStatusReducer';
@@ -12,6 +13,7 @@ import { clearAccountList } from '../../view/accountList/accountListReducer';
12
13
  import { clearAccountMappingView } from '../../view/accountMappingView/accountMappingReducer';
13
14
  import { clearAddressView } from '../../view/addressView/addressViewReducer';
14
15
  import { clearAggregatedReport } from '../../view/aiAgentPerformance/aggregatedReportViewReducer';
16
+ import { clearAiAccountantView } from '../../view/aiAccountantView/aiAccountantViewReducer';
15
17
  import { clearAiCfoView } from '../../view/aiCfoView/aiCfoViewReducer';
16
18
  import { clearApAgingDetail } from '../../view/apAgingView/apAgingDetail/apAgingDetailReducer';
17
19
  import { clearApAging } from '../../view/apAgingView/apAgingReport/apAgingReducer';
@@ -207,6 +209,8 @@ export const clearAllEpic = (actions$) => actions$.pipe(filter(clearAll.match),
207
209
  clearActivityHistory(),
208
210
  clearActivityRealTimeApproval(),
209
211
  clearAddressView(),
212
+ clearAiAccountantView(),
213
+ clearAllAiAccountantCustomers(),
210
214
  clearAiCfoView(),
211
215
  clearAllClasses(),
212
216
  clearAllMonthEndCloseChecksView(),
@@ -29,6 +29,5 @@ export const toScheduleTransaction = (payload, currency_code, currency_symbol) =
29
29
  currencyCode: currency_code,
30
30
  currencySymbol: currency_symbol,
31
31
  },
32
- description: payload.transaction_description ?? undefined,
33
32
  };
34
33
  };
package/lib/esm/epic.js CHANGED
@@ -32,6 +32,10 @@ import { saveNewAddressEpic, } from './view/addressView/epic/saveNewAddressEpic'
32
32
  import { updateAddressEpic, } from './view/addressView/epic/updateAddressEpic';
33
33
  import { fetchAggregatedReportEpic, } from './view/aiAgentPerformance/aggregatedReportEpic';
34
34
  import { acceptMasterTOSEpic, } from './view/aiCfoView/epics/acceptMasterTOSEpic';
35
+ import { fetchAiAccountantCustomersEpic, } from './view/aiAccountantView/epics/fetchAiAccountantCustomersEpic';
36
+ import { fetchAiAccountantJobsEpic, } from './view/aiAccountantView/epics/fetchAiAccountantJobsEpic';
37
+ import { triggerAiAccountantJobEpic, } from './view/aiAccountantView/epics/triggerAiAccountantJobEpic';
38
+ import { cancelAiAccountantOnboardingEpic, } from './view/aiAccountantView/epics/cancelAiAccountantOnboardingEpic';
35
39
  import { createSessionAndSubmitEpic, } from './view/aiCfoView/epics/createSessionAndSubmitEpic';
36
40
  import { createSessionEpic, } from './view/aiCfoView/epics/createSessionEpic';
37
41
  import { deleteChatSessionEpic, } from './view/aiCfoView/epics/deleteChatSessionEpic';
@@ -536,7 +540,7 @@ import { fetchZeniAccStatementListEpic, } from './view/zeniAccStatementList/fetc
536
540
  import { fetchZeniAccStatementPageEpic, } from './view/zeniAccStatementList/fetchZeniAccStatementPageEpic';
537
541
  import { fetchZeniAccountsPromoCardEpic, } from './view/zeniAccountsPromoCard/zeniAccountsPromoCardEpic';
538
542
  // Note: Please maintain strict alphabetical order
539
- const combinedEpics = combineEpics(acceptBillPayTermsEpic, acceptBillPayUpdatedTermsEpic, acceptChargeCardTermsEpic, acceptEmployeeRemiTermsEpic, acceptMasterTOSEpic, acceptRemiTermsEpic, acceptTreasuryTermsEpic, acceptZeniAccountTermsEpic, addCardPaymentSourceEpic, approveOrRejectBillEpic, approveOrRejectBillsBulkActionEpic, approveOrRejectRemiEpic, approveOrRejectRemisBulkActionEpic, approveVendorGlobalReviewEpic, archiveTaskEpic, backgroundRefetchReviewTabEpic, bulkUpdateTaskListEpic, cancelAndDeleteBillEpic, cancelAndDeleteRemiEpic, cancelOrDeleteBillsBulkActionEpic, cancelOrDeleteRemisBulkActionEpic, cancelScheduleAccruedJournalEntryEpic, changeZeniPersonRolesEpic, checkDepositEpic, clearAllEpic, closeChargeCardEpic, closeChargeCardsEpic, companyManagementSavePendingUpdatesEpic, companyManagementSaveUpdatesEpic, confirmCardSetupIntentEpic, convertAmountToHomeCurrencyEpic, createAddressEpic, createBankAccountEpic, createCardSetupIntentEpic, createCheckingAccountEpic, createCompanyAddressEpic, createCompanyOfficersEpic, createCompanyUserAddressEpic, createGlobalMerchantEpic, createInternationalBankAccountEpic, createNewSchedulesAccruedEpic, createNewSchedulesEpic, createNewTaskGroupEpic, createPaymentInstrumentEpic, createSessionAndSubmitEpic, createSessionEpic, createTagEpic, createTaskFromTaskGroupTemplateEpic, createUserBankAccountEpic, deleteAccountStatementEpic, deleteBankAccountEpic, deleteBillEpic, deleteChatSessionEpic, deleteBillPayApprovalRuleEpic, deleteFileEpic, deleteFileListEpic, deleteInternationalBankAccountEpic, deletePaymentInstrumentEpic, deletePersonEpic, deleteRemiApprovalRuleEpic, deleteRemiEpic, deleteScheduleAccruedDetailEpic, deleteScheduleDetailEpic, deleteTagEpic, deleteTaskEpic, deleteTaskGroupEpic, deleteTransactionAttachmentEpic, deleteUserBankAccountEpic, doMagicLinkSignInEpic, doSignInEpic, doSignOutEpic, sendEmailMagicLinkToUserEpic, verifyDeviceWithTwoFAEpic, downloadAccountingProviderAttachmentEpic, dragNDropTasksEpic, enableChargeCardAutoPayEpic, enableSetupEpic, establishOnboardingPlaidConnectionEpic, establishPlaidConnectionEpic, expressInterestChargeCardEpic, fetchAccountListEpic, fetchAccountListForAccountTypesEpic, fetchAccountSettingsListForAccountTypesEpic, fetchAccruedScheduleListEpic, fetchActiveTenantEpic, fetchAddressEpic, fetchAllCockpitViewsEpic, fetchAllExpenseAutomationTabsEpic, fetchAllPeopleRequiredViewsEpic, fetchAllTagsEpic, fetchAllTaskGroupsEpic, fetchAllTenantsEpic, fetchAndUpdateVendorRecommendationsEpic, fetchAggregatedReportEpic, fetchApAgingDetailEpic, fetchApAgingEpic, fetchArAgingDetailEpic, fetchArAgingEpic, fetchAuditReportGroupViewEpic, fetchAuditRuleGroupViewEpic, fetchBalanceSheetEpic, fetchBalanceSheetForTimeframeEpic, fetchBankAccountsListEpic, fetchBankConnectionsViewEpic, fetchBankCountryNameByIbanEpic, fetchBankNameByRoutingEpic, fetchBankNameBySwiftEpic, fetchBillAndInitializeLocalStoreEpic, fetchBillDetailEpic, fetchBillingAccountsListEpic, fetchBillListEpic, fetchBillListPerTabEpic, fetchBillPayApproversDetailsEpic, fetchBillPayApproversListEpic, fetchBillPayCardEpic, fetchBillPayConfigEpic, fetchBillPaySetupApproverViewEpic, fetchBillPaySetupViewEpic, fetchCardBalanceEpic, fetchCashbackDetailEpic, fetchCashBalanceEpic, fetchCashFlowEpic, fetchCashFlowForTimeframeEpic, fetchCashInCashOutEpic, fetchCashPositionEpic, fetchChargeCardConfigEpic, fetchChargeCardDetailEpic, fetchChargeCardDetailPageEpic, fetchChargeCardListEpic, fetchChargeCardListPageEpic, fetchChargeCardPaymentPageEpic, fetchChargeCardRepaymentDetailEpic, fetchChargeCardPaymentHistoryEpic, fetchChargeCardSetupViewEpic, fetchChargeCardStatementListEpic, fetchChargeCardTransactionAttachmentsEpic, fetchChargeCardTransactionListEpic, fetchChargeCardTransactionStatisticsEpic, fetchChargeCardsRecurringExpensesEpic, fetchChatHistoryEpic, fetchChatSessionsForUserEpic, fetchClassListEpic, fetchCollaborationAuthTokenEpic, fetchCompanyBillingAddressEpic, fetchCompanyConfigEpic, fetchCompanyHealthMetricConfigEpic, fetchCompanyHealthMetricViewEpic, fetchCompanyManagementViewEpic, fetchCompanyMetaDataEpic, fetchCompanyMonthEndReportHistoricDataEpic, fetchCompanyMonthEndReportHistoricDatesEpic, fetchCompanyMonthEndReportTemplatesEpic, fetchCompanyMonthEndReportViewEpic, fetchCompanyOnboardingViewEpic, fetchCompanyPassportViewEpic, fetchCompanyPortfolioViewEpic, fetchCompanyTaskManagerViewEpic, fetchCreditAccountEpic, fetchCreditAccountRepaymentEpic, fetchCurrencyConversionValueEpic, fetchDashboardEpic, fetchDashboardLayoutEpic, fetchDebitCardSummaryEpic, fetchDepositAccountDetailEpic, fetchDepositAccountEpic, fetchDepositAccountHistoryEpic, fetchDepositAccountLimitEpic, fetchDepositAccountListEpic, fetchDepositAccountListForCardsEpic, fetchDepositAccountTransactionListEpic, fetchDownloadSchedulesEpic, fetchDuplicateBillPayReviewEpic, fetchDuplicateReimbursementEpic, fetchEditBillDetailPageEpic, fetchEditRemiDetailPageEpic, fetchEligibleActionsForBillEpic, fetchEntityAutoCompleteEpic, fetchEntityHistoryEpic, fetchEntityRecommendationsByTransactionIdEpic, fetchExcludedResourcesEpic, fetchExpenseAutomationFluxAnalysisViewEpic, fetchExpenseAutomationInitializeTransactionCategorizationViewLocalDataEpic, fetchExpenseAutomationJeSchedulesEpic, fetchExpenseAutomationJESchedulesPageEpic, fetchExpenseAutomationMarkTransactionAsNotMiscategorizedEpic, fetchExpenseAutomationMissingReceiptsEpic, bulkUploadReceiptsEpic, confirmBulkUploadMatchEpic, fetchBulkUploadBatchDetailsEpic, fetchMultipleBatchDetailsEpic, fetchMoreBatchDetailsEpic, fetchBulkUploadBatchesEpic, fetchCompletedTransactionsEpic, bulkUploadAutomatchingTimeoutEpic, pollBulkUploadBatchStatusEpic, pusherBatchStatusCompletionEpic, searchTransactionsForManualMatchEpic, fetchExpenseAutomationReconciliationsViewEpic, fetchExpenseAutomationSaveTransactionCategorizationEpic, fetchExpenseAutomationTransactionCategorizationEpic, fetchExpenseAutomationTransactionCategorizationViewEpic, fetchExpenseAutomationUpdateTransactionCategorizationEpic, fetchExpenseTrendEpic, fetchExpressPayInitialDetailsEpic, fetchExternalConnectionsEpic, fetchFileEpic, fetchFileListEpic, fetchFinanceStatementEpic, fetchForecastListEpic, initiateReportsClassViewRefetchingEpic, reportsResyncEpic, fetchGlobalMerchantAutoCompleteViewEpic, fetchGlobalMerchantRecommendationEpic, fetchIncomeTrendEpic, fetchInsightsCardEpic, fetchInternationalWireDynamicFormEpic, fetchIntlVerificationFormEpic, fetchIssueCardPageEpic, fetchMagicLinkBankNameByRoutingEpic, fetchMagicLinkBankNameBySwiftEpic, fetchMagicLinkBillEpic, fetchMagicLinkTenantEpic, fetchManagementViewEpic, fetchMerchantListEpic, fetchMonthClosePerformanceTrendEpic, fetchMonthEndCloseChecksEpic, fetchMyProfileEpic, fetchMyProfileViewEpic, fetchNetBurnOrIncomeClassesViewEpic, fetchNetBurnOrIncomeEpic, fetchNetBurnOrIncomeForTimeframeClassesViewEpic, fetchNetBurnOrIncomeForTimeframeEpic, fetchNetBurnOrIncomeStoryCardEpic, fetchNetBurnOrIncomeWithForecastEpic, fetchNotificationSettingsEpic, fetchNotificationSettingsViewEpic, fetchNotificationUnreadCountEpic, fetchNotificationViewEpic, fetchOnboardingCompletedCompaniesEpic, fetchOnboardingCustomerSetupViewEpic, fetchOnboardingCustomerViewEpic, fetchOnboardingViewEpic, fetchOpExByVendorEpic, fetchOpExByVendorReportForTimeframeEpic, fetchOpExByVendorReportSummaryEpic, fetchOpExClassesViewEpic, fetchOpExEpic, fetchOpExForTimeframeClassesViewEpic, fetchOpExReportForTimeframeEpic, fetchOpExWithForecastEpic, fetchOwnerListEpic, fetchParentSubsidiaryManagementViewEpic, fetchPaymentAccountBalanceEpic, fetchPaymentAccountListEpic, fetchPaymentSourcesEpic, fetchPeopleEpic, fetchPeoplePageEpic, fetchPortfolioViewEpic, fetchPreviousBillsEpic, fetchProfitAndLossClassesViewEpic, fetchProfitAndLossEpic, fetchProfitAndLossForTimeframeClassesViewEpic, fetchProfitAndLossForTimeframeEpic, 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, fetchTransactionListByEntityEpic, fetchTransactionsForEntityEpic, fetchTransactionsListByCategoryTypeEpic, 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, parallelFetchAccountTransactionListEpic, parallelFetchClassTransactionListEpic, 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, saveBillDetailEpic, saveBillPaySetupApproverViewUpdatesEpic, saveCardOnboardingUserDetailsEpic, saveCompanyBillingAddressEpic, saveCompanyHealthMetricByIdEpic, saveCompanyMonthEndReportEpic, saveCompanyPassportDetailsEpic, saveExpenseAutomationReconciliationDetailsEpic, saveExpenseAutomationReconciliationReviewEpic, saveExternalConnectionEpic, saveMagicLinkBankAccountEpic, saveNewAddressEpic, saveNotificationSettingsEpic, saveOnboardingCustomerCompletedStatusEpic, saveOnboardingCustomerNotesEpic, saveOnboardingCustomerViewUpdatesEpic, saveRealTimeApprovalEpic, saveReasonForAuditRuleEpic, saveRemiDetailEpic, saveRemiSetupApproverViewUpdatesEpic, saveScheduleAccruedDetailsEpic, saveScheduleDetailsEpic, saveSubscriptionNotesUpdatesEpic, saveSubscriptionUpdatesEpic, saveTaskDetailEpic, saveTransactionDetailEpic, saveTransactionVendorEpic, saveVendorDetailsViewEpic, saveVendorEpic, saveVendorFirstReviewViewEpic, saveVendorsTabVendorEpic, sendCompanyMonthEndReportEpic, sendOnboardingCustomerViewInviteEpic, sendOtpEpic, sendReferralInviteEpic, statementCloseDayEpic, stopSubmitEpic, stopSubmitQuestionEpic, submitDraftBillsBulkActionEpic, submitDraftRemisBulkActionEpic, submitExpressPayEpic, submitIntlVerificationEpic, submitQuestionEpic, toggleReportUIOptionForecastModeEpic, transferMoneyEpic, treasuryTransferMoneyEpic, triggerReviewTabRefetchEpic, unlinkPaymentAccountEpic, unlockChargeCardEpic, unlockChargeCardsEpic, updateAccruedJESchedulesEpic, updateAddressEpic, updateAmountsInScheduleAccruedDetailEpic, updateAmountsInScheduleDetailEpic, updateBusinessVerificationDetailsEpic, updateChargeCardDetailEpic, updateChargeCardLimitEpic, updateChargeCardNameEpic, updateChargeCardsLimitEpic, 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, updateSelectedVendorForCreateFlowEpic, updateSetupViewLocalStoreDataEpic, updateTaskFromListViewEpic, updateTaskGroupNameEpic, updateTransactionDetailEpic, updateTreasuryVideoViewedEpic, updateVendorContactEpic, uploadAccountStatementEpic, uploadMissingAttachmentSuccessEpic, uploadMissingReceiptSuccessEpic, uploadTransactionReceiptSuccessEpic, vendorFiling1099UploadDetailsSaveEpic, verifyOtpEpic, verifyUserEpic, waitForBillDetailThenInitializeLocalStoreEpic, waitForForecastListThenFetchNetBurnOrIncomeWithForecastEpic, waitForForecastListThenFetchOpExWithForecastEpic, waitForForecastListThenFetchRevenueWithForecastEpic, waitForMerchantRecommendationFetchThenUpdateRecommendationInMerchantEpic, waitForVendorByIdThenSaveBillUpdatetoLocalStoreEpic, waitForVendorByNameThenParsetoLocalStoreEpic, waitForVendorByNameThenUpdateBillDetailEpic, waitForVendorRecommendationFetchThenUpdateRecommendationInBillEpic, wiseRedirectEpic);
543
+ const combinedEpics = combineEpics(acceptBillPayTermsEpic, acceptBillPayUpdatedTermsEpic, acceptChargeCardTermsEpic, acceptEmployeeRemiTermsEpic, acceptMasterTOSEpic, acceptRemiTermsEpic, acceptTreasuryTermsEpic, acceptZeniAccountTermsEpic, addCardPaymentSourceEpic, approveOrRejectBillEpic, approveOrRejectBillsBulkActionEpic, approveOrRejectRemiEpic, approveOrRejectRemisBulkActionEpic, approveVendorGlobalReviewEpic, archiveTaskEpic, backgroundRefetchReviewTabEpic, bulkUpdateTaskListEpic, cancelAiAccountantOnboardingEpic, cancelAndDeleteBillEpic, cancelAndDeleteRemiEpic, cancelOrDeleteBillsBulkActionEpic, cancelOrDeleteRemisBulkActionEpic, cancelScheduleAccruedJournalEntryEpic, changeZeniPersonRolesEpic, checkDepositEpic, clearAllEpic, closeChargeCardEpic, closeChargeCardsEpic, companyManagementSavePendingUpdatesEpic, companyManagementSaveUpdatesEpic, confirmCardSetupIntentEpic, convertAmountToHomeCurrencyEpic, createAddressEpic, createBankAccountEpic, createCardSetupIntentEpic, createCheckingAccountEpic, createCompanyAddressEpic, createCompanyOfficersEpic, createCompanyUserAddressEpic, createGlobalMerchantEpic, createInternationalBankAccountEpic, createNewSchedulesAccruedEpic, createNewSchedulesEpic, createNewTaskGroupEpic, createPaymentInstrumentEpic, createSessionAndSubmitEpic, createSessionEpic, createTagEpic, createTaskFromTaskGroupTemplateEpic, createUserBankAccountEpic, deleteAccountStatementEpic, deleteBankAccountEpic, deleteBillEpic, deleteChatSessionEpic, deleteBillPayApprovalRuleEpic, deleteFileEpic, deleteFileListEpic, deleteInternationalBankAccountEpic, deletePaymentInstrumentEpic, deletePersonEpic, deleteRemiApprovalRuleEpic, deleteRemiEpic, deleteScheduleAccruedDetailEpic, deleteScheduleDetailEpic, deleteTagEpic, deleteTaskEpic, deleteTaskGroupEpic, deleteTransactionAttachmentEpic, deleteUserBankAccountEpic, doMagicLinkSignInEpic, doSignInEpic, doSignOutEpic, sendEmailMagicLinkToUserEpic, 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, fetchBalanceSheetEpic, fetchBalanceSheetForTimeframeEpic, fetchBankAccountsListEpic, fetchBankConnectionsViewEpic, fetchBankCountryNameByIbanEpic, fetchBankNameByRoutingEpic, fetchBankNameBySwiftEpic, fetchBillAndInitializeLocalStoreEpic, fetchBillDetailEpic, fetchBillingAccountsListEpic, fetchBillListEpic, fetchBillListPerTabEpic, fetchBillPayApproversDetailsEpic, fetchBillPayApproversListEpic, fetchBillPayCardEpic, fetchBillPayConfigEpic, fetchBillPaySetupApproverViewEpic, fetchBillPaySetupViewEpic, fetchCardBalanceEpic, fetchCashbackDetailEpic, fetchCashBalanceEpic, fetchCashFlowEpic, fetchCashFlowForTimeframeEpic, fetchCashInCashOutEpic, fetchCashPositionEpic, fetchChargeCardConfigEpic, fetchChargeCardDetailEpic, fetchChargeCardDetailPageEpic, fetchChargeCardListEpic, fetchChargeCardListPageEpic, fetchChargeCardPaymentPageEpic, fetchChargeCardRepaymentDetailEpic, fetchChargeCardPaymentHistoryEpic, fetchChargeCardSetupViewEpic, fetchChargeCardStatementListEpic, fetchChargeCardTransactionAttachmentsEpic, fetchChargeCardTransactionListEpic, fetchChargeCardTransactionStatisticsEpic, fetchChargeCardsRecurringExpensesEpic, fetchChatHistoryEpic, fetchChatSessionsForUserEpic, fetchClassListEpic, fetchCollaborationAuthTokenEpic, fetchCompanyBillingAddressEpic, fetchCompanyConfigEpic, fetchCompanyHealthMetricConfigEpic, fetchCompanyHealthMetricViewEpic, fetchCompanyManagementViewEpic, fetchCompanyMetaDataEpic, fetchCompanyMonthEndReportHistoricDataEpic, fetchCompanyMonthEndReportHistoricDatesEpic, fetchCompanyMonthEndReportTemplatesEpic, fetchCompanyMonthEndReportViewEpic, fetchCompanyOnboardingViewEpic, fetchCompanyPassportViewEpic, fetchCompanyPortfolioViewEpic, fetchCompanyTaskManagerViewEpic, fetchCreditAccountEpic, fetchCreditAccountRepaymentEpic, fetchCurrencyConversionValueEpic, fetchDashboardEpic, fetchDashboardLayoutEpic, fetchDebitCardSummaryEpic, fetchDepositAccountDetailEpic, fetchDepositAccountEpic, fetchDepositAccountHistoryEpic, fetchDepositAccountLimitEpic, fetchDepositAccountListEpic, fetchDepositAccountListForCardsEpic, fetchDepositAccountTransactionListEpic, fetchDownloadSchedulesEpic, fetchDuplicateBillPayReviewEpic, fetchDuplicateReimbursementEpic, fetchEditBillDetailPageEpic, fetchEditRemiDetailPageEpic, fetchEligibleActionsForBillEpic, fetchEntityAutoCompleteEpic, fetchEntityHistoryEpic, fetchEntityRecommendationsByTransactionIdEpic, fetchExcludedResourcesEpic, fetchExpenseAutomationFluxAnalysisViewEpic, fetchExpenseAutomationInitializeTransactionCategorizationViewLocalDataEpic, fetchExpenseAutomationJeSchedulesEpic, fetchExpenseAutomationJESchedulesPageEpic, fetchExpenseAutomationMarkTransactionAsNotMiscategorizedEpic, fetchExpenseAutomationMissingReceiptsEpic, bulkUploadReceiptsEpic, confirmBulkUploadMatchEpic, fetchBulkUploadBatchDetailsEpic, fetchMultipleBatchDetailsEpic, fetchMoreBatchDetailsEpic, fetchBulkUploadBatchesEpic, fetchCompletedTransactionsEpic, bulkUploadAutomatchingTimeoutEpic, pollBulkUploadBatchStatusEpic, pusherBatchStatusCompletionEpic, searchTransactionsForManualMatchEpic, fetchExpenseAutomationReconciliationsViewEpic, fetchExpenseAutomationSaveTransactionCategorizationEpic, fetchExpenseAutomationTransactionCategorizationEpic, fetchExpenseAutomationTransactionCategorizationViewEpic, fetchExpenseAutomationUpdateTransactionCategorizationEpic, fetchExpenseTrendEpic, fetchExpressPayInitialDetailsEpic, fetchExternalConnectionsEpic, fetchFileEpic, fetchFileListEpic, fetchFinanceStatementEpic, fetchForecastListEpic, initiateReportsClassViewRefetchingEpic, reportsResyncEpic, fetchGlobalMerchantAutoCompleteViewEpic, fetchGlobalMerchantRecommendationEpic, fetchIncomeTrendEpic, fetchInsightsCardEpic, fetchInternationalWireDynamicFormEpic, fetchIntlVerificationFormEpic, fetchIssueCardPageEpic, fetchMagicLinkBankNameByRoutingEpic, fetchMagicLinkBankNameBySwiftEpic, fetchMagicLinkBillEpic, fetchMagicLinkTenantEpic, fetchManagementViewEpic, fetchMerchantListEpic, fetchMonthClosePerformanceTrendEpic, fetchMonthEndCloseChecksEpic, fetchMyProfileEpic, fetchMyProfileViewEpic, fetchNetBurnOrIncomeClassesViewEpic, fetchNetBurnOrIncomeEpic, fetchNetBurnOrIncomeForTimeframeClassesViewEpic, fetchNetBurnOrIncomeForTimeframeEpic, fetchNetBurnOrIncomeStoryCardEpic, fetchNetBurnOrIncomeWithForecastEpic, fetchNotificationSettingsEpic, fetchNotificationSettingsViewEpic, fetchNotificationUnreadCountEpic, fetchNotificationViewEpic, fetchOnboardingCompletedCompaniesEpic, fetchOnboardingCustomerSetupViewEpic, fetchOnboardingCustomerViewEpic, fetchOnboardingViewEpic, fetchOpExByVendorEpic, fetchOpExByVendorReportForTimeframeEpic, fetchOpExByVendorReportSummaryEpic, fetchOpExClassesViewEpic, fetchOpExEpic, fetchOpExForTimeframeClassesViewEpic, fetchOpExReportForTimeframeEpic, fetchOpExWithForecastEpic, fetchOwnerListEpic, fetchParentSubsidiaryManagementViewEpic, fetchPaymentAccountBalanceEpic, fetchPaymentAccountListEpic, fetchPaymentSourcesEpic, fetchPeopleEpic, fetchPeoplePageEpic, fetchPortfolioViewEpic, fetchPreviousBillsEpic, fetchProfitAndLossClassesViewEpic, fetchProfitAndLossEpic, fetchProfitAndLossForTimeframeClassesViewEpic, fetchProfitAndLossForTimeframeEpic, 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, fetchTransactionListByEntityEpic, fetchTransactionsForEntityEpic, fetchTransactionsListByCategoryTypeEpic, 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, parallelFetchAccountTransactionListEpic, parallelFetchClassTransactionListEpic, 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, saveBillDetailEpic, saveBillPaySetupApproverViewUpdatesEpic, saveCardOnboardingUserDetailsEpic, saveCompanyBillingAddressEpic, saveCompanyHealthMetricByIdEpic, saveCompanyMonthEndReportEpic, saveCompanyPassportDetailsEpic, saveExpenseAutomationReconciliationDetailsEpic, saveExpenseAutomationReconciliationReviewEpic, saveExternalConnectionEpic, saveMagicLinkBankAccountEpic, saveNewAddressEpic, saveNotificationSettingsEpic, saveOnboardingCustomerCompletedStatusEpic, saveOnboardingCustomerNotesEpic, saveOnboardingCustomerViewUpdatesEpic, saveRealTimeApprovalEpic, saveReasonForAuditRuleEpic, saveRemiDetailEpic, saveRemiSetupApproverViewUpdatesEpic, saveScheduleAccruedDetailsEpic, saveScheduleDetailsEpic, saveSubscriptionNotesUpdatesEpic, saveSubscriptionUpdatesEpic, saveTaskDetailEpic, saveTransactionDetailEpic, saveTransactionVendorEpic, saveVendorDetailsViewEpic, saveVendorEpic, saveVendorFirstReviewViewEpic, saveVendorsTabVendorEpic, sendCompanyMonthEndReportEpic, sendOnboardingCustomerViewInviteEpic, sendOtpEpic, sendReferralInviteEpic, statementCloseDayEpic, stopSubmitEpic, stopSubmitQuestionEpic, submitDraftBillsBulkActionEpic, submitDraftRemisBulkActionEpic, submitExpressPayEpic, submitIntlVerificationEpic, submitQuestionEpic, toggleReportUIOptionForecastModeEpic, transferMoneyEpic, treasuryTransferMoneyEpic, triggerAiAccountantJobEpic, triggerReviewTabRefetchEpic, unlinkPaymentAccountEpic, unlockChargeCardEpic, unlockChargeCardsEpic, updateAccruedJESchedulesEpic, updateAddressEpic, updateAmountsInScheduleAccruedDetailEpic, updateAmountsInScheduleDetailEpic, updateBusinessVerificationDetailsEpic, updateChargeCardDetailEpic, updateChargeCardLimitEpic, updateChargeCardNameEpic, updateChargeCardsLimitEpic, 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, updateSelectedVendorForCreateFlowEpic, updateSetupViewLocalStoreDataEpic, updateTaskFromListViewEpic, updateTaskGroupNameEpic, updateTransactionDetailEpic, updateTreasuryVideoViewedEpic, updateVendorContactEpic, uploadAccountStatementEpic, uploadMissingAttachmentSuccessEpic, uploadMissingReceiptSuccessEpic, uploadTransactionReceiptSuccessEpic, vendorFiling1099UploadDetailsSaveEpic, verifyOtpEpic, verifyUserEpic, waitForBillDetailThenInitializeLocalStoreEpic, waitForForecastListThenFetchNetBurnOrIncomeWithForecastEpic, waitForForecastListThenFetchOpExWithForecastEpic, waitForForecastListThenFetchRevenueWithForecastEpic, waitForMerchantRecommendationFetchThenUpdateRecommendationInMerchantEpic, waitForVendorByIdThenSaveBillUpdatetoLocalStoreEpic, waitForVendorByNameThenParsetoLocalStoreEpic, waitForVendorByNameThenUpdateBillDetailEpic, waitForVendorRecommendationFetchThenUpdateRecommendationInBillEpic, wiseRedirectEpic);
540
544
  const rootEpic = (action$, store$, dependencies) => combinedEpics(action$, store$, dependencies).pipe(map(identity), catchError((error, source) => {
541
545
  console.error(error);
542
546
  return source;
package/lib/esm/index.js CHANGED
@@ -602,6 +602,13 @@ export { fetchCompanyTaskManagerView, getCompanyTaskManagerView, createTaskFromT
602
602
  export { fetchInternationalVerificationForm, submitInternationalVerificationForm, updateVerificationFormLocalData, getIntlWireVerificationView, };
603
603
  export { fetchExpressPayInitialDetails, updateExpressPayFormLocalData, submitExpressPay, resetExpressPayLocalData, getExpressPayView, };
604
604
  export { acceptTreasuryTerms, fetchTreasurySetupView, clearTreasurySetupView, fetchTreasuryFunds, updatePortfolioAllocation, fetchPortfolioAllocation, updateFundAllocationLocalData, updateTreasuryVideoViewed, getTreasurySetupViewDetails, getTreasuryFundsMaximumYield, };
605
+ // ── AI Accountant Entity ──
606
+ export { toAiAccountantEnrollmentStatus, toAiAccountantJobStatus, toAiAccountantOperationType, } from './entity/aiAccountantCustomer/aiAccountantCustomerState';
607
+ export { toAiAccountantCustomer, toAiAccountantEnrollment, toAiAccountantJob, } from './entity/aiAccountantCustomer/aiAccountantCustomerPayload';
608
+ export { clearAllAiAccountantCustomers, updateAiAccountantCustomers, updateAiAccountantCustomer, updateAiAccountantJobs, } from './entity/aiAccountantCustomer/aiAccountantCustomerReducer';
609
+ export { getAiAccountantCustomers, getAiAccountantJobsByTenantId, } from './entity/aiAccountantCustomer/aiAccountantCustomerSelector';
610
+ export { cancelAiAccountantOnboarding, clearAiAccountantView, fetchAiAccountantCustomers, fetchAiAccountantJobs, setSelectedTenantIdsForJobTrigger, triggerAiAccountantJob, updateAiAccountantUIState, } from './view/aiAccountantView/aiAccountantViewReducer';
611
+ export { getAiAccountantCockpitView, } from './view/aiAccountantView/aiAccountantViewSelector';
605
612
  export { fetchChatSessionsForUser, createSession, submitQuestion, updateAiCfoViewScrollPosition, updateCurrentInput, updateCotCollapsedState, clearInput, setSession, clearAiCfoView, clearCurrentSessionId, clearDeleteChatSessionStatus, clearLastContextMessage, createSessionAndSubmit, stopSubmit, stopSubmitQuestion, fetchChatHistory, acceptMasterTOS, deleteChatSession, updateResponseState, fetchSuggestedQuestions, fetchSuggestedQuestionsSuccess, fetchSuggestedQuestionsFailure, applyAiCfoSidePanelHostPageTransition, clearAiCfoSidePanelHostPageContext, } from './view/aiCfoView/aiCfoViewReducer';
606
613
  export { getAiCfoView, getSuggestedQuestionsForPageContext, } from './view/aiCfoView/aiCfoViewSelector';
607
614
  export { setNewSession, setSessions, upsertAnswerPayload, upsertOrAddQuestionAnswerPayload, addQuestionPayload, clearSession, clearAiCfo, toAiCfoVisualization, } from './entity/aiCfo/aiCfoReducer';
@@ -67,6 +67,8 @@ import accountMapping, { initialState as initialAccountMappingState, } from './v
67
67
  import addressView, { initialState as initialAddressViewState, } from './view/addressView/addressViewReducer';
68
68
  import aggregatedReport, { initialState as initialAggregatedReportViewState, } from './view/aiAgentPerformance/aggregatedReportViewReducer';
69
69
  import aiCfoView, { initialAiCfoViewState, } from './view/aiCfoView/aiCfoViewReducer';
70
+ import aiAccountantCustomer, { initialAiAccountantCustomerState, } from './entity/aiAccountantCustomer/aiAccountantCustomerReducer';
71
+ import aiAccountantView, { initialAiAccountantViewState, } from './view/aiAccountantView/aiAccountantViewReducer';
70
72
  import apAgingDetail, { initialState as initialApAgingDetailState, } from './view/apAgingView/apAgingDetail/apAgingDetailReducer';
71
73
  import apAging, { initialState as initialApAgingState, } from './view/apAgingView/apAgingReport/apAgingReducer';
72
74
  import arAgingDetail, { initialState as initialArAgingDetailState, } from './view/arAgingView/arAgingDetail/arAgingDetailReducer';
@@ -219,6 +221,7 @@ const initialEntitiesState = {
219
221
  accountReconState: initialAccountReconState,
220
222
  accountState: initialAccountState,
221
223
  addressState: initialAddressState,
224
+ aiAccountantCustomerState: initialAiAccountantCustomerState,
222
225
  aiCfoState: initialAiCfoState,
223
226
  approvalRuleState: initialApprovalRuleState,
224
227
  bankAccountState: initialBankAccountState,
@@ -285,6 +288,7 @@ const initialViewsState = {
285
288
  accountMappingState: initialAccountMappingState,
286
289
  addressViewState: initialAddressViewState,
287
290
  aggregatedReportViewState: initialAggregatedReportViewState,
291
+ aiAccountantViewState: initialAiAccountantViewState,
288
292
  aiCfoViewState: initialAiCfoViewState,
289
293
  apAgingDetailState: initialApAgingDetailState,
290
294
  apAgingState: initialApAgingState,
@@ -442,6 +446,7 @@ const entityReducers = {
442
446
  accountingSummaryState: accountingSummary,
443
447
  accountState: account,
444
448
  addressState: address,
449
+ aiAccountantCustomerState: aiAccountantCustomer,
445
450
  aiCfoState: aiCfo,
446
451
  approvalRuleState: approvalRule,
447
452
  bankAccountState: bankAccount,
@@ -509,6 +514,7 @@ const viewReducers = {
509
514
  accountMappingState: accountMapping,
510
515
  addressViewState: addressView,
511
516
  aggregatedReportViewState: aggregatedReport,
517
+ aiAccountantViewState: aiAccountantView,
512
518
  aiCfoViewState: aiCfoView,
513
519
  apAgingDetailState: apAgingDetail,
514
520
  apAgingState: apAging,
@@ -0,0 +1,2 @@
1
+ // Re-export entity payload types and mapping functions.
2
+ export { toAiAccountantCustomer, toAiAccountantEnrollment, toAiAccountantJob, } from '../../entity/aiAccountantCustomer/aiAccountantCustomerPayload';
@@ -0,0 +1,147 @@
1
+ import { createSlice } from '@reduxjs/toolkit';
2
+ export const initialAiAccountantViewState = {
3
+ customersByTenantId: {},
4
+ customersFetchStatus: { fetchState: 'Not-Started' },
5
+ selectedTenantIdsForJobTrigger: [],
6
+ triggerJobStatus: { fetchState: 'Not-Started' },
7
+ uiState: {
8
+ filterText: '',
9
+ filters: {},
10
+ selectedCustomerTenantId: '',
11
+ sortKey: 'companyName',
12
+ sortOrder: 'ascending',
13
+ },
14
+ };
15
+ const aiAccountantView = createSlice({
16
+ name: 'aiAccountantView',
17
+ initialState: initialAiAccountantViewState,
18
+ reducers: {
19
+ // ── Customers ──
20
+ fetchAiAccountantCustomers(draft) {
21
+ draft.customersFetchStatus = { fetchState: 'In-Progress' };
22
+ },
23
+ updateAiAccountantCustomers(draft, action) {
24
+ draft.customersByTenantId = toCustomersByTenantId(action.payload);
25
+ draft.customersFetchStatus = { fetchState: 'Completed' };
26
+ },
27
+ updateAiAccountantCustomersFailure(draft, action) {
28
+ draft.customersFetchStatus = {
29
+ fetchState: 'Error',
30
+ error: action.payload,
31
+ };
32
+ },
33
+ // ── Jobs ──
34
+ fetchAiAccountantJobs: {
35
+ reducer(draft, action) {
36
+ const customerView = draft.customersByTenantId[action.payload.tenantId];
37
+ if (customerView != null) {
38
+ customerView.jobsFetchStatus = { fetchState: 'In-Progress' };
39
+ }
40
+ },
41
+ prepare(tenantId, fetchNextPage) {
42
+ return { payload: { tenantId, fetchNextPage: fetchNextPage ?? false } };
43
+ },
44
+ },
45
+ updateAiAccountantJobs: {
46
+ reducer(draft, action) {
47
+ const customerView = draft.customersByTenantId[action.payload.tenantId];
48
+ if (customerView != null) {
49
+ customerView.jobsFetchStatus = { fetchState: 'Completed' };
50
+ customerView.jobsPageToken = action.payload.nextPageToken;
51
+ }
52
+ },
53
+ prepare(tenantId, nextPageToken) {
54
+ return { payload: { tenantId, nextPageToken: nextPageToken ?? null } };
55
+ },
56
+ },
57
+ updateAiAccountantJobsFailure(draft, action) {
58
+ const customerView = draft.customersByTenantId[action.payload.tenantId];
59
+ if (customerView != null) {
60
+ customerView.jobsFetchStatus = {
61
+ fetchState: 'Error',
62
+ error: action.payload.error,
63
+ };
64
+ }
65
+ },
66
+ setSelectedTenantIdsForJobTrigger(draft, action) {
67
+ draft.selectedTenantIdsForJobTrigger = action.payload;
68
+ },
69
+ // ── Trigger Job ──
70
+ triggerAiAccountantJob: {
71
+ reducer(draft,
72
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
73
+ _action) {
74
+ draft.triggerJobStatus = { fetchState: 'In-Progress' };
75
+ },
76
+ prepare(operationType, params, triggeredBy) {
77
+ return { payload: { operationType, params, triggeredBy } };
78
+ },
79
+ },
80
+ triggerAiAccountantJobSuccess(draft) {
81
+ draft.triggerJobStatus = { fetchState: 'Completed' };
82
+ },
83
+ triggerAiAccountantJobFailure(draft, action) {
84
+ draft.triggerJobStatus = { fetchState: 'Error', error: action.payload };
85
+ },
86
+ // ── Cancel Onboarding ──
87
+ cancelAiAccountantOnboarding: {
88
+ reducer(draft, action) {
89
+ const customerView = draft.customersByTenantId[action.payload.tenantId];
90
+ if (customerView != null) {
91
+ customerView.cancelOnboardingStatus = { fetchState: 'In-Progress' };
92
+ }
93
+ },
94
+ prepare(companyId, tenantId) {
95
+ return { payload: { companyId, tenantId } };
96
+ },
97
+ },
98
+ cancelAiAccountantOnboardingSuccess: {
99
+ reducer(draft, action) {
100
+ const customerView = draft.customersByTenantId[action.payload.tenantId];
101
+ if (customerView != null) {
102
+ customerView.cancelOnboardingStatus = { fetchState: 'Completed' };
103
+ }
104
+ },
105
+ prepare(tenantId) {
106
+ return { payload: { tenantId } };
107
+ },
108
+ },
109
+ cancelAiAccountantOnboardingFailure: {
110
+ reducer(draft, action) {
111
+ const customerView = draft.customersByTenantId[action.payload.tenantId];
112
+ if (customerView != null) {
113
+ customerView.cancelOnboardingStatus = {
114
+ fetchState: 'Error',
115
+ error: action.payload.error,
116
+ };
117
+ }
118
+ },
119
+ prepare(tenantId, error) {
120
+ return { payload: { tenantId, error } };
121
+ },
122
+ },
123
+ // ── UI State ──
124
+ updateAiAccountantUIState(draft, action) {
125
+ Object.assign(draft.uiState, action.payload);
126
+ },
127
+ // ── Clear ──
128
+ clearAiAccountantView() {
129
+ return initialAiAccountantViewState;
130
+ },
131
+ },
132
+ });
133
+ export const { cancelAiAccountantOnboarding, cancelAiAccountantOnboardingFailure, cancelAiAccountantOnboardingSuccess, clearAiAccountantView, fetchAiAccountantCustomers, fetchAiAccountantJobs, setSelectedTenantIdsForJobTrigger, triggerAiAccountantJob, triggerAiAccountantJobFailure, triggerAiAccountantJobSuccess, updateAiAccountantCustomers, updateAiAccountantCustomersFailure, updateAiAccountantJobs, updateAiAccountantJobsFailure, updateAiAccountantUIState, } = aiAccountantView.actions;
134
+ export default aiAccountantView.reducer;
135
+ // ── Helpers ──
136
+ const toCustomersByTenantId = (customers) => {
137
+ const result = {};
138
+ for (const payload of customers) {
139
+ result[payload.tenant_id] = {
140
+ cancelOnboardingStatus: { fetchState: 'Not-Started' },
141
+ jobsFetchStatus: { fetchState: 'Not-Started' },
142
+ jobsPageToken: null,
143
+ tenantId: payload.tenant_id,
144
+ };
145
+ }
146
+ return result;
147
+ };
@@ -0,0 +1,61 @@
1
+ import { createSelector } from '@reduxjs/toolkit';
2
+ import orderBy from 'lodash/orderBy';
3
+ import { getAiAccountantCustomers, } from '../../entity/aiAccountantCustomer/aiAccountantCustomerSelector';
4
+ export const getAiAccountantCockpitView = createSelector((state) => state.aiAccountantViewState, (state) => state.aiAccountantCustomerState, (state) => state.userState, (viewState, customerEntityState, userState) => {
5
+ const { customersByTenantId, customersFetchStatus, selectedTenantIdsForJobTrigger, triggerJobStatus, uiState, } = viewState;
6
+ const allCustomers = getAiAccountantCustomers(customerEntityState, userState);
7
+ let filteredCustomers = allCustomers;
8
+ // Text filter
9
+ const trimmedFilterText = uiState.filterText.trim();
10
+ if (trimmedFilterText.length > 0) {
11
+ const query = trimmedFilterText.toLowerCase();
12
+ filteredCustomers = filteredCustomers.filter((customer) => customer.companyName.toLowerCase().includes(query) ||
13
+ customer.tenantId.toLowerCase().includes(query));
14
+ }
15
+ // Cockpit filters (e.g. enrollmentStatus)
16
+ const enrollmentStatusFilter = uiState.filters.categories?.find((category) => category.field === 'enrollmentStatus');
17
+ if (enrollmentStatusFilter != null &&
18
+ enrollmentStatusFilter.values.length > 0) {
19
+ const selectedStatuses = enrollmentStatusFilter.values.map(String);
20
+ const isEqual = enrollmentStatusFilter.matchingOperator === 'equal';
21
+ filteredCustomers = filteredCustomers.filter((customer) => {
22
+ const status = customer.enrollment?.status ?? 'unknown';
23
+ const matches = selectedStatuses.includes(status);
24
+ return isEqual ? matches : !matches;
25
+ });
26
+ }
27
+ // Sorting
28
+ const sortedCustomers = getSortedCustomers(filteredCustomers, uiState.sortKey, uiState.sortOrder);
29
+ const selectedCustomersForJobTrigger = allCustomers.filter((customer) => selectedTenantIdsForJobTrigger.includes(customer.tenantId));
30
+ return {
31
+ fetchState: customersFetchStatus.fetchState,
32
+ error: customersFetchStatus.error,
33
+ customers: sortedCustomers,
34
+ customerViewStateByTenantId: customersByTenantId,
35
+ selectedCustomersForJobTrigger,
36
+ triggerJobStatus,
37
+ uiState,
38
+ };
39
+ });
40
+ // ── Helpers ──
41
+ const getSortedCustomers = (customers, sortKey, sortOrder) => {
42
+ const direction = sortOrder === 'ascending' ? 'asc' : 'desc';
43
+ return orderBy(customers, (customer) => {
44
+ switch (sortKey) {
45
+ case 'companyName':
46
+ return customer.companyName.toLowerCase();
47
+ case 'status':
48
+ return (customer.enrollment?.status ?? 'unknown').toLowerCase();
49
+ case 'bookcloseDate':
50
+ return customer.bookcloseDate ?? '';
51
+ case 'latestTraining':
52
+ return customer.enrollment?.latestTraining ?? '';
53
+ case 'latestSync':
54
+ return customer.enrollment?.latestTransactionSync ?? '';
55
+ case 'accuracy':
56
+ return customer.averageAccuracy;
57
+ default:
58
+ return customer.companyName.toLowerCase();
59
+ }
60
+ }, direction);
61
+ };
@@ -0,0 +1,11 @@
1
+ import { stringToUnion } from '../../commonStateTypes/stringToUnion';
2
+ const ALL_AI_ACCOUNTANT_SORT_KEYS = [
3
+ 'companyName',
4
+ 'status',
5
+ 'bookcloseDate',
6
+ 'latestTraining',
7
+ 'latestSync',
8
+ 'accuracy',
9
+ ];
10
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
11
+ const toAiAccountantSortKeyType = (v) => stringToUnion(v, ALL_AI_ACCOUNTANT_SORT_KEYS);
@@ -0,0 +1,26 @@
1
+ import { from, of } from 'rxjs';
2
+ import { catchError, filter, mergeMap } from 'rxjs/operators';
3
+ import { createZeniAPIStatus, isSuccessResponse } from '../../../responsePayload';
4
+ import { cancelAiAccountantOnboarding, cancelAiAccountantOnboardingFailure, cancelAiAccountantOnboardingSuccess, fetchAiAccountantCustomers, } from '../aiAccountantViewReducer';
5
+ export const cancelAiAccountantOnboardingEpic = (actions$, _, zeniAPI) => actions$.pipe(filter(cancelAiAccountantOnboarding.match), mergeMap((action) => {
6
+ const { tenantId, companyId } = action.payload;
7
+ const base = `${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/cockpit-panels`;
8
+ const url = `${base}/ai-accountant/cancel-onboarding`;
9
+ return zeniAPI
10
+ .postAndGetJSON(url, {
11
+ tenant_id: tenantId,
12
+ company_id: companyId,
13
+ })
14
+ .pipe(mergeMap((response) => {
15
+ if (isSuccessResponse(response)) {
16
+ return from([
17
+ cancelAiAccountantOnboardingSuccess(tenantId),
18
+ fetchAiAccountantCustomers(),
19
+ ]);
20
+ }
21
+ else {
22
+ return of(cancelAiAccountantOnboardingFailure(tenantId, response.status));
23
+ }
24
+ }), catchError((error) => of(cancelAiAccountantOnboardingFailure(tenantId, createZeniAPIStatus('Unexpected error', 'AI Accountant cancel onboarding failed: ' +
25
+ JSON.stringify(error))))));
26
+ }));
@@ -0,0 +1,27 @@
1
+ import { from, of } from 'rxjs';
2
+ import { catchError, filter, mergeMap, switchMap } from 'rxjs/operators';
3
+ import { updateAiAccountantCustomers as updateAiAccountantCustomerEntities } from '../../../entity/aiAccountantCustomer/aiAccountantCustomerReducer';
4
+ import { updateAllUsers } from '../../../entity/user/userReducer';
5
+ import { createZeniAPIStatus, isSuccessResponse } from '../../../responsePayload';
6
+ import { fetchAiAccountantCustomers, updateAiAccountantCustomers, updateAiAccountantCustomersFailure, } from '../aiAccountantViewReducer';
7
+ export const fetchAiAccountantCustomersEpic = (actions$, _, zeniAPI) => actions$.pipe(filter(fetchAiAccountantCustomers.match), switchMap(() => {
8
+ const base = `${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/cockpit-panels`;
9
+ const url = `${base}/ai-accountant/customers`;
10
+ return zeniAPI
11
+ .getJSON(url)
12
+ .pipe(mergeMap((response) => {
13
+ if (isSuccessResponse(response)) {
14
+ const customers = response.data?.customers ?? [];
15
+ const users = response.data?.users ?? [];
16
+ return from([
17
+ updateAiAccountantCustomerEntities(customers),
18
+ updateAllUsers({ users }),
19
+ updateAiAccountantCustomers(customers),
20
+ ]);
21
+ }
22
+ else {
23
+ return of(updateAiAccountantCustomersFailure(response.status));
24
+ }
25
+ }), catchError((error) => of(updateAiAccountantCustomersFailure(createZeniAPIStatus('Unexpected error', 'AI Accountant customers fetch failed: ' +
26
+ JSON.stringify(error))))));
27
+ }));
@@ -0,0 +1,47 @@
1
+ import { from, of } from 'rxjs';
2
+ import { catchError, filter, mergeMap, switchMap } from 'rxjs/operators';
3
+ import { updateAiAccountantJobs as updateAiAccountantJobEntities } from '../../../entity/aiAccountantCustomer/aiAccountantCustomerReducer';
4
+ import { updateAllUsers } from '../../../entity/user/userReducer';
5
+ import { createZeniAPIStatus, isSuccessResponse } from '../../../responsePayload';
6
+ import { fetchAiAccountantJobs, updateAiAccountantJobs, updateAiAccountantJobsFailure, } from '../aiAccountantViewReducer';
7
+ export const fetchAiAccountantJobsEpic = (actions$, state$, zeniAPI) => actions$.pipe(filter(fetchAiAccountantJobs.match), switchMap((action) => {
8
+ const { tenantId, fetchNextPage } = action.payload;
9
+ const rootState = state$.value;
10
+ const customerView = rootState.aiAccountantViewState.customersByTenantId[tenantId];
11
+ const pageToken = fetchNextPage && customerView?.jobsPageToken != null
12
+ ? customerView.jobsPageToken
13
+ : null;
14
+ const params = new URLSearchParams({
15
+ limit: '50',
16
+ tenant_id: tenantId,
17
+ });
18
+ if (pageToken != null) {
19
+ params.set('page_token', pageToken);
20
+ }
21
+ const base = `${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/cockpit-panels`;
22
+ const url = `${base}/ai-accountant/jobs?${params.toString()}`;
23
+ return zeniAPI
24
+ .getJSON(url)
25
+ .pipe(mergeMap((response) => {
26
+ if (isSuccessResponse(response)) {
27
+ const jobs = response.data?.jobs ?? [];
28
+ const users = response.data?.users ?? [];
29
+ const nextPageToken = response.data?.next_page_token ?? null;
30
+ return from([
31
+ updateAllUsers({ users }),
32
+ updateAiAccountantJobEntities(tenantId, jobs, fetchNextPage),
33
+ updateAiAccountantJobs(tenantId, nextPageToken),
34
+ ]);
35
+ }
36
+ else {
37
+ return of(updateAiAccountantJobsFailure({
38
+ tenantId,
39
+ error: response.status,
40
+ }));
41
+ }
42
+ }), catchError((error) => of(updateAiAccountantJobsFailure({
43
+ tenantId,
44
+ error: createZeniAPIStatus('Unexpected error', 'AI Accountant jobs fetch failed: ' +
45
+ JSON.stringify(error)),
46
+ }))));
47
+ }));