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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (411) hide show
  1. package/lib/common/aiCfo/aiCfoSuggestedQuestionsPageContext.d.ts +19 -0
  2. package/lib/common/aiCfo/aiCfoSuggestedQuestionsPageContext.js +2 -0
  3. package/lib/commonPayloadTypes/subAccountView/reportBySubAccountPayload.d.ts +2 -0
  4. package/lib/commonStateTypes/animations.d.ts +1 -1
  5. package/lib/commonStateTypes/animations.js +4 -0
  6. package/lib/commonStateTypes/coaBalance/coaBalancesFilterProjectView.d.ts +13 -0
  7. package/lib/commonStateTypes/coaBalance/coaBalancesFilterProjectView.js +9 -0
  8. package/lib/commonStateTypes/common.d.ts +1 -1
  9. package/lib/commonStateTypes/projectView/projectViewParentID.d.ts +5 -0
  10. package/lib/commonStateTypes/projectView/projectViewParentID.js +2 -0
  11. package/lib/commonStateTypes/viewAndReport/reportIDHelper.d.ts +1 -0
  12. package/lib/commonStateTypes/viewAndReport/reportIDHelper.js +3 -1
  13. package/lib/commonStateTypes/viewAndReport/viewAndReport.d.ts +2 -2
  14. package/lib/commonStateTypes/viewAndReport/viewAndReport.js +2 -0
  15. package/lib/entity/account/accountPayload.d.ts +2 -0
  16. package/lib/entity/account/accountReducer.d.ts +5 -2
  17. package/lib/entity/account/accountReducer.js +13 -5
  18. package/lib/entity/account/accountSelector.d.ts +7 -0
  19. package/lib/entity/account/accountSelector.js +4 -2
  20. package/lib/entity/account/accountState.d.ts +3 -1
  21. package/lib/entity/account/accountState.js +4 -1
  22. package/lib/entity/account/pickAndMergeForecastAccountReport.d.ts +1 -0
  23. package/lib/entity/account/subAccountSelector.d.ts +2 -0
  24. package/lib/entity/account/subAccountSelector.js +2 -0
  25. package/lib/entity/accountGroup/accountGroupSelector.d.ts +22 -0
  26. package/lib/entity/accountGroup/accountGroupState.d.ts +1 -1
  27. package/lib/entity/accountRecon/accountReconPayload.d.ts +1 -1
  28. package/lib/entity/accountRecon/accountReconPayload.js +4 -2
  29. package/lib/entity/aiAccountantCustomer/aiAccountantCustomerPayload.d.ts +52 -0
  30. package/lib/entity/aiAccountantCustomer/aiAccountantCustomerPayload.js +70 -0
  31. package/lib/entity/aiAccountantCustomer/aiAccountantCustomerReducer.d.ts +10 -0
  32. package/lib/entity/aiAccountantCustomer/aiAccountantCustomerReducer.js +51 -0
  33. package/lib/entity/aiAccountantCustomer/aiAccountantCustomerSelector.d.ts +48 -0
  34. package/lib/entity/aiAccountantCustomer/aiAccountantCustomerSelector.js +66 -0
  35. package/lib/entity/aiAccountantCustomer/aiAccountantCustomerState.d.ts +52 -0
  36. package/lib/entity/aiAccountantCustomer/aiAccountantCustomerState.js +37 -0
  37. package/lib/entity/aiCfo/aiCfoSelector.d.ts +1 -2
  38. package/lib/entity/billPay/billTransaction/billTransactionState.d.ts +4 -4
  39. package/lib/entity/chargeCard/chargeCard.d.ts +1 -1
  40. package/lib/entity/class/classReducer.d.ts +4 -4
  41. package/lib/entity/class/classState.d.ts +1 -1
  42. package/lib/entity/depositAccountTransaction/depositAccountTransaction.d.ts +1 -1
  43. package/lib/entity/entityApprovalStatus/entityApprovalStatusState.d.ts +2 -2
  44. package/lib/entity/forecast/forecastState.d.ts +1 -1
  45. package/lib/entity/jeSchedules/jeSchedulesPayload.d.ts +38 -0
  46. package/lib/entity/jeSchedules/jeSchedulesPayload.js +78 -0
  47. package/lib/entity/jeSchedules/jeSchedulesSelector.d.ts +4 -1
  48. package/lib/entity/jeSchedules/jeSchedulesSelector.js +5 -1
  49. package/lib/entity/jeSchedules/jeSchedulesState.d.ts +37 -0
  50. package/lib/entity/jeSchedules/jeSchedulesTypes.d.ts +1 -1
  51. package/lib/entity/project/projectPayload.d.ts +13 -0
  52. package/lib/entity/project/projectPayload.js +30 -0
  53. package/lib/entity/project/projectReducer.d.ts +10 -0
  54. package/lib/entity/project/projectReducer.js +31 -0
  55. package/lib/entity/project/projectSelector.d.ts +5 -0
  56. package/lib/entity/project/projectSelector.js +12 -0
  57. package/lib/entity/project/projectState.d.ts +13 -0
  58. package/lib/entity/project/projectState.js +2 -0
  59. package/lib/entity/sectionAccountsView/sectionAccountsView.d.ts +1 -1
  60. package/lib/entity/sectionClassesViewV2/sectionClassesView.d.ts +1 -1
  61. package/lib/entity/sectionClassesViewV2/sectionClassesViewReducer.d.ts +2 -2
  62. package/lib/entity/sectionProjectView/sectionProjectView.d.ts +13 -0
  63. package/lib/entity/sectionProjectView/sectionProjectView.js +6 -0
  64. package/lib/entity/sectionProjectView/sectionProjectViewEpic.d.ts +6 -0
  65. package/lib/entity/sectionProjectView/sectionProjectViewEpic.js +56 -0
  66. package/lib/entity/sectionProjectView/sectionProjectViewHelper.d.ts +11 -0
  67. package/lib/entity/sectionProjectView/sectionProjectViewHelper.js +15 -0
  68. package/lib/entity/sectionProjectView/sectionProjectViewReducer.d.ts +15 -0
  69. package/lib/entity/sectionProjectView/sectionProjectViewReducer.js +64 -0
  70. package/lib/entity/sectionProjectView/sectionProjectViewSelector.d.ts +11 -0
  71. package/lib/entity/sectionProjectView/sectionProjectViewSelector.js +57 -0
  72. package/lib/entity/sectionProjectView/sectionProjectViewSelectorTypes.d.ts +16 -0
  73. package/lib/entity/sectionProjectView/sectionProjectViewSelectorTypes.js +2 -0
  74. package/lib/entity/sectionProjectView/sectionProjectViewState.d.ts +4 -0
  75. package/lib/entity/sectionProjectView/sectionProjectViewState.js +2 -0
  76. package/lib/entity/snackbar/snackbarTypes.d.ts +2 -2
  77. package/lib/entity/snackbar/snackbarTypes.js +10 -0
  78. package/lib/entity/tenant/clearAllEpic.d.ts +7 -2
  79. package/lib/entity/tenant/clearAllEpic.js +10 -0
  80. package/lib/entity/tenant/tenantPayload.d.ts +2 -0
  81. package/lib/entity/tenant/tenantReducer.d.ts +5 -2
  82. package/lib/entity/tenant/tenantReducer.js +10 -2
  83. package/lib/entity/tenant/tenantSelector.d.ts +2 -0
  84. package/lib/entity/tenant/tenantSelector.js +17 -1
  85. package/lib/entity/tenant/tenantState.d.ts +2 -0
  86. package/lib/entity/transaction/payloadTypes/scheduleTransactionPayload.d.ts +4 -1
  87. package/lib/entity/transaction/payloadTypes/scheduleTransactionPayload.js +1 -0
  88. package/lib/entity/transaction/payloadTypes/transactionPayload.d.ts +11 -0
  89. package/lib/entity/transaction/payloadTypes/transactionPayload.js +114 -1
  90. package/lib/entity/transaction/stateTypes/scheduleTransaction.d.ts +1 -0
  91. package/lib/entity/transaction/stateTypes/transaction.d.ts +11 -0
  92. package/lib/entity/transaction/stateTypes/transactionLine.d.ts +1 -1
  93. package/lib/entity/userRole/userRoleType.d.ts +2 -2
  94. package/lib/epic.d.ts +22 -2
  95. package/lib/epic.js +22 -2
  96. package/lib/esm/common/aiCfo/aiCfoSuggestedQuestionsPageContext.js +1 -0
  97. package/lib/esm/commonStateTypes/animations.js +4 -0
  98. package/lib/esm/commonStateTypes/coaBalance/coaBalancesFilterProjectView.js +5 -0
  99. package/lib/esm/commonStateTypes/projectView/projectViewParentID.js +1 -0
  100. package/lib/esm/commonStateTypes/viewAndReport/reportIDHelper.js +1 -0
  101. package/lib/esm/commonStateTypes/viewAndReport/viewAndReport.js +2 -0
  102. package/lib/esm/entity/account/accountReducer.js +12 -4
  103. package/lib/esm/entity/account/accountSelector.js +4 -2
  104. package/lib/esm/entity/account/accountState.js +4 -1
  105. package/lib/esm/entity/account/subAccountSelector.js +2 -0
  106. package/lib/esm/entity/accountRecon/accountReconPayload.js +4 -2
  107. package/lib/esm/entity/aiAccountantCustomer/aiAccountantCustomerPayload.js +64 -0
  108. package/lib/esm/entity/aiAccountantCustomer/aiAccountantCustomerReducer.js +47 -0
  109. package/lib/esm/entity/aiAccountantCustomer/aiAccountantCustomerSelector.js +62 -0
  110. package/lib/esm/entity/aiAccountantCustomer/aiAccountantCustomerState.js +31 -0
  111. package/lib/esm/entity/jeSchedules/jeSchedulesPayload.js +78 -0
  112. package/lib/esm/entity/jeSchedules/jeSchedulesSelector.js +5 -1
  113. package/lib/esm/entity/project/projectPayload.js +26 -0
  114. package/lib/esm/entity/project/projectReducer.js +27 -0
  115. package/lib/esm/entity/project/projectSelector.js +8 -0
  116. package/lib/esm/entity/project/projectState.js +1 -0
  117. package/lib/esm/entity/sectionProjectView/sectionProjectView.js +3 -0
  118. package/lib/esm/entity/sectionProjectView/sectionProjectViewEpic.js +52 -0
  119. package/lib/esm/entity/sectionProjectView/sectionProjectViewHelper.js +11 -0
  120. package/lib/esm/entity/sectionProjectView/sectionProjectViewReducer.js +60 -0
  121. package/lib/esm/entity/sectionProjectView/sectionProjectViewSelector.js +50 -0
  122. package/lib/esm/entity/sectionProjectView/sectionProjectViewSelectorTypes.js +1 -0
  123. package/lib/esm/entity/sectionProjectView/sectionProjectViewState.js +1 -0
  124. package/lib/esm/entity/snackbar/snackbarTypes.js +10 -0
  125. package/lib/esm/entity/tenant/clearAllEpic.js +10 -0
  126. package/lib/esm/entity/tenant/tenantReducer.js +9 -1
  127. package/lib/esm/entity/tenant/tenantSelector.js +14 -0
  128. package/lib/esm/entity/transaction/payloadTypes/scheduleTransactionPayload.js +1 -0
  129. package/lib/esm/entity/transaction/payloadTypes/transactionPayload.js +114 -1
  130. package/lib/esm/epic.js +22 -2
  131. package/lib/esm/index.js +32 -19
  132. package/lib/esm/reducer.js +20 -2
  133. package/lib/esm/view/aiAccountantView/aiAccountantViewPayload.js +2 -0
  134. package/lib/esm/view/aiAccountantView/aiAccountantViewReducer.js +152 -0
  135. package/lib/esm/view/aiAccountantView/aiAccountantViewSelector.js +77 -0
  136. package/lib/esm/view/aiAccountantView/aiAccountantViewState.js +11 -0
  137. package/lib/esm/view/aiAccountantView/epics/cancelAiAccountantOnboardingEpic.js +46 -0
  138. package/lib/esm/view/aiAccountantView/epics/fetchAiAccountantCustomersEpic.js +27 -0
  139. package/lib/esm/view/aiAccountantView/epics/fetchAiAccountantJobsEpic.js +47 -0
  140. package/lib/esm/view/aiAccountantView/epics/triggerAiAccountantJobEpic.js +76 -0
  141. package/lib/esm/view/aiCfoView/aiCfoViewReducer.js +82 -1
  142. package/lib/esm/view/aiCfoView/aiCfoViewSelector.js +8 -2
  143. package/lib/esm/view/aiCfoView/epics/fetchSuggestedQuestionsEpic.js +29 -0
  144. package/lib/esm/view/classList/fetchClassListEpic.js +9 -2
  145. package/lib/esm/view/commonVendorView/vendorView/vendorViewSelector.js +18 -5
  146. package/lib/esm/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewSelector.js +6 -2
  147. package/lib/esm/view/companyTaskManagerView/companyTaskManagerViewReducer.js +19 -1
  148. package/lib/esm/view/companyTaskManagerView/companyTaskManagerViewSelector.js +3 -1
  149. package/lib/esm/view/companyTaskManagerView/epics/fetchTaskManagerMetricsEpic.js +17 -0
  150. package/lib/esm/view/companyView/companyViewReducer.js +26 -1
  151. package/lib/esm/view/companyView/epic/companyPassport/updateAccountingClassesEnabledEpic.js +61 -0
  152. package/lib/esm/view/companyView/types/companyPassport/companyPassportViewState.js +4 -0
  153. package/lib/esm/view/creditAgentView/creditAgentViewReducer.js +1 -39
  154. package/lib/esm/view/creditAgentView/creditAgentViewSelector.js +0 -1
  155. package/lib/esm/view/creditAgentView/creditAgentViewState.js +0 -6
  156. package/lib/esm/view/expenseAutomationView/epics/accountRecon/excludeAccountFromReconciliationEpic.js +63 -0
  157. package/lib/esm/view/expenseAutomationView/epics/accountRecon/fetchReconciliationViewEpic.js +4 -9
  158. package/lib/esm/view/expenseAutomationView/epics/accountRecon/includeAccountInReconciliationEpic.js +65 -0
  159. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +2 -2
  160. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/bulkUploadMatchResultToastEpic.js +33 -0
  161. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/bulkUploadReceiptsEpic.js +3 -3
  162. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchesEpic.js +6 -4
  163. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchCompletedTransactionsEpic.js +20 -5
  164. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/refetchCompletedTransactionsOnBulkUploadSortEpic.js +12 -0
  165. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/restoreBulkUploadAutomatchingOnMountEpic.js +98 -0
  166. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/searchTransactionsForManualMatchEpic.js +7 -13
  167. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/watchBulkUploadBatchStatusEpic.js +21 -5
  168. package/lib/esm/view/expenseAutomationView/expenseAutomationViewSelector.js +0 -1
  169. package/lib/esm/view/expenseAutomationView/helpers/bulkUploadTiming.js +16 -0
  170. package/lib/esm/view/expenseAutomationView/helpers/rollingCalendarDateRangeInclusive.js +13 -0
  171. package/lib/esm/view/expenseAutomationView/helpers/saveTransactionHelper.js +2 -2
  172. package/lib/esm/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.js +2 -2
  173. package/lib/esm/view/expenseAutomationView/payload/missingReceiptsPayload.js +9 -0
  174. package/lib/esm/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +21 -1
  175. package/lib/esm/view/expenseAutomationView/reducers/missingReceiptsViewReducer.js +29 -6
  176. package/lib/esm/view/expenseAutomationView/reducers/reconciliationViewReducer.js +167 -3
  177. package/lib/esm/view/expenseAutomationView/selectorTypes/reconciliationViewSelectorTypes.js +1 -2
  178. package/lib/esm/view/expenseAutomationView/selectors/fluxAnalysisViewSelector.js +10 -2
  179. package/lib/esm/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +63 -6
  180. package/lib/esm/view/expenseAutomationView/selectors/missingReceiptsSelector.js +14 -4
  181. package/lib/esm/view/expenseAutomationView/selectors/reconciliationViewSelector.js +136 -9
  182. package/lib/esm/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +15 -5
  183. package/lib/esm/view/expenseAutomationView/types/jeSchedulesViewState.js +24 -1
  184. package/lib/esm/view/financeStatement/financeStatementSelector.js +12 -1
  185. package/lib/esm/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelector.js +3 -0
  186. package/lib/esm/view/profitAndLossProjectView/profitAndLossForTimeframeProjectViewEpic.js +47 -0
  187. package/lib/esm/view/profitAndLossProjectView/profitAndLossProjectViewEpic.js +30 -0
  188. package/lib/esm/view/profitAndLossProjectView/profitAndLossProjectViewPayload.js +1 -0
  189. package/lib/esm/view/profitAndLossProjectView/profitAndLossProjectViewReducer.js +113 -0
  190. package/lib/esm/view/profitAndLossProjectView/profitAndLossProjectViewSelector.js +65 -0
  191. package/lib/esm/view/profitAndLossProjectView/profitAndLossProjectViewSelectorTypes.js +1 -0
  192. package/lib/esm/view/profitAndLossProjectView/profitAndLossProjectViewState.js +1 -0
  193. package/lib/esm/view/reportsResync/reportsClassViewRefetchingEpic.js +4 -0
  194. package/lib/esm/view/spendManagement/autotransferRules/autoTransferRulesPayload.js +26 -0
  195. package/lib/esm/view/spendManagement/autotransferRules/autoTransferRulesReducer.js +199 -0
  196. package/lib/esm/view/spendManagement/autotransferRules/autoTransferRulesSelector.js +52 -0
  197. package/lib/esm/view/spendManagement/autotransferRules/autoTransferRulesState.js +1 -0
  198. package/lib/esm/view/spendManagement/autotransferRules/epics/createAutoTransferRuleEpic.js +100 -0
  199. package/lib/esm/view/spendManagement/autotransferRules/epics/deleteAutoTransferRuleEpic.js +48 -0
  200. package/lib/esm/view/spendManagement/autotransferRules/epics/fetchAutoTransferReviewDetailEpic.js +36 -0
  201. package/lib/esm/view/spendManagement/autotransferRules/epics/fetchAutoTransferRuleHistory.js +45 -0
  202. package/lib/esm/view/spendManagement/autotransferRules/epics/fetchAutoTransferRulesEpic.js +50 -0
  203. package/lib/esm/view/spendManagement/autotransferRules/epics/updateAutoTransferRuleEpic.js +69 -0
  204. package/lib/esm/view/spendManagement/billPay/billDetailView/epics/fetchBillDetailEpic.js +5 -5
  205. package/lib/esm/view/spendManagement/billPay/billList/billListSelector.js +10 -0
  206. package/lib/esm/view/spendManagement/billPay/billList/billListState.js +1 -0
  207. package/lib/esm/view/spendManagement/billPay/billPayReview/billPayReviewSelector.js +7 -3
  208. package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/billPaySetupApproverViewSelector.js +5 -5
  209. package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/epic/fetchBillPayApproversDetailsEpic.js +7 -2
  210. package/lib/esm/view/spendManagement/billPay/editBillView/editBillViewSelector.js +13 -6
  211. package/lib/esm/view/spendManagement/chargeCards/chargeCardList/chargeCardList.js +1 -0
  212. package/lib/esm/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.js +2 -0
  213. package/lib/esm/view/spendManagement/reimbursement/editRemiView/editRemiViewSelector.js +7 -4
  214. package/lib/esm/view/spendManagement/reimbursement/remiListView/remiListSelector.js +12 -0
  215. package/lib/esm/view/spendManagement/reimbursement/remiListView/remiListState.js +1 -0
  216. package/lib/esm/view/spendManagement/treasury/treasuryList/epics/fetchTreasuryDetailEpic.js +2 -2
  217. package/lib/esm/view/spendManagement/treasury/treasuryList/treasuryDetailReducer.js +2 -1
  218. package/lib/esm/view/taskManager/taskDetailView/taskDetailSelector.js +2 -2
  219. package/lib/esm/view/transactionDetail/epics/saveTransactionHelper.js +2 -2
  220. package/lib/esm/view/transactionDetail/transactionDetailLocalDataHelper.js +16 -14
  221. package/lib/esm/view/transactionDetail/transactionDetailSelector.js +9 -2
  222. package/lib/esm/view/twoFactorAuthentication/resendOtpEpic.js +16 -2
  223. package/lib/index.d.ts +49 -26
  224. package/lib/index.js +107 -39
  225. package/lib/reducer.d.ts +20 -2
  226. package/lib/reducer.js +20 -2
  227. package/lib/view/aiAccountantView/aiAccountantViewPayload.d.ts +33 -0
  228. package/lib/view/aiAccountantView/aiAccountantViewPayload.js +8 -0
  229. package/lib/view/aiAccountantView/aiAccountantViewReducer.d.ts +29 -0
  230. package/lib/view/aiAccountantView/aiAccountantViewReducer.js +156 -0
  231. package/lib/view/aiAccountantView/aiAccountantViewSelector.d.ts +16 -0
  232. package/lib/view/aiAccountantView/aiAccountantViewSelector.js +83 -0
  233. package/lib/view/aiAccountantView/aiAccountantViewState.d.ts +26 -0
  234. package/lib/view/aiAccountantView/aiAccountantViewState.js +13 -0
  235. package/lib/view/aiAccountantView/epics/cancelAiAccountantOnboardingEpic.d.ts +33 -0
  236. package/lib/view/aiAccountantView/epics/cancelAiAccountantOnboardingEpic.js +50 -0
  237. package/lib/view/aiAccountantView/epics/fetchAiAccountantCustomersEpic.d.ts +23 -0
  238. package/lib/view/aiAccountantView/epics/fetchAiAccountantCustomersEpic.js +31 -0
  239. package/lib/view/aiAccountantView/epics/fetchAiAccountantJobsEpic.d.ts +33 -0
  240. package/lib/view/aiAccountantView/epics/fetchAiAccountantJobsEpic.js +51 -0
  241. package/lib/view/aiAccountantView/epics/triggerAiAccountantJobEpic.d.ts +28 -0
  242. package/lib/view/aiAccountantView/epics/triggerAiAccountantJobEpic.js +80 -0
  243. package/lib/view/aiCfoView/aiCfoViewPayload.d.ts +7 -0
  244. package/lib/view/aiCfoView/aiCfoViewReducer.d.ts +15 -1
  245. package/lib/view/aiCfoView/aiCfoViewReducer.js +83 -2
  246. package/lib/view/aiCfoView/aiCfoViewSelector.d.ts +4 -1
  247. package/lib/view/aiCfoView/aiCfoViewSelector.js +9 -2
  248. package/lib/view/aiCfoView/aiCfoViewState.d.ts +15 -1
  249. package/lib/view/aiCfoView/epics/fetchSuggestedQuestionsEpic.d.ts +8 -0
  250. package/lib/view/aiCfoView/epics/fetchSuggestedQuestionsEpic.js +33 -0
  251. package/lib/view/auditReportView/auditReportViewState.d.ts +2 -2
  252. package/lib/view/billPayCard/billPayCardSelector.d.ts +1 -1
  253. package/lib/view/cardBalance/cardBalanceSelector.d.ts +2 -1
  254. package/lib/view/cashBalance/cashBalanceSelector.d.ts +2 -1
  255. package/lib/view/cashInCashOut/cashInCashOutSelector.d.ts +1 -1
  256. package/lib/view/cashPosition/cashPositionSelector.d.ts +1 -1
  257. package/lib/view/classList/fetchClassListEpic.d.ts +1 -1
  258. package/lib/view/classList/fetchClassListEpic.js +8 -1
  259. package/lib/view/commonVendorView/vendorView/vendorViewSelector.d.ts +1 -0
  260. package/lib/view/commonVendorView/vendorView/vendorViewSelector.js +18 -5
  261. package/lib/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewSelector.d.ts +1 -0
  262. package/lib/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewSelector.js +6 -2
  263. package/lib/view/companyTaskManagerView/companyTaskManagerViewReducer.d.ts +2 -2
  264. package/lib/view/companyTaskManagerView/companyTaskManagerViewReducer.js +20 -2
  265. package/lib/view/companyTaskManagerView/companyTaskManagerViewSelector.d.ts +4 -1
  266. package/lib/view/companyTaskManagerView/companyTaskManagerViewSelector.js +3 -1
  267. package/lib/view/companyTaskManagerView/companyTaskManagerViewState.d.ts +9 -1
  268. package/lib/view/companyTaskManagerView/epics/fetchTaskManagerMetricsEpic.d.ts +7 -0
  269. package/lib/view/companyTaskManagerView/epics/fetchTaskManagerMetricsEpic.js +21 -0
  270. package/lib/view/companyView/companyViewReducer.d.ts +6 -1
  271. package/lib/view/companyView/companyViewReducer.js +28 -2
  272. package/lib/view/companyView/epic/companyPassport/updateAccountingClassesEnabledEpic.d.ts +10 -0
  273. package/lib/view/companyView/epic/companyPassport/updateAccountingClassesEnabledEpic.js +65 -0
  274. package/lib/view/companyView/types/cockpitTypes.d.ts +6 -5
  275. package/lib/view/companyView/types/companyPassport/companyPassportViewState.d.ts +1 -0
  276. package/lib/view/companyView/types/companyPassport/companyPassportViewState.js +4 -0
  277. package/lib/view/creditAgentView/creditAgentViewPayload.d.ts +0 -36
  278. package/lib/view/creditAgentView/creditAgentViewReducer.d.ts +2 -2
  279. package/lib/view/creditAgentView/creditAgentViewReducer.js +2 -40
  280. package/lib/view/creditAgentView/creditAgentViewSelector.d.ts +0 -1
  281. package/lib/view/creditAgentView/creditAgentViewSelector.js +1 -2
  282. package/lib/view/creditAgentView/creditAgentViewState.d.ts +0 -31
  283. package/lib/view/creditAgentView/creditAgentViewState.js +0 -6
  284. package/lib/view/dashboard/dashboardReducer.d.ts +2 -2
  285. package/lib/view/expenseAutomationView/epics/accountRecon/excludeAccountFromReconciliationEpic.d.ts +9 -0
  286. package/lib/view/expenseAutomationView/epics/accountRecon/excludeAccountFromReconciliationEpic.js +67 -0
  287. package/lib/view/expenseAutomationView/epics/accountRecon/fetchReconciliationViewEpic.js +4 -9
  288. package/lib/view/expenseAutomationView/epics/accountRecon/includeAccountInReconciliationEpic.d.ts +10 -0
  289. package/lib/view/expenseAutomationView/epics/accountRecon/includeAccountInReconciliationEpic.js +69 -0
  290. package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +2 -2
  291. package/lib/view/expenseAutomationView/epics/missingReceipts/bulkUploadMatchResultToastEpic.d.ts +13 -0
  292. package/lib/view/expenseAutomationView/epics/missingReceipts/bulkUploadMatchResultToastEpic.js +37 -0
  293. package/lib/view/expenseAutomationView/epics/missingReceipts/bulkUploadReceiptsEpic.js +2 -2
  294. package/lib/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchesEpic.js +5 -3
  295. package/lib/view/expenseAutomationView/epics/missingReceipts/fetchCompletedTransactionsEpic.js +20 -5
  296. package/lib/view/expenseAutomationView/epics/missingReceipts/refetchCompletedTransactionsOnBulkUploadSortEpic.d.ts +10 -0
  297. package/lib/view/expenseAutomationView/epics/missingReceipts/refetchCompletedTransactionsOnBulkUploadSortEpic.js +16 -0
  298. package/lib/view/expenseAutomationView/epics/missingReceipts/restoreBulkUploadAutomatchingOnMountEpic.d.ts +18 -0
  299. package/lib/view/expenseAutomationView/epics/missingReceipts/restoreBulkUploadAutomatchingOnMountEpic.js +102 -0
  300. package/lib/view/expenseAutomationView/epics/missingReceipts/searchTransactionsForManualMatchEpic.js +7 -13
  301. package/lib/view/expenseAutomationView/epics/missingReceipts/watchBulkUploadBatchStatusEpic.d.ts +2 -2
  302. package/lib/view/expenseAutomationView/epics/missingReceipts/watchBulkUploadBatchStatusEpic.js +20 -4
  303. package/lib/view/expenseAutomationView/expenseAutomationViewSelector.js +0 -1
  304. package/lib/view/expenseAutomationView/helpers/bulkUploadTiming.d.ts +16 -0
  305. package/lib/view/expenseAutomationView/helpers/bulkUploadTiming.js +19 -0
  306. package/lib/view/expenseAutomationView/helpers/rollingCalendarDateRangeInclusive.d.ts +7 -0
  307. package/lib/view/expenseAutomationView/helpers/rollingCalendarDateRangeInclusive.js +16 -0
  308. package/lib/view/expenseAutomationView/helpers/saveTransactionHelper.js +2 -2
  309. package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +2 -2
  310. package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.js +2 -2
  311. package/lib/view/expenseAutomationView/payload/jeSchedulesPayload.d.ts +1 -1
  312. package/lib/view/expenseAutomationView/payload/missingReceiptsPayload.d.ts +5 -0
  313. package/lib/view/expenseAutomationView/payload/missingReceiptsPayload.js +10 -0
  314. package/lib/view/expenseAutomationView/payload/reconciliationPayload.d.ts +45 -0
  315. package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.d.ts +2 -2
  316. package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +22 -2
  317. package/lib/view/expenseAutomationView/reducers/missingReceiptsViewReducer.d.ts +18 -2
  318. package/lib/view/expenseAutomationView/reducers/missingReceiptsViewReducer.js +30 -7
  319. package/lib/view/expenseAutomationView/reducers/reconciliationViewReducer.d.ts +18 -4
  320. package/lib/view/expenseAutomationView/reducers/reconciliationViewReducer.js +168 -4
  321. package/lib/view/expenseAutomationView/selectorTypes/jeSchedulesSelectorTypes.d.ts +2 -0
  322. package/lib/view/expenseAutomationView/selectorTypes/missingReceiptsSelectorTypes.d.ts +2 -0
  323. package/lib/view/expenseAutomationView/selectorTypes/reconciliationViewSelectorTypes.d.ts +7 -2
  324. package/lib/view/expenseAutomationView/selectorTypes/reconciliationViewSelectorTypes.js +2 -2
  325. package/lib/view/expenseAutomationView/selectors/fluxAnalysisViewSelector.js +10 -2
  326. package/lib/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +63 -6
  327. package/lib/view/expenseAutomationView/selectors/missingReceiptsSelector.js +14 -4
  328. package/lib/view/expenseAutomationView/selectors/reconciliationViewSelector.js +136 -9
  329. package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +13 -3
  330. package/lib/view/expenseAutomationView/types/jeSchedulesViewState.d.ts +8 -0
  331. package/lib/view/expenseAutomationView/types/jeSchedulesViewState.js +27 -0
  332. package/lib/view/expenseAutomationView/types/missingReceiptsViewState.d.ts +5 -1
  333. package/lib/view/expenseAutomationView/types/reconciliationViewState.d.ts +14 -0
  334. package/lib/view/financeStatement/financeStatementReducer.d.ts +1 -1
  335. package/lib/view/financeStatement/financeStatementSelector.d.ts +2 -0
  336. package/lib/view/financeStatement/financeStatementSelector.js +12 -1
  337. package/lib/view/globalMerchantView/globalMerchantViewReducer.d.ts +2 -2
  338. package/lib/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelector.js +3 -0
  339. package/lib/view/profitAndLossProjectView/profitAndLossForTimeframeProjectViewEpic.d.ts +9 -0
  340. package/lib/view/profitAndLossProjectView/profitAndLossForTimeframeProjectViewEpic.js +51 -0
  341. package/lib/view/profitAndLossProjectView/profitAndLossProjectViewEpic.d.ts +6 -0
  342. package/lib/view/profitAndLossProjectView/profitAndLossProjectViewEpic.js +34 -0
  343. package/lib/view/profitAndLossProjectView/profitAndLossProjectViewPayload.d.ts +33 -0
  344. package/lib/view/profitAndLossProjectView/profitAndLossProjectViewPayload.js +2 -0
  345. package/lib/view/profitAndLossProjectView/profitAndLossProjectViewReducer.d.ts +33 -0
  346. package/lib/view/profitAndLossProjectView/profitAndLossProjectViewReducer.js +117 -0
  347. package/lib/view/profitAndLossProjectView/profitAndLossProjectViewSelector.d.ts +9 -0
  348. package/lib/view/profitAndLossProjectView/profitAndLossProjectViewSelector.js +69 -0
  349. package/lib/view/profitAndLossProjectView/profitAndLossProjectViewSelectorTypes.d.ts +19 -0
  350. package/lib/view/profitAndLossProjectView/profitAndLossProjectViewSelectorTypes.js +2 -0
  351. package/lib/view/profitAndLossProjectView/profitAndLossProjectViewState.d.ts +22 -0
  352. package/lib/view/profitAndLossProjectView/profitAndLossProjectViewState.js +2 -0
  353. package/lib/view/reimbursementCard/reimbursementCardSelector.d.ts +1 -1
  354. package/lib/view/reportsResync/reportsClassViewRefetchingEpic.d.ts +2 -1
  355. package/lib/view/reportsResync/reportsClassViewRefetchingEpic.js +4 -0
  356. package/lib/view/reportsResync/reportsResyncReducer.d.ts +2 -2
  357. package/lib/view/reviewCompanyView/reviewCompanyViewState.d.ts +1 -1
  358. package/lib/view/scheduleView/scheduleListView/scheduleListTypes.d.ts +1 -1
  359. package/lib/view/spendManagement/autotransferRules/autoTransferRulesPayload.d.ts +75 -0
  360. package/lib/view/spendManagement/autotransferRules/autoTransferRulesPayload.js +30 -0
  361. package/lib/view/spendManagement/autotransferRules/autoTransferRulesReducer.d.ts +50 -0
  362. package/lib/view/spendManagement/autotransferRules/autoTransferRulesReducer.js +206 -0
  363. package/lib/view/spendManagement/autotransferRules/autoTransferRulesSelector.d.ts +24 -0
  364. package/lib/view/spendManagement/autotransferRules/autoTransferRulesSelector.js +61 -0
  365. package/lib/view/spendManagement/autotransferRules/autoTransferRulesState.d.ts +38 -0
  366. package/lib/view/spendManagement/autotransferRules/autoTransferRulesState.js +2 -0
  367. package/lib/view/spendManagement/autotransferRules/epics/createAutoTransferRuleEpic.d.ts +12 -0
  368. package/lib/view/spendManagement/autotransferRules/epics/createAutoTransferRuleEpic.js +106 -0
  369. package/lib/view/spendManagement/autotransferRules/epics/deleteAutoTransferRuleEpic.d.ts +8 -0
  370. package/lib/view/spendManagement/autotransferRules/epics/deleteAutoTransferRuleEpic.js +52 -0
  371. package/lib/view/spendManagement/autotransferRules/epics/fetchAutoTransferReviewDetailEpic.d.ts +7 -0
  372. package/lib/view/spendManagement/autotransferRules/epics/fetchAutoTransferReviewDetailEpic.js +40 -0
  373. package/lib/view/spendManagement/autotransferRules/epics/fetchAutoTransferRuleHistory.d.ts +7 -0
  374. package/lib/view/spendManagement/autotransferRules/epics/fetchAutoTransferRuleHistory.js +52 -0
  375. package/lib/view/spendManagement/autotransferRules/epics/fetchAutoTransferRulesEpic.d.ts +10 -0
  376. package/lib/view/spendManagement/autotransferRules/epics/fetchAutoTransferRulesEpic.js +54 -0
  377. package/lib/view/spendManagement/autotransferRules/epics/updateAutoTransferRuleEpic.d.ts +8 -0
  378. package/lib/view/spendManagement/autotransferRules/epics/updateAutoTransferRuleEpic.js +73 -0
  379. package/lib/view/spendManagement/billPay/billDetailView/epics/fetchBillDetailEpic.js +5 -5
  380. package/lib/view/spendManagement/billPay/billList/billListReducer.d.ts +1 -1
  381. package/lib/view/spendManagement/billPay/billList/billListSelector.js +10 -0
  382. package/lib/view/spendManagement/billPay/billList/billListState.d.ts +2 -2
  383. package/lib/view/spendManagement/billPay/billList/billListState.js +1 -0
  384. package/lib/view/spendManagement/billPay/billPayReview/billPayReviewSelector.js +7 -3
  385. package/lib/view/spendManagement/billPay/billPaySetupApproverView/billPaySetupApproverViewSelector.js +5 -5
  386. package/lib/view/spendManagement/billPay/billPaySetupApproverView/epic/fetchBillPayApproversDetailsEpic.js +7 -2
  387. package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.js +13 -6
  388. package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailReducer.d.ts +4 -4
  389. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardList.d.ts +1 -1
  390. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardList.js +1 -0
  391. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.js +2 -0
  392. package/lib/view/spendManagement/reimbursement/editRemiView/editRemiViewSelector.js +6 -3
  393. package/lib/view/spendManagement/reimbursement/remiListView/remiListReducer.d.ts +1 -1
  394. package/lib/view/spendManagement/reimbursement/remiListView/remiListSelector.d.ts +1 -0
  395. package/lib/view/spendManagement/reimbursement/remiListView/remiListSelector.js +12 -0
  396. package/lib/view/spendManagement/reimbursement/remiListView/remiListState.d.ts +4 -4
  397. package/lib/view/spendManagement/reimbursement/remiListView/remiListState.js +1 -0
  398. package/lib/view/spendManagement/treasury/treasuryList/epics/fetchTreasuryDetailEpic.js +2 -2
  399. package/lib/view/spendManagement/treasury/treasuryList/treasuryDetailReducer.d.ts +2 -1
  400. package/lib/view/spendManagement/treasury/treasuryList/treasuryDetailReducer.js +2 -1
  401. package/lib/view/subscriptionView/types/subscriptionTypes.d.ts +1 -1
  402. package/lib/view/taskManager/taskDetailView/taskDetailSelector.js +2 -2
  403. package/lib/view/tasksCard/tasksCardSelector.d.ts +1 -1
  404. package/lib/view/topEx/topExSelector.d.ts +1 -1
  405. package/lib/view/transactionDetail/epics/saveTransactionHelper.js +2 -2
  406. package/lib/view/transactionDetail/transactionDetailLocalDataHelper.js +16 -14
  407. package/lib/view/transactionDetail/transactionDetailSelector.d.ts +1 -0
  408. package/lib/view/transactionDetail/transactionDetailSelector.js +9 -2
  409. package/lib/view/twoFactorAuthentication/resendOtpEpic.d.ts +1 -1
  410. package/lib/view/twoFactorAuthentication/resendOtpEpic.js +15 -1
  411. package/package.json +1 -1
