@zeniai/client-epic-state 4.19.97 → 4.19.99-beta0ND

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 (251) hide show
  1. package/lib/commonStateTypes/animations.d.ts +1 -1
  2. package/lib/commonStateTypes/coaBalance/coaBalanceType.d.ts +2 -0
  3. package/lib/commonStateTypes/coaBalance/coaBalanceType.js +6 -0
  4. package/lib/commonStateTypes/currencyHelper.d.ts +3 -0
  5. package/lib/commonStateTypes/currencyHelper.js +6 -1
  6. package/lib/commonStateTypes/reduceFetchState.d.ts +9 -0
  7. package/lib/commonStateTypes/reduceFetchState.js +26 -0
  8. package/lib/entity/account/accountPayload.d.ts +2 -0
  9. package/lib/entity/account/accountPayload.js +2 -0
  10. package/lib/entity/account/accountState.d.ts +2 -0
  11. package/lib/entity/aiCfo/aiCfoSelector.d.ts +1 -2
  12. package/lib/entity/billPay/billTransaction/billTransactionState.d.ts +2 -2
  13. package/lib/entity/customer/customerState.d.ts +0 -2
  14. package/lib/entity/customer/customerState.js +0 -5
  15. package/lib/entity/depositAccount/depositAccount.d.ts +1 -1
  16. package/lib/entity/depositAccount/depositAccount.js +8 -1
  17. package/lib/entity/jeSchedules/jeSchedulesPayload.d.ts +35 -0
  18. package/lib/entity/jeSchedules/jeSchedulesPayload.js +44 -0
  19. package/lib/entity/jeSchedules/jeSchedulesSelector.d.ts +2 -1
  20. package/lib/entity/jeSchedules/jeSchedulesSelector.js +2 -1
  21. package/lib/entity/jeSchedules/jeSchedulesState.d.ts +13 -0
  22. package/lib/entity/reimbursement/reimbursementPayload.d.ts +2 -0
  23. package/lib/entity/reimbursement/reimbursementPayload.js +7 -0
  24. package/lib/entity/reimbursement/reimbursementState.d.ts +2 -0
  25. package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
  26. package/lib/entity/snackbar/snackbarTypes.js +1 -0
  27. package/lib/entity/task/taskPayload.d.ts +1 -0
  28. package/lib/entity/task/taskPayload.js +1 -0
  29. package/lib/entity/task/taskState.d.ts +1 -0
  30. package/lib/entity/tenant/tenantPayload.d.ts +1 -0
  31. package/lib/entity/tenant/tenantReducer.js +1 -0
  32. package/lib/entity/tenant/tenantSelector.d.ts +1 -0
  33. package/lib/entity/tenant/tenantSelector.js +9 -1
  34. package/lib/entity/tenant/tenantState.d.ts +1 -0
  35. package/lib/entity/transaction/payloadTypes/transactionPayload.d.ts +3 -0
  36. package/lib/entity/transaction/payloadTypes/transactionPayload.js +11 -0
  37. package/lib/entity/transaction/stateTypes/transaction.d.ts +3 -0
  38. package/lib/entity/transaction/stateTypes/transactionLine.d.ts +1 -1
  39. package/lib/entity/userGroups/userGroupsPayload.d.ts +7 -0
  40. package/lib/entity/userGroups/userGroupsPayload.js +10 -0
  41. package/lib/entity/userGroups/userGroupsReducer.d.ts +8 -0
  42. package/lib/entity/userGroups/userGroupsReducer.js +29 -0
  43. package/lib/entity/userGroups/userGroupsSelector.d.ts +4 -0
  44. package/lib/entity/userGroups/userGroupsSelector.js +12 -0
  45. package/lib/entity/userGroups/userGroupsState.d.ts +9 -0
  46. package/lib/entity/userGroups/userGroupsState.js +2 -0
  47. package/lib/epic.d.ts +13 -1
  48. package/lib/epic.js +13 -1
  49. package/lib/esm/commonStateTypes/coaBalance/coaBalanceType.js +5 -0
  50. package/lib/esm/commonStateTypes/currencyHelper.js +5 -0
  51. package/lib/esm/commonStateTypes/reduceFetchState.js +25 -0
  52. package/lib/esm/entity/account/accountPayload.js +2 -0
  53. package/lib/esm/entity/customer/customerState.js +1 -4
  54. package/lib/esm/entity/depositAccount/depositAccount.js +8 -1
  55. package/lib/esm/entity/jeSchedules/jeSchedulesPayload.js +44 -0
  56. package/lib/esm/entity/jeSchedules/jeSchedulesSelector.js +2 -1
  57. package/lib/esm/entity/reimbursement/reimbursementPayload.js +7 -0
  58. package/lib/esm/entity/snackbar/snackbarTypes.js +1 -0
  59. package/lib/esm/entity/task/taskPayload.js +1 -0
  60. package/lib/esm/entity/tenant/tenantReducer.js +1 -0
  61. package/lib/esm/entity/tenant/tenantSelector.js +7 -0
  62. package/lib/esm/entity/transaction/payloadTypes/transactionPayload.js +11 -0
  63. package/lib/esm/entity/userGroups/userGroupsPayload.js +7 -0
  64. package/lib/esm/entity/userGroups/userGroupsReducer.js +25 -0
  65. package/lib/esm/entity/userGroups/userGroupsSelector.js +8 -0
  66. package/lib/esm/entity/userGroups/userGroupsState.js +1 -0
  67. package/lib/esm/epic.js +13 -1
  68. package/lib/esm/index.js +25 -16
  69. package/lib/esm/reducer.js +6 -0
  70. package/lib/esm/view/aiCfoView/aiCfoViewReducer.js +82 -1
  71. package/lib/esm/view/aiCfoView/aiCfoViewSelector.js +8 -2
  72. package/lib/esm/view/aiCfoView/epics/fetchSuggestedQuestionsEpic.js +29 -0
  73. package/lib/esm/view/arAgingView/arAgingReport/arAgingReducer.js +1 -1
  74. package/lib/esm/view/arAgingView/arAgingReport/arAgingSelector.js +1 -1
  75. package/lib/esm/view/classList/fetchClassListEpic.js +9 -2
  76. package/lib/esm/view/commonVendorView/vendorView/vendorViewSelector.js +18 -5
  77. package/lib/esm/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewSelector.js +6 -2
  78. package/lib/esm/view/expenseAutomationView/bulkUploadTiming.js +10 -0
  79. package/lib/esm/view/expenseAutomationView/epics/accountRecon/saveReconciliationReviewEpic.js +8 -3
  80. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/bulkUploadReceiptsEpic.js +29 -0
  81. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/confirmBulkUploadMatchEpic.js +49 -0
  82. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchDetailsEpic.js +40 -0
  83. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchesEpic.js +47 -0
  84. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchCompletedTransactionsEpic.js +61 -0
  85. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchMoreBatchDetailsEpic.js +33 -0
  86. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchMultipleBatchDetailsEpic.js +56 -0
  87. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/searchTransactionsForManualMatchEpic.js +77 -0
  88. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/uploadMissingReceiptSuccessEpic.js +7 -5
  89. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/watchBulkUploadBatchStatusEpic.js +79 -0
  90. package/lib/esm/view/expenseAutomationView/epics/transactionCategorization/uploadTransactionReceiptSuccessEpic.js +24 -0
  91. package/lib/esm/view/expenseAutomationView/helpers/saveTransactionHelper.js +2 -2
  92. package/lib/esm/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.js +2 -2
  93. package/lib/esm/view/expenseAutomationView/payload/missingReceiptsPayload.js +189 -1
  94. package/lib/esm/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +17 -1
  95. package/lib/esm/view/expenseAutomationView/reducers/missingReceiptsViewReducer.js +433 -2
  96. package/lib/esm/view/expenseAutomationView/reducers/transactionsViewReducer.js +23 -1
  97. package/lib/esm/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +50 -3
  98. package/lib/esm/view/expenseAutomationView/selectors/missingReceiptsSelector.js +245 -2
  99. package/lib/esm/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +2 -1
  100. package/lib/esm/view/expenseAutomationView/types/jeSchedulesViewState.js +17 -1
  101. package/lib/esm/view/expenseAutomationView/types/missingReceiptsViewState.js +44 -0
  102. package/lib/esm/view/expenseAutomationView/types/transactionsViewState.js +2 -1
  103. package/lib/esm/view/financeStatement/financeStatementReducer.js +11 -8
  104. package/lib/esm/view/financeStatement/financeStatementSelector.js +24 -9
  105. package/lib/esm/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelector.js +322 -0
  106. package/lib/esm/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelectorTypes.js +9 -0
  107. package/lib/esm/view/profitAndLossClassesView/profitAndLossClassesViewReducer.js +6 -1
  108. package/lib/esm/view/profitAndLossClassesView/profitAndLossClassesViewSelector.js +2 -29
  109. package/lib/esm/view/profitAndLossClassesView/profitAndLossForTimeframeClassesViewEpic.js +7 -5
  110. package/lib/esm/view/profitAndLossClassesView/profitAndLossHorizontalEnrichment.js +201 -0
  111. package/lib/esm/view/reportUIOptions/updateReportUIOptionCOABalancesRangeEpic.js +9 -7
  112. package/lib/esm/view/spendManagement/billPay/billList/billListSelector.js +10 -0
  113. package/lib/esm/view/spendManagement/billPay/billList/billListState.js +1 -0
  114. package/lib/esm/view/spendManagement/billPay/billPayReview/billPayReviewSelector.js +7 -3
  115. package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/billPaySetupApproverViewSelector.js +5 -5
  116. package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/epic/fetchBillPayApproversDetailsEpic.js +7 -2
  117. package/lib/esm/view/spendManagement/billPay/editBillView/editBillViewSelector.js +13 -6
  118. package/lib/esm/view/spendManagement/chargeCards/chargeCardList/chargeCardList.js +1 -0
  119. package/lib/esm/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.js +2 -0
  120. package/lib/esm/view/spendManagement/reimbursement/editRemiView/editRemiViewSelector.js +7 -4
  121. package/lib/esm/view/spendManagement/reimbursement/remiListView/remiListSelector.js +12 -0
  122. package/lib/esm/view/spendManagement/reimbursement/remiListView/remiListState.js +1 -0
  123. package/lib/esm/view/taskManager/taskDetailView/taskDetailSelector.js +3 -3
  124. package/lib/esm/view/taskManager/taskListView/epics/bulkUpdateTaskListEpic.js +1 -0
  125. package/lib/esm/view/taskManager/taskListView/taskListSelector.js +3 -1
  126. package/lib/esm/view/transactionDetail/epics/saveTransactionHelper.js +2 -2
  127. package/lib/esm/view/transactionDetail/transactionDetailLocalDataHelper.js +16 -14
  128. package/lib/esm/view/userGroupListView/userGroupListViewReducer.js +65 -0
  129. package/lib/esm/view/userGroupListView/userGroupListViewSelector.js +16 -0
  130. package/lib/esm/view/userGroupListView/userGroupListViewState.js +1 -0
  131. package/lib/esm/view/userListView/fetchUserListByTypeEpic.js +11 -0
  132. package/lib/esm/zeniAPI.js +0 -2
  133. package/lib/index.d.ts +31 -21
  134. package/lib/index.js +102 -34
  135. package/lib/reducer.d.ts +6 -0
  136. package/lib/reducer.js +6 -0
  137. package/lib/tsconfig.typecheck.tsbuildinfo +1 -0
  138. package/lib/view/aiCfoView/aiCfoViewPayload.d.ts +7 -0
  139. package/lib/view/aiCfoView/aiCfoViewReducer.d.ts +15 -1
  140. package/lib/view/aiCfoView/aiCfoViewReducer.js +83 -2
  141. package/lib/view/aiCfoView/aiCfoViewSelector.d.ts +4 -1
  142. package/lib/view/aiCfoView/aiCfoViewSelector.js +9 -2
  143. package/lib/view/aiCfoView/aiCfoViewState.d.ts +18 -1
  144. package/lib/view/aiCfoView/epics/fetchSuggestedQuestionsEpic.d.ts +8 -0
  145. package/lib/view/aiCfoView/epics/fetchSuggestedQuestionsEpic.js +33 -0
  146. package/lib/view/arAgingView/arAgingReport/arAgingReducer.js +2 -2
  147. package/lib/view/arAgingView/arAgingReport/arAgingSelector.js +5 -5
  148. package/lib/view/auditReportView/auditReportViewState.d.ts +1 -1
  149. package/lib/view/classList/fetchClassListEpic.d.ts +1 -1
  150. package/lib/view/classList/fetchClassListEpic.js +8 -1
  151. package/lib/view/commonVendorView/vendorView/vendorViewSelector.d.ts +1 -0
  152. package/lib/view/commonVendorView/vendorView/vendorViewSelector.js +18 -5
  153. package/lib/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewSelector.d.ts +1 -0
  154. package/lib/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewSelector.js +6 -2
  155. package/lib/view/expenseAutomationView/bulkUploadTiming.d.ts +10 -0
  156. package/lib/view/expenseAutomationView/bulkUploadTiming.js +13 -0
  157. package/lib/view/expenseAutomationView/epics/accountRecon/saveReconciliationReviewEpic.js +8 -3
  158. package/lib/view/expenseAutomationView/epics/missingReceipts/bulkUploadReceiptsEpic.d.ts +18 -0
  159. package/lib/view/expenseAutomationView/epics/missingReceipts/bulkUploadReceiptsEpic.js +33 -0
  160. package/lib/view/expenseAutomationView/epics/missingReceipts/confirmBulkUploadMatchEpic.d.ts +7 -0
  161. package/lib/view/expenseAutomationView/epics/missingReceipts/confirmBulkUploadMatchEpic.js +53 -0
  162. package/lib/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchDetailsEpic.d.ts +8 -0
  163. package/lib/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchDetailsEpic.js +44 -0
  164. package/lib/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchesEpic.d.ts +7 -0
  165. package/lib/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchesEpic.js +51 -0
  166. package/lib/view/expenseAutomationView/epics/missingReceipts/fetchCompletedTransactionsEpic.d.ts +8 -0
  167. package/lib/view/expenseAutomationView/epics/missingReceipts/fetchCompletedTransactionsEpic.js +65 -0
  168. package/lib/view/expenseAutomationView/epics/missingReceipts/fetchMoreBatchDetailsEpic.d.ts +8 -0
  169. package/lib/view/expenseAutomationView/epics/missingReceipts/fetchMoreBatchDetailsEpic.js +37 -0
  170. package/lib/view/expenseAutomationView/epics/missingReceipts/fetchMultipleBatchDetailsEpic.d.ts +9 -0
  171. package/lib/view/expenseAutomationView/epics/missingReceipts/fetchMultipleBatchDetailsEpic.js +61 -0
  172. package/lib/view/expenseAutomationView/epics/missingReceipts/searchTransactionsForManualMatchEpic.d.ts +14 -0
  173. package/lib/view/expenseAutomationView/epics/missingReceipts/searchTransactionsForManualMatchEpic.js +81 -0
  174. package/lib/view/expenseAutomationView/epics/missingReceipts/uploadMissingReceiptSuccessEpic.js +7 -5
  175. package/lib/view/expenseAutomationView/epics/missingReceipts/watchBulkUploadBatchStatusEpic.d.ts +25 -0
  176. package/lib/view/expenseAutomationView/epics/missingReceipts/watchBulkUploadBatchStatusEpic.js +85 -0
  177. package/lib/view/expenseAutomationView/epics/transactionCategorization/uploadTransactionReceiptSuccessEpic.d.ts +7 -0
  178. package/lib/view/expenseAutomationView/epics/transactionCategorization/uploadTransactionReceiptSuccessEpic.js +28 -0
  179. package/lib/view/expenseAutomationView/helpers/saveTransactionHelper.js +2 -2
  180. package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
  181. package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.js +2 -2
  182. package/lib/view/expenseAutomationView/payload/missingReceiptsPayload.d.ts +118 -0
  183. package/lib/view/expenseAutomationView/payload/missingReceiptsPayload.js +201 -0
  184. package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.d.ts +2 -2
  185. package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +18 -2
  186. package/lib/view/expenseAutomationView/reducers/missingReceiptsViewReducer.d.ts +76 -3
  187. package/lib/view/expenseAutomationView/reducers/missingReceiptsViewReducer.js +434 -2
  188. package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.d.ts +11 -3
  189. package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.js +24 -2
  190. package/lib/view/expenseAutomationView/selectorTypes/jeSchedulesSelectorTypes.d.ts +2 -0
  191. package/lib/view/expenseAutomationView/selectorTypes/missingReceiptsSelectorTypes.d.ts +69 -1
  192. package/lib/view/expenseAutomationView/selectorTypes/transactionsViewSelectorTypes.d.ts +1 -0
  193. package/lib/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +50 -3
  194. package/lib/view/expenseAutomationView/selectors/missingReceiptsSelector.d.ts +1 -1
  195. package/lib/view/expenseAutomationView/selectors/missingReceiptsSelector.js +244 -1
  196. package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +2 -1
  197. package/lib/view/expenseAutomationView/types/jeSchedulesViewState.d.ts +5 -0
  198. package/lib/view/expenseAutomationView/types/jeSchedulesViewState.js +19 -0
  199. package/lib/view/expenseAutomationView/types/missingReceiptsViewState.d.ts +142 -0
  200. package/lib/view/expenseAutomationView/types/missingReceiptsViewState.js +54 -1
  201. package/lib/view/expenseAutomationView/types/transactionsViewState.d.ts +2 -1
  202. package/lib/view/expenseAutomationView/types/transactionsViewState.js +2 -1
  203. package/lib/view/financeStatement/financeStatementReducer.js +11 -8
  204. package/lib/view/financeStatement/financeStatementSelector.d.ts +2 -0
  205. package/lib/view/financeStatement/financeStatementSelector.js +24 -9
  206. package/lib/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelector.d.ts +13 -0
  207. package/lib/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelector.js +326 -0
  208. package/lib/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelectorTypes.d.ts +111 -0
  209. package/lib/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelectorTypes.js +13 -0
  210. package/lib/view/profitAndLossClassesView/profitAndLossClassesViewReducer.d.ts +4 -2
  211. package/lib/view/profitAndLossClassesView/profitAndLossClassesViewReducer.js +7 -2
  212. package/lib/view/profitAndLossClassesView/profitAndLossClassesViewSelector.js +2 -29
  213. package/lib/view/profitAndLossClassesView/profitAndLossClassesViewState.d.ts +4 -0
  214. package/lib/view/profitAndLossClassesView/profitAndLossForTimeframeClassesViewEpic.js +7 -5
  215. package/lib/view/profitAndLossClassesView/profitAndLossHorizontalEnrichment.d.ts +6 -0
  216. package/lib/view/profitAndLossClassesView/profitAndLossHorizontalEnrichment.js +204 -0
  217. package/lib/view/reportUIOptions/updateReportUIOptionCOABalancesRangeEpic.js +8 -6
  218. package/lib/view/scheduleView/scheduleListView/scheduleListTypes.d.ts +1 -1
  219. package/lib/view/spendManagement/billPay/billList/billListSelector.js +10 -0
  220. package/lib/view/spendManagement/billPay/billList/billListState.d.ts +1 -1
  221. package/lib/view/spendManagement/billPay/billList/billListState.js +1 -0
  222. package/lib/view/spendManagement/billPay/billPayReview/billPayReviewSelector.js +7 -3
  223. package/lib/view/spendManagement/billPay/billPaySetupApproverView/billPaySetupApproverViewSelector.js +5 -5
  224. package/lib/view/spendManagement/billPay/billPaySetupApproverView/epic/fetchBillPayApproversDetailsEpic.js +7 -2
  225. package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.js +13 -6
  226. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardList.d.ts +1 -1
  227. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardList.js +1 -0
  228. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.js +2 -0
  229. package/lib/view/spendManagement/reimbursement/editRemiView/editRemiViewSelector.js +6 -3
  230. package/lib/view/spendManagement/reimbursement/remiListView/remiListSelector.d.ts +1 -0
  231. package/lib/view/spendManagement/reimbursement/remiListView/remiListSelector.js +12 -0
  232. package/lib/view/spendManagement/reimbursement/remiListView/remiListState.d.ts +1 -1
  233. package/lib/view/spendManagement/reimbursement/remiListView/remiListState.js +1 -0
  234. package/lib/view/taskManager/taskDetailView/taskDetailSelector.js +3 -3
  235. package/lib/view/taskManager/taskListView/epics/bulkUpdateTaskListEpic.d.ts +1 -0
  236. package/lib/view/taskManager/taskListView/epics/bulkUpdateTaskListEpic.js +1 -0
  237. package/lib/view/taskManager/taskListView/taskListSelector.d.ts +2 -0
  238. package/lib/view/taskManager/taskListView/taskListSelector.js +3 -1
  239. package/lib/view/transactionDetail/epics/saveTransactionHelper.js +2 -2
  240. package/lib/view/transactionDetail/transactionDetailLocalDataHelper.js +16 -14
  241. package/lib/view/userGroupListView/userGroupListViewReducer.d.ts +23 -0
  242. package/lib/view/userGroupListView/userGroupListViewReducer.js +69 -0
  243. package/lib/view/userGroupListView/userGroupListViewSelector.d.ts +7 -0
  244. package/lib/view/userGroupListView/userGroupListViewSelector.js +20 -0
  245. package/lib/view/userGroupListView/userGroupListViewState.d.ts +8 -0
  246. package/lib/view/userGroupListView/userGroupListViewState.js +2 -0
  247. package/lib/view/userListView/fetchUserListByTypeEpic.d.ts +3 -1
  248. package/lib/view/userListView/fetchUserListByTypeEpic.js +11 -0
  249. package/lib/view/userListView/userListViewPayload.d.ts +2 -0
  250. package/lib/zeniAPI.js +0 -2
  251. package/package.json +2 -2
