@zeniai/client-epic-state 4.20.3-betaSS12 → 4.20.3-betaSS13

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 (411) hide show
  1. package/lib/common/aiCfo/aiCfoSuggestedQuestionsPageContext.d.ts +19 -0
  2. package/lib/common/aiCfo/aiCfoSuggestedQuestionsPageContext.js +2 -0
  3. package/lib/commonPayloadTypes/subAccountView/reportBySubAccountPayload.d.ts +2 -0
  4. package/lib/commonStateTypes/animations.d.ts +1 -1
  5. package/lib/commonStateTypes/animations.js +4 -0
  6. package/lib/commonStateTypes/coaBalance/coaBalancesFilterProjectView.d.ts +13 -0
  7. package/lib/commonStateTypes/coaBalance/coaBalancesFilterProjectView.js +9 -0
  8. package/lib/commonStateTypes/common.d.ts +1 -1
  9. package/lib/commonStateTypes/projectView/projectViewParentID.d.ts +5 -0
  10. package/lib/commonStateTypes/projectView/projectViewParentID.js +2 -0
  11. package/lib/commonStateTypes/viewAndReport/reportIDHelper.d.ts +1 -0
  12. package/lib/commonStateTypes/viewAndReport/reportIDHelper.js +3 -1
  13. package/lib/commonStateTypes/viewAndReport/viewAndReport.d.ts +2 -2
  14. package/lib/commonStateTypes/viewAndReport/viewAndReport.js +2 -0
  15. package/lib/entity/account/accountPayload.d.ts +2 -0
  16. package/lib/entity/account/accountReducer.d.ts +5 -2
  17. package/lib/entity/account/accountReducer.js +13 -5
  18. package/lib/entity/account/accountSelector.d.ts +7 -0
  19. package/lib/entity/account/accountSelector.js +4 -2
  20. package/lib/entity/account/accountState.d.ts +3 -1
  21. package/lib/entity/account/accountState.js +4 -1
  22. package/lib/entity/account/pickAndMergeForecastAccountReport.d.ts +1 -0
  23. package/lib/entity/account/subAccountSelector.d.ts +2 -0
  24. package/lib/entity/account/subAccountSelector.js +2 -0
  25. package/lib/entity/accountGroup/accountGroupSelector.d.ts +22 -0
  26. package/lib/entity/accountGroup/accountGroupState.d.ts +1 -1
  27. package/lib/entity/accountRecon/accountReconPayload.d.ts +1 -1
  28. package/lib/entity/accountRecon/accountReconPayload.js +4 -2
  29. package/lib/entity/aiAccountantCustomer/aiAccountantCustomerPayload.d.ts +52 -0
  30. package/lib/entity/aiAccountantCustomer/aiAccountantCustomerPayload.js +70 -0
  31. package/lib/entity/aiAccountantCustomer/aiAccountantCustomerReducer.d.ts +10 -0
  32. package/lib/entity/aiAccountantCustomer/aiAccountantCustomerReducer.js +51 -0
  33. package/lib/entity/aiAccountantCustomer/aiAccountantCustomerSelector.d.ts +48 -0
  34. package/lib/entity/aiAccountantCustomer/aiAccountantCustomerSelector.js +66 -0
  35. package/lib/entity/aiAccountantCustomer/aiAccountantCustomerState.d.ts +52 -0
  36. package/lib/entity/aiAccountantCustomer/aiAccountantCustomerState.js +37 -0
  37. package/lib/entity/aiCfo/aiCfoSelector.d.ts +1 -2
  38. package/lib/entity/billPay/billTransaction/billTransactionState.d.ts +4 -4
  39. package/lib/entity/chargeCard/chargeCard.d.ts +1 -1
  40. package/lib/entity/class/classReducer.d.ts +4 -4
  41. package/lib/entity/class/classState.d.ts +1 -1
  42. package/lib/entity/depositAccountTransaction/depositAccountTransaction.d.ts +1 -1
  43. package/lib/entity/entityApprovalStatus/entityApprovalStatusState.d.ts +2 -2
  44. package/lib/entity/forecast/forecastState.d.ts +1 -1
  45. package/lib/entity/jeSchedules/jeSchedulesPayload.d.ts +38 -0
  46. package/lib/entity/jeSchedules/jeSchedulesPayload.js +78 -0
  47. package/lib/entity/jeSchedules/jeSchedulesSelector.d.ts +4 -1
  48. package/lib/entity/jeSchedules/jeSchedulesSelector.js +5 -1
  49. package/lib/entity/jeSchedules/jeSchedulesState.d.ts +37 -0
  50. package/lib/entity/jeSchedules/jeSchedulesTypes.d.ts +1 -1
  51. package/lib/entity/project/projectPayload.d.ts +13 -0
  52. package/lib/entity/project/projectPayload.js +30 -0
  53. package/lib/entity/project/projectReducer.d.ts +10 -0
  54. package/lib/entity/project/projectReducer.js +31 -0
  55. package/lib/entity/project/projectSelector.d.ts +5 -0
  56. package/lib/entity/project/projectSelector.js +12 -0
  57. package/lib/entity/project/projectState.d.ts +13 -0
  58. package/lib/entity/project/projectState.js +2 -0
  59. package/lib/entity/sectionAccountsView/sectionAccountsView.d.ts +1 -1
  60. package/lib/entity/sectionClassesViewV2/sectionClassesView.d.ts +1 -1
  61. package/lib/entity/sectionClassesViewV2/sectionClassesViewReducer.d.ts +2 -2
  62. package/lib/entity/sectionProjectView/sectionProjectView.d.ts +13 -0
  63. package/lib/entity/sectionProjectView/sectionProjectView.js +6 -0
  64. package/lib/entity/sectionProjectView/sectionProjectViewEpic.d.ts +6 -0
  65. package/lib/entity/sectionProjectView/sectionProjectViewEpic.js +56 -0
  66. package/lib/entity/sectionProjectView/sectionProjectViewHelper.d.ts +11 -0
  67. package/lib/entity/sectionProjectView/sectionProjectViewHelper.js +15 -0
  68. package/lib/entity/sectionProjectView/sectionProjectViewReducer.d.ts +15 -0
  69. package/lib/entity/sectionProjectView/sectionProjectViewReducer.js +64 -0
  70. package/lib/entity/sectionProjectView/sectionProjectViewSelector.d.ts +11 -0
  71. package/lib/entity/sectionProjectView/sectionProjectViewSelector.js +57 -0
  72. package/lib/entity/sectionProjectView/sectionProjectViewSelectorTypes.d.ts +16 -0
  73. package/lib/entity/sectionProjectView/sectionProjectViewSelectorTypes.js +2 -0
  74. package/lib/entity/sectionProjectView/sectionProjectViewState.d.ts +4 -0
  75. package/lib/entity/sectionProjectView/sectionProjectViewState.js +2 -0
  76. package/lib/entity/snackbar/snackbarTypes.d.ts +2 -2
  77. package/lib/entity/snackbar/snackbarTypes.js +10 -0
  78. package/lib/entity/tenant/clearAllEpic.d.ts +7 -2
  79. package/lib/entity/tenant/clearAllEpic.js +10 -0
  80. package/lib/entity/tenant/tenantPayload.d.ts +2 -0
  81. package/lib/entity/tenant/tenantReducer.d.ts +5 -2
  82. package/lib/entity/tenant/tenantReducer.js +10 -2
  83. package/lib/entity/tenant/tenantSelector.d.ts +2 -0
  84. package/lib/entity/tenant/tenantSelector.js +17 -1
  85. package/lib/entity/tenant/tenantState.d.ts +2 -0
  86. package/lib/entity/transaction/payloadTypes/scheduleTransactionPayload.d.ts +4 -1
  87. package/lib/entity/transaction/payloadTypes/scheduleTransactionPayload.js +1 -0
  88. package/lib/entity/transaction/payloadTypes/transactionPayload.d.ts +11 -0
  89. package/lib/entity/transaction/payloadTypes/transactionPayload.js +114 -1
  90. package/lib/entity/transaction/stateTypes/scheduleTransaction.d.ts +1 -0
  91. package/lib/entity/transaction/stateTypes/transaction.d.ts +11 -0
  92. package/lib/entity/transaction/stateTypes/transactionLine.d.ts +1 -1
  93. package/lib/entity/userRole/userRoleType.d.ts +2 -2
  94. package/lib/epic.d.ts +22 -2
  95. package/lib/epic.js +22 -2
  96. package/lib/esm/common/aiCfo/aiCfoSuggestedQuestionsPageContext.js +1 -0
  97. package/lib/esm/commonStateTypes/animations.js +4 -0
  98. package/lib/esm/commonStateTypes/coaBalance/coaBalancesFilterProjectView.js +5 -0
  99. package/lib/esm/commonStateTypes/projectView/projectViewParentID.js +1 -0
  100. package/lib/esm/commonStateTypes/viewAndReport/reportIDHelper.js +1 -0
  101. package/lib/esm/commonStateTypes/viewAndReport/viewAndReport.js +2 -0
  102. package/lib/esm/entity/account/accountReducer.js +12 -4
  103. package/lib/esm/entity/account/accountSelector.js +4 -2
  104. package/lib/esm/entity/account/accountState.js +4 -1
  105. package/lib/esm/entity/account/subAccountSelector.js +2 -0
  106. package/lib/esm/entity/accountRecon/accountReconPayload.js +4 -2
  107. package/lib/esm/entity/aiAccountantCustomer/aiAccountantCustomerPayload.js +64 -0
  108. package/lib/esm/entity/aiAccountantCustomer/aiAccountantCustomerReducer.js +47 -0
  109. package/lib/esm/entity/aiAccountantCustomer/aiAccountantCustomerSelector.js +62 -0
  110. package/lib/esm/entity/aiAccountantCustomer/aiAccountantCustomerState.js +31 -0
  111. package/lib/esm/entity/jeSchedules/jeSchedulesPayload.js +78 -0
  112. package/lib/esm/entity/jeSchedules/jeSchedulesSelector.js +5 -1
  113. package/lib/esm/entity/project/projectPayload.js +26 -0
  114. package/lib/esm/entity/project/projectReducer.js +27 -0
  115. package/lib/esm/entity/project/projectSelector.js +8 -0
  116. package/lib/esm/entity/project/projectState.js +1 -0
  117. package/lib/esm/entity/sectionProjectView/sectionProjectView.js +3 -0
  118. package/lib/esm/entity/sectionProjectView/sectionProjectViewEpic.js +52 -0
  119. package/lib/esm/entity/sectionProjectView/sectionProjectViewHelper.js +11 -0
  120. package/lib/esm/entity/sectionProjectView/sectionProjectViewReducer.js +60 -0
  121. package/lib/esm/entity/sectionProjectView/sectionProjectViewSelector.js +50 -0
  122. package/lib/esm/entity/sectionProjectView/sectionProjectViewSelectorTypes.js +1 -0
  123. package/lib/esm/entity/sectionProjectView/sectionProjectViewState.js +1 -0
  124. package/lib/esm/entity/snackbar/snackbarTypes.js +10 -0
  125. package/lib/esm/entity/tenant/clearAllEpic.js +10 -0
  126. package/lib/esm/entity/tenant/tenantReducer.js +9 -1
  127. package/lib/esm/entity/tenant/tenantSelector.js +14 -0
  128. package/lib/esm/entity/transaction/payloadTypes/scheduleTransactionPayload.js +1 -0
  129. package/lib/esm/entity/transaction/payloadTypes/transactionPayload.js +114 -1
  130. package/lib/esm/epic.js +22 -2
  131. package/lib/esm/index.js +32 -19
  132. package/lib/esm/reducer.js +20 -2
  133. package/lib/esm/view/aiAccountantView/aiAccountantViewPayload.js +2 -0
  134. package/lib/esm/view/aiAccountantView/aiAccountantViewReducer.js +152 -0
  135. package/lib/esm/view/aiAccountantView/aiAccountantViewSelector.js +77 -0
  136. package/lib/esm/view/aiAccountantView/aiAccountantViewState.js +11 -0
  137. package/lib/esm/view/aiAccountantView/epics/cancelAiAccountantOnboardingEpic.js +46 -0
  138. package/lib/esm/view/aiAccountantView/epics/fetchAiAccountantCustomersEpic.js +27 -0
  139. package/lib/esm/view/aiAccountantView/epics/fetchAiAccountantJobsEpic.js +47 -0
  140. package/lib/esm/view/aiAccountantView/epics/triggerAiAccountantJobEpic.js +76 -0
  141. package/lib/esm/view/aiCfoView/aiCfoViewReducer.js +82 -1
  142. package/lib/esm/view/aiCfoView/aiCfoViewSelector.js +8 -2
  143. package/lib/esm/view/aiCfoView/epics/fetchSuggestedQuestionsEpic.js +29 -0
  144. package/lib/esm/view/classList/fetchClassListEpic.js +9 -2
  145. package/lib/esm/view/commonVendorView/vendorView/vendorViewSelector.js +18 -5
  146. package/lib/esm/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewSelector.js +6 -2
  147. package/lib/esm/view/companyTaskManagerView/companyTaskManagerViewReducer.js +19 -1
  148. package/lib/esm/view/companyTaskManagerView/companyTaskManagerViewSelector.js +3 -1
  149. package/lib/esm/view/companyTaskManagerView/epics/fetchTaskManagerMetricsEpic.js +17 -0
  150. package/lib/esm/view/companyView/companyViewReducer.js +26 -1
  151. package/lib/esm/view/companyView/epic/companyPassport/updateAccountingClassesEnabledEpic.js +61 -0
  152. package/lib/esm/view/companyView/types/companyPassport/companyPassportViewState.js +4 -0
  153. package/lib/esm/view/creditAgentView/creditAgentViewReducer.js +1 -39
  154. package/lib/esm/view/creditAgentView/creditAgentViewSelector.js +0 -1
  155. package/lib/esm/view/creditAgentView/creditAgentViewState.js +0 -6
  156. package/lib/esm/view/expenseAutomationView/epics/accountRecon/excludeAccountFromReconciliationEpic.js +63 -0
  157. package/lib/esm/view/expenseAutomationView/epics/accountRecon/fetchReconciliationViewEpic.js +4 -9
  158. package/lib/esm/view/expenseAutomationView/epics/accountRecon/includeAccountInReconciliationEpic.js +65 -0
  159. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +2 -2
  160. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/bulkUploadMatchResultToastEpic.js +33 -0
  161. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/bulkUploadReceiptsEpic.js +3 -3
  162. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchesEpic.js +6 -4
  163. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchCompletedTransactionsEpic.js +20 -5
  164. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/refetchCompletedTransactionsOnBulkUploadSortEpic.js +12 -0
  165. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/restoreBulkUploadAutomatchingOnMountEpic.js +98 -0
  166. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/searchTransactionsForManualMatchEpic.js +7 -13
  167. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/watchBulkUploadBatchStatusEpic.js +21 -5
  168. package/lib/esm/view/expenseAutomationView/expenseAutomationViewSelector.js +0 -1
  169. package/lib/esm/view/expenseAutomationView/helpers/bulkUploadTiming.js +16 -0
  170. package/lib/esm/view/expenseAutomationView/helpers/rollingCalendarDateRangeInclusive.js +13 -0
  171. package/lib/esm/view/expenseAutomationView/helpers/saveTransactionHelper.js +2 -2
  172. package/lib/esm/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.js +2 -2
  173. package/lib/esm/view/expenseAutomationView/payload/missingReceiptsPayload.js +9 -0
  174. package/lib/esm/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +21 -1
  175. package/lib/esm/view/expenseAutomationView/reducers/missingReceiptsViewReducer.js +29 -6
  176. package/lib/esm/view/expenseAutomationView/reducers/reconciliationViewReducer.js +167 -3
  177. package/lib/esm/view/expenseAutomationView/selectorTypes/reconciliationViewSelectorTypes.js +1 -2
  178. package/lib/esm/view/expenseAutomationView/selectors/fluxAnalysisViewSelector.js +10 -2
  179. package/lib/esm/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +63 -6
  180. package/lib/esm/view/expenseAutomationView/selectors/missingReceiptsSelector.js +14 -4
  181. package/lib/esm/view/expenseAutomationView/selectors/reconciliationViewSelector.js +136 -9
  182. package/lib/esm/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +15 -5
  183. package/lib/esm/view/expenseAutomationView/types/jeSchedulesViewState.js +24 -1
  184. package/lib/esm/view/financeStatement/financeStatementSelector.js +12 -1
  185. package/lib/esm/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelector.js +3 -0
  186. package/lib/esm/view/profitAndLossProjectView/profitAndLossForTimeframeProjectViewEpic.js +47 -0
  187. package/lib/esm/view/profitAndLossProjectView/profitAndLossProjectViewEpic.js +30 -0
  188. package/lib/esm/view/profitAndLossProjectView/profitAndLossProjectViewPayload.js +1 -0
  189. package/lib/esm/view/profitAndLossProjectView/profitAndLossProjectViewReducer.js +113 -0
  190. package/lib/esm/view/profitAndLossProjectView/profitAndLossProjectViewSelector.js +65 -0
  191. package/lib/esm/view/profitAndLossProjectView/profitAndLossProjectViewSelectorTypes.js +1 -0
  192. package/lib/esm/view/profitAndLossProjectView/profitAndLossProjectViewState.js +1 -0
  193. package/lib/esm/view/reportsResync/reportsClassViewRefetchingEpic.js +4 -0
  194. package/lib/esm/view/spendManagement/autotransferRules/autoTransferRulesPayload.js +26 -0
  195. package/lib/esm/view/spendManagement/autotransferRules/autoTransferRulesReducer.js +199 -0
  196. package/lib/esm/view/spendManagement/autotransferRules/autoTransferRulesSelector.js +52 -0
  197. package/lib/esm/view/spendManagement/autotransferRules/autoTransferRulesState.js +1 -0
  198. package/lib/esm/view/spendManagement/autotransferRules/epics/createAutoTransferRuleEpic.js +100 -0
  199. package/lib/esm/view/spendManagement/autotransferRules/epics/deleteAutoTransferRuleEpic.js +48 -0
  200. package/lib/esm/view/spendManagement/autotransferRules/epics/fetchAutoTransferReviewDetailEpic.js +36 -0
  201. package/lib/esm/view/spendManagement/autotransferRules/epics/fetchAutoTransferRuleHistory.js +45 -0
  202. package/lib/esm/view/spendManagement/autotransferRules/epics/fetchAutoTransferRulesEpic.js +50 -0
  203. package/lib/esm/view/spendManagement/autotransferRules/epics/updateAutoTransferRuleEpic.js +69 -0
  204. package/lib/esm/view/spendManagement/billPay/billDetailView/epics/fetchBillDetailEpic.js +5 -5
  205. package/lib/esm/view/spendManagement/billPay/billList/billListSelector.js +10 -0
  206. package/lib/esm/view/spendManagement/billPay/billList/billListState.js +1 -0
  207. package/lib/esm/view/spendManagement/billPay/billPayReview/billPayReviewSelector.js +7 -3
  208. package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/billPaySetupApproverViewSelector.js +5 -5
  209. package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/epic/fetchBillPayApproversDetailsEpic.js +7 -2
  210. package/lib/esm/view/spendManagement/billPay/editBillView/editBillViewSelector.js +13 -6
  211. package/lib/esm/view/spendManagement/chargeCards/chargeCardList/chargeCardList.js +1 -0
  212. package/lib/esm/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.js +2 -0
  213. package/lib/esm/view/spendManagement/reimbursement/editRemiView/editRemiViewSelector.js +7 -4
  214. package/lib/esm/view/spendManagement/reimbursement/remiListView/remiListSelector.js +12 -0
  215. package/lib/esm/view/spendManagement/reimbursement/remiListView/remiListState.js +1 -0
  216. package/lib/esm/view/spendManagement/treasury/treasuryList/epics/fetchTreasuryDetailEpic.js +2 -2
  217. package/lib/esm/view/spendManagement/treasury/treasuryList/treasuryDetailReducer.js +2 -1
  218. package/lib/esm/view/taskManager/taskDetailView/taskDetailSelector.js +2 -2
  219. package/lib/esm/view/transactionDetail/epics/saveTransactionHelper.js +2 -2
  220. package/lib/esm/view/transactionDetail/transactionDetailLocalDataHelper.js +16 -14
  221. package/lib/esm/view/transactionDetail/transactionDetailSelector.js +9 -2
  222. package/lib/esm/view/twoFactorAuthentication/resendOtpEpic.js +16 -2
  223. package/lib/index.d.ts +49 -26
  224. package/lib/index.js +107 -39
  225. package/lib/reducer.d.ts +20 -2
  226. package/lib/reducer.js +20 -2
  227. package/lib/view/aiAccountantView/aiAccountantViewPayload.d.ts +33 -0
  228. package/lib/view/aiAccountantView/aiAccountantViewPayload.js +8 -0
  229. package/lib/view/aiAccountantView/aiAccountantViewReducer.d.ts +29 -0
  230. package/lib/view/aiAccountantView/aiAccountantViewReducer.js +156 -0
  231. package/lib/view/aiAccountantView/aiAccountantViewSelector.d.ts +16 -0
  232. package/lib/view/aiAccountantView/aiAccountantViewSelector.js +83 -0
  233. package/lib/view/aiAccountantView/aiAccountantViewState.d.ts +26 -0
  234. package/lib/view/aiAccountantView/aiAccountantViewState.js +13 -0
  235. package/lib/view/aiAccountantView/epics/cancelAiAccountantOnboardingEpic.d.ts +33 -0
  236. package/lib/view/aiAccountantView/epics/cancelAiAccountantOnboardingEpic.js +50 -0
  237. package/lib/view/aiAccountantView/epics/fetchAiAccountantCustomersEpic.d.ts +23 -0
  238. package/lib/view/aiAccountantView/epics/fetchAiAccountantCustomersEpic.js +31 -0
  239. package/lib/view/aiAccountantView/epics/fetchAiAccountantJobsEpic.d.ts +33 -0
  240. package/lib/view/aiAccountantView/epics/fetchAiAccountantJobsEpic.js +51 -0
  241. package/lib/view/aiAccountantView/epics/triggerAiAccountantJobEpic.d.ts +28 -0
  242. package/lib/view/aiAccountantView/epics/triggerAiAccountantJobEpic.js +80 -0
  243. package/lib/view/aiCfoView/aiCfoViewPayload.d.ts +7 -0
  244. package/lib/view/aiCfoView/aiCfoViewReducer.d.ts +15 -1
  245. package/lib/view/aiCfoView/aiCfoViewReducer.js +83 -2
  246. package/lib/view/aiCfoView/aiCfoViewSelector.d.ts +4 -1
  247. package/lib/view/aiCfoView/aiCfoViewSelector.js +9 -2
  248. package/lib/view/aiCfoView/aiCfoViewState.d.ts +15 -1
  249. package/lib/view/aiCfoView/epics/fetchSuggestedQuestionsEpic.d.ts +8 -0
  250. package/lib/view/aiCfoView/epics/fetchSuggestedQuestionsEpic.js +33 -0
  251. package/lib/view/auditReportView/auditReportViewState.d.ts +2 -2
  252. package/lib/view/billPayCard/billPayCardSelector.d.ts +1 -1
  253. package/lib/view/cardBalance/cardBalanceSelector.d.ts +2 -1
  254. package/lib/view/cashBalance/cashBalanceSelector.d.ts +2 -1
  255. package/lib/view/cashInCashOut/cashInCashOutSelector.d.ts +1 -1
  256. package/lib/view/cashPosition/cashPositionSelector.d.ts +1 -1
  257. package/lib/view/classList/fetchClassListEpic.d.ts +1 -1
  258. package/lib/view/classList/fetchClassListEpic.js +8 -1
  259. package/lib/view/commonVendorView/vendorView/vendorViewSelector.d.ts +1 -0
  260. package/lib/view/commonVendorView/vendorView/vendorViewSelector.js +18 -5
  261. package/lib/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewSelector.d.ts +1 -0
  262. package/lib/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewSelector.js +6 -2
  263. package/lib/view/companyTaskManagerView/companyTaskManagerViewReducer.d.ts +2 -2
  264. package/lib/view/companyTaskManagerView/companyTaskManagerViewReducer.js +20 -2
  265. package/lib/view/companyTaskManagerView/companyTaskManagerViewSelector.d.ts +4 -1
  266. package/lib/view/companyTaskManagerView/companyTaskManagerViewSelector.js +3 -1
  267. package/lib/view/companyTaskManagerView/companyTaskManagerViewState.d.ts +9 -1
  268. package/lib/view/companyTaskManagerView/epics/fetchTaskManagerMetricsEpic.d.ts +7 -0
  269. package/lib/view/companyTaskManagerView/epics/fetchTaskManagerMetricsEpic.js +21 -0
  270. package/lib/view/companyView/companyViewReducer.d.ts +6 -1
  271. package/lib/view/companyView/companyViewReducer.js +28 -2
  272. package/lib/view/companyView/epic/companyPassport/updateAccountingClassesEnabledEpic.d.ts +10 -0
  273. package/lib/view/companyView/epic/companyPassport/updateAccountingClassesEnabledEpic.js +65 -0
  274. package/lib/view/companyView/types/cockpitTypes.d.ts +6 -5
  275. package/lib/view/companyView/types/companyPassport/companyPassportViewState.d.ts +1 -0
  276. package/lib/view/companyView/types/companyPassport/companyPassportViewState.js +4 -0
  277. package/lib/view/creditAgentView/creditAgentViewPayload.d.ts +0 -36
  278. package/lib/view/creditAgentView/creditAgentViewReducer.d.ts +2 -2
  279. package/lib/view/creditAgentView/creditAgentViewReducer.js +2 -40
  280. package/lib/view/creditAgentView/creditAgentViewSelector.d.ts +0 -1
  281. package/lib/view/creditAgentView/creditAgentViewSelector.js +1 -2
  282. package/lib/view/creditAgentView/creditAgentViewState.d.ts +0 -31
  283. package/lib/view/creditAgentView/creditAgentViewState.js +0 -6
  284. package/lib/view/dashboard/dashboardReducer.d.ts +2 -2
  285. package/lib/view/expenseAutomationView/epics/accountRecon/excludeAccountFromReconciliationEpic.d.ts +9 -0
  286. package/lib/view/expenseAutomationView/epics/accountRecon/excludeAccountFromReconciliationEpic.js +67 -0
  287. package/lib/view/expenseAutomationView/epics/accountRecon/fetchReconciliationViewEpic.js +4 -9
  288. package/lib/view/expenseAutomationView/epics/accountRecon/includeAccountInReconciliationEpic.d.ts +10 -0
  289. package/lib/view/expenseAutomationView/epics/accountRecon/includeAccountInReconciliationEpic.js +69 -0
  290. package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +2 -2
  291. package/lib/view/expenseAutomationView/epics/missingReceipts/bulkUploadMatchResultToastEpic.d.ts +13 -0
  292. package/lib/view/expenseAutomationView/epics/missingReceipts/bulkUploadMatchResultToastEpic.js +37 -0
  293. package/lib/view/expenseAutomationView/epics/missingReceipts/bulkUploadReceiptsEpic.js +2 -2
  294. package/lib/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchesEpic.js +5 -3
  295. package/lib/view/expenseAutomationView/epics/missingReceipts/fetchCompletedTransactionsEpic.js +20 -5
  296. package/lib/view/expenseAutomationView/epics/missingReceipts/refetchCompletedTransactionsOnBulkUploadSortEpic.d.ts +10 -0
  297. package/lib/view/expenseAutomationView/epics/missingReceipts/refetchCompletedTransactionsOnBulkUploadSortEpic.js +16 -0
  298. package/lib/view/expenseAutomationView/epics/missingReceipts/restoreBulkUploadAutomatchingOnMountEpic.d.ts +18 -0
  299. package/lib/view/expenseAutomationView/epics/missingReceipts/restoreBulkUploadAutomatchingOnMountEpic.js +102 -0
  300. package/lib/view/expenseAutomationView/epics/missingReceipts/searchTransactionsForManualMatchEpic.js +7 -13
  301. package/lib/view/expenseAutomationView/epics/missingReceipts/watchBulkUploadBatchStatusEpic.d.ts +2 -2
  302. package/lib/view/expenseAutomationView/epics/missingReceipts/watchBulkUploadBatchStatusEpic.js +20 -4
  303. package/lib/view/expenseAutomationView/expenseAutomationViewSelector.js +0 -1
  304. package/lib/view/expenseAutomationView/helpers/bulkUploadTiming.d.ts +16 -0
  305. package/lib/view/expenseAutomationView/helpers/bulkUploadTiming.js +19 -0
  306. package/lib/view/expenseAutomationView/helpers/rollingCalendarDateRangeInclusive.d.ts +7 -0
  307. package/lib/view/expenseAutomationView/helpers/rollingCalendarDateRangeInclusive.js +16 -0
  308. package/lib/view/expenseAutomationView/helpers/saveTransactionHelper.js +2 -2
  309. package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +2 -2
  310. package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.js +2 -2
  311. package/lib/view/expenseAutomationView/payload/jeSchedulesPayload.d.ts +1 -1
  312. package/lib/view/expenseAutomationView/payload/missingReceiptsPayload.d.ts +5 -0
  313. package/lib/view/expenseAutomationView/payload/missingReceiptsPayload.js +10 -0
  314. package/lib/view/expenseAutomationView/payload/reconciliationPayload.d.ts +45 -0
  315. package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.d.ts +2 -2
  316. package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +22 -2
  317. package/lib/view/expenseAutomationView/reducers/missingReceiptsViewReducer.d.ts +18 -2
  318. package/lib/view/expenseAutomationView/reducers/missingReceiptsViewReducer.js +30 -7
  319. package/lib/view/expenseAutomationView/reducers/reconciliationViewReducer.d.ts +18 -4
  320. package/lib/view/expenseAutomationView/reducers/reconciliationViewReducer.js +168 -4
  321. package/lib/view/expenseAutomationView/selectorTypes/jeSchedulesSelectorTypes.d.ts +2 -0
  322. package/lib/view/expenseAutomationView/selectorTypes/missingReceiptsSelectorTypes.d.ts +2 -0
  323. package/lib/view/expenseAutomationView/selectorTypes/reconciliationViewSelectorTypes.d.ts +7 -2
  324. package/lib/view/expenseAutomationView/selectorTypes/reconciliationViewSelectorTypes.js +2 -2
  325. package/lib/view/expenseAutomationView/selectors/fluxAnalysisViewSelector.js +10 -2
  326. package/lib/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +63 -6
  327. package/lib/view/expenseAutomationView/selectors/missingReceiptsSelector.js +14 -4
  328. package/lib/view/expenseAutomationView/selectors/reconciliationViewSelector.js +136 -9
  329. package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +13 -3
  330. package/lib/view/expenseAutomationView/types/jeSchedulesViewState.d.ts +8 -0
  331. package/lib/view/expenseAutomationView/types/jeSchedulesViewState.js +27 -0
  332. package/lib/view/expenseAutomationView/types/missingReceiptsViewState.d.ts +5 -1
  333. package/lib/view/expenseAutomationView/types/reconciliationViewState.d.ts +14 -0
  334. package/lib/view/financeStatement/financeStatementReducer.d.ts +1 -1
  335. package/lib/view/financeStatement/financeStatementSelector.d.ts +2 -0
  336. package/lib/view/financeStatement/financeStatementSelector.js +12 -1
  337. package/lib/view/globalMerchantView/globalMerchantViewReducer.d.ts +2 -2
  338. package/lib/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelector.js +3 -0
  339. package/lib/view/profitAndLossProjectView/profitAndLossForTimeframeProjectViewEpic.d.ts +9 -0
  340. package/lib/view/profitAndLossProjectView/profitAndLossForTimeframeProjectViewEpic.js +51 -0
  341. package/lib/view/profitAndLossProjectView/profitAndLossProjectViewEpic.d.ts +6 -0
  342. package/lib/view/profitAndLossProjectView/profitAndLossProjectViewEpic.js +34 -0
  343. package/lib/view/profitAndLossProjectView/profitAndLossProjectViewPayload.d.ts +33 -0
  344. package/lib/view/profitAndLossProjectView/profitAndLossProjectViewPayload.js +2 -0
  345. package/lib/view/profitAndLossProjectView/profitAndLossProjectViewReducer.d.ts +33 -0
  346. package/lib/view/profitAndLossProjectView/profitAndLossProjectViewReducer.js +117 -0
  347. package/lib/view/profitAndLossProjectView/profitAndLossProjectViewSelector.d.ts +9 -0
  348. package/lib/view/profitAndLossProjectView/profitAndLossProjectViewSelector.js +69 -0
  349. package/lib/view/profitAndLossProjectView/profitAndLossProjectViewSelectorTypes.d.ts +19 -0
  350. package/lib/view/profitAndLossProjectView/profitAndLossProjectViewSelectorTypes.js +2 -0
  351. package/lib/view/profitAndLossProjectView/profitAndLossProjectViewState.d.ts +22 -0
  352. package/lib/view/profitAndLossProjectView/profitAndLossProjectViewState.js +2 -0
  353. package/lib/view/reimbursementCard/reimbursementCardSelector.d.ts +1 -1
  354. package/lib/view/reportsResync/reportsClassViewRefetchingEpic.d.ts +2 -1
  355. package/lib/view/reportsResync/reportsClassViewRefetchingEpic.js +4 -0
  356. package/lib/view/reportsResync/reportsResyncReducer.d.ts +2 -2
  357. package/lib/view/reviewCompanyView/reviewCompanyViewState.d.ts +1 -1
  358. package/lib/view/scheduleView/scheduleListView/scheduleListTypes.d.ts +1 -1
  359. package/lib/view/spendManagement/autotransferRules/autoTransferRulesPayload.d.ts +75 -0
  360. package/lib/view/spendManagement/autotransferRules/autoTransferRulesPayload.js +30 -0
  361. package/lib/view/spendManagement/autotransferRules/autoTransferRulesReducer.d.ts +50 -0
  362. package/lib/view/spendManagement/autotransferRules/autoTransferRulesReducer.js +206 -0
  363. package/lib/view/spendManagement/autotransferRules/autoTransferRulesSelector.d.ts +24 -0
  364. package/lib/view/spendManagement/autotransferRules/autoTransferRulesSelector.js +61 -0
  365. package/lib/view/spendManagement/autotransferRules/autoTransferRulesState.d.ts +38 -0
  366. package/lib/view/spendManagement/autotransferRules/autoTransferRulesState.js +2 -0
  367. package/lib/view/spendManagement/autotransferRules/epics/createAutoTransferRuleEpic.d.ts +12 -0
  368. package/lib/view/spendManagement/autotransferRules/epics/createAutoTransferRuleEpic.js +106 -0
  369. package/lib/view/spendManagement/autotransferRules/epics/deleteAutoTransferRuleEpic.d.ts +8 -0
  370. package/lib/view/spendManagement/autotransferRules/epics/deleteAutoTransferRuleEpic.js +52 -0
  371. package/lib/view/spendManagement/autotransferRules/epics/fetchAutoTransferReviewDetailEpic.d.ts +7 -0
  372. package/lib/view/spendManagement/autotransferRules/epics/fetchAutoTransferReviewDetailEpic.js +40 -0
  373. package/lib/view/spendManagement/autotransferRules/epics/fetchAutoTransferRuleHistory.d.ts +7 -0
  374. package/lib/view/spendManagement/autotransferRules/epics/fetchAutoTransferRuleHistory.js +52 -0
  375. package/lib/view/spendManagement/autotransferRules/epics/fetchAutoTransferRulesEpic.d.ts +10 -0
  376. package/lib/view/spendManagement/autotransferRules/epics/fetchAutoTransferRulesEpic.js +54 -0
  377. package/lib/view/spendManagement/autotransferRules/epics/updateAutoTransferRuleEpic.d.ts +8 -0
  378. package/lib/view/spendManagement/autotransferRules/epics/updateAutoTransferRuleEpic.js +73 -0
  379. package/lib/view/spendManagement/billPay/billDetailView/epics/fetchBillDetailEpic.js +5 -5
  380. package/lib/view/spendManagement/billPay/billList/billListReducer.d.ts +1 -1
  381. package/lib/view/spendManagement/billPay/billList/billListSelector.js +10 -0
  382. package/lib/view/spendManagement/billPay/billList/billListState.d.ts +2 -2
  383. package/lib/view/spendManagement/billPay/billList/billListState.js +1 -0
  384. package/lib/view/spendManagement/billPay/billPayReview/billPayReviewSelector.js +7 -3
  385. package/lib/view/spendManagement/billPay/billPaySetupApproverView/billPaySetupApproverViewSelector.js +5 -5
  386. package/lib/view/spendManagement/billPay/billPaySetupApproverView/epic/fetchBillPayApproversDetailsEpic.js +7 -2
  387. package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.js +13 -6
  388. package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailReducer.d.ts +4 -4
  389. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardList.d.ts +1 -1
  390. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardList.js +1 -0
  391. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.js +2 -0
  392. package/lib/view/spendManagement/reimbursement/editRemiView/editRemiViewSelector.js +6 -3
  393. package/lib/view/spendManagement/reimbursement/remiListView/remiListReducer.d.ts +1 -1
  394. package/lib/view/spendManagement/reimbursement/remiListView/remiListSelector.d.ts +1 -0
  395. package/lib/view/spendManagement/reimbursement/remiListView/remiListSelector.js +12 -0
  396. package/lib/view/spendManagement/reimbursement/remiListView/remiListState.d.ts +4 -4
  397. package/lib/view/spendManagement/reimbursement/remiListView/remiListState.js +1 -0
  398. package/lib/view/spendManagement/treasury/treasuryList/epics/fetchTreasuryDetailEpic.js +2 -2
  399. package/lib/view/spendManagement/treasury/treasuryList/treasuryDetailReducer.d.ts +2 -1
  400. package/lib/view/spendManagement/treasury/treasuryList/treasuryDetailReducer.js +2 -1
  401. package/lib/view/subscriptionView/types/subscriptionTypes.d.ts +1 -1
  402. package/lib/view/taskManager/taskDetailView/taskDetailSelector.js +2 -2
  403. package/lib/view/tasksCard/tasksCardSelector.d.ts +1 -1
  404. package/lib/view/topEx/topExSelector.d.ts +1 -1
  405. package/lib/view/transactionDetail/epics/saveTransactionHelper.js +2 -2
  406. package/lib/view/transactionDetail/transactionDetailLocalDataHelper.js +16 -14
  407. package/lib/view/transactionDetail/transactionDetailSelector.d.ts +1 -0
  408. package/lib/view/transactionDetail/transactionDetailSelector.js +9 -2
  409. package/lib/view/twoFactorAuthentication/resendOtpEpic.d.ts +1 -1
  410. package/lib/view/twoFactorAuthentication/resendOtpEpic.js +15 -1
  411. package/package.json +1 -1