@@ -0,0 +1,69 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.includeAccountInReconciliationEpic = void 0;
4
+ const rxjs_1 = require("rxjs");
5
+ const operators_1 = require("rxjs/operators");
6
+ const timePeriod_1 = require("../../../../commonStateTypes/timePeriod");
7
+ const accountReducer_1 = require("../../../../entity/account/accountReducer");
8
+ const accountSelector_1 = require("../../../../entity/account/accountSelector");
9
+ const accountState_1 = require("../../../../entity/account/accountState");
10
+ const accountReconReducer_1 = require("../../../../entity/accountRecon/accountReconReducer");
11
+ const snackbarReducer_1 = require("../../../../entity/snackbar/snackbarReducer");
12
+ const tenantSelector_1 = require("../../../../entity/tenant/tenantSelector");
13
+ const responsePayload_1 = require("../../../../responsePayload");
14
+ const reconciliationViewReducer_1 = require("../../reducers/reconciliationViewReducer");
15
+ const includeAccountInReconciliationEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(reconciliationViewReducer_1.includeAccountInReconciliation.match), (0, operators_1.mergeMap)((action) => {
16
+ const { accountId } = action.payload;
17
+ const state = state$.value;
18
+ const currentTenant = (0, tenantSelector_1.getCurrentTenant)(state);
19
+ const selectedPeriod = state.expenseAutomationViewState.selectedPeriodByTenantId[currentTenant.tenantId];
20
+ const account = (0, accountSelector_1.getAccountBase)(state.accountState, accountId, 'excluded_account_reconciliation');
21
+ const period = (0, timePeriod_1.convertToPeriod)(selectedPeriod, true);
22
+ const query = JSON.stringify({
23
+ start_date: period.start,
24
+ end_date: period.end,
25
+ });
26
+ const apiUrl = `${zeniAPI.apiEndPoints.reconciliationMicroServiceBaseUrl}/1.0/reconciliation/excluded-accounts/${accountId}?query=${encodeURIComponent(query)}`;
27
+ return zeniAPI
28
+ .deleteAndGetJSON(apiUrl)
29
+ .pipe((0, operators_1.mergeMap)((response) => {
30
+ if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
31
+ const reconciliation = response.data.reconciliation;
32
+ const oldAccountKey = (0, accountState_1.getAccountKey)('excluded_account_reconciliation', reconciliation.account_id);
33
+ const newAccountKey = (0, accountState_1.getAccountKey)('account_reconciliation', reconciliation.account_id);
34
+ return (0, rxjs_1.of)((0, accountReconReducer_1.updateAccountRecon)(selectedPeriod, [reconciliation]), (0, reconciliationViewReducer_1.includeAccountInReconciliationSuccess)({
35
+ reconciliation,
36
+ selectedPeriod,
37
+ }), (0, accountReducer_1.changeAccountKey)({
38
+ oldKey: oldAccountKey,
39
+ newKey: newAccountKey,
40
+ }), (0, snackbarReducer_1.openSnackbar)({
41
+ messageSection: 'account_included_in_reconciliation',
42
+ messageText: 'success',
43
+ type: 'success',
44
+ variables: [
45
+ {
46
+ variableName: '_account-name_',
47
+ variableValue: account?.accountName ?? '',
48
+ },
49
+ ],
50
+ }));
51
+ }
52
+ else {
53
+ return (0, rxjs_1.of)((0, reconciliationViewReducer_1.includeAccountInReconciliationFailure)({
54
+ error: response.status,
55
+ }), (0, snackbarReducer_1.openSnackbar)({
56
+ messageSection: 'account_included_in_reconciliation',
57
+ messageText: 'failed',
58
+ type: 'error',
59
+ }));
60
+ }
61
+ }), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, reconciliationViewReducer_1.includeAccountInReconciliationFailure)({
62
+ error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', `Include account in reconciliation REST API call errored out ${JSON.stringify(error)}`),
63
+ }), (0, snackbarReducer_1.openSnackbar)({
64
+ messageSection: 'account_included_in_reconciliation',
65
+ messageText: 'failed',
66
+ type: 'error',
67
+ }))));
68
+ }));
69
+ exports.includeAccountInReconciliationEpic = includeAccountInReconciliationEpic;
@@ -24,13 +24,13 @@ const fetchJeSchedulesEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, op
24
24
  if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