@@ -1,6 +1,7 @@
1
1
  import { AiCfoAnswerPayload, ChatSessionPayload } from '../../entity/aiCfo/aiCfoPayload';
2
2
  import { UserRolePayload } from '../../entity/userRole/userRolePayload';
3
3
  import { ZeniAPIResponse } from '../../responsePayload';
4
+ import { AiCfoSuggestedQuestionsPageContext } from './aiCfoViewState';
4
5
  export type ContextStatus = 'NONE' | 'NOT_FOUND' | 'PERMISSION_DENIED' | 'SUCCESS';
5
6
  export interface CreateSessionResponseData {
6
7
  chat_session_id: string;
@@ -23,4 +24,10 @@ interface AcceptMasterTOSPayload {
23
24
  user_roles: UserRolePayload[];
24
25
  }
25
26
  export type AcceptMasterTOSResponse = ZeniAPIResponse<AcceptMasterTOSPayload>;
27
+ export interface SuggestedQuestionsDataPayload {
28
+ generated_at: string;
29
+ page_context: AiCfoSuggestedQuestionsPageContext;
30
+ suggested_questions: string[];
31
+ }
32
+ export type FetchSuggestedQuestionsResponse = ZeniAPIResponse<SuggestedQuestionsDataPayload>;
26
33
  export {};
@@ -4,6 +4,7 @@ import { ChatSessionPayload } from '../../entity/aiCfo/aiCfoPayload';
4
4
  import { AiCfoAnswerResponseType } from '../../entity/aiCfo/aiCfoState';
5
5
  import { ZeniAPIStatus } from '../../responsePayload';
6
6
  import { ContextStatus } from './aiCfoViewPayload';
7
+ import { AiCfoSuggestedQuestionsPageContext } from './aiCfoViewState';
7
8
  import { AiCfoViewState } from './aiCfoViewState';
8
9
  export declare const initialAiCfoViewState: AiCfoViewState;
9
10
  export declare const submitQuestion: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[sessionId: string, questionAnswerId: string, userId: string, questionId: string, createdAt: import("dayjs").Dayjs, question: string, files?: File[] | undefined], {
@@ -89,6 +90,19 @@ export declare const submitQuestion: import("@reduxjs/toolkit").ActionCreatorWit
89
90
  }, "aiCfoView/clearDeleteChatSessionStatus">, clearAiCfoView: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"aiCfoView/clearAiCfoView">, updateCotCollapsedState: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
90
91
  isCollapsed: boolean;
91
92
  questionAnswerId: ID;
92
- }, "aiCfoView/updateCotCollapsedState">;
93
+ }, "aiCfoView/updateCotCollapsedState">, fetchSuggestedQuestions: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
94
+ pageContext: AiCfoSuggestedQuestionsPageContext;
95
+ }, "aiCfoView/fetchSuggestedQuestions">, fetchSuggestedQuestionsSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
96
+ generatedAt: string;
97
+ pageContext: AiCfoSuggestedQuestionsPageContext;
98
+ suggestedQuestions: string[];
99
+ }, "aiCfoView/fetchSuggestedQuestionsSuccess">, fetchSuggestedQuestionsFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
100
+ error: ZeniAPIStatus;
101
+ pageContext: AiCfoSuggestedQuestionsPageContext;
102
+ }, "aiCfoView/fetchSuggestedQuestionsFailure">, applyAiCfoSidePanelHostPageTransition: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
103
+ newAiCfoSidePanelHostPageKey: string;
104
+ /** When omitted or null, clears the active session (empty / suggested questions). */
105
+ nextCurrentChatSessionId?: ID | null;
106
+ }, "aiCfoView/applyAiCfoSidePanelHostPageTransition">, clearAiCfoSidePanelHostPageContext: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"aiCfoView/clearAiCfoSidePanelHostPageContext">;
93
107
  declare const _default: import("redux").Reducer<AiCfoViewState>;
