@zeniai/client-epic-state 4.20.3-betaSS11 → 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 (414) 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 +2 -42
  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/creditAgentView/epics/downloadCreditReportEpic.js +49 -25
  157. package/lib/esm/view/expenseAutomationView/epics/accountRecon/excludeAccountFromReconciliationEpic.js +63 -0
  158. package/lib/esm/view/expenseAutomationView/epics/accountRecon/fetchReconciliationViewEpic.js +4 -9
  159. package/lib/esm/view/expenseAutomationView/epics/accountRecon/includeAccountInReconciliationEpic.js +65 -0
  160. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +2 -2
  161. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/bulkUploadMatchResultToastEpic.js +33 -0
  162. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/bulkUploadReceiptsEpic.js +3 -3
  163. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchesEpic.js +6 -4
  164. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchCompletedTransactionsEpic.js +20 -5
  165. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/refetchCompletedTransactionsOnBulkUploadSortEpic.js +12 -0
  166. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/restoreBulkUploadAutomatchingOnMountEpic.js +98 -0
  167. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/searchTransactionsForManualMatchEpic.js +7 -13
  168. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/watchBulkUploadBatchStatusEpic.js +21 -5
  169. package/lib/esm/view/expenseAutomationView/expenseAutomationViewSelector.js +0 -1
  170. package/lib/esm/view/expenseAutomationView/helpers/bulkUploadTiming.js +16 -0
  171. package/lib/esm/view/expenseAutomationView/helpers/rollingCalendarDateRangeInclusive.js +13 -0
  172. package/lib/esm/view/expenseAutomationView/helpers/saveTransactionHelper.js +2 -2
  173. package/lib/esm/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.js +2 -2
  174. package/lib/esm/view/expenseAutomationView/payload/missingReceiptsPayload.js +9 -0
  175. package/lib/esm/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +21 -1
  176. package/lib/esm/view/expenseAutomationView/reducers/missingReceiptsViewReducer.js +29 -6
  177. package/lib/esm/view/expenseAutomationView/reducers/reconciliationViewReducer.js +167 -3
  178. package/lib/esm/view/expenseAutomationView/selectorTypes/reconciliationViewSelectorTypes.js +1 -2
  179. package/lib/esm/view/expenseAutomationView/selectors/fluxAnalysisViewSelector.js +10 -2
  180. package/lib/esm/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +63 -6
  181. package/lib/esm/view/expenseAutomationView/selectors/missingReceiptsSelector.js +14 -4
  182. package/lib/esm/view/expenseAutomationView/selectors/reconciliationViewSelector.js +136 -9
  183. package/lib/esm/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +15 -5
  184. package/lib/esm/view/expenseAutomationView/types/jeSchedulesViewState.js +24 -1
  185. package/lib/esm/view/financeStatement/financeStatementSelector.js +12 -1
  186. package/lib/esm/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelector.js +3 -0
  187. package/lib/esm/view/profitAndLossProjectView/profitAndLossForTimeframeProjectViewEpic.js +47 -0
  188. package/lib/esm/view/profitAndLossProjectView/profitAndLossProjectViewEpic.js +30 -0
  189. package/lib/esm/view/profitAndLossProjectView/profitAndLossProjectViewPayload.js +1 -0
  190. package/lib/esm/view/profitAndLossProjectView/profitAndLossProjectViewReducer.js +113 -0
  191. package/lib/esm/view/profitAndLossProjectView/profitAndLossProjectViewSelector.js +65 -0
  192. package/lib/esm/view/profitAndLossProjectView/profitAndLossProjectViewSelectorTypes.js +1 -0
  193. package/lib/esm/view/profitAndLossProjectView/profitAndLossProjectViewState.js +1 -0
  194. package/lib/esm/view/reportsResync/reportsClassViewRefetchingEpic.js +4 -0
  195. package/lib/esm/view/spendManagement/autotransferRules/autoTransferRulesPayload.js +26 -0
  196. package/lib/esm/view/spendManagement/autotransferRules/autoTransferRulesReducer.js +199 -0
  197. package/lib/esm/view/spendManagement/autotransferRules/autoTransferRulesSelector.js +52 -0
  198. package/lib/esm/view/spendManagement/autotransferRules/autoTransferRulesState.js +1 -0
  199. package/lib/esm/view/spendManagement/autotransferRules/epics/createAutoTransferRuleEpic.js +100 -0
  200. package/lib/esm/view/spendManagement/autotransferRules/epics/deleteAutoTransferRuleEpic.js +48 -0
  201. package/lib/esm/view/spendManagement/autotransferRules/epics/fetchAutoTransferReviewDetailEpic.js +36 -0
  202. package/lib/esm/view/spendManagement/autotransferRules/epics/fetchAutoTransferRuleHistory.js +45 -0
  203. package/lib/esm/view/spendManagement/autotransferRules/epics/fetchAutoTransferRulesEpic.js +50 -0
  204. package/lib/esm/view/spendManagement/autotransferRules/epics/updateAutoTransferRuleEpic.js +69 -0
  205. package/lib/esm/view/spendManagement/billPay/billDetailView/epics/fetchBillDetailEpic.js +5 -5
  206. package/lib/esm/view/spendManagement/billPay/billList/billListSelector.js +10 -0
  207. package/lib/esm/view/spendManagement/billPay/billList/billListState.js +1 -0
  208. package/lib/esm/view/spendManagement/billPay/billPayReview/billPayReviewSelector.js +7 -3
  209. package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/billPaySetupApproverViewSelector.js +5 -5
  210. package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/epic/fetchBillPayApproversDetailsEpic.js +7 -2
  211. package/lib/esm/view/spendManagement/billPay/editBillView/editBillViewSelector.js +13 -6
  212. package/lib/esm/view/spendManagement/chargeCards/chargeCardList/chargeCardList.js +1 -0
  213. package/lib/esm/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.js +2 -0
  214. package/lib/esm/view/spendManagement/reimbursement/editRemiView/editRemiViewSelector.js +7 -4
  215. package/lib/esm/view/spendManagement/reimbursement/remiListView/remiListSelector.js +12 -0
  216. package/lib/esm/view/spendManagement/reimbursement/remiListView/remiListState.js +1 -0
  217. package/lib/esm/view/spendManagement/treasury/treasuryList/epics/fetchTreasuryDetailEpic.js +2 -2
  218. package/lib/esm/view/spendManagement/treasury/treasuryList/treasuryDetailReducer.js +2 -1
  219. package/lib/esm/view/taskManager/taskDetailView/taskDetailSelector.js +2 -2
  220. package/lib/esm/view/transactionDetail/epics/saveTransactionHelper.js +2 -2
  221. package/lib/esm/view/transactionDetail/transactionDetailLocalDataHelper.js +16 -14
  222. package/lib/esm/view/transactionDetail/transactionDetailSelector.js +9 -2
  223. package/lib/esm/view/twoFactorAuthentication/resendOtpEpic.js +16 -2
  224. package/lib/index.d.ts +49 -26
  225. package/lib/index.js +107 -39
  226. package/lib/reducer.d.ts +20 -2
  227. package/lib/reducer.js +20 -2
  228. package/lib/view/aiAccountantView/aiAccountantViewPayload.d.ts +33 -0
  229. package/lib/view/aiAccountantView/aiAccountantViewPayload.js +8 -0
  230. package/lib/view/aiAccountantView/aiAccountantViewReducer.d.ts +29 -0
  231. package/lib/view/aiAccountantView/aiAccountantViewReducer.js +156 -0
  232. package/lib/view/aiAccountantView/aiAccountantViewSelector.d.ts +16 -0
  233. package/lib/view/aiAccountantView/aiAccountantViewSelector.js +83 -0
  234. package/lib/view/aiAccountantView/aiAccountantViewState.d.ts +26 -0
  235. package/lib/view/aiAccountantView/aiAccountantViewState.js +13 -0
  236. package/lib/view/aiAccountantView/epics/cancelAiAccountantOnboardingEpic.d.ts +33 -0
  237. package/lib/view/aiAccountantView/epics/cancelAiAccountantOnboardingEpic.js +50 -0
  238. package/lib/view/aiAccountantView/epics/fetchAiAccountantCustomersEpic.d.ts +23 -0
  239. package/lib/view/aiAccountantView/epics/fetchAiAccountantCustomersEpic.js +31 -0
  240. package/lib/view/aiAccountantView/epics/fetchAiAccountantJobsEpic.d.ts +33 -0
  241. package/lib/view/aiAccountantView/epics/fetchAiAccountantJobsEpic.js +51 -0
  242. package/lib/view/aiAccountantView/epics/triggerAiAccountantJobEpic.d.ts +28 -0
  243. package/lib/view/aiAccountantView/epics/triggerAiAccountantJobEpic.js +80 -0
  244. package/lib/view/aiCfoView/aiCfoViewPayload.d.ts +7 -0
  245. package/lib/view/aiCfoView/aiCfoViewReducer.d.ts +15 -1
  246. package/lib/view/aiCfoView/aiCfoViewReducer.js +83 -2
  247. package/lib/view/aiCfoView/aiCfoViewSelector.d.ts +4 -1
  248. package/lib/view/aiCfoView/aiCfoViewSelector.js +9 -2
  249. package/lib/view/aiCfoView/aiCfoViewState.d.ts +15 -1
  250. package/lib/view/aiCfoView/epics/fetchSuggestedQuestionsEpic.d.ts +8 -0
  251. package/lib/view/aiCfoView/epics/fetchSuggestedQuestionsEpic.js +33 -0
  252. package/lib/view/auditReportView/auditReportViewState.d.ts +2 -2
  253. package/lib/view/billPayCard/billPayCardSelector.d.ts +1 -1
  254. package/lib/view/cardBalance/cardBalanceSelector.d.ts +2 -1
  255. package/lib/view/cashBalance/cashBalanceSelector.d.ts +2 -1
  256. package/lib/view/cashInCashOut/cashInCashOutSelector.d.ts +1 -1
  257. package/lib/view/cashPosition/cashPositionSelector.d.ts +1 -1
  258. package/lib/view/classList/fetchClassListEpic.d.ts +1 -1
  259. package/lib/view/classList/fetchClassListEpic.js +8 -1
  260. package/lib/view/commonVendorView/vendorView/vendorViewSelector.d.ts +1 -0
  261. package/lib/view/commonVendorView/vendorView/vendorViewSelector.js +18 -5
  262. package/lib/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewSelector.d.ts +1 -0
  263. package/lib/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewSelector.js +6 -2
  264. package/lib/view/companyTaskManagerView/companyTaskManagerViewReducer.d.ts +2 -2
  265. package/lib/view/companyTaskManagerView/companyTaskManagerViewReducer.js +20 -2
  266. package/lib/view/companyTaskManagerView/companyTaskManagerViewSelector.d.ts +4 -1
  267. package/lib/view/companyTaskManagerView/companyTaskManagerViewSelector.js +3 -1
  268. package/lib/view/companyTaskManagerView/companyTaskManagerViewState.d.ts +9 -1
  269. package/lib/view/companyTaskManagerView/epics/fetchTaskManagerMetricsEpic.d.ts +7 -0
  270. package/lib/view/companyTaskManagerView/epics/fetchTaskManagerMetricsEpic.js +21 -0
  271. package/lib/view/companyView/companyViewReducer.d.ts +6 -1
  272. package/lib/view/companyView/companyViewReducer.js +28 -2
  273. package/lib/view/companyView/epic/companyPassport/updateAccountingClassesEnabledEpic.d.ts +10 -0
  274. package/lib/view/companyView/epic/companyPassport/updateAccountingClassesEnabledEpic.js +65 -0
  275. package/lib/view/companyView/types/cockpitTypes.d.ts +6 -5
  276. package/lib/view/companyView/types/companyPassport/companyPassportViewState.d.ts +1 -0
  277. package/lib/view/companyView/types/companyPassport/companyPassportViewState.js +4 -0
  278. package/lib/view/creditAgentView/creditAgentViewPayload.d.ts +0 -36
  279. package/lib/view/creditAgentView/creditAgentViewReducer.d.ts +3 -5
  280. package/lib/view/creditAgentView/creditAgentViewReducer.js +3 -43
  281. package/lib/view/creditAgentView/creditAgentViewSelector.d.ts +0 -1
  282. package/lib/view/creditAgentView/creditAgentViewSelector.js +1 -2
  283. package/lib/view/creditAgentView/creditAgentViewState.d.ts +0 -31
  284. package/lib/view/creditAgentView/creditAgentViewState.js +0 -6
  285. package/lib/view/creditAgentView/epics/downloadCreditReportEpic.d.ts +1 -1
  286. package/lib/view/creditAgentView/epics/downloadCreditReportEpic.js +47 -23
  287. package/lib/view/dashboard/dashboardReducer.d.ts +2 -2
  288. package/lib/view/expenseAutomationView/epics/accountRecon/excludeAccountFromReconciliationEpic.d.ts +9 -0
  289. package/lib/view/expenseAutomationView/epics/accountRecon/excludeAccountFromReconciliationEpic.js +67 -0
  290. package/lib/view/expenseAutomationView/epics/accountRecon/fetchReconciliationViewEpic.js +4 -9
  291. package/lib/view/expenseAutomationView/epics/accountRecon/includeAccountInReconciliationEpic.d.ts +10 -0
  292. package/lib/view/expenseAutomationView/epics/accountRecon/includeAccountInReconciliationEpic.js +69 -0
  293. package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +2 -2
  294. package/lib/view/expenseAutomationView/epics/missingReceipts/bulkUploadMatchResultToastEpic.d.ts +13 -0
  295. package/lib/view/expenseAutomationView/epics/missingReceipts/bulkUploadMatchResultToastEpic.js +37 -0
  296. package/lib/view/expenseAutomationView/epics/missingReceipts/bulkUploadReceiptsEpic.js +2 -2
  297. package/lib/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchesEpic.js +5 -3
  298. package/lib/view/expenseAutomationView/epics/missingReceipts/fetchCompletedTransactionsEpic.js +20 -5
  299. package/lib/view/expenseAutomationView/epics/missingReceipts/refetchCompletedTransactionsOnBulkUploadSortEpic.d.ts +10 -0
  300. package/lib/view/expenseAutomationView/epics/missingReceipts/refetchCompletedTransactionsOnBulkUploadSortEpic.js +16 -0
  301. package/lib/view/expenseAutomationView/epics/missingReceipts/restoreBulkUploadAutomatchingOnMountEpic.d.ts +18 -0
  302. package/lib/view/expenseAutomationView/epics/missingReceipts/restoreBulkUploadAutomatchingOnMountEpic.js +102 -0
  303. package/lib/view/expenseAutomationView/epics/missingReceipts/searchTransactionsForManualMatchEpic.js +7 -13
  304. package/lib/view/expenseAutomationView/epics/missingReceipts/watchBulkUploadBatchStatusEpic.d.ts +2 -2
  305. package/lib/view/expenseAutomationView/epics/missingReceipts/watchBulkUploadBatchStatusEpic.js +20 -4
  306. package/lib/view/expenseAutomationView/expenseAutomationViewSelector.js +0 -1
  307. package/lib/view/expenseAutomationView/helpers/bulkUploadTiming.d.ts +16 -0
  308. package/lib/view/expenseAutomationView/helpers/bulkUploadTiming.js +19 -0
  309. package/lib/view/expenseAutomationView/helpers/rollingCalendarDateRangeInclusive.d.ts +7 -0
  310. package/lib/view/expenseAutomationView/helpers/rollingCalendarDateRangeInclusive.js +16 -0
  311. package/lib/view/expenseAutomationView/helpers/saveTransactionHelper.js +2 -2
  312. package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +2 -2
  313. package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.js +2 -2
  314. package/lib/view/expenseAutomationView/payload/jeSchedulesPayload.d.ts +1 -1
  315. package/lib/view/expenseAutomationView/payload/missingReceiptsPayload.d.ts +5 -0
  316. package/lib/view/expenseAutomationView/payload/missingReceiptsPayload.js +10 -0
  317. package/lib/view/expenseAutomationView/payload/reconciliationPayload.d.ts +45 -0
  318. package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.d.ts +2 -2
  319. package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +22 -2
  320. package/lib/view/expenseAutomationView/reducers/missingReceiptsViewReducer.d.ts +18 -2
  321. package/lib/view/expenseAutomationView/reducers/missingReceiptsViewReducer.js +30 -7
  322. package/lib/view/expenseAutomationView/reducers/reconciliationViewReducer.d.ts +18 -4
  323. package/lib/view/expenseAutomationView/reducers/reconciliationViewReducer.js +168 -4
  324. package/lib/view/expenseAutomationView/selectorTypes/jeSchedulesSelectorTypes.d.ts +2 -0
  325. package/lib/view/expenseAutomationView/selectorTypes/missingReceiptsSelectorTypes.d.ts +2 -0
  326. package/lib/view/expenseAutomationView/selectorTypes/reconciliationViewSelectorTypes.d.ts +7 -2
  327. package/lib/view/expenseAutomationView/selectorTypes/reconciliationViewSelectorTypes.js +2 -2
  328. package/lib/view/expenseAutomationView/selectors/fluxAnalysisViewSelector.js +10 -2
  329. package/lib/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +63 -6
  330. package/lib/view/expenseAutomationView/selectors/missingReceiptsSelector.js +14 -4
  331. package/lib/view/expenseAutomationView/selectors/reconciliationViewSelector.js +136 -9
  332. package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +13 -3
  333. package/lib/view/expenseAutomationView/types/jeSchedulesViewState.d.ts +8 -0
  334. package/lib/view/expenseAutomationView/types/jeSchedulesViewState.js +27 -0
  335. package/lib/view/expenseAutomationView/types/missingReceiptsViewState.d.ts +5 -1
  336. package/lib/view/expenseAutomationView/types/reconciliationViewState.d.ts +14 -0
  337. package/lib/view/financeStatement/financeStatementReducer.d.ts +1 -1
  338. package/lib/view/financeStatement/financeStatementSelector.d.ts +2 -0
  339. package/lib/view/financeStatement/financeStatementSelector.js +12 -1
  340. package/lib/view/globalMerchantView/globalMerchantViewReducer.d.ts +2 -2
  341. package/lib/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelector.js +3 -0
  342. package/lib/view/profitAndLossProjectView/profitAndLossForTimeframeProjectViewEpic.d.ts +9 -0
  343. package/lib/view/profitAndLossProjectView/profitAndLossForTimeframeProjectViewEpic.js +51 -0
  344. package/lib/view/profitAndLossProjectView/profitAndLossProjectViewEpic.d.ts +6 -0
  345. package/lib/view/profitAndLossProjectView/profitAndLossProjectViewEpic.js +34 -0
  346. package/lib/view/profitAndLossProjectView/profitAndLossProjectViewPayload.d.ts +33 -0
  347. package/lib/view/profitAndLossProjectView/profitAndLossProjectViewPayload.js +2 -0
  348. package/lib/view/profitAndLossProjectView/profitAndLossProjectViewReducer.d.ts +33 -0
  349. package/lib/view/profitAndLossProjectView/profitAndLossProjectViewReducer.js +117 -0
  350. package/lib/view/profitAndLossProjectView/profitAndLossProjectViewSelector.d.ts +9 -0
  351. package/lib/view/profitAndLossProjectView/profitAndLossProjectViewSelector.js +69 -0
  352. package/lib/view/profitAndLossProjectView/profitAndLossProjectViewSelectorTypes.d.ts +19 -0
  353. package/lib/view/profitAndLossProjectView/profitAndLossProjectViewSelectorTypes.js +2 -0
  354. package/lib/view/profitAndLossProjectView/profitAndLossProjectViewState.d.ts +22 -0
  355. package/lib/view/profitAndLossProjectView/profitAndLossProjectViewState.js +2 -0
  356. package/lib/view/reimbursementCard/reimbursementCardSelector.d.ts +1 -1
  357. package/lib/view/reportsResync/reportsClassViewRefetchingEpic.d.ts +2 -1
  358. package/lib/view/reportsResync/reportsClassViewRefetchingEpic.js +4 -0
  359. package/lib/view/reportsResync/reportsResyncReducer.d.ts +2 -2
  360. package/lib/view/reviewCompanyView/reviewCompanyViewState.d.ts +1 -1
  361. package/lib/view/scheduleView/scheduleListView/scheduleListTypes.d.ts +1 -1
  362. package/lib/view/spendManagement/autotransferRules/autoTransferRulesPayload.d.ts +75 -0
  363. package/lib/view/spendManagement/autotransferRules/autoTransferRulesPayload.js +30 -0
  364. package/lib/view/spendManagement/autotransferRules/autoTransferRulesReducer.d.ts +50 -0
  365. package/lib/view/spendManagement/autotransferRules/autoTransferRulesReducer.js +206 -0
  366. package/lib/view/spendManagement/autotransferRules/autoTransferRulesSelector.d.ts +24 -0
  367. package/lib/view/spendManagement/autotransferRules/autoTransferRulesSelector.js +61 -0
  368. package/lib/view/spendManagement/autotransferRules/autoTransferRulesState.d.ts +38 -0
  369. package/lib/view/spendManagement/autotransferRules/autoTransferRulesState.js +2 -0
  370. package/lib/view/spendManagement/autotransferRules/epics/createAutoTransferRuleEpic.d.ts +12 -0
  371. package/lib/view/spendManagement/autotransferRules/epics/createAutoTransferRuleEpic.js +106 -0
  372. package/lib/view/spendManagement/autotransferRules/epics/deleteAutoTransferRuleEpic.d.ts +8 -0
  373. package/lib/view/spendManagement/autotransferRules/epics/deleteAutoTransferRuleEpic.js +52 -0
  374. package/lib/view/spendManagement/autotransferRules/epics/fetchAutoTransferReviewDetailEpic.d.ts +7 -0
  375. package/lib/view/spendManagement/autotransferRules/epics/fetchAutoTransferReviewDetailEpic.js +40 -0
  376. package/lib/view/spendManagement/autotransferRules/epics/fetchAutoTransferRuleHistory.d.ts +7 -0
  377. package/lib/view/spendManagement/autotransferRules/epics/fetchAutoTransferRuleHistory.js +52 -0
  378. package/lib/view/spendManagement/autotransferRules/epics/fetchAutoTransferRulesEpic.d.ts +10 -0
  379. package/lib/view/spendManagement/autotransferRules/epics/fetchAutoTransferRulesEpic.js +54 -0
  380. package/lib/view/spendManagement/autotransferRules/epics/updateAutoTransferRuleEpic.d.ts +8 -0
  381. package/lib/view/spendManagement/autotransferRules/epics/updateAutoTransferRuleEpic.js +73 -0
  382. package/lib/view/spendManagement/billPay/billDetailView/epics/fetchBillDetailEpic.js +5 -5
  383. package/lib/view/spendManagement/billPay/billList/billListReducer.d.ts +1 -1
  384. package/lib/view/spendManagement/billPay/billList/billListSelector.js +10 -0
  385. package/lib/view/spendManagement/billPay/billList/billListState.d.ts +2 -2
  386. package/lib/view/spendManagement/billPay/billList/billListState.js +1 -0
  387. package/lib/view/spendManagement/billPay/billPayReview/billPayReviewSelector.js +7 -3
  388. package/lib/view/spendManagement/billPay/billPaySetupApproverView/billPaySetupApproverViewSelector.js +5 -5
  389. package/lib/view/spendManagement/billPay/billPaySetupApproverView/epic/fetchBillPayApproversDetailsEpic.js +7 -2
  390. package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.js +13 -6
  391. package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailReducer.d.ts +4 -4
  392. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardList.d.ts +1 -1
  393. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardList.js +1 -0
  394. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.js +2 -0
  395. package/lib/view/spendManagement/reimbursement/editRemiView/editRemiViewSelector.js +6 -3
  396. package/lib/view/spendManagement/reimbursement/remiListView/remiListReducer.d.ts +1 -1
  397. package/lib/view/spendManagement/reimbursement/remiListView/remiListSelector.d.ts +1 -0
  398. package/lib/view/spendManagement/reimbursement/remiListView/remiListSelector.js +12 -0
  399. package/lib/view/spendManagement/reimbursement/remiListView/remiListState.d.ts +4 -4
  400. package/lib/view/spendManagement/reimbursement/remiListView/remiListState.js +1 -0
  401. package/lib/view/spendManagement/treasury/treasuryList/epics/fetchTreasuryDetailEpic.js +2 -2
  402. package/lib/view/spendManagement/treasury/treasuryList/treasuryDetailReducer.d.ts +2 -1
  403. package/lib/view/spendManagement/treasury/treasuryList/treasuryDetailReducer.js +2 -1
  404. package/lib/view/subscriptionView/types/subscriptionTypes.d.ts +1 -1
  405. package/lib/view/taskManager/taskDetailView/taskDetailSelector.js +2 -2
  406. package/lib/view/tasksCard/tasksCardSelector.d.ts +1 -1
  407. package/lib/view/topEx/topExSelector.d.ts +1 -1
  408. package/lib/view/transactionDetail/epics/saveTransactionHelper.js +2 -2
  409. package/lib/view/transactionDetail/transactionDetailLocalDataHelper.js +16 -14
  410. package/lib/view/transactionDetail/transactionDetailSelector.d.ts +1 -0
  411. package/lib/view/transactionDetail/transactionDetailSelector.js +9 -2
  412. package/lib/view/twoFactorAuthentication/resendOtpEpic.d.ts +1 -1
  413. package/lib/view/twoFactorAuthentication/resendOtpEpic.js +15 -1
  414. package/package.json +1 -1