25
25
  const updateActions = [];
26
26
  updateActions.push((0, jeSchedulesReducer_1.updateJESchedules)([
27
- ...response.data.draft_je_schedules,
27
+ ...response.data.je_schedules,
28
28
  ...response.data.failed_je_postings.je_schedules,
29
29
  ]), (0, jeSchedulesReducer_1.updateJESchedulesDetails)([...response.data.failed_je_postings.je_schedules], response.data.failed_je_postings.scheduled_journal_entries), (0, jeSchedulesViewReducer_1.initializeJeScheduleLocalData)([
30
30
  ...response.data.failed_je_postings.je_schedules,
31
31
  ]));
32
32
  updateActions.push((0, jeSchedulesViewReducer_1.fetchJeSchedulesSuccess)({
33
- jeSchedules: [...response.data.draft_je_schedules],
33
+ jeSchedules: [...response.data.je_schedules],
34
34
  failedJeSchedules: [
35
35
  ...response.data.failed_je_postings.je_schedules,
36
36
  ],
@@ -0,0 +1,13 @@
1
+ import { ActionsObservable } from 'redux-observable';
2
+ import { Observable } from 'rxjs';
3
+ import { openSnackbar } from '../../../../entity/snackbar/snackbarReducer';
4
+ import { bulkUploadReceiptsSuccess, clearBulkUpload, fetchBulkUploadBatchDetailsSuccess, restoreBulkUploadMatchingState, storeBatchDetails } from '../../reducers/missingReceiptsViewReducer';
5
+ export type ActionType = ReturnType<typeof bulkUploadReceiptsSuccess> | ReturnType<typeof restoreBulkUploadMatchingState> | ReturnType<typeof fetchBulkUploadBatchDetailsSuccess> | ReturnType<typeof storeBatchDetails> | ReturnType<typeof clearBulkUpload> | ReturnType<typeof openSnackbar>;
6
+ /**
7
+ * Show a success toast when batch details arrive for the current upload batch,
8
+ * e.g. "17 out of 20 Receipts Matched". Scoped per upload session so it fires
9
+ * only once: starts on `bulkUploadReceiptsSuccess` (or `restoreBulkUploadMatchingState`
10
+ * for a restored session), waits for the first batch-details action for that batch,
11
+ * emits the toast, then stops. `clearBulkUpload` cancels the in-flight wait.
12
+ */
13
+ export declare const bulkUploadMatchResultToastEpic: (actions$: ActionsObservable<ActionType>) => Observable<ActionType>;
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.bulkUploadMatchResultToastEpic = 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 missingReceiptsViewReducer_1 = require("../../reducers/missingReceiptsViewReducer");
8
+ /**
9
+ * Show a success toast when batch details arrive for the current upload batch,
10
+ * e.g. "17 out of 20 Receipts Matched". Scoped per upload session so it fires
11
+ * only once: starts on `bulkUploadReceiptsSuccess` (or `restoreBulkUploadMatchingState`
12
+ * for a restored session), waits for the first batch-details action for that batch,
13
+ * emits the toast, then stops. `clearBulkUpload` cancels the in-flight wait.
14
+ */
15
+ const bulkUploadMatchResultToastEpic = (actions$) => actions$.pipe((0, operators_1.filter)((action) => missingReceiptsViewReducer_1.bulkUploadReceiptsSuccess.match(action) ||
16
+ missingReceiptsViewReducer_1.restoreBulkUploadMatchingState.match(action)), (0, operators_1.switchMap)((uploadAction) => {
17
+ const { batchId } = uploadAction.payload;
18
+ return (0, rxjs_1.merge)(actions$.pipe((0, operators_1.filter)(missingReceiptsViewReducer_1.fetchBulkUploadBatchDetailsSuccess.match)), actions$.pipe((0, operators_1.filter)(missingReceiptsViewReducer_1.storeBatchDetails.match))).pipe((0, operators_1.filter)((a) => a.payload.batchId === batchId), (0, operators_1.take)(1), (0, operators_1.mergeMap)((action) => {
19
+ const { summary } = action.payload;
20
+ return (0, rxjs_1.of)((0, snackbarReducer_1.openSnackbar)({
21
+ messageSection: 'receipts_bulk_match',
22
+ messageText: 'success',
23
+ type: 'success',
24
+ variables: [
25
+ {
26
+ variableName: '_matched_',
27
+ variableValue: String(summary.matched),
28
+ },
29
+ {
30
+ variableName: '_total_',
31
+ variableValue: String(summary.total),
32
+ },
33
+ ],
34
+ }));
35
+ }), (0, operators_1.takeUntil)(actions$.pipe((0, operators_1.filter)(missingReceiptsViewReducer_1.clearBulkUpload.match))));
36
+ }));
37
+ exports.bulkUploadMatchResultToastEpic = bulkUploadMatchResultToastEpic;
@@ -4,9 +4,9 @@ exports.bulkUploadReceiptsEpic = void 0;
4
4
  const rxjs_1 = require("rxjs");
5
5
  const operators_1 = require("rxjs/operators");
6
6
  const responsePayload_1 = require("../../../../responsePayload");
7
- const bulkUploadTiming_1 = require("../../bulkUploadTiming");
7
+ const bulkUploadTiming_1 = require("../../helpers/bulkUploadTiming");
8
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.mergeMap)((action) => {
9
+ const bulkUploadReceiptsEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(missingReceiptsViewReducer_1.bulkUploadReceipts.match), (0, operators_1.switchMap)((action) => {
10
10
  const { files } = action.payload;
11
11
  const formData = new FormData();
12
12
  for (const file of files) {
@@ -8,6 +8,8 @@ const tenantSelector_1 = require("../../../../entity/tenant/tenantSelector");
8
8
  const responsePayload_1 = require("../../../../responsePayload");
9
9
  const missingReceiptsPayload_1 = require("../../payload/missingReceiptsPayload");
10
10
  const missingReceiptsViewReducer_1 = require("../../reducers/missingReceiptsViewReducer");
11
+ const bulkUploadTiming_1 = require("../../helpers/bulkUploadTiming");
12
+ const rollingCalendarDateRangeInclusive_1 = require("../../helpers/rollingCalendarDateRangeInclusive");
11
13
  const fetchBulkUploadBatchesEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(missingReceiptsViewReducer_1.fetchBulkUploadBatches.match), (0, operators_1.switchMap)((action) => {
12
14
  const { cacheOverride } = action.payload;
13
15
  const state = state$.value;
@@ -22,10 +24,10 @@ const fetchBulkUploadBatchesEpic = (actions$, state$, zeniAPI) => actions$.pipe(
22
24
  selectedPeriod,
23
25
  }));
24
26
  }
25
- const period = (0, timePeriod_1.convertToPeriod)(selectedPeriod);
27
+ const { end, start } = (0, rollingCalendarDateRangeInclusive_1.rollingCalendarDateRangeInclusive)(bulkUploadTiming_1.BULK_UPLOAD_BATCH_LIST_DATE_RANGE_DAYS);
26
28
  const queryParam = {
27
- start_date: period.start,
28
- end_date: period.end,
29
+ start_date: start,
30
+ end_date: end,
29
31
  sort_order: 'desc',
30
32
  };
31
33
  return zeniAPI
@@ -15,7 +15,13 @@ const fetchCompletedTransactionsEpic = (actions$, state$, zeniAPI) => actions$.p
15
15
  const selectedPeriod = selectedPeriodByTenantId[currentTenant.tenantId];
16
16
  const periodId = (0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod);
17
17
  const isInitialLoad = action.payload.pageToken == null;
18
- const cacheKey = (0, missingReceiptsViewReducer_1.getCompletedTransactionsCacheKey)(periodId, bulkUpload.sortKey, bulkUpload.sortOrder, bulkUpload.completedSubTab);
18
+ /**
19
+ * Snapshot sort config + subTab at request time so success/failure write
20
+ * into the same cache key the request was made under, even if the user
21
+ * toggles sort while the request is in flight.
22
+ */
23
+ const { sortKey, sortOrder, completedSubTab } = bulkUpload;
24
+ const cacheKey = (0, missingReceiptsViewReducer_1.getCompletedTransactionsCacheKey)(periodId, sortKey, sortOrder, completedSubTab);
19
25
  const existingData = bulkUpload.completedTransactionsByPeriod[cacheKey];
20
26
  if (isInitialLoad &&
21
27
  action.payload.cacheOverride !== true &&
@@ -27,13 +33,13 @@ const fetchCompletedTransactionsEpic = (actions$, state$, zeniAPI) => actions$.p
27
33
  const queryPayload = {
28
34
  start_date: period.start,
29
35
  end_date: period.end,
30
- sort_by: bulkUpload.sortKey,
31
- sort_order: bulkUpload.sortOrder === 'ascending' ? 'asc' : 'desc',
36
+ sort_by: sortKey,
37
+ sort_order: sortOrder === 'ascending' ? 'asc' : 'desc',
32
38
  page_token: action.payload.pageToken ?? null,
33
39
  page_size: 25,
34
40
  };
35
- if (bulkUpload.completedSubTab !== 'all') {
36
- queryPayload.match_type = bulkUpload.completedSubTab;
41
+ if (completedSubTab !== 'all') {
42
+ queryPayload.match_type = completedSubTab;
37
43
  }
38
44
  const encodedQuery = encodeURIComponent(JSON.stringify(queryPayload));
39
45
  return zeniAPI
@@ -49,17 +55,26 @@ const fetchCompletedTransactionsEpic = (actions$, state$, zeniAPI) => actions$.p
49
55
  nextPageToken: response.data.next_page_token,
50
56
  totalCount: response.data.total_count,
51
57
  selectedPeriod,
58
+ sortKey,
59
+ sortOrder,
60
+ completedSubTab,
52
61
  }));
53
62
  return (0, rxjs_1.from)(updateActions);
54
63
  }
55
64
  return (0, rxjs_1.of)((0, missingReceiptsViewReducer_1.fetchCompletedTransactionsFailure)({
56
65
  error: response.status,
57
66
  selectedPeriod,
67
+ sortKey,
68
+ sortOrder,
69
+ completedSubTab,
58
70
  }));
59
71
  }), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, missingReceiptsViewReducer_1.fetchCompletedTransactionsFailure)({
60
72
  error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Fetch completed transactions errored: ' +
61
73
  JSON.stringify(error)),
62
74
  selectedPeriod,
75
+ sortKey,
76
+ sortOrder,
77
+ completedSubTab,
63
78
  }))));
