@zeniai/client-epic-state 4.19.99-betaVR3 → 4.19.100

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (262) hide show
  1. package/lib/commonStateTypes/animations.d.ts +1 -1
  2. package/lib/commonStateTypes/coaBalance/coaBalanceType.d.ts +0 -2
  3. package/lib/commonStateTypes/coaBalance/coaBalanceType.js +0 -6
  4. package/lib/commonStateTypes/currencyHelper.d.ts +0 -3
  5. package/lib/commonStateTypes/currencyHelper.js +1 -6
  6. package/lib/commonStateTypes/reduceFetchState.d.ts +0 -9
  7. package/lib/commonStateTypes/reduceFetchState.js +0 -26
  8. package/lib/entity/account/accountPayload.d.ts +0 -2
  9. package/lib/entity/account/accountPayload.js +0 -2
  10. package/lib/entity/account/accountState.d.ts +0 -2
  11. package/lib/entity/aiCfo/aiCfoSelector.d.ts +2 -1
  12. package/lib/entity/billPay/billTransaction/billTransactionState.d.ts +2 -2
  13. package/lib/entity/customer/customerState.d.ts +2 -0
  14. package/lib/entity/customer/customerState.js +5 -0
  15. package/lib/entity/depositAccount/depositAccount.d.ts +1 -1
  16. package/lib/entity/depositAccount/depositAccount.js +1 -8
  17. package/lib/entity/jeSchedules/jeSchedulesPayload.d.ts +0 -38
  18. package/lib/entity/jeSchedules/jeSchedulesPayload.js +0 -78
  19. package/lib/entity/jeSchedules/jeSchedulesSelector.d.ts +1 -4
  20. package/lib/entity/jeSchedules/jeSchedulesSelector.js +1 -5
  21. package/lib/entity/jeSchedules/jeSchedulesState.d.ts +0 -37
  22. package/lib/entity/reimbursement/reimbursementPayload.d.ts +0 -2
  23. package/lib/entity/reimbursement/reimbursementPayload.js +0 -7
  24. package/lib/entity/reimbursement/reimbursementState.d.ts +0 -2
  25. package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
  26. package/lib/entity/snackbar/snackbarTypes.js +0 -1
  27. package/lib/entity/task/taskPayload.d.ts +0 -1
  28. package/lib/entity/task/taskPayload.js +0 -1
  29. package/lib/entity/task/taskState.d.ts +0 -1
  30. package/lib/entity/tenant/tenantPayload.d.ts +0 -1
  31. package/lib/entity/tenant/tenantReducer.js +0 -1
  32. package/lib/entity/tenant/tenantSelector.d.ts +0 -1
  33. package/lib/entity/tenant/tenantSelector.js +1 -9
  34. package/lib/entity/tenant/tenantState.d.ts +0 -1
  35. package/lib/entity/transaction/payloadTypes/scheduleTransactionPayload.d.ts +1 -4
  36. package/lib/entity/transaction/payloadTypes/scheduleTransactionPayload.js +0 -1
  37. package/lib/entity/transaction/payloadTypes/transactionPayload.d.ts +0 -3
  38. package/lib/entity/transaction/payloadTypes/transactionPayload.js +1 -17
  39. package/lib/entity/transaction/stateTypes/scheduleTransaction.d.ts +0 -1
  40. package/lib/entity/transaction/stateTypes/transaction.d.ts +0 -5
  41. package/lib/entity/transaction/stateTypes/transactionLine.d.ts +1 -1
  42. package/lib/epic.d.ts +1 -13
  43. package/lib/epic.js +1 -13
  44. package/lib/esm/commonStateTypes/coaBalance/coaBalanceType.js +0 -5
  45. package/lib/esm/commonStateTypes/currencyHelper.js +0 -5
  46. package/lib/esm/commonStateTypes/reduceFetchState.js +0 -25
  47. package/lib/esm/entity/account/accountPayload.js +0 -2
  48. package/lib/esm/entity/customer/customerState.js +4 -1
  49. package/lib/esm/entity/depositAccount/depositAccount.js +1 -8
  50. package/lib/esm/entity/jeSchedules/jeSchedulesPayload.js +0 -78
  51. package/lib/esm/entity/jeSchedules/jeSchedulesSelector.js +1 -5
  52. package/lib/esm/entity/reimbursement/reimbursementPayload.js +0 -7
  53. package/lib/esm/entity/snackbar/snackbarTypes.js +0 -1
  54. package/lib/esm/entity/task/taskPayload.js +0 -1
  55. package/lib/esm/entity/tenant/tenantReducer.js +0 -1
  56. package/lib/esm/entity/tenant/tenantSelector.js +0 -7
  57. package/lib/esm/entity/transaction/payloadTypes/scheduleTransactionPayload.js +0 -1
  58. package/lib/esm/entity/transaction/payloadTypes/transactionPayload.js +1 -17
  59. package/lib/esm/epic.js +1 -13
  60. package/lib/esm/index.js +16 -25
  61. package/lib/esm/reducer.js +0 -6
  62. package/lib/esm/view/aiCfoView/aiCfoViewReducer.js +1 -82
  63. package/lib/esm/view/aiCfoView/aiCfoViewSelector.js +2 -8
  64. package/lib/esm/view/arAgingView/arAgingReport/arAgingReducer.js +1 -1
  65. package/lib/esm/view/arAgingView/arAgingReport/arAgingSelector.js +1 -1
  66. package/lib/esm/view/classList/fetchClassListEpic.js +2 -9
  67. package/lib/esm/view/commonVendorView/vendorView/vendorViewSelector.js +5 -18
  68. package/lib/esm/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewSelector.js +2 -6
  69. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/uploadMissingReceiptSuccessEpic.js +5 -7
  70. package/lib/esm/view/expenseAutomationView/expenseAutomationViewSelector.js +1 -0
  71. package/lib/esm/view/expenseAutomationView/helpers/saveTransactionHelper.js +2 -2
  72. package/lib/esm/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.js +2 -2
  73. package/lib/esm/view/expenseAutomationView/payload/missingReceiptsPayload.js +1 -189
  74. package/lib/esm/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +1 -17
  75. package/lib/esm/view/expenseAutomationView/reducers/missingReceiptsViewReducer.js +2 -433
  76. package/lib/esm/view/expenseAutomationView/reducers/transactionsViewReducer.js +1 -23
  77. package/lib/esm/view/expenseAutomationView/selectors/fluxAnalysisViewSelector.js +2 -10
  78. package/lib/esm/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +6 -63
  79. package/lib/esm/view/expenseAutomationView/selectors/missingReceiptsSelector.js +5 -256
  80. package/lib/esm/view/expenseAutomationView/selectors/reconciliationViewSelector.js +9 -22
  81. package/lib/esm/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +7 -14
  82. package/lib/esm/view/expenseAutomationView/types/jeSchedulesViewState.js +1 -18
  83. package/lib/esm/view/expenseAutomationView/types/missingReceiptsViewState.js +0 -44
  84. package/lib/esm/view/expenseAutomationView/types/transactionsViewState.js +1 -2
  85. package/lib/esm/view/financeStatement/financeStatementReducer.js +8 -11
  86. package/lib/esm/view/financeStatement/financeStatementSelector.js +9 -24
  87. package/lib/esm/view/profitAndLossClassesView/profitAndLossClassesViewReducer.js +1 -6
  88. package/lib/esm/view/profitAndLossClassesView/profitAndLossClassesViewSelector.js +29 -2
  89. package/lib/esm/view/profitAndLossClassesView/profitAndLossForTimeframeClassesViewEpic.js +5 -7
  90. package/lib/esm/view/reportUIOptions/updateReportUIOptionCOABalancesRangeEpic.js +7 -9
  91. package/lib/esm/view/spendManagement/billPay/billList/billListSelector.js +0 -10
  92. package/lib/esm/view/spendManagement/billPay/billList/billListState.js +0 -1
  93. package/lib/esm/view/spendManagement/billPay/billPayReview/billPayReviewSelector.js +3 -7
  94. package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/billPaySetupApproverViewSelector.js +5 -5
  95. package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/epic/fetchBillPayApproversDetailsEpic.js +2 -7
  96. package/lib/esm/view/spendManagement/billPay/editBillView/editBillViewSelector.js +6 -13
  97. package/lib/esm/view/spendManagement/chargeCards/chargeCardList/chargeCardList.js +0 -1
  98. package/lib/esm/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.js +0 -2
  99. package/lib/esm/view/spendManagement/reimbursement/editRemiView/editRemiViewSelector.js +4 -7
  100. package/lib/esm/view/spendManagement/reimbursement/remiListView/remiListSelector.js +0 -12
  101. package/lib/esm/view/spendManagement/reimbursement/remiListView/remiListState.js +0 -1
  102. package/lib/esm/view/taskManager/taskDetailView/taskDetailSelector.js +3 -3
  103. package/lib/esm/view/taskManager/taskListView/epics/bulkUpdateTaskListEpic.js +0 -1
  104. package/lib/esm/view/taskManager/taskListView/taskListSelector.js +1 -3
  105. package/lib/esm/view/transactionDetail/epics/saveTransactionHelper.js +2 -2
  106. package/lib/esm/view/transactionDetail/transactionDetailLocalDataHelper.js +14 -16
  107. package/lib/esm/view/twoFactorAuthentication/resendOtpEpic.js +16 -2
  108. package/lib/esm/view/userListView/fetchUserListByTypeEpic.js +0 -11
  109. package/lib/esm/zeniAPI.js +2 -0
  110. package/lib/index.d.ts +21 -31
  111. package/lib/index.js +34 -102
  112. package/lib/reducer.d.ts +0 -6
  113. package/lib/reducer.js +0 -6
  114. package/lib/view/aiCfoView/aiCfoViewPayload.d.ts +0 -7
  115. package/lib/view/aiCfoView/aiCfoViewReducer.d.ts +1 -15
  116. package/lib/view/aiCfoView/aiCfoViewReducer.js +2 -83
  117. package/lib/view/aiCfoView/aiCfoViewSelector.d.ts +1 -4
  118. package/lib/view/aiCfoView/aiCfoViewSelector.js +2 -9
  119. package/lib/view/aiCfoView/aiCfoViewState.d.ts +1 -18
  120. package/lib/view/arAgingView/arAgingReport/arAgingReducer.js +2 -2
  121. package/lib/view/arAgingView/arAgingReport/arAgingSelector.js +5 -5
  122. package/lib/view/auditReportView/auditReportViewState.d.ts +1 -1
  123. package/lib/view/classList/fetchClassListEpic.d.ts +1 -1
  124. package/lib/view/classList/fetchClassListEpic.js +1 -8
  125. package/lib/view/commonVendorView/vendorView/vendorViewSelector.d.ts +0 -1
  126. package/lib/view/commonVendorView/vendorView/vendorViewSelector.js +5 -18
  127. package/lib/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewSelector.d.ts +0 -1
  128. package/lib/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewSelector.js +2 -6
  129. package/lib/view/expenseAutomationView/epics/missingReceipts/uploadMissingReceiptSuccessEpic.js +5 -7
  130. package/lib/view/expenseAutomationView/expenseAutomationViewSelector.js +1 -0
  131. package/lib/view/expenseAutomationView/helpers/saveTransactionHelper.js +2 -2
  132. package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
  133. package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.js +2 -2
  134. package/lib/view/expenseAutomationView/payload/missingReceiptsPayload.d.ts +0 -118
  135. package/lib/view/expenseAutomationView/payload/missingReceiptsPayload.js +0 -201
  136. package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.d.ts +2 -2
  137. package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +2 -18
  138. package/lib/view/expenseAutomationView/reducers/missingReceiptsViewReducer.d.ts +3 -76
  139. package/lib/view/expenseAutomationView/reducers/missingReceiptsViewReducer.js +2 -434
  140. package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.d.ts +3 -11
  141. package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.js +2 -24
  142. package/lib/view/expenseAutomationView/selectorTypes/jeSchedulesSelectorTypes.d.ts +0 -2
  143. package/lib/view/expenseAutomationView/selectorTypes/missingReceiptsSelectorTypes.d.ts +1 -69
  144. package/lib/view/expenseAutomationView/selectorTypes/transactionsViewSelectorTypes.d.ts +0 -1
  145. package/lib/view/expenseAutomationView/selectors/fluxAnalysisViewSelector.js +2 -10
  146. package/lib/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +6 -63
  147. package/lib/view/expenseAutomationView/selectors/missingReceiptsSelector.d.ts +1 -1
  148. package/lib/view/expenseAutomationView/selectors/missingReceiptsSelector.js +4 -255
  149. package/lib/view/expenseAutomationView/selectors/reconciliationViewSelector.js +9 -22
  150. package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +6 -13
  151. package/lib/view/expenseAutomationView/types/jeSchedulesViewState.d.ts +0 -5
  152. package/lib/view/expenseAutomationView/types/jeSchedulesViewState.js +0 -20
  153. package/lib/view/expenseAutomationView/types/missingReceiptsViewState.d.ts +0 -142
  154. package/lib/view/expenseAutomationView/types/missingReceiptsViewState.js +1 -54
  155. package/lib/view/expenseAutomationView/types/transactionsViewState.d.ts +1 -2
  156. package/lib/view/expenseAutomationView/types/transactionsViewState.js +1 -2
  157. package/lib/view/financeStatement/financeStatementReducer.js +8 -11
  158. package/lib/view/financeStatement/financeStatementSelector.d.ts +0 -2
  159. package/lib/view/financeStatement/financeStatementSelector.js +9 -24
  160. package/lib/view/profitAndLossClassesView/profitAndLossClassesViewReducer.d.ts +2 -4
  161. package/lib/view/profitAndLossClassesView/profitAndLossClassesViewReducer.js +2 -7
  162. package/lib/view/profitAndLossClassesView/profitAndLossClassesViewSelector.js +29 -2
  163. package/lib/view/profitAndLossClassesView/profitAndLossClassesViewState.d.ts +0 -4
  164. package/lib/view/profitAndLossClassesView/profitAndLossForTimeframeClassesViewEpic.js +5 -7
  165. package/lib/view/reportUIOptions/updateReportUIOptionCOABalancesRangeEpic.js +6 -8
  166. package/lib/view/scheduleView/scheduleListView/scheduleListTypes.d.ts +1 -1
  167. package/lib/view/spendManagement/billPay/billList/billListSelector.js +0 -10
  168. package/lib/view/spendManagement/billPay/billList/billListState.d.ts +1 -1
  169. package/lib/view/spendManagement/billPay/billList/billListState.js +0 -1
  170. package/lib/view/spendManagement/billPay/billPayReview/billPayReviewSelector.js +3 -7
  171. package/lib/view/spendManagement/billPay/billPaySetupApproverView/billPaySetupApproverViewSelector.js +5 -5
  172. package/lib/view/spendManagement/billPay/billPaySetupApproverView/epic/fetchBillPayApproversDetailsEpic.js +2 -7
  173. package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.js +6 -13
  174. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardList.d.ts +1 -1
  175. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardList.js +0 -1
  176. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.js +0 -2
  177. package/lib/view/spendManagement/reimbursement/editRemiView/editRemiViewSelector.js +3 -6
  178. package/lib/view/spendManagement/reimbursement/remiListView/remiListSelector.d.ts +0 -1
  179. package/lib/view/spendManagement/reimbursement/remiListView/remiListSelector.js +0 -12
  180. package/lib/view/spendManagement/reimbursement/remiListView/remiListState.d.ts +1 -1
  181. package/lib/view/spendManagement/reimbursement/remiListView/remiListState.js +0 -1
  182. package/lib/view/taskManager/taskDetailView/taskDetailSelector.js +3 -3
  183. package/lib/view/taskManager/taskListView/epics/bulkUpdateTaskListEpic.d.ts +0 -1
  184. package/lib/view/taskManager/taskListView/epics/bulkUpdateTaskListEpic.js +0 -1
  185. package/lib/view/taskManager/taskListView/taskListSelector.d.ts +0 -2
  186. package/lib/view/taskManager/taskListView/taskListSelector.js +1 -3
  187. package/lib/view/transactionDetail/epics/saveTransactionHelper.js +2 -2
  188. package/lib/view/transactionDetail/transactionDetailLocalDataHelper.js +14 -16
  189. package/lib/view/twoFactorAuthentication/resendOtpEpic.d.ts +1 -1
  190. package/lib/view/twoFactorAuthentication/resendOtpEpic.js +15 -1
  191. package/lib/view/userListView/fetchUserListByTypeEpic.d.ts +1 -3
  192. package/lib/view/userListView/fetchUserListByTypeEpic.js +0 -11
  193. package/lib/view/userListView/userListViewPayload.d.ts +0 -2
  194. package/lib/zeniAPI.js +2 -0
  195. package/package.json +2 -2
  196. package/lib/entity/userGroups/userGroupsPayload.d.ts +0 -7
  197. package/lib/entity/userGroups/userGroupsPayload.js +0 -10
  198. package/lib/entity/userGroups/userGroupsReducer.d.ts +0 -8
  199. package/lib/entity/userGroups/userGroupsReducer.js +0 -29
  200. package/lib/entity/userGroups/userGroupsSelector.d.ts +0 -4
  201. package/lib/entity/userGroups/userGroupsSelector.js +0 -12
  202. package/lib/entity/userGroups/userGroupsState.d.ts +0 -9
  203. package/lib/entity/userGroups/userGroupsState.js +0 -2
  204. package/lib/esm/entity/userGroups/userGroupsPayload.js +0 -7
  205. package/lib/esm/entity/userGroups/userGroupsReducer.js +0 -25
  206. package/lib/esm/entity/userGroups/userGroupsSelector.js +0 -8
  207. package/lib/esm/entity/userGroups/userGroupsState.js +0 -1
  208. package/lib/esm/view/aiCfoView/epics/fetchSuggestedQuestionsEpic.js +0 -29
  209. package/lib/esm/view/expenseAutomationView/bulkUploadTiming.js +0 -10
  210. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/bulkUploadReceiptsEpic.js +0 -29
  211. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/confirmBulkUploadMatchEpic.js +0 -49
  212. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchDetailsEpic.js +0 -40
  213. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchesEpic.js +0 -47
  214. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchCompletedTransactionsEpic.js +0 -61
  215. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchMoreBatchDetailsEpic.js +0 -33
  216. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchMultipleBatchDetailsEpic.js +0 -56
  217. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/searchTransactionsForManualMatchEpic.js +0 -77
  218. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/watchBulkUploadBatchStatusEpic.js +0 -80
  219. package/lib/esm/view/expenseAutomationView/epics/transactionCategorization/uploadTransactionReceiptSuccessEpic.js +0 -24
  220. package/lib/esm/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelector.js +0 -317
  221. package/lib/esm/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelectorTypes.js +0 -9
  222. package/lib/esm/view/profitAndLossClassesView/profitAndLossHorizontalEnrichment.js +0 -282
  223. package/lib/esm/view/userGroupListView/userGroupListViewReducer.js +0 -65
  224. package/lib/esm/view/userGroupListView/userGroupListViewSelector.js +0 -16
  225. package/lib/esm/view/userGroupListView/userGroupListViewState.js +0 -1
  226. package/lib/tsconfig.typecheck.tsbuildinfo +0 -1
  227. package/lib/view/aiCfoView/epics/fetchSuggestedQuestionsEpic.d.ts +0 -8
  228. package/lib/view/aiCfoView/epics/fetchSuggestedQuestionsEpic.js +0 -33
  229. package/lib/view/expenseAutomationView/bulkUploadTiming.d.ts +0 -10
  230. package/lib/view/expenseAutomationView/bulkUploadTiming.js +0 -13
  231. package/lib/view/expenseAutomationView/epics/missingReceipts/bulkUploadReceiptsEpic.d.ts +0 -18
  232. package/lib/view/expenseAutomationView/epics/missingReceipts/bulkUploadReceiptsEpic.js +0 -33
  233. package/lib/view/expenseAutomationView/epics/missingReceipts/confirmBulkUploadMatchEpic.d.ts +0 -7
  234. package/lib/view/expenseAutomationView/epics/missingReceipts/confirmBulkUploadMatchEpic.js +0 -53
  235. package/lib/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchDetailsEpic.d.ts +0 -8
  236. package/lib/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchDetailsEpic.js +0 -44
  237. package/lib/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchesEpic.d.ts +0 -7
  238. package/lib/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchesEpic.js +0 -51
  239. package/lib/view/expenseAutomationView/epics/missingReceipts/fetchCompletedTransactionsEpic.d.ts +0 -8
  240. package/lib/view/expenseAutomationView/epics/missingReceipts/fetchCompletedTransactionsEpic.js +0 -65
  241. package/lib/view/expenseAutomationView/epics/missingReceipts/fetchMoreBatchDetailsEpic.d.ts +0 -8
  242. package/lib/view/expenseAutomationView/epics/missingReceipts/fetchMoreBatchDetailsEpic.js +0 -37
  243. package/lib/view/expenseAutomationView/epics/missingReceipts/fetchMultipleBatchDetailsEpic.d.ts +0 -9
  244. package/lib/view/expenseAutomationView/epics/missingReceipts/fetchMultipleBatchDetailsEpic.js +0 -61
  245. package/lib/view/expenseAutomationView/epics/missingReceipts/searchTransactionsForManualMatchEpic.d.ts +0 -14
  246. package/lib/view/expenseAutomationView/epics/missingReceipts/searchTransactionsForManualMatchEpic.js +0 -81
  247. package/lib/view/expenseAutomationView/epics/missingReceipts/watchBulkUploadBatchStatusEpic.d.ts +0 -25
  248. package/lib/view/expenseAutomationView/epics/missingReceipts/watchBulkUploadBatchStatusEpic.js +0 -86
  249. package/lib/view/expenseAutomationView/epics/transactionCategorization/uploadTransactionReceiptSuccessEpic.d.ts +0 -7
  250. package/lib/view/expenseAutomationView/epics/transactionCategorization/uploadTransactionReceiptSuccessEpic.js +0 -28
  251. package/lib/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelector.d.ts +0 -13
  252. package/lib/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelector.js +0 -321
  253. package/lib/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelectorTypes.d.ts +0 -111
  254. package/lib/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelectorTypes.js +0 -13
  255. package/lib/view/profitAndLossClassesView/profitAndLossHorizontalEnrichment.d.ts +0 -6
  256. package/lib/view/profitAndLossClassesView/profitAndLossHorizontalEnrichment.js +0 -285
  257. package/lib/view/userGroupListView/userGroupListViewReducer.d.ts +0 -23
  258. package/lib/view/userGroupListView/userGroupListViewReducer.js +0 -69
  259. package/lib/view/userGroupListView/userGroupListViewSelector.d.ts +0 -7
  260. package/lib/view/userGroupListView/userGroupListViewSelector.js +0 -20
  261. package/lib/view/userGroupListView/userGroupListViewState.d.ts +0 -8
  262. package/lib/view/userGroupListView/userGroupListViewState.js +0 -2