@@ -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 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 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 const BULK_UPLOAD_BATCH_LIST_DATE_RANGE_DAYS = 30;
@@ -0,0 +1,13 @@
1
+ import { DEFAULT_DATE_FORMAT } from '../../../commonStateTypes/fiscalYearHelpers/formatZeniDateFY';
2
+ import { dateNow } from '../../../zeniDayJS';
3
+ /**
4
+ * Local calendar dates from (end − (days − 1)) through end, inclusive.
5
+ */
6
+ export function rollingCalendarDateRangeInclusive(days) {
7
+ const end = dateNow().startOf('day');
8
+ const start = end.subtract(days - 1, 'day');
9
+ return {
10
+ end: end.format(DEFAULT_DATE_FORMAT),
11
+ start: start.format(DEFAULT_DATE_FORMAT),
12
+ };
13
+ }
@@ -64,8 +64,8 @@ export const toTransactionUpdatesFromTransactionCategorizationLocalData = (trans
64
64
  lineItem.account?.qboId !== accountLine.account.qboId &&
65
65
  Boolean(lineItem.account?.qboId);
66
66
  hasClassChanged =
67
- Boolean(lineItem.class?.qboId) &&
68
- lineItem.class?.qboId !== accountLine.class.qboId;
67
+ (lineItem.class?.qboId != null || accountLine.class?.qboId != null) &&
68
+ lineItem.class?.qboId !== accountLine.class?.qboId;
69
69
  const recommendedAccountBase = toRecommendedAccountBase(lineItem.amount.amount, lineItem.account);
70
70
  const recommendedClassBase = toRecommendedClassBase(lineItem.amount.amount, lineItem.class);
71
71
  if (entityDetails != null &&
@@ -234,7 +234,7 @@ const buildLineItemById = (transaction, uncategorizedIncomeExpense, recommendati
234
234
  isPreFilled: true,
235
235
  };
236
236
  }
237
- if (accountLine.class.classId === '' &&
237
+ if (Boolean(accountLine.class?.classId) === false &&
238
238
  higherPreferenceRecommendation?.class != null) {
239
239
  record.class = {
240
240
  ...higherPreferenceRecommendation.class,
@@ -464,7 +464,7 @@ export const setEntityRecommendationForLineIdInLocalData = (draft, transaction,
464
464
  }
465
465
  : accountLine.account;
466
466
  record.class =
467
- accountLine.class.classId !== ''
467
+ Boolean(accountLine.class?.classId) !== false
468
468
  ? accountLine.class
469
469
  : recommendations?.[0]?.class
470
470
  ? {
@@ -99,8 +99,16 @@ export function toBatchDetails(payload, filesEndPoint) {
99
99
  files: payload.files.map((file) => toBatchFile(file, filesEndPoint)),
100
100
  status: toBatchStatusValue(payload.status),
101
101
  summary: toBatchSummary(payload.summary),
102
+ ...(payload.user_id != null && payload.user_id !== ''
103
+ ? { userId: payload.user_id }
104
+ : {}),
102
105
  };
103
106
  }
107
+ /** Batch is still in-flight for automatching (GET /batches/:id while not completed). */
108
+ export function isBatchDetailsStatusPendingOrProcessing(status) {
109
+ const s = status.toLowerCase();
110
+ return s === 'processing' || s === 'pending';
111
+ }
104
112
  /** Batch list `status` is a string from the API — compare case-insensitively. */
105
113
  export function isBatchListStatusCompleted(status) {
106
114
  return status.toLowerCase() === 'completed';
@@ -158,6 +166,7 @@ export function toBatchListItem(payload) {
158
166
  possibleMatchesCount: payload.possible_matches_count,
159
167
  status: payload.status,
160
168
  totalFiles: payload.total_files,
169
+ userId: payload.user_id,
161
170
  };
162
171
  }
163
172
  /**
@@ -44,6 +44,9 @@ export const initialState = {
44
44
  uiState: {
45
45
  searchString: '',
46
46
  scrollPosition: { scrollTop: 0, scrollLeft: undefined },
47
+ selectedMainTab: 'pending_review',
48
+ sortKey: 'transactionDate',
49
+ sortOrder: 'descending',
47
50
  totalCount: 0,
48
51
  limit: 10,
49
52
  },
@@ -365,12 +368,29 @@ const expenseAutomationJESchedulesView = createSlice({
365
368
  clearJeAccountSettingsLocalData(draft) {
366
369
  draft.accountSettings.localData = accountSettingsInitialState.localData;
367
370
  },
371
+ updateJESchedulesUIState(draft, action) {
372
+ if (action.payload.sortKey != null) {
373
+ draft.uiState.sortKey = action.payload.sortKey;
374
+ }
375
+ if (action.payload.sortOrder != null) {
376
+ draft.uiState.sortOrder = action.payload.sortOrder;
377
+ }
378
+ if (action.payload.searchString != null) {
379
+ draft.uiState.searchString = action.payload.searchString;
380
+ }
381
+ if (action.payload.scrollPosition != null) {
382
+ draft.uiState.scrollPosition = action.payload.scrollPosition;
383
+ }
384
+ if (action.payload.selectedMainTab != null) {
385
+ draft.uiState.selectedMainTab = action.payload.selectedMainTab;
386
+ }
387
+ },
368
388
  clearExpenseAutomationJESchedulesView(draft) {
369
389
  Object.assign(draft, initialState);
370
390
  },
371
391
  },
372
392
  });
373
- export const { clearExpenseAutomationJESchedulesView, clearJeAccountSettingsLocalData, clearJeScheduleLocalData, fetchAccountSettingsListForAccountTypes, fetchJeSchedules, fetchJeSchedulesFailure, fetchJeSchedulesPage, fetchJeSchedulesSuccess, fetchRecommendationForAccountSettings, ignoreRecommendedJeSchedule, ignoreRecommendedJeScheduleFailure, ignoreRecommendedJeScheduleSuccess, initializeAccountSettingsView, initializeJeScheduleLocalData, removeFailedJeScheduleTransactionKey, removeJeScheduleLocalDataById, removeJeScheduleTransactionKey, retryJeSchedule, retryJeScheduleFailure, retryJeScheduleSuccess, saveAccountSettings, saveAccountSettingsFailure, saveAccountSettingsLocalData, saveAccountSettingsSuccess, updateAccountSettingsListForAccountTypes, updateAccountSettingsListForAccountTypesFailure, updateJeScheduleLocalDataById, updateJeScheduleTransactionKeys, updateRecommendationForAccountSettings, updateRecommendationForAccountSettingsFailure, } = expenseAutomationJESchedulesView.actions;
393
+ export const { clearExpenseAutomationJESchedulesView, clearJeAccountSettingsLocalData, clearJeScheduleLocalData, fetchAccountSettingsListForAccountTypes, fetchJeSchedules, fetchJeSchedulesFailure, fetchJeSchedulesPage, fetchJeSchedulesSuccess, fetchRecommendationForAccountSettings, ignoreRecommendedJeSchedule, ignoreRecommendedJeScheduleFailure, ignoreRecommendedJeScheduleSuccess, initializeAccountSettingsView, initializeJeScheduleLocalData, removeFailedJeScheduleTransactionKey, removeJeScheduleLocalDataById, removeJeScheduleTransactionKey, retryJeSchedule, retryJeScheduleFailure, retryJeScheduleSuccess, saveAccountSettings, saveAccountSettingsFailure, saveAccountSettingsLocalData, saveAccountSettingsSuccess, updateAccountSettingsListForAccountTypes, updateAccountSettingsListForAccountTypesFailure, updateJESchedulesUIState, updateJeScheduleLocalDataById, updateJeScheduleTransactionKeys, updateRecommendationForAccountSettings, updateRecommendationForAccountSettingsFailure, } = expenseAutomationJESchedulesView.actions;
374
394
  export default expenseAutomationJESchedulesView.reducer;
375
395
  const doUpdateRecommendationForAccountSettings = (draft, payload) => {
376
396
  const { prepaidExpensesRecommendations, fixedAssetsRecommendations, accruedExpensesRecommendations, } = mapAccountTypeRecommendationPayloadToAccountRecommendationByType(payload);
@@ -27,6 +27,7 @@ export const initialBulkUploadState = {
27
27
  phase: 'idle',
28
28
  sortKey: 'date',
29
29
  sortOrder: 'descending',
30
+ uploadedFileCount: 0,
30
31
  uploadProgress: 0,
31
32
  uploadStatus: { fetchState: 'Not-Started', error: undefined },
32
33
  };
@@ -53,6 +54,12 @@ export const initialState = {
53
54
  };
54
55
  /** Epic trigger only; batch-details fetch is handled in epics. */
55
56
  export const fetchBulkUploadBatchDetails = createAction('expenseAutomationMissingReceiptsView/fetchBulkUploadBatchDetails');
57
+ /**
58
+ * Epic trigger only. Dispatched from the screen on missing-receipts entry / period switch so the
59
+ * automatching banner is restored for the logged-in user even when they sit on the Missing tab
60
+ * after a hard refresh. The epic owns the list + details API calls end-to-end.
61
+ */
62
+ export const restoreBulkUploadAutomatchingOnMount = createAction('expenseAutomationMissingReceiptsView/restoreBulkUploadAutomatchingOnMount');
56
63
  const expenseAutomationMissingReceiptsView = createSlice({
57
64
  name: 'expenseAutomationMissingReceiptsView',
58
65
  initialState,
@@ -156,21 +163,29 @@ const expenseAutomationMissingReceiptsView = createSlice({
156
163
  },
157
164
  // -- Bulk Upload Actions --
158
165
  bulkUploadReceipts: {
159
- reducer(draft) {
166
+ reducer(draft, action) {
160
167
  draft.bulkUpload.phase = 'uploading';
161
168
  draft.bulkUpload.uploadProgress = 0;
169
+ draft.bulkUpload.uploadedFileCount = action.payload.fileCount;
162
170
  draft.bulkUpload.uploadStatus = {
163
171
  fetchState: 'In-Progress',
164
172
  error: undefined,
165
173
  };
166
174
  },
167
175
  prepare(files) {
168
- return { payload: { files } };
176
+ return { payload: { files, fileCount: files.length } };
169
177
  },
170
178
  },
171
179
  updateBulkUploadProgress(draft, action) {
172
180
  draft.bulkUpload.uploadProgress = action.payload;
173
181
  },
182
+ /**
183
+ * Sync file count when bulk upload uses direct HTTP (`bulkUploadReceipts` Redux action is not
184
+ * dispatched, so `bulkUploadReceipts` reducer never runs).
185
+ */
186
+ setBulkUploadUploadedFileCount(draft, action) {
187
+ draft.bulkUpload.uploadedFileCount = action.payload;
188
+ },
174
189
  bulkUploadReceiptsSuccess(draft, action) {
175
190
  draft.bulkUpload.currentBatchId = action.payload.batchId;
176
191
  draft.bulkUpload.uploadProgress = 100;
@@ -187,6 +202,14 @@ const expenseAutomationMissingReceiptsView = createSlice({
187
202
  };
188
203
  draft.bulkUpload.phase = 'idle';
189
204
  },
205
+ restoreBulkUploadMatchingState(draft, action) {
206
+ if (draft.bulkUpload.phase !== 'idle') {
207
+ return;
208
+ }
209
+ draft.bulkUpload.currentBatchId = action.payload.batchId;
210
+ draft.bulkUpload.uploadedFileCount = action.payload.totalFiles;
211
+ draft.bulkUpload.phase = 'matching';
212
+ },
190
213
  bulkUploadAutomatchingTimedOut: {
191
214
  reducer(draft, action) {
192
215
  if (draft.bulkUpload.phase !== 'matching' ||
@@ -499,9 +522,9 @@ const expenseAutomationMissingReceiptsView = createSlice({
499
522
  },
500
523
  },
501
524
  fetchCompletedTransactionsSuccess(draft, action) {
502
- const { transactionIds, nextPageToken, totalCount, selectedPeriod, isInitialLoad, } = action.payload;
525
+ const { transactionIds, nextPageToken, totalCount, selectedPeriod, isInitialLoad, sortKey, sortOrder, completedSubTab, } = action.payload;
503
526
  const periodId = toMonthYearPeriodId(selectedPeriod);
504
- const cacheKey = getCompletedTransactionsCacheKey(periodId, draft.bulkUpload.sortKey, draft.bulkUpload.sortOrder, draft.bulkUpload.completedSubTab);
527
+ const cacheKey = getCompletedTransactionsCacheKey(periodId, sortKey, sortOrder, completedSubTab);
505
528
  if (isInitialLoad) {
506
529
  draft.bulkUpload.completedTransactionsByPeriod[cacheKey] = {
507
530
  transactionIds,
@@ -530,7 +553,7 @@ const expenseAutomationMissingReceiptsView = createSlice({
530
553
  },
531
554
  fetchCompletedTransactionsFailure(draft, action) {
532
555
  const periodId = toMonthYearPeriodId(action.payload.selectedPeriod);
533
- const cacheKey = getCompletedTransactionsCacheKey(periodId, draft.bulkUpload.sortKey, draft.bulkUpload.sortOrder, draft.bulkUpload.completedSubTab);
556
+ const cacheKey = getCompletedTransactionsCacheKey(periodId, action.payload.sortKey, action.payload.sortOrder, action.payload.completedSubTab);
534
557
  const existing = draft.bulkUpload.completedTransactionsByPeriod[cacheKey];
535
558
  if (existing != null) {
536
559
  existing.fetchState = {
@@ -551,7 +574,7 @@ const expenseAutomationMissingReceiptsView = createSlice({
551
574
  });
552
575
  export const { fetchMissingReceipts, fetchMissingReceiptsSuccess, fetchMissingReceiptsFailure, uploadMissingReceiptSuccess, updateMissingReceiptUploadState, updateMissingReceiptsUIState, markMissingReceiptAsDone, clearExpenseAutomationMissingReceiptsView,
553
576
  // Bulk Upload
554
- bulkUploadReceipts, updateBulkUploadProgress, bulkUploadReceiptsSuccess, bulkUploadReceiptsFailure, bulkUploadAutomatchingTimedOut, pusherBatchStatusUpdate, requestMissingReceiptsTabNavigation, clearMissingReceiptsTabNavigation, fetchBulkUploadBatchDetailsSuccess, fetchBulkUploadBatchDetailsFailure, storeBatchDetails, batchDetailFetchFailed, setInitialBatchDetailsLoading, fetchMoreBatchDetails, fetchMoreBatchDetailsComplete, fetchMoreBatchDetailsFailure, fetchBulkUploadBatches, fetchBulkUploadBatchesSuccess, fetchBulkUploadBatchesFailure, confirmBulkUploadMatch, confirmBulkUploadMatchSuccess, confirmBulkUploadMatchFailure, setBulkUploadResultsTab, setBulkUploadCompletedSubTab, setBulkUploadSortConfig, clearBulkUpload, searchTransactionsForManualMatch, searchTransactionsForManualMatchSuccess, searchTransactionsForManualMatchFailure, clearManualSearchResults, acknowledgeBulkUploadConfirmMatchComplete,
577
+ bulkUploadReceipts, updateBulkUploadProgress, setBulkUploadUploadedFileCount, bulkUploadReceiptsSuccess, bulkUploadReceiptsFailure, restoreBulkUploadMatchingState, bulkUploadAutomatchingTimedOut, pusherBatchStatusUpdate, requestMissingReceiptsTabNavigation, clearMissingReceiptsTabNavigation, fetchBulkUploadBatchDetailsSuccess, fetchBulkUploadBatchDetailsFailure, storeBatchDetails, batchDetailFetchFailed, setInitialBatchDetailsLoading, fetchMoreBatchDetails, fetchMoreBatchDetailsComplete, fetchMoreBatchDetailsFailure, fetchBulkUploadBatches, fetchBulkUploadBatchesSuccess, fetchBulkUploadBatchesFailure, confirmBulkUploadMatch, confirmBulkUploadMatchSuccess, confirmBulkUploadMatchFailure, setBulkUploadResultsTab, setBulkUploadCompletedSubTab, setBulkUploadSortConfig, clearBulkUpload, searchTransactionsForManualMatch, searchTransactionsForManualMatchSuccess, searchTransactionsForManualMatchFailure, clearManualSearchResults, acknowledgeBulkUploadConfirmMatchComplete,
555
578
  // Completed Transactions
556
579
  fetchCompletedTransactions, fetchCompletedTransactionsSuccess, fetchCompletedTransactionsFailure, } = expenseAutomationMissingReceiptsView.actions;
557
580
  export default expenseAutomationMissingReceiptsView.reducer;
@@ -37,7 +37,15 @@ export const initialReconciliationTabsState = {
37
37
  },
38
38
  };
39
39
  export const initialActionFetchState = {
40
+ excludeAccountFetch: {
41
+ fetchState: 'Not-Started',
42
+ error: undefined,
43
+ },
40
44
  excludeFetchById: {},
45
+ includeAccountFetch: {
46
+ fetchState: 'Not-Started',
47
+ error: undefined,
48
+ },
41
49
  reconcileFetch: {
42
50
  fetchState: 'Not-Started',
43
51
  error: undefined,
@@ -51,6 +59,7 @@ export const initialActionFetchState = {
51
59
  export const initialState = {
52
60
  accountReconciliationRecordsBySelectedPeriod: {},
53
61
  accountConnectionStatusByAccountID: {},
62
+ excludedAccountExclusionInfo: {},
54
63
  fetchState: 'Not-Started',
55
64
  error: undefined,
56
65
  selectedTab: 'review',
@@ -60,10 +69,12 @@ export const initialState = {
60
69
  selectedAccountId: undefined,
61
70
  statementUploadChosen: false,
62
71
  reconListUIState: {
72
+ nodeCollapseState: {},
63
73
  scrollPosition: {
64
74
  scrollTop: 0,
65
75
  },
66
76
  },
77
+ excludedAccountIDs: [],
67
78
  };
68
79
  // Create slice with reducers
69
80
  const expenseAutomationReconciliationView = createSlice({
@@ -132,7 +143,7 @@ const expenseAutomationReconciliationView = createSlice({
132
143
  fetchReconciliationSuccess: {
133
144
  reducer(draft, action) {
134
145
  if (action.payload.accountId == null) {
135
- updateAllReconciliation(draft, action.payload.reconciliation.accounts, action.payload.selectedPeriod, action.payload.reconciliation.reconciliation, action.payload.refreshViewInBackground);
146
+ updateAllReconciliation(draft, action.payload.reconciliation.accounts, action.payload.selectedPeriod, action.payload.reconciliation.reconciliation, action.payload.refreshViewInBackground, action.payload.reconciliation.excluded_accounts ?? []);
136
147
  }
137
148
  else if (action.payload.reconciliation.reconciliation.length > 0 &&
138
149
  action.payload.reconciliation.accounts.length > 0) {
@@ -344,6 +355,10 @@ const expenseAutomationReconciliationView = createSlice({
344
355
  updateReconListScrollPosition: (draft, action) => {
345
356
  draft.reconListUIState.scrollPosition = action.payload.scrollPosition;
346
357
  },
358
+ updateNodeCollapseState: (draft, action) => {
359
+ draft.reconListUIState.nodeCollapseState[action.payload.nodeId] =
360
+ action.payload.collapsed;
361
+ },
347
362
  setConnectionInProgressForAccount: (draft, action) => {
348
363
  if (draft.accountConnectionStatusByAccountID[action.payload.accountId] ==
349
364
  null) {
@@ -421,6 +436,85 @@ const expenseAutomationReconciliationView = createSlice({
421
436
  ...localData,
422
437
  };
423
438
  },
439
+ excludeAccountFromReconciliation: {
440
+ reducer(draft) {
441
+ draft.actionFetchState.excludeAccountFetch = {
442
+ fetchState: 'In-Progress',
443
+ error: undefined,
444
+ };
445
+ },
446
+ prepare(payload) {
447
+ return { payload };
448
+ },
449
+ },
450
+ excludeAccountFromReconciliationSuccess: (draft, action) => {
451
+ draft.actionFetchState.excludeAccountFetch = {
452
+ fetchState: 'Completed',
453
+ error: undefined,
454
+ };
455
+ const { account, selectedPeriod } = action.payload;
456
+ if (account != null) {
457
+ if (!draft.excludedAccountIDs.includes(account.account_id)) {
458
+ draft.excludedAccountIDs.push(account.account_id);
459
+ }
460
+ updateExcludedAccountExclusionInfo(draft, account);
461
+ const monthYearPeriodId = toMonthYearPeriodId(selectedPeriod);
462
+ if (draft.accountReconciliationRecordsBySelectedPeriod[monthYearPeriodId]
463
+ ?.accountIDs != null) {
464
+ draft.accountReconciliationRecordsBySelectedPeriod[monthYearPeriodId].accountIDs = draft.accountReconciliationRecordsBySelectedPeriod[monthYearPeriodId].accountIDs.filter((id) => id !== account.account_id);
465
+ }
466
+ }
467
+ },
468
+ excludeAccountFromReconciliationFailure: (draft, action) => {
469
+ draft.actionFetchState.excludeAccountFetch = {
470
+ fetchState: 'Error',
471
+ error: action.payload.error,
472
+ };
473
+ },
474
+ includeAccountInReconciliation: {
475
+ reducer(draft) {
476
+ draft.actionFetchState.includeAccountFetch = {
477
+ fetchState: 'In-Progress',
478
+ error: undefined,
479
+ };
480
+ },
481
+ prepare(payload) {
482
+ return { payload };
483
+ },
484
+ },
485
+ includeAccountInReconciliationSuccess: (draft, action) => {
486
+ draft.actionFetchState.includeAccountFetch = {
487
+ fetchState: 'Completed',
488
+ error: undefined,
489
+ };
490
+ const { reconciliation, selectedPeriod } = action.payload;
491
+ if (reconciliation == null) {
492
+ return;
493
+ }
494
+ const accountId = reconciliation.account_id;
495
+ draft.excludedAccountIDs = draft.excludedAccountIDs.filter((id) => id !== accountId);
496
+ delete draft.excludedAccountExclusionInfo[accountId];
497
+ const monthYearPeriodId = toMonthYearPeriodId(selectedPeriod);
498
+ const accountReconciliationRecords = draft.accountReconciliationRecordsBySelectedPeriod[monthYearPeriodId];
499
+ if (accountReconciliationRecords != null) {
500
+ if (!accountReconciliationRecords.accountIDs.includes(accountId)) {
501
+ accountReconciliationRecords.accountIDs.push(accountId);
502
+ }
503
+ // put this in a function
504
+ updateReconciliationByAccountIDOnIncludeAccount(draft, accountId, reconciliation, monthYearPeriodId);
505
+ }
506
+ draft.accountConnectionStatusByAccountID[accountId] = {
507
+ status: toBankStatusCodeType(reconciliation.bank_status.code),
508
+ connectionInProgress: false,
509
+ paymentAccountId: undefined,
510
+ };
511
+ },
512
+ includeAccountInReconciliationFailure: (draft, action) => {
513
+ draft.actionFetchState.includeAccountFetch = {
514
+ fetchState: 'Error',
515
+ error: action.payload.error,
516
+ };
517
+ },
424
518
  updateStatementUploadChosen: (draft, action) => {
425
519
  draft.statementUploadChosen = action.payload.statementUploadChosen;
426
520
  },
@@ -430,10 +524,38 @@ const expenseAutomationReconciliationView = createSlice({
430
524
  },
431
525
  });
432
526
  // Export actions
433
- export const { fetchReconciliation, fetchReconciliationFailure, fetchReconciliationSuccess, saveReconciliationDetail, saveReconciliationDetailFailure, updateSelectedAccountId, setConnectionInProgressForAccount, setStatementParseInProgress, updateReconcileTabLocalData, updateReconcileTabListSortState, updateReconcileTabListScrollState, saveReconciliationDetailSuccess, updateSelectedTab, updateBalancesLocalData, initialiseLocalDataForSelectedAccountId, clearExpenseAutomationReconciliationView, updateSelectedDrawerAccountId, updateReviewTabSortState, initializeReconciliationReviewTabLocalData, updateReviewTabLocalData, saveReconciliationReview, updateSaveReconciliationReviewFetchStatus, updateReconListScrollPosition, updateAccountReconciliationLocalData, deleteAccountStatement, deleteAccountStatementSuccess, deleteAccountStatementFailure, uploadAccountStatement, uploadAccountStatementSuccess, uploadAccountStatementFailure, updateStatementUploadChosen, } = expenseAutomationReconciliationView.actions;
527
+ export const { fetchReconciliation, fetchReconciliationFailure, fetchReconciliationSuccess, saveReconciliationDetail, saveReconciliationDetailFailure, updateSelectedAccountId, setConnectionInProgressForAccount, setStatementParseInProgress, updateReconcileTabLocalData, updateReconcileTabListSortState, updateReconcileTabListScrollState, saveReconciliationDetailSuccess, updateSelectedTab, updateBalancesLocalData, initialiseLocalDataForSelectedAccountId, clearExpenseAutomationReconciliationView, updateSelectedDrawerAccountId, updateReviewTabSortState, initializeReconciliationReviewTabLocalData, updateReviewTabLocalData, saveReconciliationReview, updateSaveReconciliationReviewFetchStatus, updateReconListScrollPosition, updateAccountReconciliationLocalData, deleteAccountStatement, deleteAccountStatementSuccess, deleteAccountStatementFailure, excludeAccountFromReconciliation, excludeAccountFromReconciliationSuccess, excludeAccountFromReconciliationFailure, includeAccountInReconciliation, includeAccountInReconciliationSuccess, includeAccountInReconciliationFailure, uploadAccountStatement, uploadAccountStatementSuccess, uploadAccountStatementFailure, updateStatementUploadChosen, updateNodeCollapseState, } = expenseAutomationReconciliationView.actions;
434
528
  // Export reducer
435
529
  export default expenseAutomationReconciliationView.reducer;
436
- function updateAllReconciliation(draft, accounts, selectedPeriod, reconciliationData, refreshViewInBackground) {
530
+ function updateAllReconciliation(draft, accounts, selectedPeriod, reconciliationData, refreshViewInBackground, excludedAccounts) {
531
+ draft.excludedAccountIDs = excludedAccounts.map((ea) => ea.account_id);
532
+ draft.excludedAccountExclusionInfo = {};
533
+ excludedAccounts.forEach((ea) => {
534
+ const { exclusion_info } = ea;
535
+ draft.excludedAccountExclusionInfo[ea.account_id] = {
536
+ bankBalance: exclusion_info.bank_balance != null
537
+ ? {
538
+ amount: exclusion_info.bank_balance,
539
+ currencyCode: ea.currency_code ?? 'USD',
540
+ currencySymbol: ea.currency_symbol ?? '$',
541
+ }
542
+ : undefined,
543
+ clearedBalance: exclusion_info.cleared_balance != null
544
+ ? {
545
+ amount: exclusion_info.cleared_balance,
546
+ currencyCode: ea.currency_code ?? 'USD',
547
+ currencySymbol: ea.currency_symbol ?? '$',
548
+ }
549
+ : undefined,
550
+ variance: exclusion_info.variance != null
551
+ ? {
552
+ amount: exclusion_info.variance,
553
+ currencyCode: ea.currency_code ?? 'USD',
554
+ currencySymbol: ea.currency_symbol ?? '$',
555
+ }
556
+ : undefined,
557
+ };
558
+ });
437
559
  draft.accountReconciliationRecordsBySelectedPeriod[toMonthYearPeriodId(selectedPeriod)] = {
438
560
  accountIDs: [],
439
561
  reconciliationByAccountID: {},
@@ -471,6 +593,9 @@ function updateAllReconciliation(draft, accounts, selectedPeriod, reconciliation
471
593
  ? toReconciliationAccountSource(account.reconciliation_source)
472
594
  : undefined,
473
595
  },
596
+ accountDetectionReason: account?.detection_info != null && account.detection_reason != null
597
+ ? account.detection_reason
598
+ : undefined,
474
599
  };
475
600
  accountReconciliationRecords.accountIDs.push(reconciliation.account_id);
476
601
  });
@@ -516,3 +641,42 @@ function updateReconciliationByAccountID(draft, accounts, selectedPeriod, accoun
516
641
  };
517
642
  }
518
643
  }
644
+ const updateExcludedAccountExclusionInfo = (draft, account) => {
645
+ draft.excludedAccountExclusionInfo[account.account_id] = {
646
+ bankBalance: account.bank_balance != null
647
+ ? {
648
+ amount: account.bank_balance,
649
+ currencyCode: account.currency_code ?? 'USD',
650
+ currencySymbol: account.currency_symbol ?? '$',
651
+ }
652
+ : undefined,
653
+ clearedBalance: account.cleared_balance != null
654
+ ? {
655
+ amount: account.cleared_balance,
656
+ currencyCode: account.currency_code ?? 'USD',
657
+ currencySymbol: account.currency_symbol ?? '$',
658
+ }
659
+ : undefined,
660
+ variance: account.variance != null
661
+ ? {
662
+ amount: account.variance,
663
+ currencyCode: account.currency_code ?? 'USD',
664
+ currencySymbol: account.currency_symbol ?? '$',
665
+ }
666
+ : undefined,
667
+ };
668
+ };
669
+ const updateReconciliationByAccountIDOnIncludeAccount = (draft, accountId, reconciliation, monthYearPeriodId) => {
670
+ draft.accountReconciliationRecordsBySelectedPeriod[monthYearPeriodId].reconciliationByAccountID[accountId] = {
671
+ accountId,
672
+ reconciliationId: reconciliation.reconciliation_id ?? undefined,
673
+ transactionFetchState: { fetchState: 'Not-Started', error: undefined },
674
+ refreshStatus: { fetchState: 'Not-Started', error: undefined },
675
+ statementDeleteStatus: { fetchState: 'Not-Started', error: undefined },
676
+ statementUploadStatus: { fetchState: 'Not-Started', error: undefined },
677
+ statementUpdateStatus: { fetchState: 'Not-Started', error: undefined },
678
+ statementParseInProgress: reconciliation.bank_status.code === 'parsing',
679
+ localData: {},
680
+ accountDetectionReason: undefined,
681
+ };
682
+ };
@@ -1,4 +1,3 @@
1
1
  import { stringToUnion } from '../../../commonStateTypes/stringToUnion';
2
2
  export const ALL_ACCOUNT_RECON_SECTION_IDS = ['assets', 'liabilities'];
3
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
4
- const toAccountReconSectionID = (v) => stringToUnion(v, ALL_ACCOUNT_RECON_SECTION_IDS);
3
+ export const toAccountReconSectionID = (v) => stringToUnion(v, ALL_ACCOUNT_RECON_SECTION_IDS);
@@ -1,3 +1,4 @@
1
+ import { reduceAnyFetchState } from '../../../commonStateTypes/reduceFetchState';
1
2
  import { toMonthYearPeriodId } from '../../../commonStateTypes/timePeriod';
2
3
  import { getAccountBase } from '../../../entity/account/accountSelector';
3
4
  import { getClassById } from '../../../entity/class/classSelector';
@@ -6,7 +7,7 @@ import { getUserByUserId } from '../../../entity/user/userSelector';
6
7
  import { getVendorByVendorId } from '../../../entity/vendor/vendorSelector';
7
8
  import { getAllSteps } from '../selectorTypes/expenseAutomationViewSelectorTypes';
8
9
  export function getExpenseAutomationFluxAnalysisView(state) {
9
- const { expenseAutomationFluxAnalysisViewState, monthEndCloseChecksState } = state;
10
+ const { expenseAutomationFluxAnalysisViewState, monthEndCloseChecksState, monthEndCloseChecksViewState, } = state;
10
11
  const { fetchState, error, refreshStatus, uiState, reviewOperatingExpenseIdsByPeriod, selectedSectionIdsByPeriod, groupsBySelectedPeriod, fluxAnalysisEntities, bulkReviewStatus, currency, totalBalancesAndVariance, } = expenseAutomationFluxAnalysisViewState;
11
12
  const fetchStateAndError = {
12
13
  fetchState,
@@ -91,10 +92,17 @@ export function getExpenseAutomationFluxAnalysisView(state) {
91
92
  },
92
93
  };
93
94
  const completionStatus = fluxCompletionStatus != null ? fluxCompletionStatus : 'incomplete';
95
+ const monthEndFetchState = monthYearPeriodId != null
96
+ ? (monthEndCloseChecksViewState.monthEndCloseChecksViewByTenantId[currentTenant.tenantId]?.[monthYearPeriodId] ?? { fetchState: 'Not-Started', error: undefined })
97
+ : { fetchState: 'Not-Started', error: undefined };
98
+ const reducedFetchStatus = reduceAnyFetchState([
99
+ fetchStateAndError,
100
+ monthEndFetchState,
101
+ ]);
94
102
  return {
95
103
  sections,
96
104
  totalBalancesAndVariance,
97
- fetchStatus: fetchStateAndError,
105
+ fetchStatus: reducedFetchStatus,
98
106
  bulkReviewStatus,
99
107
  reviewOperatingExpensesIds,
100
108
  selectedSectionIds,
@@ -1,4 +1,6 @@
1
1
  import omit from 'lodash/omit';
2
+ import orderBy from 'lodash/orderBy';
3
+ import { reduceAnyFetchState } from '../../../commonStateTypes/reduceFetchState';
2
4
  import { toMonthYearPeriodId } from '../../../commonStateTypes/timePeriod';
3
5
  import { getAccountIdsForTypes } from '../../../entity/account/accountSelector';
4
6
  import { getJEScheduledTransactionByJEScheduleTransactionKey, } from '../../../entity/jeSchedules/jeSchedulesSelector';
@@ -10,10 +12,48 @@ import { filterNestedAccountHierarchyById } from '../../scheduleView/scheduleDet
10
12
  import { getAccountLabelForScheduleType, getAccountsTypesForScheduleList, } from '../../scheduleView/scheduleListView/scheduleListHelper';
11
13
  import { getAllSteps } from '../selectorTypes/expenseAutomationViewSelectorTypes';
12
14
  import { getJEAccountSettingsView } from './jeAccountSettingsViewSelector';
15
+ function getJEScheduleSortAccessor(sortKey) {
16
+ switch (sortKey) {
17
+ case 'vendor':
18
+ return (s) => s.vendor.name?.toLowerCase();
19
+ case 'category':
20
+ return (s) => s.jeDebit.account?.accountName?.toLowerCase();
21
+ case 'class':
22
+ return (s) => s.jeDebit.accountingClass?.className?.toLowerCase();
23
+ case 'depCategory':
24
+ return (s) => s.jeCredit.account?.accountName?.toLowerCase();
25
+ case 'scheduleCategory':
26
+ return (s) => s.jeScheduleType;
27
+ case 'startMonth':
28
+ return (s) => s.startDate?.valueOf();
29
+ case 'type':
30
+ return (s) => s.baseTransaction.typeOfTransaction;
31
+ case 'amortizationPeriod':
32
+ return (s) => s.period;
33
+ case 'jePostingDate':
34
+ return (s) => s.dayOfPostingDate;
35
+ case 'remainingMonths':
36
+ return (s) => s.period;
37
+ case 'runningBalance':
38
+ return (s) => s.balanceAsOfToday?.amount;
39
+ case 'totalAmount':
40
+ return (s) => s.baseTransaction.amount.amount;
41
+ case 'transactionDate':
42
+ return (s) => s.baseTransaction.date.valueOf();
43
+ case 'memo':
44
+ return (s) => s.baseTransaction.memo?.toLowerCase();
45
+ default:
46
+ return (s) => s.startDate?.valueOf();
47
+ }
48
+ }
49
+ function sortJEScheduledTransactions(transactions, sortKey, sortOrder) {
50
+ const accessor = getJEScheduleSortAccessor(sortKey);
51
+ return orderBy(transactions, [accessor], [sortOrder === 'ascending' ? 'asc' : 'desc']);
52
+ }
13
53
  export function getExpenseAutomationJESchedulesView(state) {
14
54
  const jeScheduledTransaction = [];
15
55
  const failedJeScheduledTransaction = [];
16
- const { accountState, accountListState, classState, classListState, expenseAutomationJESchedulesViewState, expenseAutomationViewState, monthEndCloseChecksState, } = state;
56
+ const { accountState, accountListState, classState, classListState, expenseAutomationJESchedulesViewState, expenseAutomationViewState, monthEndCloseChecksState, monthEndCloseChecksViewState, } = state;
17
57
  const { jeScheduleTransactionKeysByPeriod, failedJeScheduleTransactionKeysByPeriod, jeScheduleLocalDataById, postStatusById, ignoreStatusById, uiState, error, fetchState, refreshStatus, } = expenseAutomationJESchedulesViewState;
18
58
  const accountSettingsView = getJEAccountSettingsView(state);
19
59
  const currentTenant = getCurrentTenant(state);
@@ -59,18 +99,33 @@ export function getExpenseAutomationJESchedulesView(state) {
59
99
  const jeScheduleDetails = getJEScheduledTransactionByJEScheduleTransactionKey(jeScheduleKey, state);
60
100
  failedJeScheduledTransaction.push(jeScheduleDetails);
61
101
  });
62
- const draftSchedules = jeScheduledTransaction.filter((schedule) => schedule.status.code === 'draft');
63
- const resolveSchedules = [];
102
+ const { sortKey, sortOrder } = uiState;
103
+ const draftSchedules = sortJEScheduledTransactions(jeScheduledTransaction.filter((schedule) => schedule.status.code === 'draft'), sortKey, sortOrder);
104
+ const ongoingSchedules = sortJEScheduledTransactions(jeScheduledTransaction.filter((schedule) => schedule.status.code === 'ongoing'), sortKey, sortOrder);
105
+ const completedSchedules = sortJEScheduledTransactions(jeScheduledTransaction.filter((schedule) => schedule.status.code === 'completed' ||
106
+ schedule.status.code === 'marked_as_completed'), sortKey, sortOrder);
107
+ const unsortedResolveSchedules = [];
64
108
  failedJeScheduledTransaction.forEach((schedule) => {
65
109
  schedule.scheduledJournalEntry.forEach((journalEntry) => {
66
- resolveSchedules.push({ ...schedule, scheduledJournalEntry: journalEntry });
110
+ unsortedResolveSchedules.push({
111
+ ...schedule,
112
+ scheduledJournalEntry: journalEntry,
113
+ });
67
114
  });
68
115
  });
116
+ const resolveSchedules = sortJEScheduledTransactions(unsortedResolveSchedules, sortKey, sortOrder);
69
117
  const allSteps = monthYearPeriodId != null
70
118
  ? getAllSteps(monthEndCloseChecksState, monthYearPeriodId, currentTenant.tenantId)
71
119
  : [];
72
120
  const jeCompletionStatus = allSteps.find((step) => step.step === 'je_schedules')?.completionStatus;
73
121
  const completionStatus = jeCompletionStatus != null ? jeCompletionStatus : 'incomplete';
122
+ const monthEndFetchState = monthYearPeriodId != null
123
+ ? (monthEndCloseChecksViewState.monthEndCloseChecksViewByTenantId[currentTenant.tenantId]?.[monthYearPeriodId] ?? { fetchState: 'Not-Started', error: undefined })
124
+ : { fetchState: 'Not-Started', error: undefined };
125
+ const reducedFetchStatus = reduceAnyFetchState([
126
+ { fetchState, error },
127
+ monthEndFetchState,
128
+ ]);
74
129
  return {
75
130
  uncategorizedAccounts,
76
131
  allDepreciationAccountList: filteredDepAccounts,
@@ -79,15 +134,17 @@ export function getExpenseAutomationJESchedulesView(state) {
79
134
  allAccountList: filteredAccounts,
80
135
  accountListNestedAccountHierarchy,
81
136
  allClassList: allClasses,
137
+ completedSchedules,
82
138
  draftSchedules,
139
+ ongoingSchedules,
83
140
  resolveSchedules: resolveSchedules,
84
141
  accountSettingsView,
85
142
  postStatusById: postStatusById,
86
143
  ignoreStatusById: ignoreStatusById,
87
- fetchState: fetchState,
144
+ fetchState: reducedFetchStatus.fetchState,
88
145
  jeScheduleLocalDataById: jeScheduleLocalDataById,
89
146
  uiState: uiState,
90
- error: error,
147
+ error: reducedFetchStatus.error,
91
148
  refreshStatus,
92
149
  completionStatus,
93
150
  };