64
79
  }));
65
80
  exports.fetchCompletedTransactionsEpic = fetchCompletedTransactionsEpic;
@@ -0,0 +1,10 @@
1
+ import { ActionsObservable } from 'redux-observable';
2
+ import { Observable } from 'rxjs';
3
+ import { fetchCompletedTransactions, setBulkUploadCompletedSubTab, setBulkUploadSortConfig } from '../../reducers/missingReceiptsViewReducer';
4
+ export type ActionType = ReturnType<typeof setBulkUploadSortConfig> | ReturnType<typeof setBulkUploadCompletedSubTab> | ReturnType<typeof fetchCompletedTransactions>;
5
+ /**
6
+ * Completed transactions are cached per sort key/order/sub-tab. After a sort or sub-tab
7
+ * change, the fetch epic would otherwise skip the network when that cache entry already
8
+ * exists — dispatch a cache-bypassing initial fetch whenever either changes from the UI.
9
+ */
10
+ export declare const refetchCompletedTransactionsOnBulkUploadSortEpic: (actions$: ActionsObservable<ActionType>) => Observable<ActionType>;
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.refetchCompletedTransactionsOnBulkUploadSortEpic = void 0;
4
+ const rxjs_1 = require("rxjs");
5
+ const operators_1 = require("rxjs/operators");
6
+ const missingReceiptsViewReducer_1 = require("../../reducers/missingReceiptsViewReducer");
7
+ /**
8
+ * Completed transactions are cached per sort key/order/sub-tab. After a sort or sub-tab
9
+ * change, the fetch epic would otherwise skip the network when that cache entry already
10
+ * exists — dispatch a cache-bypassing initial fetch whenever either changes from the UI.
11
+ */
12
+ const refetchCompletedTransactionsOnBulkUploadSortEpic = (actions$) => {
13
+ return actions$.pipe((0, operators_1.filter)((action) => missingReceiptsViewReducer_1.setBulkUploadSortConfig.match(action) ||
14
+ missingReceiptsViewReducer_1.setBulkUploadCompletedSubTab.match(action)), (0, operators_1.mergeMap)(() => (0, rxjs_1.of)((0, missingReceiptsViewReducer_1.fetchCompletedTransactions)(undefined, true))));
15
+ };
16
+ exports.refetchCompletedTransactionsOnBulkUploadSortEpic = refetchCompletedTransactionsOnBulkUploadSortEpic;
@@ -0,0 +1,18 @@
1
+ import { ActionsObservable, StateObservable } from 'redux-observable';
2
+ import { Observable } from 'rxjs';
3
+ import { RootState } from '../../../../reducer';
4
+ import { ZeniAPI } from '../../../../zeniAPI';
5
+ import { fetchBulkUploadBatchesSuccess, restoreBulkUploadAutomatchingOnMount, restoreBulkUploadMatchingState } from '../../reducers/missingReceiptsViewReducer';
6
+ export type ActionType = ReturnType<typeof restoreBulkUploadAutomatchingOnMount> | ReturnType<typeof fetchBulkUploadBatchesSuccess> | ReturnType<typeof restoreBulkUploadMatchingState>;
7
+ /**
8
+ * On missing-receipts entry / period switch, hydrate the automatching banner for the logged-in
9
+ * user without relying on UI-driven list fetches (the Missing tab does not fetch the batch list
10
+ * while `phase === 'idle'`). Flow:
11
+ * 1. Call `GET /1.0/batches` (rolling 30-day window).
12
+ * 2. Emit `fetchBulkUploadBatchesSuccess` so `batchListByPeriod` is populated for the selected
13
+ * period (prevents a duplicate list fetch when the user switches to the Unmatched tab).
14
+ * 3. For each `processing|pending` row, call `GET /1.0/batches/:id` in order; for the first row
15
+ * whose details `user_id` matches the logged-in user and whose status is still
16
+ * pending/processing, dispatch `restoreBulkUploadMatchingState` and stop.
17
+ */
18
+ export declare const restoreBulkUploadAutomatchingOnMountEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
@@ -0,0 +1,102 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.restoreBulkUploadAutomatchingOnMountEpic = void 0;
4
+ const rxjs_1 = require("rxjs");
5
+ const operators_1 = require("rxjs/operators");
6
+ const responsePayload_1 = require("../../../../responsePayload");
7
+ const missingReceiptsPayload_1 = require("../../payload/missingReceiptsPayload");
8
+ const missingReceiptsViewReducer_1 = require("../../reducers/missingReceiptsViewReducer");
9
+ const bulkUploadTiming_1 = require("../../helpers/bulkUploadTiming");
10
+ const rollingCalendarDateRangeInclusive_1 = require("../../helpers/rollingCalendarDateRangeInclusive");
11
+ const timePeriod_1 = require("../../../../commonStateTypes/timePeriod");
12
+ const tenantSelector_1 = require("../../../../entity/tenant/tenantSelector");
13
+ /**
14
+ * On missing-receipts entry / period switch, hydrate the automatching banner for the logged-in
15
+ * user without relying on UI-driven list fetches (the Missing tab does not fetch the batch list
16
+ * while `phase === 'idle'`). Flow:
17
+ * 1. Call `GET /1.0/batches` (rolling 30-day window).
18
+ * 2. Emit `fetchBulkUploadBatchesSuccess` so `batchListByPeriod` is populated for the selected
19
+ * period (prevents a duplicate list fetch when the user switches to the Unmatched tab).
20
+ * 3. For each `processing|pending` row, call `GET /1.0/batches/:id` in order; for the first row
21
+ * whose details `user_id` matches the logged-in user and whose status is still
22
+ * pending/processing, dispatch `restoreBulkUploadMatchingState` and stop.
23
+ */
24
+ const restoreBulkUploadAutomatchingOnMountEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(missingReceiptsViewReducer_1.restoreBulkUploadAutomatchingOnMount.match), (0, operators_1.mergeMap)(() => {
25
+ const state = state$.value;
26
+ const { expenseAutomationMissingReceiptsViewState: { bulkUpload }, expenseAutomationViewState: { selectedPeriodByTenantId }, } = state;
27
+ if (bulkUpload.phase !== 'idle') {
28
+ return rxjs_1.EMPTY;
29
+ }
30
+ if (bulkUpload.batchListFetchState.fetchState === 'In-Progress') {
31
+ return rxjs_1.EMPTY;
32
+ }
33
+ const loggedInUserId = state.tenantState.loggedInUser?.userId;
34
+ if (loggedInUserId == null) {
35
+ return rxjs_1.EMPTY;
36
+ }
37
+ const currentTenant = (0, tenantSelector_1.getCurrentTenant)(state);
38
+ const selectedPeriod = selectedPeriodByTenantId[currentTenant.tenantId];
39
+ if (selectedPeriod == null) {
40
+ return rxjs_1.EMPTY;
41
+ }
42
+ const { end, start } = (0, rollingCalendarDateRangeInclusive_1.rollingCalendarDateRangeInclusive)(bulkUploadTiming_1.BULK_UPLOAD_BATCH_LIST_DATE_RANGE_DAYS);
43
+ const queryParam = {
44
+ start_date: start,
45
+ end_date: end,
46
+ sort_order: 'desc',
47
+ };
48
+ const listUrl = `${zeniAPI.apiEndPoints.communicationAgentMicroServiceBaseUrl}/1.0/batches?query=${encodeURIComponent(JSON.stringify(queryParam))}`;
49
+ const detailsBaseUrl = `${zeniAPI.apiEndPoints.communicationAgentMicroServiceBaseUrl}/1.0/batches/`;
50
+ const periodId = (0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod);
51
+ const alreadyCached = (bulkUpload.batchListByPeriod[periodId] ?? []).length > 0 &&
52
+ bulkUpload.batchListFetchState.fetchState === 'Completed';
53
+ const listSource = alreadyCached
54
+ ? (0, rxjs_1.of)(null)
55
+ : zeniAPI.getJSON(listUrl).pipe((0, operators_1.catchError)(() => (0, rxjs_1.of)(null)));
56
+ return listSource.pipe((0, operators_1.mergeMap)((listResponse) => {
57
+ const batchList = alreadyCached
58
+ ? bulkUpload.batchListByPeriod[periodId] ?? []
59
+ : listResponse != null &&
60
+ (0, responsePayload_1.isSuccessResponse)(listResponse) &&
61
+ listResponse.data != null
62
+ ? listResponse.data.batches.map(missingReceiptsPayload_1.toBatchListItem)
63
+ : null;
64
+ if (batchList == null) {
65
+ return rxjs_1.EMPTY;
66
+ }
67
+ const successAction = alreadyCached
68
+ ? null
69
+ : (0, missingReceiptsViewReducer_1.fetchBulkUploadBatchesSuccess)({
70
+ batchList,
71
+ selectedPeriod,
72
+ });
73
+ const processingBatches = batchList.filter((b) => {
74
+ const status = b.status.toLowerCase();
75
+ return status === 'processing' || status === 'pending';
76
+ });
77
+ const restoreStream = (0, rxjs_1.from)(processingBatches).pipe((0, operators_1.concatMap)((batch) => zeniAPI
78
+ .getJSON(`${detailsBaseUrl}${batch.batchId}`)
79
+ .pipe((0, operators_1.mergeMap)((response) => {
80
+ if (!(0, responsePayload_1.isSuccessResponse)(response) || response.data == null) {
81
+ return rxjs_1.EMPTY;
82
+ }
83
+ const data = response.data;
84
+ const detailsUserId = data.user_id;
85
+ if (detailsUserId == null ||
86
+ detailsUserId !== loggedInUserId) {
87
+ return rxjs_1.EMPTY;
88
+ }
89
+ if (!(0, missingReceiptsPayload_1.isBatchDetailsStatusPendingOrProcessing)(data.status)) {
90
+ return rxjs_1.EMPTY;
91
+ }
92
+ return (0, rxjs_1.of)((0, missingReceiptsViewReducer_1.restoreBulkUploadMatchingState)({
93
+ batchId: batch.batchId,
94
+ totalFiles: batch.totalFiles,
95
+ }));
96
+ }), (0, operators_1.catchError)(() => rxjs_1.EMPTY))), (0, operators_1.take)(1));
97
+ return successAction != null
98
+ ? (0, rxjs_1.concat)((0, rxjs_1.of)(successAction), restoreStream)
99
+ : restoreStream;
100
+ }));
101
+ }));
102
+ exports.restoreBulkUploadAutomatchingOnMountEpic = restoreBulkUploadAutomatchingOnMountEpic;
@@ -3,19 +3,20 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.searchTransactionsForManualMatchEpic = exports.MANUAL_TRANSACTION_SEARCH_AUTO_CATEGORIZED = void 0;
4
4
  const rxjs_1 = require("rxjs");