@@ -1,8 +0,0 @@
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>;
@@ -1,33 +0,0 @@
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;
@@ -1,10 +0,0 @@
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;
@@ -1,13 +0,0 @@
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;
@@ -1,18 +0,0 @@
1
- import { ActionsObservable } from 'redux-observable';
2
- import { ZeniAPI } from '../../../../zeniAPI';
3
- import { bulkUploadReceipts, bulkUploadReceiptsFailure, bulkUploadReceiptsSuccess } from '../../reducers/missingReceiptsViewReducer';
4
- export type ActionType = ReturnType<typeof bulkUploadReceipts> | ReturnType<typeof bulkUploadReceiptsSuccess> | ReturnType<typeof bulkUploadReceiptsFailure>;
5
- export declare const bulkUploadReceiptsEpic: (actions$: ActionsObservable<ActionType>, _state$: unknown, zeniAPI: ZeniAPI) => import("rxjs").Observable<{
6
- payload: {
7
- batchId: import("../../../..").ID;
8
- };
9
- type: "expenseAutomationMissingReceiptsView/bulkUploadReceiptsSuccess";
10
- } | {
11
- payload: {
12
- error: import("../../../../responsePayload").ZeniAPIStatus;
13
- };
14
- type: "expenseAutomationMissingReceiptsView/bulkUploadReceiptsFailure";
15
- } | {
16
- payload: number;
17
- type: "expenseAutomationMissingReceiptsView/updateBulkUploadProgress";
18
- }>;
@@ -1,33 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.bulkUploadReceiptsEpic = void 0;
4
- const rxjs_1 = require("rxjs");
5
- const operators_1 = require("rxjs/operators");
6
- const responsePayload_1 = require("../../../../responsePayload");
7
- const bulkUploadTiming_1 = require("../../bulkUploadTiming");
8
- const missingReceiptsViewReducer_1 = require("../../reducers/missingReceiptsViewReducer");
9
- const bulkUploadReceiptsEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(missingReceiptsViewReducer_1.bulkUploadReceipts.match), (0, operators_1.switchMap)((action) => {
10
- const { files } = action.payload;
11
- const formData = new FormData();
12
- for (const file of files) {
13
- formData.append('files', file, file.name);
14
- }
15
- return zeniAPI
16
- .postFormData(`${zeniAPI.apiEndPoints.communicationAgentMicroServiceBaseUrl}/1.0/receipts/bulk-upload`, formData)
17
- .pipe((0, operators_1.mergeMap)((response) => {
18
- if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
19
- const batchId = String(response.data.batch_id ?? '').trim();
20
- if (batchId === '') {
21
- return (0, rxjs_1.of)((0, missingReceiptsViewReducer_1.bulkUploadReceiptsFailure)({
22
- error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Bulk upload succeeded but batch_id was missing or empty.'),
23
- }));
24
- }
25
- return (0, rxjs_1.concat)((0, rxjs_1.of)((0, missingReceiptsViewReducer_1.updateBulkUploadProgress)(100)), (0, rxjs_1.timer)(bulkUploadTiming_1.BULK_UPLOAD_BAR_COMPLETE_HOLD_MS).pipe((0, operators_1.mergeMap)(() => (0, rxjs_1.of)((0, missingReceiptsViewReducer_1.bulkUploadReceiptsSuccess)({ batchId })))));
26
- }
27
- return (0, rxjs_1.of)((0, missingReceiptsViewReducer_1.bulkUploadReceiptsFailure)({ error: response.status }));
28
- }), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, missingReceiptsViewReducer_1.bulkUploadReceiptsFailure)({
29
- error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Bulk upload receipts API call errored out: ' +
30
- JSON.stringify(error)),
31
- }))));
32
- }));
33
- exports.bulkUploadReceiptsEpic = bulkUploadReceiptsEpic;
@@ -1,7 +0,0 @@
1
- import { ActionsObservable } from 'redux-observable';
2
- import { Observable } from 'rxjs';
3
- import { openSnackbar } from '../../../../entity/snackbar/snackbarReducer';
4
- import { ZeniAPI } from '../../../../zeniAPI';
5
- import { confirmBulkUploadMatch, confirmBulkUploadMatchFailure, confirmBulkUploadMatchSuccess } from '../../reducers/missingReceiptsViewReducer';
6
- export type ActionType = ReturnType<typeof confirmBulkUploadMatch> | ReturnType<typeof confirmBulkUploadMatchSuccess> | ReturnType<typeof confirmBulkUploadMatchFailure> | ReturnType<typeof openSnackbar>;
7
- export declare const confirmBulkUploadMatchEpic: (actions$: ActionsObservable<ActionType>, _state$: unknown, zeniAPI: ZeniAPI) => Observable<ActionType>;
@@ -1,53 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.confirmBulkUploadMatchEpic = void 0;
4
- const rxjs_1 = require("rxjs");
5
- const operators_1 = require("rxjs/operators");
6
- const snackbarReducer_1 = require("../../../../entity/snackbar/snackbarReducer");
7
- const responsePayload_1 = require("../../../../responsePayload");
8
- const missingReceiptsViewReducer_1 = require("../../reducers/missingReceiptsViewReducer");
9
- const confirmBulkUploadMatchEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(missingReceiptsViewReducer_1.confirmBulkUploadMatch.match), (0, operators_1.exhaustMap)((action) => {
10
- const { batchId, attachmentId, transactionId, transactionType, fileName } = action.payload;
11
- return zeniAPI
12
- .postAndGetJSON(`${zeniAPI.apiEndPoints.communicationAgentMicroServiceBaseUrl}/1.0/receipts/manual-match`, {
13
- attachment_id: attachmentId,
14
- transaction_id: transactionId,
15
- transaction_type: transactionType,
16
- file_name: fileName,
17
- })
18
- .pipe((0, operators_1.mergeMap)((response) => {
19
- if ((0, responsePayload_1.isSuccessResponse)(response)) {
20
- return (0, rxjs_1.from)([
21
- (0, missingReceiptsViewReducer_1.confirmBulkUploadMatchSuccess)({
22
- batchId,
23
- attachmentId,
24
- transactionId,
25
- }),
26
- (0, snackbarReducer_1.openSnackbar)({
27
- messageSection: 'receipt_match',
28
- messageText: 'success',
29
- type: 'success',
30
- }),
31
- ]);
32
- }
33
- return (0, rxjs_1.from)([
34
- (0, missingReceiptsViewReducer_1.confirmBulkUploadMatchFailure)({ error: response.status }),
35
- (0, snackbarReducer_1.openSnackbar)({
36
- messageSection: 'receipt_match',
37
- messageText: 'failed',
38
- type: 'error',
39
- }),
40
- ]);
41
- }), (0, operators_1.catchError)((error) => (0, rxjs_1.from)([
42
- (0, missingReceiptsViewReducer_1.confirmBulkUploadMatchFailure)({
43
- error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Confirm bulk upload match errored out: ' +
44
- JSON.stringify(error)),
45
- }),
46
- (0, snackbarReducer_1.openSnackbar)({
47
- messageSection: 'receipt_match',
48
- messageText: 'failed',
49
- type: 'error',
50
- }),
51
- ])));
52
- }));
53
- exports.confirmBulkUploadMatchEpic = confirmBulkUploadMatchEpic;
@@ -1,8 +0,0 @@
1
- import { ActionsObservable, StateObservable } from 'redux-observable';
2
- import { Observable } from 'rxjs';
3
- import { updateTransactions } from '../../../../entity/transaction/transactionReducer';
4
- import { RootState } from '../../../../reducer';
5
- import { ZeniAPI } from '../../../../zeniAPI';
6
- import { fetchBulkUploadBatchDetails, fetchBulkUploadBatchDetailsFailure, fetchBulkUploadBatchDetailsSuccess, fetchBulkUploadBatches } from '../../reducers/missingReceiptsViewReducer';
7
- export type ActionType = ReturnType<typeof fetchBulkUploadBatchDetails> | ReturnType<typeof updateTransactions> | ReturnType<typeof fetchBulkUploadBatchDetailsSuccess> | ReturnType<typeof fetchBulkUploadBatchDetailsFailure> | ReturnType<typeof fetchBulkUploadBatches>;
8
- export declare const fetchBulkUploadBatchDetailsEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
@@ -1,44 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.fetchBulkUploadBatchDetailsEpic = void 0;
4
- const rxjs_1 = require("rxjs");
5
- const operators_1 = require("rxjs/operators");
6
- const transactionReducer_1 = require("../../../../entity/transaction/transactionReducer");
7
- const responsePayload_1 = require("../../../../responsePayload");
8
- const missingReceiptsPayload_1 = require("../../payload/missingReceiptsPayload");
9
- const missingReceiptsViewReducer_1 = require("../../reducers/missingReceiptsViewReducer");
10
- const fetchBulkUploadBatchDetailsEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(missingReceiptsViewReducer_1.fetchBulkUploadBatchDetails.match), (0, operators_1.mergeMap)(() => {
11
- const bulkUpload = state$.value.expenseAutomationMissingReceiptsViewState.bulkUpload;
12
- const { currentBatchId } = bulkUpload;
13
- if (currentBatchId == null) {
14
- return (0, rxjs_1.of)((0, missingReceiptsViewReducer_1.fetchBulkUploadBatchDetailsFailure)({
15
- error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'No current batch ID available'),
16
- }));
17
- }
18
- if (!(0, missingReceiptsPayload_1.shouldFetchBatchDetailsForBatchId)(bulkUpload.batchStatusById, bulkUpload.batchListByPeriod, currentBatchId)) {
19
- return rxjs_1.EMPTY;
20
- }
21
- return zeniAPI
22
- .getJSON(`${zeniAPI.apiEndPoints.communicationAgentMicroServiceBaseUrl}/1.0/batches/${currentBatchId}`)
23
- .pipe((0, operators_1.mergeMap)((response) => {
24
- if (!(0, responsePayload_1.isSuccessResponse)(response) ||
25
- response.data == null ||
26
- !(0, missingReceiptsPayload_1.isBatchDetailsApiStatusCompleted)(response.data.status)) {
27
- if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
28
- return rxjs_1.EMPTY;
29
- }
30
- return (0, rxjs_1.of)((0, missingReceiptsViewReducer_1.fetchBulkUploadBatchDetailsFailure)({ error: response.status }));
31
- }
32
- const actions = [];
33
- const transactionPayloads = (0, missingReceiptsPayload_1.extractTransactionPayloadsFromBatchFiles)(response.data.files);
34
- if (transactionPayloads.length > 0) {
35
- actions.push((0, transactionReducer_1.updateTransactions)(transactionPayloads, (value) => value.transaction_id));
36
- }
37
- actions.push((0, missingReceiptsViewReducer_1.fetchBulkUploadBatchDetailsSuccess)((0, missingReceiptsPayload_1.toBatchDetails)(response.data, zeniAPI.apiEndPoints.fileMicroServiceBaseUrl)));
38
- actions.push((0, missingReceiptsViewReducer_1.fetchBulkUploadBatches)({ cacheOverride: true }));
39
- return (0, rxjs_1.from)(actions);
40
- }), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, missingReceiptsViewReducer_1.fetchBulkUploadBatchDetailsFailure)({
41
- error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Fetch batch details errored out: ' + JSON.stringify(error)),
42
- }))));
43
- }));
44
- exports.fetchBulkUploadBatchDetailsEpic = fetchBulkUploadBatchDetailsEpic;
@@ -1,7 +0,0 @@
1
- import { ActionsObservable, StateObservable } from 'redux-observable';
2
- import { Observable } from 'rxjs';
3
- import { RootState } from '../../../../reducer';
4
- import { ZeniAPI } from '../../../../zeniAPI';
5
- import { fetchBulkUploadBatches, fetchBulkUploadBatchesFailure, fetchBulkUploadBatchesSuccess } from '../../reducers/missingReceiptsViewReducer';
6
- export type ActionType = ReturnType<typeof fetchBulkUploadBatches> | ReturnType<typeof fetchBulkUploadBatchesSuccess> | ReturnType<typeof fetchBulkUploadBatchesFailure>;
7
- export declare const fetchBulkUploadBatchesEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
@@ -1,51 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.fetchBulkUploadBatchesEpic = void 0;
4
- const rxjs_1 = require("rxjs");
5
- const operators_1 = require("rxjs/operators");
6
- const timePeriod_1 = require("../../../../commonStateTypes/timePeriod");
7
- const tenantSelector_1 = require("../../../../entity/tenant/tenantSelector");
8
- const responsePayload_1 = require("../../../../responsePayload");
9
- const missingReceiptsPayload_1 = require("../../payload/missingReceiptsPayload");
10
- const missingReceiptsViewReducer_1 = require("../../reducers/missingReceiptsViewReducer");
11
- const fetchBulkUploadBatchesEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(missingReceiptsViewReducer_1.fetchBulkUploadBatches.match), (0, operators_1.switchMap)((action) => {
12
- const { cacheOverride } = action.payload;
13
- const state = state$.value;
14
- const { expenseAutomationViewState: { selectedPeriodByTenantId }, expenseAutomationMissingReceiptsViewState: { bulkUpload }, } = state;
15
- const currentTenant = (0, tenantSelector_1.getCurrentTenant)(state);
16
- const selectedPeriod = selectedPeriodByTenantId[currentTenant.tenantId];
17
- const periodId = (0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod);
18
- const existingBatches = bulkUpload.batchListByPeriod[periodId] ?? [];
19
- if (cacheOverride !== true && existingBatches.length > 0) {
20
- return (0, rxjs_1.of)((0, missingReceiptsViewReducer_1.fetchBulkUploadBatchesSuccess)({
21
- batchList: existingBatches,
22
- selectedPeriod,
23
- }));
24
- }
25
- const period = (0, timePeriod_1.convertToPeriod)(selectedPeriod);
26
- const queryParam = {
27
- start_date: period.start,
28
- end_date: period.end,
29
- sort_order: 'desc',
30
- };
31
- return zeniAPI
32
- .getJSON(`${zeniAPI.apiEndPoints.communicationAgentMicroServiceBaseUrl}/1.0/batches?query=${encodeURIComponent(JSON.stringify(queryParam))}`)
33
- .pipe((0, operators_1.mergeMap)((response) => {
34
- if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
35
- /** Full list (all statuses) for UI; batch-details epics filter to `completed` only. */
36
- return (0, rxjs_1.of)((0, missingReceiptsViewReducer_1.fetchBulkUploadBatchesSuccess)({
37
- batchList: response.data.batches.map(missingReceiptsPayload_1.toBatchListItem),
38
- selectedPeriod,
39
- }));
40
- }
41
- return (0, rxjs_1.of)((0, missingReceiptsViewReducer_1.fetchBulkUploadBatchesFailure)({
42
- error: response.status,
43
- selectedPeriod,
44
- }));
45
- }), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, missingReceiptsViewReducer_1.fetchBulkUploadBatchesFailure)({
46
- error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Fetch bulk upload batches errored out: ' +
47
- JSON.stringify(error)),
48
- selectedPeriod,
49
- }))));
50
- }));
51
- exports.fetchBulkUploadBatchesEpic = fetchBulkUploadBatchesEpic;
@@ -1,8 +0,0 @@
1
- import { ActionsObservable, StateObservable } from 'redux-observable';
2
- import { Observable } from 'rxjs';
3
- import { updateTransactions } from '../../../../entity/transaction/transactionReducer';
4
- import { RootState } from '../../../../reducer';
5
- import { ZeniAPI } from '../../../../zeniAPI';
6
- import { fetchCompletedTransactions, fetchCompletedTransactionsFailure, fetchCompletedTransactionsSuccess } from '../../reducers/missingReceiptsViewReducer';
7
- export type ActionType = ReturnType<typeof fetchCompletedTransactions> | ReturnType<typeof updateTransactions> | ReturnType<typeof fetchCompletedTransactionsSuccess> | ReturnType<typeof fetchCompletedTransactionsFailure>;
8
- export declare const fetchCompletedTransactionsEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
@@ -1,65 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.fetchCompletedTransactionsEpic = void 0;
4
- const rxjs_1 = require("rxjs");
5
- const operators_1 = require("rxjs/operators");
6
- const timePeriod_1 = require("../../../../commonStateTypes/timePeriod");
7
- const tenantSelector_1 = require("../../../../entity/tenant/tenantSelector");
8
- const transactionReducer_1 = require("../../../../entity/transaction/transactionReducer");
9
- const responsePayload_1 = require("../../../../responsePayload");
10
- const missingReceiptsViewReducer_1 = require("../../reducers/missingReceiptsViewReducer");
11
- const fetchCompletedTransactionsEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(missingReceiptsViewReducer_1.fetchCompletedTransactions.match), (0, operators_1.switchMap)((action) => {
12
- const state = state$.value;
13
- const { expenseAutomationViewState: { selectedPeriodByTenantId }, expenseAutomationMissingReceiptsViewState: { bulkUpload }, } = state;
14
- const currentTenant = (0, tenantSelector_1.getCurrentTenant)(state);
15
- const selectedPeriod = selectedPeriodByTenantId[currentTenant.tenantId];
16
- const periodId = (0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod);
17
- const isInitialLoad = action.payload.pageToken == null;
18
- const cacheKey = (0, missingReceiptsViewReducer_1.getCompletedTransactionsCacheKey)(periodId, bulkUpload.sortKey, bulkUpload.sortOrder, bulkUpload.completedSubTab);
19
- const existingData = bulkUpload.completedTransactionsByPeriod[cacheKey];
20
- if (isInitialLoad &&
21
- action.payload.cacheOverride !== true &&
22
- existingData != null &&
23
- existingData.transactionIds.length > 0) {
24
- return (0, rxjs_1.from)([]);
25
- }
26
- const period = (0, timePeriod_1.convertToPeriod)(selectedPeriod);
27
- const queryPayload = {
28
- start_date: period.start,
29
- end_date: period.end,
30
- sort_by: bulkUpload.sortKey,
31
- sort_order: bulkUpload.sortOrder === 'ascending' ? 'asc' : 'desc',
32
- page_token: action.payload.pageToken ?? null,
33
- page_size: 25,
34
- };
35
- if (bulkUpload.completedSubTab !== 'all') {
36
- queryPayload.match_type = bulkUpload.completedSubTab;
37
- }
38
- const encodedQuery = encodeURIComponent(JSON.stringify(queryPayload));
39
- return zeniAPI
40
- .getJSON(`${zeniAPI.apiEndPoints.communicationAgentMicroServiceBaseUrl}/1.0/receipt-agent/transactions/completed?query=${encodedQuery}`)
41
- .pipe((0, operators_1.mergeMap)((response) => {
42
- if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
43
- const transactionIds = response.data.transactions.map((t) => t.transaction_id);
44
- const updateActions = [];
45
- updateActions.push((0, transactionReducer_1.updateTransactions)(response.data.transactions, (value) => value.transaction_id));
46
- updateActions.push((0, missingReceiptsViewReducer_1.fetchCompletedTransactionsSuccess)({
47
- isInitialLoad,
48
- transactionIds,
49
- nextPageToken: response.data.next_page_token,
50
- totalCount: response.data.total_count,
51
- selectedPeriod,
52
- }));
53
- return (0, rxjs_1.from)(updateActions);
54
- }
55
- return (0, rxjs_1.of)((0, missingReceiptsViewReducer_1.fetchCompletedTransactionsFailure)({
56
- error: response.status,
57
- selectedPeriod,
58
- }));
59
- }), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, missingReceiptsViewReducer_1.fetchCompletedTransactionsFailure)({
60
- error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Fetch completed transactions errored: ' +
61
- JSON.stringify(error)),
62
- selectedPeriod,
63
- }))));
64
- }));
65
- exports.fetchCompletedTransactionsEpic = fetchCompletedTransactionsEpic;
@@ -1,8 +0,0 @@
1
- import { ActionsObservable, StateObservable } from 'redux-observable';
2
- import { Observable } from 'rxjs';
3
- import { updateTransactions } from '../../../../entity/transaction/transactionReducer';
4
- import { RootState } from '../../../../reducer';
5
- import { ZeniAPI } from '../../../../zeniAPI';
6
- import { batchDetailFetchFailed, fetchBulkUploadBatchDetails, fetchBulkUploadBatchesSuccess, fetchMoreBatchDetails, fetchMoreBatchDetailsComplete, fetchMoreBatchDetailsFailure, setInitialBatchDetailsLoading, storeBatchDetails } from '../../reducers/missingReceiptsViewReducer';
7
- export type ActionType = ReturnType<typeof fetchBulkUploadBatchDetails> | ReturnType<typeof fetchBulkUploadBatchesSuccess> | ReturnType<typeof fetchMoreBatchDetails> | ReturnType<typeof fetchMoreBatchDetailsComplete> | ReturnType<typeof fetchMoreBatchDetailsFailure> | ReturnType<typeof batchDetailFetchFailed> | ReturnType<typeof setInitialBatchDetailsLoading> | ReturnType<typeof storeBatchDetails> | ReturnType<typeof updateTransactions>;
8
- export declare const fetchMoreBatchDetailsEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
@@ -1,37 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.fetchMoreBatchDetailsEpic = void 0;
4
- const rxjs_1 = require("rxjs");
5
- const operators_1 = require("rxjs/operators");
6
- const timePeriod_1 = require("../../../../commonStateTypes/timePeriod");
7
- const tenantSelector_1 = require("../../../../entity/tenant/tenantSelector");
8
- const responsePayload_1 = require("../../../../responsePayload");
9
- const missingReceiptsPayload_1 = require("../../payload/missingReceiptsPayload");
10
- const missingReceiptsViewReducer_1 = require("../../reducers/missingReceiptsViewReducer");
11
- const fetchMultipleBatchDetailsEpic_1 = require("./fetchMultipleBatchDetailsEpic");
12
- const MORE_BATCH_PAGE_SIZE = 5;
13
- const fetchMoreBatchDetailsEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(missingReceiptsViewReducer_1.fetchMoreBatchDetails.match),
14
- /** One page at a time — avoids duplicate loads if IO + scroll fallback both fire. */
15
- (0, operators_1.exhaustMap)(() => {
16
- const state = state$.value;
17
- const { expenseAutomationViewState: { selectedPeriodByTenantId }, expenseAutomationMissingReceiptsViewState: { bulkUpload }, } = state;
18
- const currentTenant = (0, tenantSelector_1.getCurrentTenant)(state);
19
- const selectedPeriod = selectedPeriodByTenantId[currentTenant.tenantId];
20
- if (selectedPeriod == null) {
21
- return (0, rxjs_1.of)((0, missingReceiptsViewReducer_1.fetchMoreBatchDetailsComplete)());
22
- }
23
- const periodId = (0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod);
24
- const batchList = bulkUpload.batchListByPeriod[periodId] ?? [];
25
- const failedIds = new Set(bulkUpload.failedBatchDetailIds);
26
- const unfetchedBatches = (0, missingReceiptsPayload_1.filterBatchListItemsForBatchDetailsFetch)(batchList).filter((batch) => bulkUpload.batchDetailsById[batch.batchId] == null &&
27
- !failedIds.has(batch.batchId));
28
- const unfetchedBatchIds = unfetchedBatches.map((batch) => batch.batchId);
29
- if (unfetchedBatchIds.length === 0) {
30
- return (0, rxjs_1.of)((0, missingReceiptsViewReducer_1.fetchMoreBatchDetailsComplete)());
31
- }
32
- const nextPage = unfetchedBatchIds.slice(0, MORE_BATCH_PAGE_SIZE);
33
- return (0, rxjs_1.concat)((0, fetchMultipleBatchDetailsEpic_1.fetchBatchDetailsByIds)(nextPage, zeniAPI), (0, rxjs_1.of)((0, missingReceiptsViewReducer_1.fetchMoreBatchDetailsComplete)())).pipe((0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, missingReceiptsViewReducer_1.fetchMoreBatchDetailsFailure)({
34
- error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Fetch more batch details errored out: ' + JSON.stringify(error)),
35
- }))));
36
- }));
37
- exports.fetchMoreBatchDetailsEpic = fetchMoreBatchDetailsEpic;
@@ -1,9 +0,0 @@
1
- import { ActionsObservable, StateObservable } from 'redux-observable';
2
- import { Observable } from 'rxjs';
3
- import { updateTransactions } from '../../../../entity/transaction/transactionReducer';
4
- import { RootState } from '../../../../reducer';
5
- import { ZeniAPI } from '../../../../zeniAPI';
6
- import { batchDetailFetchFailed, fetchBulkUploadBatchDetails, fetchBulkUploadBatchesSuccess, fetchMoreBatchDetailsComplete, setInitialBatchDetailsLoading, storeBatchDetails } from '../../reducers/missingReceiptsViewReducer';
7
- export type ActionType = ReturnType<typeof fetchBulkUploadBatchDetails> | ReturnType<typeof fetchBulkUploadBatchesSuccess> | ReturnType<typeof updateTransactions> | ReturnType<typeof storeBatchDetails> | ReturnType<typeof batchDetailFetchFailed> | ReturnType<typeof setInitialBatchDetailsLoading> | ReturnType<typeof fetchMoreBatchDetailsComplete>;
8
- export declare function fetchBatchDetailsByIds(batchIds: string[], zeniAPI: ZeniAPI): Observable<ActionType>;
9
- export declare const fetchMultipleBatchDetailsEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
@@ -1,61 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.fetchMultipleBatchDetailsEpic = void 0;
4
- exports.fetchBatchDetailsByIds = fetchBatchDetailsByIds;
5
- const rxjs_1 = require("rxjs");
6
- const operators_1 = require("rxjs/operators");
7
- const transactionReducer_1 = require("../../../../entity/transaction/transactionReducer");
8
- const responsePayload_1 = require("../../../../responsePayload");
9
- const missingReceiptsPayload_1 = require("../../payload/missingReceiptsPayload");
10
- const missingReceiptsViewReducer_1 = require("../../reducers/missingReceiptsViewReducer");
11
- const INITIAL_BATCH_PAGE_SIZE = 5;
12
- function fetchBatchDetailsByIds(batchIds, zeniAPI) {
13
- if (batchIds.length === 0) {
14
- return rxjs_1.EMPTY;
15
- }
16
- return (0, rxjs_1.from)(batchIds).pipe((0, operators_1.mergeMap)((batchId) => zeniAPI
17
- .getJSON(`${zeniAPI.apiEndPoints.communicationAgentMicroServiceBaseUrl}/1.0/batches/${batchId}`)
18
- .pipe((0, operators_1.mergeMap)((response) => {
19
- if (!(0, responsePayload_1.isSuccessResponse)(response) ||
20
- response.data == null ||
21
- !(0, missingReceiptsPayload_1.isBatchDetailsApiStatusCompleted)(response.data.status)) {
22
- return rxjs_1.EMPTY;
23
- }
24
- const actions = [];
25
- const transactionPayloads = (0, missingReceiptsPayload_1.extractTransactionPayloadsFromBatchFiles)(response.data.files);
26
- if (transactionPayloads.length > 0) {
27
- actions.push((0, transactionReducer_1.updateTransactions)(transactionPayloads, (value) => value.transaction_id));
28
- }
29
- actions.push((0, missingReceiptsViewReducer_1.storeBatchDetails)((0, missingReceiptsPayload_1.toBatchDetails)(response.data, zeniAPI.apiEndPoints.fileMicroServiceBaseUrl)));
30
- return (0, rxjs_1.from)(actions);
31
- }), (0, operators_1.catchError)((error) => {
32
- console.error(`Failed to fetch batch details for ${batchId}:`, (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Fetch batch details errored out: ' + JSON.stringify(error)));
33
- return (0, rxjs_1.of)((0, missingReceiptsViewReducer_1.batchDetailFetchFailed)({ batchId }));
34
- })), 5));
35
- }
36
- const fetchMultipleBatchDetailsEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(missingReceiptsViewReducer_1.fetchBulkUploadBatchesSuccess.match), (0, operators_1.mergeMap)((action) => {
37
- const batchList = action.payload.batchList;
38
- const { batchDetailsById } = state$.value.expenseAutomationMissingReceiptsViewState.bulkUpload;
39
- /** Only completed list rows may trigger batch-details API; preserve platform order. */
40
- const completedBatchesMissingDetails = (0, missingReceiptsPayload_1.filterBatchListItemsForBatchDetailsFetch)(batchList).filter((batch) => batchDetailsById[batch.batchId] == null);
41
- const completedBatchIds = completedBatchesMissingDetails.map((batch) => batch.batchId);
42
- const batchIdsToFetch = completedBatchIds.slice(0, INITIAL_BATCH_PAGE_SIZE);
43
- if (batchIdsToFetch.length === 0) {
44
- /**
45
- * List refresh can complete while no row is `completed` yet (multi-fetch skips), or
46
- * `currentBatchId` may not appear in the filtered list but still needs `GET /batches/:id`.
47
- * Fall back to the single-batch-details epic so `phase` and details can resolve.
48
- */
49
- const bulkUpload = state$.value.expenseAutomationMissingReceiptsViewState.bulkUpload;
50
- const currentId = bulkUpload.currentBatchId;
51
- if (currentId != null &&
52
- bulkUpload.phase === 'matching' &&
53
- bulkUpload.batchDetailsById[currentId] == null &&
54
- (0, missingReceiptsPayload_1.shouldFetchBatchDetailsForBatchId)(bulkUpload.batchStatusById, bulkUpload.batchListByPeriod, currentId)) {
55
- return (0, rxjs_1.of)((0, missingReceiptsViewReducer_1.fetchBulkUploadBatchDetails)());
56
- }
57
- return rxjs_1.EMPTY;
58
- }
59
- return (0, rxjs_1.concat)((0, rxjs_1.of)((0, missingReceiptsViewReducer_1.setInitialBatchDetailsLoading)()), fetchBatchDetailsByIds(batchIdsToFetch, zeniAPI), (0, rxjs_1.of)((0, missingReceiptsViewReducer_1.fetchMoreBatchDetailsComplete)()));
60
- }));
61
- exports.fetchMultipleBatchDetailsEpic = fetchMultipleBatchDetailsEpic;
@@ -1,14 +0,0 @@
1
- import { ActionsObservable, StateObservable } from 'redux-observable';
2
- import { Observable } from 'rxjs';
3
- import { updateTransactions } from '../../../../entity/transaction/transactionReducer';
4
- import { RootState } from '../../../../reducer';
5
- import { ZeniAPI } from '../../../../zeniAPI';
6
- import { searchTransactionsForManualMatch, searchTransactionsForManualMatchFailure, searchTransactionsForManualMatchSuccess } from '../../reducers/missingReceiptsViewReducer';
7
- /**
8
- * `auto_categorized` for manual transaction search (Unmatched).
9
- * Backend contract TBD — align with `fetchTransactionCategorizationEpic` (`selectedTab === 'autoCategorized'`)
10
- * when the expense-automation API documents the intended filter for this flow.
11
- */
12
- export declare const MANUAL_TRANSACTION_SEARCH_AUTO_CATEGORIZED = false;
13
- export type ActionType = ReturnType<typeof searchTransactionsForManualMatch> | ReturnType<typeof searchTransactionsForManualMatchSuccess> | ReturnType<typeof searchTransactionsForManualMatchFailure> | ReturnType<typeof updateTransactions>;
14
- export declare const searchTransactionsForManualMatchEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
@@ -1,81 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.searchTransactionsForManualMatchEpic = exports.MANUAL_TRANSACTION_SEARCH_AUTO_CATEGORIZED = void 0;
4
- const rxjs_1 = require("rxjs");
5
- const operators_1 = require("rxjs/operators");
6
- const timePeriod_1 = require("../../../../commonStateTypes/timePeriod");
7
- const tenantSelector_1 = require("../../../../entity/tenant/tenantSelector");
8
- const transactionReducer_1 = require("../../../../entity/transaction/transactionReducer");
9
- const responsePayload_1 = require("../../../../responsePayload");
10
- const missingReceiptsPayload_1 = require("../../payload/missingReceiptsPayload");
11
- const missingReceiptsViewReducer_1 = require("../../reducers/missingReceiptsViewReducer");
12
- const transactionsViewState_1 = require("../../types/transactionsViewState");
13
- /**
14
- * `auto_categorized` for manual transaction search (Unmatched).
15
- * Backend contract TBD — align with `fetchTransactionCategorizationEpic` (`selectedTab === 'autoCategorized'`)
16
- * when the expense-automation API documents the intended filter for this flow.
17
- */
18
- exports.MANUAL_TRANSACTION_SEARCH_AUTO_CATEGORIZED = false;
19
- const searchTransactionsForManualMatchEpic = (actions$, state$, zeniAPI) => {
20
- const searchActions$ = actions$.pipe((0, operators_1.filter)(missingReceiptsViewReducer_1.searchTransactionsForManualMatch.match));
21
- const pagination$ = searchActions$.pipe((0, operators_1.filter)((action) => action.payload.pageToken != null));
22
- /**
23
- * No API for empty or 1-char queries; immediate merge so switchMap cancels any in-flight HTTP.
24
- */
25
- const newSearchTooShortOrClear$ = searchActions$.pipe((0, operators_1.filter)((action) => action.payload.pageToken == null &&
26
- action.payload.query.trim().length < 2));
27
- const newSearchDebounced$ = searchActions$.pipe((0, operators_1.filter)((action) => action.payload.pageToken == null &&
28
- action.payload.query.trim().length >= 2), (0, operators_1.debounceTime)(300));
29
- return (0, rxjs_1.merge)(pagination$, newSearchTooShortOrClear$, newSearchDebounced$).pipe((0, operators_1.switchMap)((action) => {
30
- const { query, pageToken } = action.payload;
31
- if (pageToken == null && query.trim().length < 2) {
32
- return rxjs_1.EMPTY;
33
- }
34
- const state = state$.value;
35
- const { expenseAutomationViewState: { selectedPeriodByTenantId }, expenseAutomationMissingReceiptsViewState: { bulkUpload: { manualSearch, sortKey, sortOrder }, }, } = state;
36
- const currentTenant = (0, tenantSelector_1.getCurrentTenant)(state);
37
- const selectedPeriod = selectedPeriodByTenantId[currentTenant.tenantId];
38
- if (selectedPeriod == null) {
39
- return (0, rxjs_1.of)((0, missingReceiptsViewReducer_1.searchTransactionsForManualMatchFailure)({
40
- error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Manual search requires a selected accounting period.'),
41
- }));
42
- }
43
- const period = (0, timePeriod_1.convertToPeriod)(selectedPeriod);
44
- const queryParam = {
45
- start_date: period.start,
46
- end_date: period.end,
47
- auto_categorized: exports.MANUAL_TRANSACTION_SEARCH_AUTO_CATEGORIZED,
48
- sort_by: (0, transactionsViewState_1.toTransactionsSortKey)(sortKey),
49
- sort_order: sortOrder === 'ascending' ? 'asc' : 'desc',
50
- page_token: pageToken ?? null,
51
- page_size: manualSearch.pageSize,
52
- search_text: query,
53
- };
54
- return zeniAPI
55
- .getJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/expense-automation/transactions?query=${encodeURIComponent(JSON.stringify(queryParam))}`)
56
- .pipe((0, operators_1.mergeMap)((response) => {
57
- if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
58
- const { transactions, next_page_token, total_count } = response.data;
59
- const append = pageToken != null;
60
- const results = transactions.map(missingReceiptsPayload_1.supportedTransactionPayloadToManualSearchResult);
61
- const actionsOut = [
62
- (0, transactionReducer_1.updateTransactions)(transactions, (value) => value.transaction_id, 'merge'),
63
- (0, missingReceiptsViewReducer_1.searchTransactionsForManualMatchSuccess)({
64
- append,
65
- nextPageToken: next_page_token ?? null,
66
- results,
67
- totalCount: total_count,
68
- }),
69
- ];
70
- return (0, rxjs_1.from)(actionsOut);
71
- }
72
- return (0, rxjs_1.of)((0, missingReceiptsViewReducer_1.searchTransactionsForManualMatchFailure)({
73
- error: response.status,
74
- }));
75
- }), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, missingReceiptsViewReducer_1.searchTransactionsForManualMatchFailure)({
76
- error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Search transactions for manual match errored: ' +
77
- JSON.stringify(error)),
78
- }))));
79
- }));
80
- };
81
- exports.searchTransactionsForManualMatchEpic = searchTransactionsForManualMatchEpic;