@@ -1,4 +1,19 @@
1
1
  import { createSlice } from '@reduxjs/toolkit';
2
+ function removeSessionIdFromPageKeyMap(draft, sessionId) {
3
+ const map = draft.uiState.chatSessionIdByPageKey;
4
+ for (const key of Object.keys(map)) {
5
+ if (map[key] === sessionId) {
6
+ delete map[key];
7
+ }
8
+ }
9
+ }
10
+ function mirrorCurrentSessionToPageKeyMapIfActive(draft) {
11
+ const key = draft.uiState.aiCfoSidePanelHostPageKey;
12
+ const sessionId = draft.uiState.currentChatSessionId;
13
+ if (key != null && sessionId != null) {
14
+ draft.uiState.chatSessionIdByPageKey[key] = sessionId;
15
+ }
16
+ }
2
17
  export const initialAiCfoViewState = {
3
18
  fetchState: 'Not-Started',
4
19
  error: undefined,
@@ -6,6 +21,8 @@ export const initialAiCfoViewState = {
6
21
  currentInput: '',
7
22
  scrollPositionByChatSessionId: {},
8
23
  currentChatSessionId: undefined,
24
+ aiCfoSidePanelHostPageKey: undefined,
25
+ chatSessionIdByPageKey: {},
9
26
  agentId: undefined,
10
27
  chatHistoryNextPageToken: {},
11
28
  chatSessionsNextPageToken: { nextPageToken: null, hasMore: false },
@@ -29,6 +46,7 @@ export const initialAiCfoViewState = {
29
46
  fetchChatSessionHistoryByChatSessionId: {},
30
47
  responseStateByChatSessionId: {},
31
48
  stopSubmitStateByChatSessionId: {},
49
+ suggestedQuestionsByPageContext: {},
32
50
  };
33
51
  const aiCfoView = createSlice({
34
52
  name: 'aiCfoView',
@@ -162,6 +180,7 @@ const aiCfoView = createSlice({
162
180
  setSession(draft, action) {
163
181
  draft.uiState.currentChatSessionId = action.payload.sessionId;
164
182
  draft.uiState.agentId = action.payload.agentId;
183
+ mirrorCurrentSessionToPageKeyMapIfActive(draft);
165
184
  },
166
185
  createSession: {
167
186
  reducer(draft, action) {
@@ -185,6 +204,7 @@ const aiCfoView = createSlice({
185
204
  nextPageToken: null,
186
205
  hasMore: false,
187
206
  };
207
+ mirrorCurrentSessionToPageKeyMapIfActive(draft);
188
208
  },
189
209
  createSessionFailure(draft, action) {
190
210
  draft.createSessionState.fetchState = 'Error';
@@ -222,6 +242,7 @@ const aiCfoView = createSlice({
222
242
  nextPageToken: null,
223
243
  hasMore: false,
224
244
  };
245
+ mirrorCurrentSessionToPageKeyMapIfActive(draft);
225
246
  },
226
247
  createSessionAndSubmitSuccess(draft) {
227
248
  // Note: currentChatSessionId, agentId, and chatHistoryNextPageToken are set by initializeNewSessionState
@@ -338,6 +359,7 @@ const aiCfoView = createSlice({
338
359
  draft.uiState.currentChatSessionId = undefined;
339
360
  draft.uiState.agentId = undefined;
340
361
  }
362
+ removeSessionIdFromPageKeyMap(draft, chatSessionId);
341
363
  delete draft.uiState.chatHistoryNextPageToken[chatSessionId];
342
364
  delete draft.uiState.scrollPositionByChatSessionId[chatSessionId];
343
365
  delete draft.fetchChatSessionHistoryByChatSessionId[chatSessionId];
@@ -360,6 +382,65 @@ const aiCfoView = createSlice({
360
382
  },
361
383
  clearCurrentSessionId(draft) {
362
384
  draft.uiState.currentChatSessionId = undefined;
385
+ const key = draft.uiState.aiCfoSidePanelHostPageKey;
386
+ if (key != null) {
387
+ delete draft.uiState.chatSessionIdByPageKey[key];
388
+ }
389
+ },
390
+ applyAiCfoSidePanelHostPageTransition(draft, action) {
391
+ const { newAiCfoSidePanelHostPageKey, nextCurrentChatSessionId } = action.payload;
392
+ const prevKey = draft.uiState.aiCfoSidePanelHostPageKey;
393
+ const curId = draft.uiState.currentChatSessionId;
394
+ if (prevKey != null &&
395
+ prevKey !== newAiCfoSidePanelHostPageKey &&
396
+ curId != null) {
397
+ draft.uiState.chatSessionIdByPageKey[prevKey] = curId;
398
+ }
399
+ draft.uiState.aiCfoSidePanelHostPageKey = newAiCfoSidePanelHostPageKey;
400
+ draft.uiState.currentChatSessionId =
401
+ nextCurrentChatSessionId != null ? nextCurrentChatSessionId : undefined;
402
+ draft.uiState.currentInput = '';
403
+ mirrorCurrentSessionToPageKeyMapIfActive(draft);
404
+ },
405
+ clearAiCfoSidePanelHostPageContext(draft) {
406
+ const key = draft.uiState.aiCfoSidePanelHostPageKey;
407
+ const curId = draft.uiState.currentChatSessionId;
408
+ if (key != null && curId != null) {
409
+ draft.uiState.chatSessionIdByPageKey[key] = curId;
410
+ }
411
+ draft.uiState.aiCfoSidePanelHostPageKey = undefined;
412
+ },
413
+ fetchSuggestedQuestions(draft, action) {
414
+ const { pageContext } = action.payload;
415
+ const prev = draft.suggestedQuestionsByPageContext[pageContext];
416
+ draft.suggestedQuestionsByPageContext[pageContext] = {
417
+ fetchState: 'In-Progress',
418
+ pageContext,
419
+ suggestedQuestions: prev?.suggestedQuestions ?? [],
420
+ generatedAt: prev?.generatedAt,
421
+ error: undefined,
422
+ };
423
+ },
424
+ fetchSuggestedQuestionsSuccess(draft, action) {
425
+ const { pageContext, generatedAt, suggestedQuestions } = action.payload;
426
+ draft.suggestedQuestionsByPageContext[pageContext] = {
427
+ fetchState: 'Completed',
428
+ pageContext,
429
+ generatedAt,
430
+ suggestedQuestions,
431
+ error: undefined,
432
+ };
433
+ },
434
+ fetchSuggestedQuestionsFailure(draft, action) {
435
+ const { pageContext, error } = action.payload;
436
+ const prev = draft.suggestedQuestionsByPageContext[pageContext];
437
+ draft.suggestedQuestionsByPageContext[pageContext] = {
438
+ fetchState: 'Error',
439
+ pageContext,
440
+ suggestedQuestions: prev?.suggestedQuestions ?? [],
441
+ generatedAt: prev?.generatedAt,
442
+ error,
443
+ };
363
444
  },
364
445
  clearAiCfoView(draft) {
365
446
  Object.assign(draft, initialAiCfoViewState);
@@ -371,5 +452,5 @@ const aiCfoView = createSlice({
371
452
  },
372
453
  },
373
454
  });
374
- export const { submitQuestion, submitQuestionSuccess, submitQuestionFailure, updateResponseState, updateAiCfoViewScrollPosition, updateCurrentInput, clearInput, setSession, createSession, createSessionSuccess, createSessionFailure, createSessionAndSubmit, initializeNewSessionState, createSessionAndSubmitSuccess, createSessionAndSubmitFailure, fetchChatSessionsForUser, fetchChatSessionsForUserSuccess, fetchChatSessionsForUserFailure, fetchChatHistory, fetchChatHistorySuccess, fetchChatHistoryFailure, clearCurrentSessionId, clearLastContextMessage, stopSubmit, stopSubmitSuccess, stopSubmitFailure, stopSubmitQuestion, stopSubmitQuestionSuccess, stopSubmitQuestionFailure, acceptMasterTOS, acceptMasterTOSSuccess, acceptMasterTOSFailure, deleteChatSession, deleteChatSessionSuccess, deleteChatSessionFailure, clearDeleteChatSessionStatus, clearAiCfoView, updateCotCollapsedState, } = aiCfoView.actions;
455
+ export const { submitQuestion, submitQuestionSuccess, submitQuestionFailure, updateResponseState, updateAiCfoViewScrollPosition, updateCurrentInput, clearInput, setSession, createSession, createSessionSuccess, createSessionFailure, createSessionAndSubmit, initializeNewSessionState, createSessionAndSubmitSuccess, createSessionAndSubmitFailure, fetchChatSessionsForUser, fetchChatSessionsForUserSuccess, fetchChatSessionsForUserFailure, fetchChatHistory, fetchChatHistorySuccess, fetchChatHistoryFailure, clearCurrentSessionId, clearLastContextMessage, stopSubmit, stopSubmitSuccess, stopSubmitFailure, stopSubmitQuestion, stopSubmitQuestionSuccess, stopSubmitQuestionFailure, acceptMasterTOS, acceptMasterTOSSuccess, acceptMasterTOSFailure, deleteChatSession, deleteChatSessionSuccess, deleteChatSessionFailure, clearDeleteChatSessionStatus, clearAiCfoView, updateCotCollapsedState, fetchSuggestedQuestions, fetchSuggestedQuestionsSuccess, fetchSuggestedQuestionsFailure, applyAiCfoSidePanelHostPageTransition, clearAiCfoSidePanelHostPageContext, } = aiCfoView.actions;
375
456
  export default aiCfoView.reducer;
@@ -1,6 +1,8 @@
1
+ import { initialAiCfoState } from '../../entity/aiCfo/aiCfoReducer';
1
2
  import { getAiCfoSelectorView, } from '../../entity/aiCfo/aiCfoSelector';
3
+ import { initialAiCfoViewState } from './aiCfoViewReducer';
2
4
  export const getAiCfoView = (state) => {
3
- const { fetchState, error, uiState, createSessionState, createSessionAndSubmitState, deleteChatSessionStateByChatSessionId, stopSubmitStateByChatSessionId, responseStateByChatSessionId, fetchChatSessionHistoryByChatSessionId, masterTOSAcceptanceState, } = state.aiCfoViewState;
5
+ const { fetchState, error, uiState, createSessionState, createSessionAndSubmitState, deleteChatSessionStateByChatSessionId, stopSubmitStateByChatSessionId, responseStateByChatSessionId, fetchChatSessionHistoryByChatSessionId, masterTOSAcceptanceState, suggestedQuestionsByPageContext, } = state.aiCfoViewState ?? initialAiCfoViewState;
4
6
  return {
5
7
  fetchState,
6
8
  error,
@@ -12,7 +14,11 @@ export const getAiCfoView = (state) => {
12
14
  uiState,
13
15
  fetchChatSessionHistoryByChatSessionId,
14
16
  masterTOSAcceptanceState,
15
- ...getAiCfoSelectorView(state.aiCfoState),
17
+ suggestedQuestionsByPageContext,
18
+ ...getAiCfoSelectorView(state.aiCfoState ?? initialAiCfoState),
16
19
  version: 1,
17
20
  };
18
21
  };
22
+ export function getSuggestedQuestionsForPageContext(state, pageContext) {
23
+ return state.aiCfoViewState?.suggestedQuestionsByPageContext?.[pageContext];
24
+ }
@@ -0,0 +1,29 @@
1
+ import { of } from 'rxjs';
2
+ import { catchError, filter, mergeMap } from 'rxjs/operators';
3
+ import { createZeniAPIStatus, isSuccessResponse } from '../../../responsePayload';
4
+ import { fetchSuggestedQuestions, fetchSuggestedQuestionsFailure, fetchSuggestedQuestionsSuccess, } from '../aiCfoViewReducer';
5
+ /** GET {aiCfoMicroServiceBaseUrl}/1.0/suggested-questions?page_context=... */
6
+ export const fetchSuggestedQuestionsEpic = (actions$, _state$, zeniAPI) => actions$.pipe(filter(fetchSuggestedQuestions.match),
7
+ // mergeMap (not switchMap): each page_context is keyed separately in Redux; switchMap
8
+ // would cancel in-flight HTTP for context A when B is requested, leaving A stuck In-Progress.
9
+ mergeMap((action) => {
10
+ const { pageContext } = action.payload;
11
+ const query = new URLSearchParams({ page_context: pageContext });
12
+ const url = `${zeniAPI.apiEndPoints.aiCfoMicroServiceBaseUrl}/1.0/suggested-questions?${query.toString()}`;
13
+ return zeniAPI.getJSON(url).pipe(mergeMap((response) => {
14
+ if (isSuccessResponse(response) && response.data != null) {
15
+ return of(fetchSuggestedQuestionsSuccess({
16
+ pageContext,
17
+ generatedAt: response.data.generated_at,
18
+ suggestedQuestions: response.data.suggested_questions,
19
+ }));
20
+ }
21
+ return of(fetchSuggestedQuestionsFailure({
22
+ pageContext,
23
+ error: response.status,
24
+ }));
25
+ }), catchError((error) => of(fetchSuggestedQuestionsFailure({
26
+ pageContext,
27
+ error: createZeniAPIStatus('Unexpected Error', 'Fetch suggested questions REST API call failed', error instanceof Error ? { message: error.message } : undefined),
28
+ }))));
29
+ }));
@@ -1,9 +1,16 @@
1
1
  import { of } from 'rxjs';
2
- import { catchError, filter, mergeMap, switchMap } from 'rxjs/operators';
2
+ import { catchError, filter, mergeMap, switchMap, withLatestFrom, } from 'rxjs/operators';
3
3
  import { updateClasses } from '../../entity/class/classReducer';
4
+ import { getIsAccountingClassesEnabled } from '../../entity/tenant/tenantSelector';
4
5
  import { createZeniAPIStatus, isSuccessResponse } from '../../responsePayload';
5
6
  import { fetchClassList, updateClassList, updateClassListFailure, } from './classListReducer';
6
- export const fetchClassListEpic = (actions$, _state$, zeniAPI) => actions$.pipe(filter(fetchClassList.match), switchMap((action) => {
7
+ export const fetchClassListEpic = (actions$, state$, zeniAPI) => actions$.pipe(filter(fetchClassList.match), withLatestFrom(state$), switchMap(([action, state]) => {
8
+ if (!getIsAccountingClassesEnabled(state)) {
9
+ return of(updateClassList({
10
+ status: createZeniAPIStatus('Success', ''),
11
+ data: { accounting_classes: [] },
12
+ }));
13
+ }
7
14
  const { isIncludeDeleted } = action.payload;
8
15
  const queryParams = isIncludeDeleted === true
9
16
  ? `?query=${encodeURIComponent(JSON.stringify({ is_include_deleted: true }))}`
@@ -6,6 +6,7 @@ import { getContactsByIds } from '../../../entity/billPay/contact/contactSelecto
6
6
  import { getClassById } from '../../../entity/class/classSelector';
7
7
  import { getFilesByFileIds } from '../../../entity/file/fileSelector';
8
8
  import { getPaymentInstrumentsByIds } from '../../../entity/paymentInstrument/paymentInstrumentSelector';
9
+ import { getIsAccountingClassesEnabled } from '../../../entity/tenant/tenantSelector';
9
10
  import { getUserByUserId, getUsersByUserIds, } from '../../../entity/user/userSelector';
10
11
  import { getVendorByVendorId } from '../../../entity/vendor/vendorSelector';
11
12
  import { getAccountList, getNestedAccountListHierarchy, } from '../../accountList/accountListSelector';
@@ -60,13 +61,17 @@ export const getVendorView = (state, vendorIdFromUrl) => {
60
61
  ?.vendorDetailLocalData,
61
62
  supportedCountries: billPayConfigState.vendor.supportedCountries,
62
63
  };
63
- fetchState = reduceFetchState([
64
+ const isAccountingClassesEnabled = getIsAccountingClassesEnabled(state);
65
+ const editFetchStateList = [
64
66
  accountList,
65
- classList,
66
67
  vendorTypeListState,
67
68
  vendorViewState.editVendorStateById[vendorIdFromUrl]?.fetchStatus ??
68
69
  vendorViewInitialState.newVendorState.fetchStatus,
69
- ]);
70
+ ];
71
+ if (isAccountingClassesEnabled) {
72
+ editFetchStateList.push(classList);
73
+ }
74
+ fetchState = reduceFetchState(editFetchStateList);
70
75
  }
71
76
  else {
72
77
  const basicVendorDetails = getBasicVendorDetailsForNewVendor(state, vendorViewState.newVendorState);
@@ -95,11 +100,17 @@ export const getVendorView = (state, vendorIdFromUrl) => {
95
100
  if (tentativeName != null) {
96
101
  entityRecommendations = getRecommendationsForEntity(state, tentativeName, 'vendor');
97
102
  }
103
+ const isAccountingClassesEnabled = getIsAccountingClassesEnabled(state);
98
104
  const fetchStateList = [
99
105
  { fetchState: accountList.fetchState, error: accountList.error },
100
- { fetchState: classList.fetchState, error: classList.error },
101
106
  vendorTypeListState,
102
107
  ];
108
+ if (isAccountingClassesEnabled) {
109
+ fetchStateList.push({
110
+ fetchState: classList.fetchState,
111
+ error: classList.error,
112
+ });
113
+ }
103
114
  if (entityRecommendations != null &&
104
115
  entityRecommendations.recommendations != null &&
105
116
  entityRecommendations.recommendations.length > 0) {
@@ -144,6 +155,7 @@ export const getVendorView = (state, vendorIdFromUrl) => {
144
155
  fetchState: fetchState.fetchState,
145
156
  hasWireTransfer,
146
157
  hasInternationalWireTransfer,
158
+ isAccountingClassesEnabled: getIsAccountingClassesEnabled(state),
147
159
  deleteFileStatusById,
148
160
  updateFileStatusById,
149
161
  loggedInUserVerification,
@@ -219,9 +231,10 @@ const getBasicVendorDetailsForNewVendor = (state, newVendor) => {
219
231
  };
220
232
  export const getVendorDetailPageView = (state, vendorId, entity) => {
221
233
  const trendWithTransactions = getTrendWithTransactions(state, entity, 'EntityDetail');
234
+ const isAccountingClassesEnabled = getIsAccountingClassesEnabled(state);
222
235
  const reducedFetchState = reduceAnyFetchState([
223
236
  state.accountListState.byReportId.accountList,
224
- state.classListState,
237
+ ...(isAccountingClassesEnabled ? [state.classListState] : []),
225
238
  state.vendorTypeListState,
226
239
  state.ownerListState,
227
240
  state.vendorViewState.editVendorStateById[vendorId]?.fetchStatus ?? {
@@ -6,6 +6,7 @@ import { getAccountBase } from '../../../entity/account/accountSelector';
6
6
  import { getAddressByAddressId } from '../../../entity/address/addressSelector';
7
7
  import { getContactsByIds } from '../../../entity/billPay/contact/contactSelector';
8
8
  import { getClassById } from '../../../entity/class/classSelector';
9
+ import { getIsAccountingClassesEnabled } from '../../../entity/tenant/tenantSelector';
9
10
  import { getUserByUserId, getUsersByUserIds, } from '../../../entity/user/userSelector';
10
11
  import { getVendorByVendorId } from '../../../entity/vendor/vendorSelector';
11
12
  import { dateNow } from '../../../zeniDayJS';
@@ -20,6 +21,7 @@ const ALL_VENDOR_DETAIL_TABS_TYPES = [
20
21
  export const toVendorDetailTabsType = (v) => stringToUnion(v, ALL_VENDOR_DETAIL_TABS_TYPES);
21
22
  export const getVendorsTabVendorView = (state, vendorIdFromUrl) => {
22
23
  const { accountListState, accountState, classListState, classState, vendorState, userState, vendorsTabVendorViewState, vendorTypeListState, addressState, addressViewState, contactState, } = state;
24
+ const isAccountingClassesEnabled = getIsAccountingClassesEnabled(state);
23
25
  const accountList = getAccountList(accountState, accountListState, 'accountList');
24
26
  const classList = getClassList(classState, classListState);
25
27
  const ownerList = getUsersByUserIds(state.userState, state.ownerListState.ownerIds);
@@ -51,7 +53,7 @@ export const getVendorsTabVendorView = (state, vendorIdFromUrl) => {
51
53
  }
52
54
  fetchState = reduceFetchState([
53
55
  accountList,
54
- classList,
56
+ ...(isAccountingClassesEnabled ? [classList] : []),
55
57
  vendorTypeListState,
56
58
  vendorsTabVendorViewState.vendorStateById[vendorIdFromUrl]?.fetchStatus ?? {
57
59
  fetchState: 'Not-Started',
@@ -62,6 +64,7 @@ export const getVendorsTabVendorView = (state, vendorIdFromUrl) => {
62
64
  return {
63
65
  accountList: accountList,
64
66
  classList: classList,
67
+ isAccountingClassesEnabled,
65
68
  vendorTypeList: vendorTypeList,
66
69
  accountsHierarchyList,
67
70
  classHierarchyList,
@@ -102,9 +105,10 @@ export const getVendorsTabDetailPageView = (state, vendorId, entity) => {
102
105
  ? getTransactionListByEntityForSinglePeriod(state, entity, state.vendorsTabVendorViewState.allTransactionsTabData
103
106
  .numberOfQuartersFetched)
104
107
  : undefined;
108
+ const isAccountingClassesEnabled = getIsAccountingClassesEnabled(state);
105
109
  const reducedFetchState = reduceAnyFetchState([
106
110
  state.accountListState.byReportId.accountList,
107
- state.classListState,
111
+ ...(isAccountingClassesEnabled ? [state.classListState] : []),
108
112
  state.ownerListState,
109
113
  state.vendorTypeListState,
110
114
  state.vendorsTabVendorViewState.vendorStateById[vendorId]?.fetchStatus ?? {
@@ -5,10 +5,18 @@ export const initialUIState = {
5
5
  sortOrder: 'descending',
6
6
  pageToken: null,
7
7
  };
8
+ const initialMetrics = {
9
+ closed: 0,
10
+ open: 0,
11
+ overdue: 0,
12
+ total: 0,
13
+ };
8
14
  export const initialState = {
9
15
  taskIds: [],
10
16
  fetchState: 'Not-Started',
11
17
  error: undefined,
18
+ metrics: initialMetrics,
19
+ metricsFetchState: 'Not-Started',
12
20
  uiState: initialUIState,
13
21
  hasValidState() {
14
22
  return this.fetchState == 'Completed';
@@ -67,10 +75,20 @@ const companyTaskManagerView = createSlice({
67
75
  return { payload: { error } };
68
76
  },
69
77
  },
78
+ fetchTaskManagerMetrics(draft) {
79
+ draft.metricsFetchState = 'In-Progress';
80
+ },
81
+ updateTaskManagerMetrics(draft, action) {
82
+ draft.metrics = action.payload;
83
+ draft.metricsFetchState = 'Completed';
84
+ },
85
+ updateTaskManagerMetricsOnFailure(draft) {
86
+ draft.metricsFetchState = 'Error';
87
+ },
70
88
  clearCompanyTaskManagerView(draft) {
71
89
  Object.assign(draft, initialState);
72
90
  },
73
91
  },
74
92
  });
75
- export const { fetchCompanyTaskManagerView, updateCompanyTaskManagerViewOnSuccess, updateCompanyTaskManagerViewOnFailure, clearCompanyTaskManagerView, } = companyTaskManagerView.actions;
93
+ export const { fetchCompanyTaskManagerView, updateCompanyTaskManagerViewOnSuccess, updateCompanyTaskManagerViewOnFailure, fetchTaskManagerMetrics, updateTaskManagerMetrics, updateTaskManagerMetricsOnFailure, clearCompanyTaskManagerView, } = companyTaskManagerView.actions;
76
94
  export default companyTaskManagerView.reducer;
@@ -4,7 +4,7 @@ import { getTagsByIds } from '../../entity/tag/tagSelector';
4
4
  import { getTaskById } from '../../entity/task/taskSelector';
5
5
  import { getUserByUserId, getUsersByUserIds, } from '../../entity/user/userSelector';
6
6
  export const getCompanyTaskManagerView = createSelector((state) => state.companyTaskManagerViewState, (state) => state.companyState, (state) => state.userState, (state) => state.taskState, (state) => state.tagState, (companyTaskManagerViewState, companyState, userState, taskState, tagState) => {
7
- const { taskIds, uiState, fetchState, error, totalTaskCount } = companyTaskManagerViewState;
7
+ const { taskIds, uiState, fetchState, error, totalTaskCount, metrics, metricsFetchState } = companyTaskManagerViewState;
8
8
  const tasksList = [];
9
9
  taskIds.forEach((taskId) => {
10
10
  const task = getTaskById(taskState, taskId);
@@ -27,6 +27,8 @@ export const getCompanyTaskManagerView = createSelector((state) => state.company
27
27
  }
28
28
  });
29
29
  return {
30
+ metrics,
31
+ metricsFetchState,
30
32
  tasksList,
31
33
  uiState,
32
34
  fetchState,
@@ -0,0 +1,17 @@
1
+ import { of } from 'rxjs';
2
+ import { catchError, filter, mergeMap, switchMap } from 'rxjs/operators';
3
+ import { isSuccessResponse, } from '../../../responsePayload';
4
+ import { fetchTaskManagerMetrics, updateTaskManagerMetrics, updateTaskManagerMetricsOnFailure, } from '../companyTaskManagerViewReducer';
5
+ export const fetchTaskManagerMetricsEpic = (actions$, _state$, zeniAPI) => actions$.pipe(filter(fetchTaskManagerMetrics.match), switchMap(() => {
6
+ const query = JSON.stringify({ is_filter_by_logged_in_user: true });
7
+ return zeniAPI
8
+ .getJSON(`${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/cockpit-panels/tasks-es-metrics?query=${encodeURIComponent(query)}`)
9
+ .pipe(mergeMap((response) => {
10
+ if (isSuccessResponse(response) && response.data != null) {
11
+ return of(updateTaskManagerMetrics(response.data.summary));
12
+ }
13
+ else {
14
+ return of(updateTaskManagerMetricsOnFailure());
15
+ }
16
+ }), catchError(() => of(updateTaskManagerMetricsOnFailure())));
17
+ }));
@@ -284,6 +284,31 @@ const companyView = createSlice({
284
284
  error: status,
285
285
  };
286
286
  },
287
+ updateAccountingClassesEnabled: {
288
+ reducer(draft,
289
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
290
+ _action) {
291
+ draft.passportView.accountingClassesUpdateStatus = {
292
+ fetchState: 'In-Progress',
293
+ error: undefined,
294
+ };
295
+ },
296
+ prepare(companyId, enabled) {
297
+ return { payload: { companyId, enabled } };
298
+ },
299
+ },
300
+ updateAccountingClassesEnabledSuccess(draft) {
301
+ draft.passportView.accountingClassesUpdateStatus = {
302
+ fetchState: 'Completed',
303
+ error: undefined,
304
+ };
305
+ },
306
+ updateAccountingClassesEnabledFailure(draft, action) {
307
+ draft.passportView.accountingClassesUpdateStatus = {
308
+ fetchState: 'Error',
309
+ error: action.payload.status,
310
+ };
311
+ },
287
312
  companyPassportUpdatePrimaryContact: {
288
313
  reducer(draft, action) {
289
314
  const { primaryContact } = action.payload;
@@ -557,5 +582,5 @@ const companyView = createSlice({
557
582
  },
558
583
  },
559
584
  });
560
- export const { fetchCompanyPassportView, fetchAllCockpitViews, fetchOnboardingView, fetchManagementView, fetchSubscriptionView, fetchPortfolioView, fetchCompanyManagementView, companyManagementSaveUpdates, companyManagementSavePendingUpdates, companyManagementDiscardUpdates, companyManagementSaveUpdatesSuccess, companyManagementSaveUpdatesFailure, updateCompanyViewOnSuccess, updateCompanyViewOnFailure, fetchCompanyPortfolioView, fetchZeniUsers, updateZeniUsersOnSuccess, updateZeniUsersOnFailure, clearCompanyView, updateCompanyPortfolioUIState, updateCompanyManagementUIState, companyPassportSaveDataInLocalStore, deleteCompanyOfficerInLocalStore, companyPassportClearDataInLocalStore, companyPassportUpdateCompanyDetails, companyPassportUpdateCompanyDetailsSuccess, companyPassportUpdateCompanyDetailsFailure, companyPassportUpdatePrimaryContact, companyPassportUpdatePrimaryContactSuccess, companyPassportUpdatePrimaryContactFailure, companyPassportUpdateCompanyOfficer, companyPassportUpdateCompanyOfficerSuccess, companyPassportUpdateCompanyOfficerFailure, companyPassportCreateCompanyOfficers, companyPassportCreateCompanyOfficersSuccess, companyPassportCreateCompanyOfficersFailure, updateCompanyPassportLocalStoreData, saveIndustryAndIncDateInCompanyPassportLocalStore, saveCompanyPassportDetails, fetchParentSubsidiaryManagementView, updateParentSubsidiaryView, updateParentSubsidiaryViewOnFailure, updateCompanyDownloadState, fetchCompanyMetaData, updateCompanyMetaDataOnSuccess, updateCompanyMetaDataOnFailure, updateMetaDataOnSendMonthEndReport, } = companyView.actions;
585
+ export const { fetchCompanyPassportView, fetchAllCockpitViews, fetchOnboardingView, fetchManagementView, fetchSubscriptionView, fetchPortfolioView, fetchCompanyManagementView, companyManagementSaveUpdates, companyManagementSavePendingUpdates, companyManagementDiscardUpdates, companyManagementSaveUpdatesSuccess, companyManagementSaveUpdatesFailure, updateCompanyViewOnSuccess, updateCompanyViewOnFailure, fetchCompanyPortfolioView, fetchZeniUsers, updateZeniUsersOnSuccess, updateZeniUsersOnFailure, clearCompanyView, updateCompanyPortfolioUIState, updateCompanyManagementUIState, companyPassportSaveDataInLocalStore, deleteCompanyOfficerInLocalStore, companyPassportClearDataInLocalStore, companyPassportUpdateCompanyDetails, companyPassportUpdateCompanyDetailsSuccess, companyPassportUpdateCompanyDetailsFailure, updateAccountingClassesEnabled, updateAccountingClassesEnabledSuccess, updateAccountingClassesEnabledFailure, companyPassportUpdatePrimaryContact, companyPassportUpdatePrimaryContactSuccess, companyPassportUpdatePrimaryContactFailure, companyPassportUpdateCompanyOfficer, companyPassportUpdateCompanyOfficerSuccess, companyPassportUpdateCompanyOfficerFailure, companyPassportCreateCompanyOfficers, companyPassportCreateCompanyOfficersSuccess, companyPassportCreateCompanyOfficersFailure, updateCompanyPassportLocalStoreData, saveIndustryAndIncDateInCompanyPassportLocalStore, saveCompanyPassportDetails, fetchParentSubsidiaryManagementView, updateParentSubsidiaryView, updateParentSubsidiaryViewOnFailure, updateCompanyDownloadState, fetchCompanyMetaData, updateCompanyMetaDataOnSuccess, updateCompanyMetaDataOnFailure, updateMetaDataOnSendMonthEndReport, } = companyView.actions;
561
586
  export default companyView.reducer;
@@ -0,0 +1,61 @@
1
+ import { from } from 'rxjs';
2
+ import { catchError, filter, mergeMap, switchMap } from 'rxjs/operators';
3
+ import { updateCompanies } from '../../../../entity/company/companyReducer';
4
+ import { openSnackbar } from '../../../../entity/snackbar/snackbarReducer';
5
+ import { updateTenantAccountingClassesEnabled } from '../../../../entity/tenant/tenantReducer';
6
+ import { createZeniAPIStatus, isSuccessResponse, } from '../../../../responsePayload';
7
+ import { updateAccountingClassesEnabled, updateAccountingClassesEnabledFailure, updateAccountingClassesEnabledSuccess, } from '../../companyViewReducer';
8
+ export const updateAccountingClassesEnabledEpic = (actions$, state$, zeniAPI) => actions$.pipe(filter(updateAccountingClassesEnabled.match), switchMap((action) => {
9
+ const { companyId, enabled } = action.payload;
10
+ const tenantId = Object.values(state$.value.tenantState.tenantsById).find((t) => t.companyId === companyId)?.tenantId;
11
+ return zeniAPI
12
+ .putAndGetJSON(`${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/companies/${companyId}`, { is_accounting_classes_enabled: enabled })
13
+ .pipe(mergeMap((response) => {
14
+ const companies = response.data?.companies ?? [];
15
+ if (isSuccessResponse(response) && companies.length > 0) {
16
+ const actions = [
17
+ updateCompanies({
18
+ payload: companies,
19
+ schema: {},
20
+ }),
21
+ ];
22
+ if (tenantId != null) {
23
+ actions.push(updateTenantAccountingClassesEnabled({
24
+ enabled,
25
+ tenantId,
26
+ }));
27
+ }
28
+ actions.push(updateAccountingClassesEnabledSuccess());
29
+ actions.push(openSnackbar({
30
+ messageSection: 'accounting_classes_enabled_update',
31
+ messageText: 'success',
32
+ type: 'success',
33
+ }));
34
+ return from(actions);
35
+ }
36
+ else {
37
+ return from([
38
+ updateAccountingClassesEnabledFailure({
39
+ status: response.status,
40
+ }),
41
+ openSnackbar({
42
+ messageSection: 'accounting_classes_enabled_update',
43
+ messageText: 'failed',
44
+ type: 'error',
45
+ }),
46
+ ]);
47
+ }
48
+ }), catchError((error) => from([
49
+ updateAccountingClassesEnabledFailure({
50
+ status: createZeniAPIStatus('Unexpected error', 'Update Accounting Classes Enabled errored out' +
51
+ (error instanceof Error
52
+ ? error.message
53
+ : JSON.stringify(error))),
54
+ }),
55
+ openSnackbar({
56
+ messageSection: 'accounting_classes_enabled_update',
57
+ messageText: 'failed',
58
+ type: 'error',
59
+ }),
60
+ ])));
61
+ }));
@@ -1,6 +1,10 @@
1
1
  import { initialCommonState } from '../commonState';
2
2
  export const initialCompanyPassportView = {
3
3
  ...initialCommonState,
4
+ accountingClassesUpdateStatus: {
5
+ fetchState: 'Not-Started',
6
+ error: undefined,
7
+ },
4
8
  companyDetails: {
5
9
  localData: undefined,
6
10
  updateStatus: {
@@ -16,44 +16,6 @@ const creditAgentView = createSlice({
16
16
  draft.access.fetchState = 'Error';
17
17
  draft.access.isAllowed = false;
18
18
  },
19
- fetchTenantCreditScoreReport(draft) {
20
- draft.report.fetchState = 'In-Progress';
21
- draft.report.error = undefined;
22
- },
23
- updateTenantCreditScoreReport(draft, action) {
24
- draft.report.fetchState = 'Completed';
25
- draft.report.error = undefined;
26
- draft.report.rows = action.payload.report.map((row) => ({
27
- customerName: row.customer_name,
28
- totalCashBalance: row.total_cash_balance,
29
- totalCardBalance: row.total_card_balance,
30
- cards: row.cards,
31
- controllerName: row.controller_name,
32
- period: row.period,
33
- runway: row.runway,
34
- burnRateMonthly: row.burn_rate_monthly,
35
- healthMonitorScore: row.health_monitor_score,
36
- creditScore: row.credit_score,
37
- confidence: row.confidence,
38
- creditAmount: row.credit_amount,
39
- creditLimit: row.credit_limit,
40
- conservativeLimitRationale: row.conservative_limit_rationale,
41
- liberalCreditLimit: row.liberal_credit_limit,
42
- liberalLimitRationale: row.liberal_limit_rationale,
43
- pros: row.pros,
44
- cons: row.cons,
45
- reasoning: row.reasoning,
46
- goingConcernAnalysis: row.going_concern_analysis,
47
- keyRatios: row.key_ratios,
48
- runDate: row.run_date,
49
- status: row.status,
50
- }));
51
- draft.report.count = action.payload.count;
52
- },
53
- updateTenantCreditScoreReportFailure(draft, action) {
54
- draft.report.fetchState = 'Error';
55
- draft.report.error = action.payload;
56
- },
57
19
  scheduleTenantCreditScoreCron(draft,
58
20
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
59
21
  _action) {
@@ -178,6 +140,6 @@ function mapMacroPayload(payload) {
178
140
  updatedAt: payload.updated_at,
179
141
  };
180
142
  }
181
- export const { fetchCreditAgentAccess, fetchCreditAgentAccessCompleted, fetchCreditAgentAccessFailed, fetchTenantCreditScoreReport, updateTenantCreditScoreReport, updateTenantCreditScoreReportFailure, scheduleTenantCreditScoreCron, scheduleTenantCreditScoreCronSuccess, scheduleTenantCreditScoreCronFailure, resetScheduleCronState, fetchCreditAgentMacro, updateCreditAgentMacro, updateCreditAgentMacroFailure, saveCreditAgentMacro, saveCreditAgentMacroSuccess, saveCreditAgentMacroFailure, resetSaveMacroState, fetchCardProfiles, fetchCardProfilesCompleted, fetchCardProfilesFailed, updateCardProfile, updateCardProfileCompleted, updateCardProfileFailed, downloadCreditReport, downloadCreditReportCompleted, downloadCreditReportFailed, } = creditAgentView.actions;
143
+ export const { fetchCreditAgentAccess, fetchCreditAgentAccessCompleted, fetchCreditAgentAccessFailed, scheduleTenantCreditScoreCron, scheduleTenantCreditScoreCronSuccess, scheduleTenantCreditScoreCronFailure, resetScheduleCronState, fetchCreditAgentMacro, updateCreditAgentMacro, updateCreditAgentMacroFailure, saveCreditAgentMacro, saveCreditAgentMacroSuccess, saveCreditAgentMacroFailure, resetSaveMacroState, fetchCardProfiles, fetchCardProfilesCompleted, fetchCardProfilesFailed, updateCardProfile, updateCardProfileCompleted, updateCardProfileFailed, downloadCreditReport, downloadCreditReportCompleted, downloadCreditReportFailed, } = creditAgentView.actions;
182
144
  export { initialCreditAgentViewState as initialState };
183
145
  export default creditAgentView.reducer;
@@ -1,6 +1,5 @@
1
1
  import { createSelector } from '@reduxjs/toolkit';
2
2
  const getCreditAgentViewState = (state) => state.creditAgentViewState;
3
- export const getCreditAgentReport = createSelector(getCreditAgentViewState, (creditAgentViewState) => creditAgentViewState.report);
4
3
  export const getCreditAgentMacro = createSelector(getCreditAgentViewState, (creditAgentViewState) => creditAgentViewState.macro);
5
4
  export const getScheduleCronState = createSelector(getCreditAgentViewState, (creditAgentViewState) => creditAgentViewState.scheduleCron);
6
5
  export const getCardProfilesData = createSelector(getCreditAgentViewState, (creditAgentViewState) => creditAgentViewState.cardProfiles);
@@ -15,12 +15,6 @@ export const initialCreditAgentViewState = {
15
15
  fetchState: 'Not-Started',
16
16
  updateState: 'Not-Started',
17
17
  },
18
- report: {
19
- count: 0,
20
- error: undefined,
21
- fetchState: 'Not-Started',
22
- rows: [],
23
- },
24
18
  scheduleCron: {
25
19
  error: undefined,
26
20
  fetchState: 'Not-Started',