5
5
  const operators_1 = require("rxjs/operators");
6
- const timePeriod_1 = require("../../../../commonStateTypes/timePeriod");
7
- const tenantSelector_1 = require("../../../../entity/tenant/tenantSelector");
8
6
  const transactionReducer_1 = require("../../../../entity/transaction/transactionReducer");
9
7
  const responsePayload_1 = require("../../../../responsePayload");
10
8
  const missingReceiptsPayload_1 = require("../../payload/missingReceiptsPayload");
11
9
  const missingReceiptsViewReducer_1 = require("../../reducers/missingReceiptsViewReducer");
12
10
  const transactionsViewState_1 = require("../../types/transactionsViewState");
11
+ const rollingCalendarDateRangeInclusive_1 = require("../../helpers/rollingCalendarDateRangeInclusive");
13
12
  /**
14
13
  * `auto_categorized` for manual transaction search (Unmatched).
15
14
  * Backend contract TBD — align with `fetchTransactionCategorizationEpic` (`selectedTab === 'autoCategorized'`)
16
15
  * when the expense-automation API documents the intended filter for this flow.
17
16
  */
18
17
  exports.MANUAL_TRANSACTION_SEARCH_AUTO_CATEGORIZED = false;
18
+ /** Inclusive rolling window for manual match search (ignores accounting period picker). */
19
+ const MANUAL_SEARCH_TRANSACTION_DATE_RANGE_DAYS = 90;
19
20
  const searchTransactionsForManualMatchEpic = (actions$, state$, zeniAPI) => {
20
21
  const searchActions$ = actions$.pipe((0, operators_1.filter)(missingReceiptsViewReducer_1.searchTransactionsForManualMatch.match));
21
22
  const pagination$ = searchActions$.pipe((0, operators_1.filter)((action) => action.payload.pageToken != null));
@@ -32,18 +33,11 @@ const searchTransactionsForManualMatchEpic = (actions$, state$, zeniAPI) => {
32
33
  return rxjs_1.EMPTY;
33
34
  }
34
35
  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);