94
108
  export default _default;
@@ -1,8 +1,23 @@
1
1
  "use strict";
2
2
  var _a;
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.updateCotCollapsedState = exports.clearAiCfoView = exports.clearDeleteChatSessionStatus = exports.deleteChatSessionFailure = exports.deleteChatSessionSuccess = exports.deleteChatSession = exports.acceptMasterTOSFailure = exports.acceptMasterTOSSuccess = exports.acceptMasterTOS = exports.stopSubmitQuestionFailure = exports.stopSubmitQuestionSuccess = exports.stopSubmitQuestion = exports.stopSubmitFailure = exports.stopSubmitSuccess = exports.stopSubmit = exports.clearLastContextMessage = exports.clearCurrentSessionId = exports.fetchChatHistoryFailure = exports.fetchChatHistorySuccess = exports.fetchChatHistory = exports.fetchChatSessionsForUserFailure = exports.fetchChatSessionsForUserSuccess = exports.fetchChatSessionsForUser = exports.createSessionAndSubmitFailure = exports.createSessionAndSubmitSuccess = exports.initializeNewSessionState = exports.createSessionAndSubmit = exports.createSessionFailure = exports.createSessionSuccess = exports.createSession = exports.setSession = exports.clearInput = exports.updateCurrentInput = exports.updateAiCfoViewScrollPosition = exports.updateResponseState = exports.submitQuestionFailure = exports.submitQuestionSuccess = exports.submitQuestion = exports.initialAiCfoViewState = void 0;
4
+ exports.clearAiCfoSidePanelHostPageContext = exports.applyAiCfoSidePanelHostPageTransition = exports.fetchSuggestedQuestionsFailure = exports.fetchSuggestedQuestionsSuccess = exports.fetchSuggestedQuestions = exports.updateCotCollapsedState = exports.clearAiCfoView = exports.clearDeleteChatSessionStatus = exports.deleteChatSessionFailure = exports.deleteChatSessionSuccess = exports.deleteChatSession = exports.acceptMasterTOSFailure = exports.acceptMasterTOSSuccess = exports.acceptMasterTOS = exports.stopSubmitQuestionFailure = exports.stopSubmitQuestionSuccess = exports.stopSubmitQuestion = exports.stopSubmitFailure = exports.stopSubmitSuccess = exports.stopSubmit = exports.clearLastContextMessage = exports.clearCurrentSessionId = exports.fetchChatHistoryFailure = exports.fetchChatHistorySuccess = exports.fetchChatHistory = exports.fetchChatSessionsForUserFailure = exports.fetchChatSessionsForUserSuccess = exports.fetchChatSessionsForUser = exports.createSessionAndSubmitFailure = exports.createSessionAndSubmitSuccess = exports.initializeNewSessionState = exports.createSessionAndSubmit = exports.createSessionFailure = exports.createSessionSuccess = exports.createSession = exports.setSession = exports.clearInput = exports.updateCurrentInput = exports.updateAiCfoViewScrollPosition = exports.updateResponseState = exports.submitQuestionFailure = exports.submitQuestionSuccess = exports.submitQuestion = exports.initialAiCfoViewState = void 0;
5
5
  const toolkit_1 = require("@reduxjs/toolkit");