36
+ const { expenseAutomationMissingReceiptsViewState: { bulkUpload: { manualSearch, sortKey, sortOrder }, }, } = state;
37
+ const { end, start } = (0, rollingCalendarDateRangeInclusive_1.rollingCalendarDateRangeInclusive)(MANUAL_SEARCH_TRANSACTION_DATE_RANGE_DAYS);
44
38
  const queryParam = {
45
- start_date: period.start,
46
- end_date: period.end,
39
+ start_date: start,
40
+ end_date: end,
47
41
  auto_categorized: exports.MANUAL_TRANSACTION_SEARCH_AUTO_CATEGORIZED,
48
42
  sort_by: (0, transactionsViewState_1.toTransactionsSortKey)(sortKey),
49
43
  sort_order: sortOrder === 'ascending' ? 'asc' : 'desc',
@@ -4,8 +4,8 @@ import { openSnackbar } from '../../../../entity/snackbar/snackbarReducer';
4
4
  import { updateTransactions } from '../../../../entity/transaction/transactionReducer';
5
5
  import { RootState } from '../../../../reducer';
6
6
  import { ZeniAPI } from '../../../../zeniAPI';
7
- import { bulkUploadAutomatchingTimedOut, bulkUploadReceiptsSuccess, clearBulkUpload, fetchBulkUploadBatchDetailsSuccess, fetchBulkUploadBatches, pusherBatchStatusUpdate, requestMissingReceiptsTabNavigation } from '../../reducers/missingReceiptsViewReducer';
8
- export type ActionType = ReturnType<typeof bulkUploadReceiptsSuccess> | ReturnType<typeof pusherBatchStatusUpdate> | ReturnType<typeof fetchBulkUploadBatchDetailsSuccess> | ReturnType<typeof fetchBulkUploadBatches> | ReturnType<typeof requestMissingReceiptsTabNavigation> | ReturnType<typeof updateTransactions> | ReturnType<typeof clearBulkUpload> | ReturnType<typeof openSnackbar> | ReturnType<typeof bulkUploadAutomatchingTimedOut>;
7
+ import { bulkUploadAutomatchingTimedOut, bulkUploadReceiptsSuccess, clearBulkUpload, fetchBulkUploadBatchDetails, fetchBulkUploadBatchDetailsSuccess, fetchBulkUploadBatches, pusherBatchStatusUpdate, requestMissingReceiptsTabNavigation, restoreBulkUploadMatchingState } from '../../reducers/missingReceiptsViewReducer';
8
+ export type ActionType = ReturnType<typeof bulkUploadReceiptsSuccess> | ReturnType<typeof restoreBulkUploadMatchingState> | ReturnType<typeof pusherBatchStatusUpdate> | ReturnType<typeof fetchBulkUploadBatchDetails> | ReturnType<typeof fetchBulkUploadBatchDetailsSuccess> | ReturnType<typeof fetchBulkUploadBatches> | ReturnType<typeof requestMissingReceiptsTabNavigation> | ReturnType<typeof updateTransactions> | ReturnType<typeof clearBulkUpload> | ReturnType<typeof openSnackbar> | ReturnType<typeof bulkUploadAutomatchingTimedOut>;
9
9
  /**
10
10
  * On Pusher batch completion: refresh batch list (then fetchMultipleBatchDetailsEpic runs),
11
11
  * and request switching to the Unmatched tab. Debounced to reduce duplicate refreshes.
@@ -6,11 +6,13 @@ const operators_1 = require("rxjs/operators");
6
6
  const snackbarReducer_1 = require("../../../../entity/snackbar/snackbarReducer");
7
7
  const transactionReducer_1 = require("../../../../entity/transaction/transactionReducer");
8
8
  const responsePayload_1 = require("../../../../responsePayload");
9
- const bulkUploadTiming_1 = require("../../bulkUploadTiming");
9
+ const bulkUploadTiming_1 = require("../../helpers/bulkUploadTiming");
10
10
  const missingReceiptsPayload_1 = require("../../payload/missingReceiptsPayload");
11
11
  const missingReceiptsViewReducer_1 = require("../../reducers/missingReceiptsViewReducer");
12
12
  /** First poll after upload; then interval while batch not resolved via Pusher or API. */
13
13
  const FALLBACK_FIRST_DELAY_MS = 30000;
14
+ /** Shorter first poll for restored sessions — batch may already be near completion. */
15
+ const RESTORE_FIRST_DELAY_MS = 5000;
14
16
  const FALLBACK_POLL_INTERVAL_MS = 10000;
15
17
  /**
16
18
  * On Pusher batch completion: refresh batch list (then fetchMultipleBatchDetailsEpic runs),
@@ -29,16 +31,25 @@ exports.pusherBatchStatusCompletionEpic = pusherBatchStatusCompletionEpic;
29
31
  * force `phase` to `completed` (dismiss automatching banner) and refresh the batch list.
30
32
  * Cancels when the batch completes normally, bulk state is cleared, or another upload supersedes.
31
33
  */
32
- const bulkUploadAutomatchingTimeoutEpic = (actions$, state$) => actions$.pipe((0, operators_1.filter)(missingReceiptsViewReducer_1.bulkUploadReceiptsSuccess.match), (0, operators_1.mergeMap)((action) => {
34
+ const bulkUploadAutomatchingTimeoutEpic = (actions$, state$) => actions$.pipe((0, operators_1.filter)((action) => missingReceiptsViewReducer_1.bulkUploadReceiptsSuccess.match(action) ||
35
+ missingReceiptsViewReducer_1.restoreBulkUploadMatchingState.match(action)), (0, operators_1.mergeMap)((action) => {
33
36
  const { batchId } = action.payload;
34
37
  return (0, rxjs_1.timer)(bulkUploadTiming_1.BULK_UPLOAD_AUTOMATCHING_TIMEOUT_MS).pipe((0, operators_1.mergeMap)(() => {
35
38
  const bulk = state$.value.expenseAutomationMissingReceiptsViewState.bulkUpload;
36
39
  if (bulk.phase !== 'matching' || bulk.currentBatchId !== batchId) {
37
40
  return rxjs_1.EMPTY;
38
41
  }
42
+ /**
43
+ * Also request the single-batch details directly so the "X out of Y Receipts Matched"
44
+ * toast still fires when the backend actually completed between the last Pusher ping
45
+ * and this timeout. If Pusher already tagged the batch as still `processing`,
46
+ * `fetchBulkUploadBatchDetailsEpic`'s guard will skip the call and we simply rely on
47
+ * the list refresh to eventually populate details via `fetchMultipleBatchDetailsEpic`.
48
+ */
39
49
  return (0, rxjs_1.from)([
40
50
  (0, missingReceiptsViewReducer_1.bulkUploadAutomatchingTimedOut)(batchId),
41
51
  (0, missingReceiptsViewReducer_1.fetchBulkUploadBatches)({ cacheOverride: true }),
52
+ (0, missingReceiptsViewReducer_1.fetchBulkUploadBatchDetails)(),
42
53
  ]);
43
54
  }), (0, operators_1.takeUntil)((0, rxjs_1.merge)(actions$.pipe((0, operators_1.filter)(missingReceiptsViewReducer_1.clearBulkUpload.match)), actions$.pipe((0, operators_1.filter)(missingReceiptsViewReducer_1.pusherBatchStatusUpdate.match), (0, operators_1.filter)((a) => a.payload.batchId === batchId &&
44
55
  a.payload.status === 'completed')), actions$.pipe((0, operators_1.filter)(missingReceiptsViewReducer_1.fetchBulkUploadBatchDetailsSuccess.match), (0, operators_1.filter)((a) => a.payload.batchId === batchId)))));
@@ -49,10 +60,15 @@ exports.bulkUploadAutomatchingTimeoutEpic = bulkUploadAutomatchingTimeoutEpic;
49
60
  * error snackbar per upload session (first failure only) so the user is not spammed every
50
61
  * interval; Pusher or a later successful poll still completes the flow.
51
62
  */
52
- const pollBulkUploadBatchStatusEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(missingReceiptsViewReducer_1.bulkUploadReceiptsSuccess.match), (0, operators_1.mergeMap)((action) => {
63
+ const pollBulkUploadBatchStatusEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)((action) => missingReceiptsViewReducer_1.bulkUploadReceiptsSuccess.match(action) ||
64
+ missingReceiptsViewReducer_1.restoreBulkUploadMatchingState.match(action)), (0, operators_1.mergeMap)((action) => {
53
65
  const { batchId } = action.payload;
54
66
  let pollErrorNotified = false;
55
- return (0, rxjs_1.timer)(FALLBACK_FIRST_DELAY_MS, FALLBACK_POLL_INTERVAL_MS).pipe((0, operators_1.takeUntil)((0, rxjs_1.merge)(actions$.pipe((0, operators_1.filter)(missingReceiptsViewReducer_1.clearBulkUpload.match)), actions$.pipe((0, operators_1.filter)(missingReceiptsViewReducer_1.pusherBatchStatusUpdate.match), (0, operators_1.filter)((action) => action.payload.batchId === batchId)), actions$.pipe((0, operators_1.filter)(missingReceiptsViewReducer_1.fetchBulkUploadBatchDetailsSuccess.match), (0, operators_1.filter)((action) => action.payload.batchId === batchId)), actions$.pipe((0, operators_1.filter)(missingReceiptsViewReducer_1.bulkUploadAutomatchingTimedOut.match), (0, operators_1.filter)((action) => action.payload.batchId === batchId)))), (0, operators_1.switchMap)(() => zeniAPI
67
+ const firstDelay = missingReceiptsViewReducer_1.restoreBulkUploadMatchingState.match(action)
68
+ ? RESTORE_FIRST_DELAY_MS
69
+ : FALLBACK_FIRST_DELAY_MS;
70
+ return (0, rxjs_1.timer)(firstDelay, FALLBACK_POLL_INTERVAL_MS).pipe((0, operators_1.takeUntil)((0, rxjs_1.merge)(actions$.pipe((0, operators_1.filter)(missingReceiptsViewReducer_1.clearBulkUpload.match)), actions$.pipe((0, operators_1.filter)(missingReceiptsViewReducer_1.pusherBatchStatusUpdate.match), (0, operators_1.filter)((action) => action.payload.batchId === batchId &&
71
+ action.payload.status === 'completed')), actions$.pipe((0, operators_1.filter)(missingReceiptsViewReducer_1.fetchBulkUploadBatchDetailsSuccess.match), (0, operators_1.filter)((action) => action.payload.batchId === batchId)), actions$.pipe((0, operators_1.filter)(missingReceiptsViewReducer_1.bulkUploadAutomatchingTimedOut.match), (0, operators_1.filter)((action) => action.payload.batchId === batchId)))), (0, operators_1.switchMap)(() => zeniAPI
56
72
  .getJSON(`${zeniAPI.apiEndPoints.communicationAgentMicroServiceBaseUrl}/1.0/batches/${batchId}`)
57
73
  .pipe((0, operators_1.mergeMap)((response) => {
58
74
  /** Same batch-details URL; polls until `status` is completed (Pusher may win first). */
@@ -94,7 +94,6 @@ function getExpenseAutomationView(state) {
94
94
  const fetchStateVariables = [
95
95
  expenseAutomationMissingReceiptsViewState,
96
96
  expenseAutomationJESchedulesViewState,
97
- monthEndCloseChecksView,
98
97
  expenseAutomationTransactionsView,
99
98
  expenseAutomationReconciliationViewState,
100
99
  ];
@@ -0,0 +1,16 @@
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;
11
+ /**
12
+ * Rolling window (in days) for the bulk-upload batch list API. Period-agnostic — the batch list
13
+ * ignores the accounting month picker. Shared between the regular batch-list fetch and the
14
+ * restore-on-mount hydration so both flows always query the same window.
15
+ */
16
+ export declare const BULK_UPLOAD_BATCH_LIST_DATE_RANGE_DAYS = 30;
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BULK_UPLOAD_BATCH_LIST_DATE_RANGE_DAYS = 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;
14
+ /**
15
+ * Rolling window (in days) for the bulk-upload batch list API. Period-agnostic — the batch list
16
+ * ignores the accounting month picker. Shared between the regular batch-list fetch and the
17
+ * restore-on-mount hydration so both flows always query the same window.
18
+ */
19
+ exports.BULK_UPLOAD_BATCH_LIST_DATE_RANGE_DAYS = 30;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Local calendar dates from (end − (days − 1)) through end, inclusive.
3
+ */
4
+ export declare function rollingCalendarDateRangeInclusive(days: number): {
5
+ end: string;
6
+ start: string;
7
+ };
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.rollingCalendarDateRangeInclusive = rollingCalendarDateRangeInclusive;
4
+ const formatZeniDateFY_1 = require("../../../commonStateTypes/fiscalYearHelpers/formatZeniDateFY");
5
+ const zeniDayJS_1 = require("../../../zeniDayJS");
6
+ /**
7
+ * Local calendar dates from (end − (days − 1)) through end, inclusive.
8
+ */
9
+ function rollingCalendarDateRangeInclusive(days) {
10
+ const end = (0, zeniDayJS_1.dateNow)().startOf('day');
11
+ const start = end.subtract(days - 1, 'day');
12
+ return {
13
+ end: end.format(formatZeniDateFY_1.DEFAULT_DATE_FORMAT),
14
+ start: start.format(formatZeniDateFY_1.DEFAULT_DATE_FORMAT),
15
+ };
16
+ }
@@ -67,8 +67,8 @@ const toTransactionUpdatesFromTransactionCategorizationLocalData = (transactionC
67
67
  lineItem.account?.qboId !== accountLine.account.qboId &&
68
68
  Boolean(lineItem.account?.qboId);
69
69
  hasClassChanged =
70
- Boolean(lineItem.class?.qboId) &&
71
- lineItem.class?.qboId !== accountLine.class.qboId;
70
+ (lineItem.class?.qboId != null || accountLine.class?.qboId != null) &&
71
+ lineItem.class?.qboId !== accountLine.class?.qboId;
72
72
  const recommendedAccountBase = (0, saveTransactionHelper_1.toRecommendedAccountBase)(lineItem.amount.amount, lineItem.account);
73
73
  const recommendedClassBase = (0, saveTransactionHelper_1.toRecommendedClassBase)(lineItem.amount.amount, lineItem.class);
74
74
  if (entityDetails != null &&