6
+ function removeSessionIdFromPageKeyMap(draft, sessionId) {
7
+ const map = draft.uiState.chatSessionIdByPageKey;
8
+ for (const key of Object.keys(map)) {
9
+ if (map[key] === sessionId) {
10
+ delete map[key];
11
+ }
12
+ }
13
+ }
14
+ function mirrorCurrentSessionToPageKeyMapIfActive(draft) {
15
+ const key = draft.uiState.aiCfoSidePanelHostPageKey;
16
+ const sessionId = draft.uiState.currentChatSessionId;
17
+ if (key != null && sessionId != null) {
18
+ draft.uiState.chatSessionIdByPageKey[key] = sessionId;
19
+ }
20
+ }
6
21
  exports.initialAiCfoViewState = {
7
22
  fetchState: 'Not-Started',
8
23
  error: undefined,
@@ -10,6 +25,8 @@ exports.initialAiCfoViewState = {
10
25
  currentInput: '',
11
26
  scrollPositionByChatSessionId: {},
12
27
  currentChatSessionId: undefined,
28
+ aiCfoSidePanelHostPageKey: undefined,
29
+ chatSessionIdByPageKey: {},
13
30
  agentId: undefined,
14
31
  chatHistoryNextPageToken: {},
15
32
  chatSessionsNextPageToken: { nextPageToken: null, hasMore: false },
@@ -33,6 +50,7 @@ exports.initialAiCfoViewState = {
33
50
  fetchChatSessionHistoryByChatSessionId: {},
34
51
  responseStateByChatSessionId: {},
35
52
  stopSubmitStateByChatSessionId: {},
53
+ suggestedQuestionsByPageContext: {},
36
54
  };
37
55
  const aiCfoView = (0, toolkit_1.createSlice)({
38
56
  name: 'aiCfoView',
@@ -166,6 +184,7 @@ const aiCfoView = (0, toolkit_1.createSlice)({
166
184
  setSession(draft, action) {
167
185
  draft.uiState.currentChatSessionId = action.payload.sessionId;
168
186
  draft.uiState.agentId = action.payload.agentId;
187
+ mirrorCurrentSessionToPageKeyMapIfActive(draft);
169
188
  },
170
189
  createSession: {
171
190
  reducer(draft, action) {
@@ -189,6 +208,7 @@ const aiCfoView = (0, toolkit_1.createSlice)({
189
208
  nextPageToken: null,
190
209
  hasMore: false,
191
210
  };
211
+ mirrorCurrentSessionToPageKeyMapIfActive(draft);
192
212
  },
193
213
  createSessionFailure(draft, action) {
194
214
  draft.createSessionState.fetchState = 'Error';
@@ -226,6 +246,7 @@ const aiCfoView = (0, toolkit_1.createSlice)({
226
246
  nextPageToken: null,
227
247
  hasMore: false,
228
248
  };
249
+ mirrorCurrentSessionToPageKeyMapIfActive(draft);
229
250
  },
230
251
  createSessionAndSubmitSuccess(draft) {
231
252
  // Note: currentChatSessionId, agentId, and chatHistoryNextPageToken are set by initializeNewSessionState
@@ -342,6 +363,7 @@ const aiCfoView = (0, toolkit_1.createSlice)({
342
363
  draft.uiState.currentChatSessionId = undefined;
343
364
  draft.uiState.agentId = undefined;
344
365
  }
366
+ removeSessionIdFromPageKeyMap(draft, chatSessionId);
345
367
  delete draft.uiState.chatHistoryNextPageToken[chatSessionId];
346
368
  delete draft.uiState.scrollPositionByChatSessionId[chatSessionId];
347
369
  delete draft.fetchChatSessionHistoryByChatSessionId[chatSessionId];
@@ -364,6 +386,65 @@ const aiCfoView = (0, toolkit_1.createSlice)({
364
386
  },
365
387
  clearCurrentSessionId(draft) {
366
388
  draft.uiState.currentChatSessionId = undefined;
389
+ const key = draft.uiState.aiCfoSidePanelHostPageKey;
390
+ if (key != null) {
391
+ delete draft.uiState.chatSessionIdByPageKey[key];
392
+ }
393
+ },
394
+ applyAiCfoSidePanelHostPageTransition(draft, action) {
395
+ const { newAiCfoSidePanelHostPageKey, nextCurrentChatSessionId } = action.payload;
396
+ const prevKey = draft.uiState.aiCfoSidePanelHostPageKey;
397
+ const curId = draft.uiState.currentChatSessionId;
398
+ if (prevKey != null &&
399
+ prevKey !== newAiCfoSidePanelHostPageKey &&
400
+ curId != null) {
401
+ draft.uiState.chatSessionIdByPageKey[prevKey] = curId;
402
+ }
403
+ draft.uiState.aiCfoSidePanelHostPageKey = newAiCfoSidePanelHostPageKey;
404
+ draft.uiState.currentChatSessionId =
405
+ nextCurrentChatSessionId != null ? nextCurrentChatSessionId : undefined;
406
+ draft.uiState.currentInput = '';
407
+ mirrorCurrentSessionToPageKeyMapIfActive(draft);
408
+ },
409
+ clearAiCfoSidePanelHostPageContext(draft) {
410
+ const key = draft.uiState.aiCfoSidePanelHostPageKey;
411
+ const curId = draft.uiState.currentChatSessionId;
412
+ if (key != null && curId != null) {
413
+ draft.uiState.chatSessionIdByPageKey[key] = curId;
414
+ }
415
+ draft.uiState.aiCfoSidePanelHostPageKey = undefined;
416
+ },
417
+ fetchSuggestedQuestions(draft, action) {
418
+ const { pageContext } = action.payload;
419
+ const prev = draft.suggestedQuestionsByPageContext[pageContext];
420
+ draft.suggestedQuestionsByPageContext[pageContext] = {
421
+ fetchState: 'In-Progress',
422
+ pageContext,
423
+ suggestedQuestions: prev?.suggestedQuestions ?? [],
424
+ generatedAt: prev?.generatedAt,
425
+ error: undefined,
426
+ };
427
+ },
428
+ fetchSuggestedQuestionsSuccess(draft, action) {
429
+ const { pageContext, generatedAt, suggestedQuestions } = action.payload;
430
+ draft.suggestedQuestionsByPageContext[pageContext] = {
431
+ fetchState: 'Completed',
432
+ pageContext,
433
+ generatedAt,
434
+ suggestedQuestions,
435
+ error: undefined,
436
+ };
437
+ },
438
+ fetchSuggestedQuestionsFailure(draft, action) {
439
+ const { pageContext, error } = action.payload;
440
+ const prev = draft.suggestedQuestionsByPageContext[pageContext];
441
+ draft.suggestedQuestionsByPageContext[pageContext] = {
442
+ fetchState: 'Error',
443
+ pageContext,
444
+ suggestedQuestions: prev?.suggestedQuestions ?? [],
445
+ generatedAt: prev?.generatedAt,
446
+ error,
447
+ };
367
448
  },
368
449
  clearAiCfoView(draft) {
369
450
  Object.assign(draft, exports.initialAiCfoViewState);
@@ -375,5 +456,5 @@ const aiCfoView = (0, toolkit_1.createSlice)({
375
456
  },
376
457
  },
377
458
  });
378
- _a = aiCfoView.actions, exports.submitQuestion = _a.submitQuestion, exports.submitQuestionSuccess = _a.submitQuestionSuccess, exports.submitQuestionFailure = _a.submitQuestionFailure, exports.updateResponseState = _a.updateResponseState, exports.updateAiCfoViewScrollPosition = _a.updateAiCfoViewScrollPosition, exports.updateCurrentInput = _a.updateCurrentInput, exports.clearInput = _a.clearInput, exports.setSession = _a.setSession, exports.createSession = _a.createSession, exports.createSessionSuccess = _a.createSessionSuccess, exports.createSessionFailure = _a.createSessionFailure, exports.createSessionAndSubmit = _a.createSessionAndSubmit, exports.initializeNewSessionState = _a.initializeNewSessionState, exports.createSessionAndSubmitSuccess = _a.createSessionAndSubmitSuccess, exports.createSessionAndSubmitFailure = _a.createSessionAndSubmitFailure, exports.fetchChatSessionsForUser = _a.fetchChatSessionsForUser, exports.fetchChatSessionsForUserSuccess = _a.fetchChatSessionsForUserSuccess, exports.fetchChatSessionsForUserFailure = _a.fetchChatSessionsForUserFailure, exports.fetchChatHistory = _a.fetchChatHistory, exports.fetchChatHistorySuccess = _a.fetchChatHistorySuccess, exports.fetchChatHistoryFailure = _a.fetchChatHistoryFailure, exports.clearCurrentSessionId = _a.clearCurrentSessionId, exports.clearLastContextMessage = _a.clearLastContextMessage, exports.stopSubmit = _a.stopSubmit, exports.stopSubmitSuccess = _a.stopSubmitSuccess, exports.stopSubmitFailure = _a.stopSubmitFailure, exports.stopSubmitQuestion = _a.stopSubmitQuestion, exports.stopSubmitQuestionSuccess = _a.stopSubmitQuestionSuccess, exports.stopSubmitQuestionFailure = _a.stopSubmitQuestionFailure, exports.acceptMasterTOS = _a.acceptMasterTOS, exports.acceptMasterTOSSuccess = _a.acceptMasterTOSSuccess, exports.acceptMasterTOSFailure = _a.acceptMasterTOSFailure, exports.deleteChatSession = _a.deleteChatSession, exports.deleteChatSessionSuccess = _a.deleteChatSessionSuccess, exports.deleteChatSessionFailure = _a.deleteChatSessionFailure, exports.clearDeleteChatSessionStatus = _a.clearDeleteChatSessionStatus, exports.clearAiCfoView = _a.clearAiCfoView, exports.updateCotCollapsedState = _a.updateCotCollapsedState;
459
+ _a = aiCfoView.actions, exports.submitQuestion = _a.submitQuestion, exports.submitQuestionSuccess = _a.submitQuestionSuccess, exports.submitQuestionFailure = _a.submitQuestionFailure, exports.updateResponseState = _a.updateResponseState, exports.updateAiCfoViewScrollPosition = _a.updateAiCfoViewScrollPosition, exports.updateCurrentInput = _a.updateCurrentInput, exports.clearInput = _a.clearInput, exports.setSession = _a.setSession, exports.createSession = _a.createSession, exports.createSessionSuccess = _a.createSessionSuccess, exports.createSessionFailure = _a.createSessionFailure, exports.createSessionAndSubmit = _a.createSessionAndSubmit, exports.initializeNewSessionState = _a.initializeNewSessionState, exports.createSessionAndSubmitSuccess = _a.createSessionAndSubmitSuccess, exports.createSessionAndSubmitFailure = _a.createSessionAndSubmitFailure, exports.fetchChatSessionsForUser = _a.fetchChatSessionsForUser, exports.fetchChatSessionsForUserSuccess = _a.fetchChatSessionsForUserSuccess, exports.fetchChatSessionsForUserFailure = _a.fetchChatSessionsForUserFailure, exports.fetchChatHistory = _a.fetchChatHistory, exports.fetchChatHistorySuccess = _a.fetchChatHistorySuccess, exports.fetchChatHistoryFailure = _a.fetchChatHistoryFailure, exports.clearCurrentSessionId = _a.clearCurrentSessionId, exports.clearLastContextMessage = _a.clearLastContextMessage, exports.stopSubmit = _a.stopSubmit, exports.stopSubmitSuccess = _a.stopSubmitSuccess, exports.stopSubmitFailure = _a.stopSubmitFailure, exports.stopSubmitQuestion = _a.stopSubmitQuestion, exports.stopSubmitQuestionSuccess = _a.stopSubmitQuestionSuccess, exports.stopSubmitQuestionFailure = _a.stopSubmitQuestionFailure, exports.acceptMasterTOS = _a.acceptMasterTOS, exports.acceptMasterTOSSuccess = _a.acceptMasterTOSSuccess, exports.acceptMasterTOSFailure = _a.acceptMasterTOSFailure, exports.deleteChatSession = _a.deleteChatSession, exports.deleteChatSessionSuccess = _a.deleteChatSessionSuccess, exports.deleteChatSessionFailure = _a.deleteChatSessionFailure, exports.clearDeleteChatSessionStatus = _a.clearDeleteChatSessionStatus, exports.clearAiCfoView = _a.clearAiCfoView, exports.updateCotCollapsedState = _a.updateCotCollapsedState, exports.fetchSuggestedQuestions = _a.fetchSuggestedQuestions, exports.fetchSuggestedQuestionsSuccess = _a.fetchSuggestedQuestionsSuccess, exports.fetchSuggestedQuestionsFailure = _a.fetchSuggestedQuestionsFailure, exports.applyAiCfoSidePanelHostPageTransition = _a.applyAiCfoSidePanelHostPageTransition, exports.clearAiCfoSidePanelHostPageContext = _a.clearAiCfoSidePanelHostPageContext;
379
460
  exports.default = aiCfoView.reducer;
@@ -3,7 +3,8 @@ import { FetchStateAndError } from '../../commonStateTypes/common';
3
3
  import { SelectorView } from '../../commonStateTypes/viewAndReport/viewAndReport';
4
4
  import { AiCfoSelectorView } from '../../entity/aiCfo/aiCfoSelector';
5
5
  import { RootState } from '../../reducer';
6
- import { AiCfoViewUIState } from './aiCfoViewState';
6
+ import { AiCfoSuggestedQuestionsPageContext } from './aiCfoViewState';
7
+ import { AiCfoViewUIState, SuggestedQuestionsForPageContext } from './aiCfoViewState';
7
8
  export interface AiCfoViewSelector extends SelectorView, AiCfoSelectorView {
8
9
  createSessionAndSubmitState: FetchStateAndError;
9
10
  createSessionState: FetchStateAndError;
@@ -17,6 +18,8 @@ export interface AiCfoViewSelector extends SelectorView, AiCfoSelectorView {
17
18
  thought: FetchStateAndError;
18
19
  }>;
19
20
  stopSubmitStateByChatSessionId: Record<ID, FetchStateAndError>;
21
+ suggestedQuestionsByPageContext: Partial<Record<AiCfoSuggestedQuestionsPageContext, SuggestedQuestionsForPageContext>>;
20
22
  uiState: AiCfoViewUIState;
21
23
  }
22
24
  export declare const getAiCfoView: (state: RootState) => AiCfoViewSelector;
25
+ export declare function getSuggestedQuestionsForPageContext(state: RootState, pageContext: AiCfoSuggestedQuestionsPageContext): SuggestedQuestionsForPageContext | undefined;
@@ -1,9 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getAiCfoView = void 0;
4
+ exports.getSuggestedQuestionsForPageContext = getSuggestedQuestionsForPageContext;
5
+ const aiCfoReducer_1 = require("../../entity/aiCfo/aiCfoReducer");
4
6
  const aiCfoSelector_1 = require("../../entity/aiCfo/aiCfoSelector");
7
+ const aiCfoViewReducer_1 = require("./aiCfoViewReducer");
5
8
  const getAiCfoView = (state) => {
6
- const { fetchState, error, uiState, createSessionState, createSessionAndSubmitState, deleteChatSessionStateByChatSessionId, stopSubmitStateByChatSessionId, responseStateByChatSessionId, fetchChatSessionHistoryByChatSessionId, masterTOSAcceptanceState, } = state.aiCfoViewState;
9
+ const { fetchState, error, uiState, createSessionState, createSessionAndSubmitState, deleteChatSessionStateByChatSessionId, stopSubmitStateByChatSessionId, responseStateByChatSessionId, fetchChatSessionHistoryByChatSessionId, masterTOSAcceptanceState, suggestedQuestionsByPageContext, } = state.aiCfoViewState ?? aiCfoViewReducer_1.initialAiCfoViewState;
7
10
  return {
8
11
  fetchState,
9
12
  error,
@@ -15,8 +18,12 @@ const getAiCfoView = (state) => {
15
18
  uiState,
16
19
  fetchChatSessionHistoryByChatSessionId,
17
20
  masterTOSAcceptanceState,
18
- ...(0, aiCfoSelector_1.getAiCfoSelectorView)(state.aiCfoState),
21
+ suggestedQuestionsByPageContext,
22
+ ...(0, aiCfoSelector_1.getAiCfoSelectorView)(state.aiCfoState ?? aiCfoReducer_1.initialAiCfoState),
19
23
  version: 1,
20
24
  };
21
25
  };
22
26
  exports.getAiCfoView = getAiCfoView;
27
+ function getSuggestedQuestionsForPageContext(state, pageContext) {
28
+ return state.aiCfoViewState?.suggestedQuestionsByPageContext?.[pageContext];
29
+ }
@@ -9,6 +9,8 @@ export interface AiCfoViewUIState {
9
9
  chatHistoryNextPageToken: {
10
10
  [chatSessionId: ID]: PageTokenState;
11
11
  };
12
+ /** Last focused chat session id per side-panel host page key (e.g. `dashboard`, `reports:profit_loss`). */
13
+ chatSessionIdByPageKey: Partial<Record<string, ID>>;
12
14
  chatSessionsFirstPageFetched: boolean;
13
15
  chatSessionsNextPageToken: PageTokenState;
14
16
  cotCollapsedByQuestionAnswerId: {
@@ -20,11 +22,24 @@ export interface AiCfoViewUIState {
20
22
  scrollTop: number;
21
23
  };
22
24
  };
23
- agentId?: ID;
25
+ agentId?: ID; /**
26
+ * When set, the side panel on host routes (e.g. dashboard/reports) is scoped to this **page key**;
27
+ * session ids are mirrored into {@link chatSessionIdByPageKey}. Full `/ai-cfo/...` should clear this.
28
+ */
29
+ aiCfoSidePanelHostPageKey?: string;
24
30
  currentChatSessionId?: ID;
25
31
  lastContextMessage?: string;
26
32
  lastContextStatus?: ContextStatus;
27
33
  }
34
+ /**
35
+ * Supported `page_context` values for GET .../suggested-questions and related UI state.
36
+ */
37
+ export type AiCfoSuggestedQuestionsPageContext = 'balance_sheet' | 'profit_loss' | 'vendors' | 'transactions' | 'cash_flow' | 'accounts_receivable' | 'accounts_payable' | 'transaction_details';
38
+ export interface SuggestedQuestionsForPageContext extends FetchStateAndError {
39
+ pageContext: AiCfoSuggestedQuestionsPageContext;
40
+ suggestedQuestions: string[];
41
+ generatedAt?: string;
42
+ }
28
43
  export interface AiCfoViewState extends FetchStateAndError {
29
44
  allChatSessionIds: ID[];
30
45
  createSessionAndSubmitState: FetchStateAndError;
@@ -39,5 +54,7 @@ export interface AiCfoViewState extends FetchStateAndError {
39
54
  thought: FetchStateAndError;
40
55
  }>;
41
56
  stopSubmitStateByChatSessionId: Record<ID, FetchStateAndError>;
57
+ /** Keyed by `page_context` query value (e.g. balance_sheet). */
58
+ suggestedQuestionsByPageContext: Partial<Record<AiCfoSuggestedQuestionsPageContext, SuggestedQuestionsForPageContext>>;
42
59
  uiState: AiCfoViewUIState;
43
60
  }
@@ -0,0 +1,8 @@
1
+ import { ActionsObservable, StateObservable } from 'redux-observable';
2
+ import { Observable } from 'rxjs';
3
+ import { RootState } from '../../../reducer';
4
+ import { ZeniAPI } from '../../../zeniAPI';
5
+ import { fetchSuggestedQuestions, fetchSuggestedQuestionsFailure, fetchSuggestedQuestionsSuccess } from '../aiCfoViewReducer';
6
+ export type ActionType = ReturnType<typeof fetchSuggestedQuestions> | ReturnType<typeof fetchSuggestedQuestionsSuccess> | ReturnType<typeof fetchSuggestedQuestionsFailure>;
7
+ /** GET {aiCfoMicroServiceBaseUrl}/1.0/suggested-questions?page_context=... */
8
+ export declare const fetchSuggestedQuestionsEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.fetchSuggestedQuestionsEpic = void 0;
4
+ const rxjs_1 = require("rxjs");
5
+ const operators_1 = require("rxjs/operators");
6
+ const responsePayload_1 = require("../../../responsePayload");
7
+ const aiCfoViewReducer_1 = require("../aiCfoViewReducer");
8
+ /** GET {aiCfoMicroServiceBaseUrl}/1.0/suggested-questions?page_context=... */
9
+ const fetchSuggestedQuestionsEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(aiCfoViewReducer_1.fetchSuggestedQuestions.match),
10
+ // mergeMap (not switchMap): each page_context is keyed separately in Redux; switchMap
11
+ // would cancel in-flight HTTP for context A when B is requested, leaving A stuck In-Progress.
12
+ (0, operators_1.mergeMap)((action) => {
13
+ const { pageContext } = action.payload;
14
+ const query = new URLSearchParams({ page_context: pageContext });
15
+ const url = `${zeniAPI.apiEndPoints.aiCfoMicroServiceBaseUrl}/1.0/suggested-questions?${query.toString()}`;
16
+ return zeniAPI.getJSON(url).pipe((0, operators_1.mergeMap)((response) => {
17
+ if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
18
+ return (0, rxjs_1.of)((0, aiCfoViewReducer_1.fetchSuggestedQuestionsSuccess)({
19
+ pageContext: response.data.page_context,
20
+ generatedAt: response.data.generated_at,
21
+ suggestedQuestions: response.data.suggested_questions,
22
+ }));
23
+ }
24
+ return (0, rxjs_1.of)((0, aiCfoViewReducer_1.fetchSuggestedQuestionsFailure)({
25
+ pageContext,
26
+ error: response.status,
27
+ }));
28
+ }), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, aiCfoViewReducer_1.fetchSuggestedQuestionsFailure)({
29
+ pageContext,
30
+ error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Fetch suggested questions REST API call failed', error instanceof Error ? { message: error.message } : undefined),
31
+ }))));
32
+ }));
33
+ exports.fetchSuggestedQuestionsEpic = fetchSuggestedQuestionsEpic;
@@ -5,9 +5,9 @@ exports.clearArAging = exports.updateArAgingNodeCollapseState = exports.updateAr
5
5
  const toolkit_1 = require("@reduxjs/toolkit");
6
6
  const viewAndReportPayloadv2_1 = require("../../../commonPayloadTypes/v2/viewAndReportPayloadv2");
7
7
  const agingBalance_1 = require("../../../commonStateTypes/agingBalance/agingBalance");
8
+ const currencyHelper_1 = require("../../../commonStateTypes/currencyHelper");
8
9
  const getNestedCustomerHierarchy_1 = require("../../../commonStateTypes/customerView/getNestedCustomerHierarchy");
9
10
  const customerPayload_1 = require("../../../entity/customer/customerPayload");
10
- const customerState_1 = require("../../../entity/customer/customerState");
11
11
  const zeniDayJS_1 = require("../../../zeniDayJS");
12
12
  const arAgingPayload_1 = require("./arAgingPayload");
13
13
  exports.inititalUIState = {
@@ -30,7 +30,7 @@ exports.initialState = {
30
30
  agingPeriods: [],
31
31
  bookCloseDate: undefined,
32
32
  dataAvailable: undefined,
33
- currency: customerState_1.defaultCustomerCurrency,
33
+ currency: currencyHelper_1.defaultCustomerCurrency,
34
34
  };
35
35
  exports.initialStateAgingBalances = {
36
36
  arAgingBalancesByCustomerId: {},
@@ -7,8 +7,8 @@ exports.getArAgingReport = void 0;
7
7
  const toolkit_1 = require("@reduxjs/toolkit");
8
8
  const orderBy_1 = __importDefault(require("lodash/orderBy"));
9
9
  const agingBalance_1 = require("../../../commonStateTypes/agingBalance/agingBalance");
10
+ const currencyHelper_1 = require("../../../commonStateTypes/currencyHelper");
10
11
  const customerSelector_1 = require("../../../entity/customer/customerSelector");
11
- const customerState_1 = require("../../../entity/customer/customerState");
12
12
  exports.getArAgingReport = (0, toolkit_1.createSelector)((state) => state.arAgingState, (state) => state.customerState, (arAgingState, customerState) => {
13
13
  const { reportId, reportTitle, fetchState, uiState, firstMonthOfFY, agingPeriods, } = arAgingState;
14
14
  const { searchString, sortOrder, sortKey, selectedDate } = uiState;
@@ -87,13 +87,13 @@ const getCustomerAgingReport = (customerState, nestedCustomer, arAgingBalancesBy
87
87
  children: getNestedAgingBalancesByCustomer(customerState, arAgingBalancesByCustomerId, nestedCustomer.children, searchString, sortKey, sortOrder),
88
88
  total: {
89
89
  amount: customerTotal,
90
- currencyCode: currencyCode ?? customerState_1.defaultCustomerCurrency.currencyCode,
91
- currencySymbol: currencySymbol ?? customerState_1.defaultCustomerCurrency.currencySymbol,
90
+ currencyCode: currencyCode ?? currencyHelper_1.defaultCustomerCurrency.currencyCode,
91
+ currencySymbol: currencySymbol ?? currencyHelper_1.defaultCustomerCurrency.currencySymbol,
92
92
  },
93
93
  totalWithChildren: {
94
94
  amount: customerTotalWithChildren,
95
- currencyCode: currencyCode ?? customerState_1.defaultCustomerCurrency.currencyCode,
96
- currencySymbol: currencySymbol ?? customerState_1.defaultCustomerCurrency.currencySymbol,
95
+ currencyCode: currencyCode ?? currencyHelper_1.defaultCustomerCurrency.currencyCode,
96
+ currencySymbol: currencySymbol ?? currencyHelper_1.defaultCustomerCurrency.currencySymbol,
97
97
  },
98
98
  };
99
99
  };
@@ -3,7 +3,7 @@ import { Status } from '../../commonStateTypes/status';
3
3
  import { View } from '../../commonStateTypes/viewAndReport/viewAndReport';
4
4
  import { ZeniDate } from '../../zeniDayJS';
5
5
  import { AuditSummary } from '../reviewCompanyView/reviewCompanyViewState';
6
- export declare const toAuditRuleEntityType: (v: string) => "dashboard" | "reports" | "transactions";
6
+ export declare const toAuditRuleEntityType: (v: string) => "dashboard" | "transactions" | "reports";
7
7
  export type AuditRuleEntityType = ReturnType<typeof toAuditRuleEntityType>;
8
8
  declare const toAuditRuleEntityIdType: (v: string) => "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "revenue" | "revenue_by_classes" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "zeni_treasury" | "charge_cards" | "other_connection" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "billing" | "flux_analysis_operating_expense" | "account_reconciliation" | "zeni_credit_promo_card" | "treasury_promo_card" | "uncategorized-expense" | "uncategorized-income";
9
9
  export type AuditRuleEntityIdType = ReturnType<typeof toAuditRuleEntityIdType>;
@@ -5,4 +5,4 @@ import { RootState } from '../../reducer';
5
5
  import { ZeniAPI } from '../../zeniAPI';
6
6
  import { fetchClassList, updateClassList, updateClassListFailure } from './classListReducer';
7
7
  export type ActionType = ReturnType<typeof fetchClassList> | ReturnType<typeof updateClasses> | ReturnType<typeof updateClassList> | ReturnType<typeof updateClassListFailure>;
8
- export declare const fetchClassListEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
8
+ export declare const fetchClassListEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
@@ -4,9 +4,16 @@ exports.fetchClassListEpic = void 0;
4
4
  const rxjs_1 = require("rxjs");
5
5
  const operators_1 = require("rxjs/operators");
6
6
  const classReducer_1 = require("../../entity/class/classReducer");
7
+ const tenantSelector_1 = require("../../entity/tenant/tenantSelector");
7
8
  const responsePayload_1 = require("../../responsePayload");
8
9
  const classListReducer_1 = require("./classListReducer");
9
- const fetchClassListEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(classListReducer_1.fetchClassList.match), (0, operators_1.switchMap)((action) => {
10
+ const fetchClassListEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(classListReducer_1.fetchClassList.match), (0, operators_1.withLatestFrom)(state$), (0, operators_1.switchMap)(([action, state]) => {
11
+ if (!(0, tenantSelector_1.getIsAccountingClassesEnabled)(state)) {
12
+ return (0, rxjs_1.of)((0, classListReducer_1.updateClassList)({
13
+ status: (0, responsePayload_1.createZeniAPIStatus)('Success', ''),
14
+ data: { accounting_classes: [] },
15
+ }));
16
+ }
10
17
  const { isIncludeDeleted } = action.payload;
11
18
  const queryParams = isIncludeDeleted === true
12
19
  ? `?query=${encodeURIComponent(JSON.stringify({ is_include_deleted: true }))}`
@@ -57,6 +57,7 @@ export interface VendorViewSelectorView extends BankAccountSelectorView, Selecto
57
57
  deleteFileStatusById: Record<ID, FetchStateAndError | undefined>;
58
58
  hasInternationalWireTransfer: boolean;
59
59
  hasWireTransfer: boolean;
60
+ isAccountingClassesEnabled: boolean;
60
61
  loggedInUserVerification: UserVerificationState;
61
62
  ownerList: User[];
62
63
  updateFileStatusById: Record<ID, FetchStateAndError | undefined>;
@@ -9,6 +9,7 @@ const contactSelector_1 = require("../../../entity/billPay/contact/contactSelect
9
9
  const classSelector_1 = require("../../../entity/class/classSelector");
10
10
  const fileSelector_1 = require("../../../entity/file/fileSelector");
11
11
  const paymentInstrumentSelector_1 = require("../../../entity/paymentInstrument/paymentInstrumentSelector");
12
+ const tenantSelector_1 = require("../../../entity/tenant/tenantSelector");
12
13
  const userSelector_1 = require("../../../entity/user/userSelector");
13
14
  const vendorSelector_1 = require("../../../entity/vendor/vendorSelector");
14
15
  const accountListSelector_1 = require("../../accountList/accountListSelector");
@@ -63,13 +64,17 @@ const getVendorView = (state, vendorIdFromUrl) => {
63
64
  ?.vendorDetailLocalData,
64
65
  supportedCountries: billPayConfigState.vendor.supportedCountries,
65
66
  };
66
- fetchState = (0, reduceFetchState_1.reduceFetchState)([
67
+ const isAccountingClassesEnabled = (0, tenantSelector_1.getIsAccountingClassesEnabled)(state);
68
+ const editFetchStateList = [
67
69
  accountList,
68
- classList,
69
70
  vendorTypeListState,
70
71
  vendorViewState.editVendorStateById[vendorIdFromUrl]?.fetchStatus ??
71
72
  vendorViewReducer_1.initialState.newVendorState.fetchStatus,
72
- ]);
73
+ ];
74
+ if (isAccountingClassesEnabled) {
75
+ editFetchStateList.push(classList);
76
+ }
77
+ fetchState = (0, reduceFetchState_1.reduceFetchState)(editFetchStateList);
73
78
  }
74
79
  else {
75
80
  const basicVendorDetails = getBasicVendorDetailsForNewVendor(state, vendorViewState.newVendorState);
@@ -98,11 +103,17 @@ const getVendorView = (state, vendorIdFromUrl) => {
98
103
  if (tentativeName != null) {
99
104
  entityRecommendations = (0, recommendationSelector_1.getRecommendationsForEntity)(state, tentativeName, 'vendor');
100
105
  }
106
+ const isAccountingClassesEnabled = (0, tenantSelector_1.getIsAccountingClassesEnabled)(state);
101
107
  const fetchStateList = [
102
108
  { fetchState: accountList.fetchState, error: accountList.error },
103
- { fetchState: classList.fetchState, error: classList.error },
104
109
  vendorTypeListState,
105
110
  ];
111
+ if (isAccountingClassesEnabled) {
112
+ fetchStateList.push({
113
+ fetchState: classList.fetchState,
114
+ error: classList.error,
115
+ });
116
+ }
106
117
  if (entityRecommendations != null &&
107
118
  entityRecommendations.recommendations != null &&
108
119
  entityRecommendations.recommendations.length > 0) {
@@ -147,6 +158,7 @@ const getVendorView = (state, vendorIdFromUrl) => {
147
158
  fetchState: fetchState.fetchState,
148
159
  hasWireTransfer,
149
160
  hasInternationalWireTransfer,
161
+ isAccountingClassesEnabled: (0, tenantSelector_1.getIsAccountingClassesEnabled)(state),
150
162
  deleteFileStatusById,
151
163
  updateFileStatusById,
152
164
  loggedInUserVerification,
@@ -223,9 +235,10 @@ const getBasicVendorDetailsForNewVendor = (state, newVendor) => {
223
235
  };
224
236
  const getVendorDetailPageView = (state, vendorId, entity) => {
225
237
  const trendWithTransactions = (0, trendWithTransactionsSelector_1.getTrendWithTransactions)(state, entity, 'EntityDetail');
238
+ const isAccountingClassesEnabled = (0, tenantSelector_1.getIsAccountingClassesEnabled)(state);
226
239
  const reducedFetchState = (0, reduceFetchState_1.reduceAnyFetchState)([
227
240
  state.accountListState.byReportId.accountList,
228
- state.classListState,
241
+ ...(isAccountingClassesEnabled ? [state.classListState] : []),
229
242
  state.vendorTypeListState,
230
243
  state.ownerListState,
231
244
  state.vendorViewState.editVendorStateById[vendorId]?.fetchStatus ?? {
@@ -50,6 +50,7 @@ export interface VendorsTabVendorViewSelectorView extends SelectorView {
50
50
  accountsHierarchyList: NestedAccountHierarchyForReport[];
51
51
  classHierarchyList: NestedClassHierarchyForReport[];
52
52
  classList: ClassListSelectorView;
53
+ isAccountingClassesEnabled: boolean;
53
54
  ownerList: User[];
54
55
  vendorTypeList: VendorType[];
55
56
  vendorView?: VendorsTabVendorDetails;
@@ -9,6 +9,7 @@ const accountSelector_1 = require("../../../entity/account/accountSelector");
9
9
  const addressSelector_1 = require("../../../entity/address/addressSelector");
10
10
  const contactSelector_1 = require("../../../entity/billPay/contact/contactSelector");
11
11
  const classSelector_1 = require("../../../entity/class/classSelector");
12
+ const tenantSelector_1 = require("../../../entity/tenant/tenantSelector");
12
13
  const userSelector_1 = require("../../../entity/user/userSelector");
13
14
  const vendorSelector_1 = require("../../../entity/vendor/vendorSelector");
14
15
  const zeniDayJS_1 = require("../../../zeniDayJS");
@@ -24,6 +25,7 @@ const toVendorDetailTabsType = (v) => (0, stringToUnion_1.stringToUnion)(v, ALL_
24
25
  exports.toVendorDetailTabsType = toVendorDetailTabsType;
25
26
  const getVendorsTabVendorView = (state, vendorIdFromUrl) => {
26
27
  const { accountListState, accountState, classListState, classState, vendorState, userState, vendorsTabVendorViewState, vendorTypeListState, addressState, addressViewState, contactState, } = state;
28
+ const isAccountingClassesEnabled = (0, tenantSelector_1.getIsAccountingClassesEnabled)(state);
27
29
  const accountList = (0, accountListSelector_1.getAccountList)(accountState, accountListState, 'accountList');
28
30
  const classList = (0, classListSelector_1.getClassList)(classState, classListState);
29
31
  const ownerList = (0, userSelector_1.getUsersByUserIds)(state.userState, state.ownerListState.ownerIds);
@@ -55,7 +57,7 @@ const getVendorsTabVendorView = (state, vendorIdFromUrl) => {
55
57
  }
56
58
  fetchState = (0, reduceFetchState_1.reduceFetchState)([
57
59
  accountList,
58
- classList,
60
+ ...(isAccountingClassesEnabled ? [classList] : []),
59
61
  vendorTypeListState,
60
62
  vendorsTabVendorViewState.vendorStateById[vendorIdFromUrl]?.fetchStatus ?? {
61
63
  fetchState: 'Not-Started',
@@ -66,6 +68,7 @@ const getVendorsTabVendorView = (state, vendorIdFromUrl) => {
66
68
  return {
67
69
  accountList: accountList,
68
70
  classList: classList,
71
+ isAccountingClassesEnabled,
69
72
  vendorTypeList: vendorTypeList,
70
73
  accountsHierarchyList,
71
74
  classHierarchyList,
@@ -107,9 +110,10 @@ const getVendorsTabDetailPageView = (state, vendorId, entity) => {
107
110
  ? (0, transactionListByEntitySelector_1.getTransactionListByEntityForSinglePeriod)(state, entity, state.vendorsTabVendorViewState.allTransactionsTabData
108
111
  .numberOfQuartersFetched)
109
112
  : undefined;
113
+ const isAccountingClassesEnabled = (0, tenantSelector_1.getIsAccountingClassesEnabled)(state);
110
114
  const reducedFetchState = (0, reduceFetchState_1.reduceAnyFetchState)([
111
115
  state.accountListState.byReportId.accountList,
112
- state.classListState,
116
+ ...(isAccountingClassesEnabled ? [state.classListState] : []),
113
117
  state.ownerListState,
114
118
  state.vendorTypeListState,
115
119
  state.vendorsTabVendorViewState.vendorStateById[vendorId]?.fetchStatus ?? {
@@ -0,0 +1,10 @@
1
+ /**
2
+ * After upload API success, hold the bar at 100% this long before transitioning to matching,
3
+ * so the fill animation can complete without an abrupt swap to the auto-matching banner.
4
+ */
5
+ export declare const BULK_UPLOAD_BAR_COMPLETE_HOLD_MS = 400;
6
+ /**
7
+ * Max wall-clock wait for Pusher + batch-details resolution after upload. If exceeded, we stop
8
+ * fallback polling, clear the automatching banner (`phase` → completed), and refresh batch list.
9
+ */
10
+ export declare const BULK_UPLOAD_AUTOMATCHING_TIMEOUT_MS = 300000;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BULK_UPLOAD_AUTOMATCHING_TIMEOUT_MS = exports.BULK_UPLOAD_BAR_COMPLETE_HOLD_MS = void 0;
4
+ /**
5
+ * After upload API success, hold the bar at 100% this long before transitioning to matching,
6
+ * so the fill animation can complete without an abrupt swap to the auto-matching banner.
7
+ */
8
+ exports.BULK_UPLOAD_BAR_COMPLETE_HOLD_MS = 400;
9
+ /**
10
+ * Max wall-clock wait for Pusher + batch-details resolution after upload. If exceeded, we stop
11
+ * fallback polling, clear the automatching banner (`phase` → completed), and refresh batch list.
12
+ */
13
+ exports.BULK_UPLOAD_AUTOMATCHING_TIMEOUT_MS = 300000;
@@ -7,6 +7,7 @@ const formatZeniDateFY_1 = require("../../../../commonStateTypes/fiscalYearHelpe
7
7
  const accountReconReducer_1 = require("../../../../entity/accountRecon/accountReconReducer");
8
8
  const accountReconSelector_1 = require("../../../../entity/accountRecon/accountReconSelector");
9
9
  const accountReconState_1 = require("../../../../entity/accountRecon/accountReconState");
10
+ const entitySelector_1 = require("../../../../entity/genericEntity/entitySelector");
10
11
  const snackbarReducer_1 = require("../../../../entity/snackbar/snackbarReducer");
11
12
  const tenantSelector_1 = require("../../../../entity/tenant/tenantSelector");
12
13
  const transactionReducer_1 = require("../../../../entity/transaction/transactionReducer");
@@ -15,6 +16,7 @@ const responsePayload_1 = require("../../../../responsePayload");
15
16
  const reconciliationViewReducer_1 = require("../../reducers/reconciliationViewReducer");
16
17
  const saveReconciliationReviewEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(reconciliationViewReducer_1.saveReconciliationReview.match), (0, operators_1.mergeMap)((action) => {
17
18
  const state = state$.value;
19
+ const entityState = state.entityState;
18
20
  const { transactionId } = action.payload;
19
21
  const localData = state.expenseAutomationReconciliationViewState.reconTabsState.review
20
22
  .localData[transactionId];
@@ -62,7 +64,7 @@ const saveReconciliationReviewEpic = (actions$, state$, zeniAPI) => actions$.pip
62
64
  payload = getPayloadForCCPayment(updatedTransaction, localData, reconciliationData?.account.accountType);
63
65
  break;
64
66
  case 'record_deposit':
65
- payload = getPayloadForDeposit(updatedTransaction, localData);
67
+ payload = getPayloadForDeposit(updatedTransaction, localData, entityState);
66
68
  break;
67
69
  }
68
70
  }
@@ -163,7 +165,10 @@ function getPayloadForExpenseRecord(updatedTransaction, localData) {
163
165
  currency_code: updatedTransaction.amount.currencyCode,
164
166
  };
165
167
  }
166
- function getPayloadForDeposit(updatedTransaction, localData) {
168
+ function getPayloadForDeposit(updatedTransaction, localData, entityState) {
169
+ const customerZeniId = localData.customer?.id != null
170
+ ? (0, entitySelector_1.getEntityByEntityIDs)(entityState, [localData.customer?.id])[0]?.zeniId
171
+ : undefined;
167
172
  return {
168
173
  amount: updatedTransaction.amount.amount,
169
174
  transaction_memo: updatedTransaction.memo,
@@ -171,7 +176,7 @@ function getPayloadForDeposit(updatedTransaction, localData) {
171
176
  transaction_date: updatedTransaction.transactionDate.format(formatZeniDateFY_1.DEFAULT_DATE_FORMAT),
172
177
  transaction_direction: updatedTransaction.transactionDirection,
173
178
  transaction_id: updatedTransaction.transactionId,
174
- customer_id: localData.customer?.id,
179
+ customer_id: customerZeniId,
175
180
  customer_name: localData.customer?.name,
176
181
  account_id: localData.categoryId,
177
182
  accounting_class_id: localData.classId,