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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (251) hide show
  1. package/lib/commonStateTypes/animations.d.ts +1 -1
  2. package/lib/commonStateTypes/coaBalance/coaBalanceType.d.ts +2 -0
  3. package/lib/commonStateTypes/coaBalance/coaBalanceType.js +6 -0
  4. package/lib/commonStateTypes/currencyHelper.d.ts +3 -0
  5. package/lib/commonStateTypes/currencyHelper.js +6 -1
  6. package/lib/commonStateTypes/reduceFetchState.d.ts +9 -0
  7. package/lib/commonStateTypes/reduceFetchState.js +26 -0
  8. package/lib/entity/account/accountPayload.d.ts +2 -0
  9. package/lib/entity/account/accountPayload.js +2 -0
  10. package/lib/entity/account/accountState.d.ts +2 -0
  11. package/lib/entity/aiCfo/aiCfoSelector.d.ts +1 -2
  12. package/lib/entity/billPay/billTransaction/billTransactionState.d.ts +2 -2
  13. package/lib/entity/customer/customerState.d.ts +0 -2
  14. package/lib/entity/customer/customerState.js +0 -5
  15. package/lib/entity/depositAccount/depositAccount.d.ts +1 -1
  16. package/lib/entity/depositAccount/depositAccount.js +8 -1
  17. package/lib/entity/jeSchedules/jeSchedulesPayload.d.ts +35 -0
  18. package/lib/entity/jeSchedules/jeSchedulesPayload.js +44 -0
  19. package/lib/entity/jeSchedules/jeSchedulesSelector.d.ts +2 -1
  20. package/lib/entity/jeSchedules/jeSchedulesSelector.js +2 -1
  21. package/lib/entity/jeSchedules/jeSchedulesState.d.ts +13 -0
  22. package/lib/entity/reimbursement/reimbursementPayload.d.ts +2 -0
  23. package/lib/entity/reimbursement/reimbursementPayload.js +7 -0
  24. package/lib/entity/reimbursement/reimbursementState.d.ts +2 -0
  25. package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
  26. package/lib/entity/snackbar/snackbarTypes.js +1 -0
  27. package/lib/entity/task/taskPayload.d.ts +1 -0
  28. package/lib/entity/task/taskPayload.js +1 -0
  29. package/lib/entity/task/taskState.d.ts +1 -0
  30. package/lib/entity/tenant/tenantPayload.d.ts +1 -0
  31. package/lib/entity/tenant/tenantReducer.js +1 -0
  32. package/lib/entity/tenant/tenantSelector.d.ts +1 -0
  33. package/lib/entity/tenant/tenantSelector.js +9 -1
  34. package/lib/entity/tenant/tenantState.d.ts +1 -0
  35. package/lib/entity/transaction/payloadTypes/transactionPayload.d.ts +3 -0
  36. package/lib/entity/transaction/payloadTypes/transactionPayload.js +11 -0
  37. package/lib/entity/transaction/stateTypes/transaction.d.ts +3 -0
  38. package/lib/entity/transaction/stateTypes/transactionLine.d.ts +1 -1
  39. package/lib/entity/userGroups/userGroupsPayload.d.ts +7 -0
  40. package/lib/entity/userGroups/userGroupsPayload.js +10 -0
  41. package/lib/entity/userGroups/userGroupsReducer.d.ts +8 -0
  42. package/lib/entity/userGroups/userGroupsReducer.js +29 -0
  43. package/lib/entity/userGroups/userGroupsSelector.d.ts +4 -0
  44. package/lib/entity/userGroups/userGroupsSelector.js +12 -0
  45. package/lib/entity/userGroups/userGroupsState.d.ts +9 -0
  46. package/lib/entity/userGroups/userGroupsState.js +2 -0
  47. package/lib/epic.d.ts +13 -1
  48. package/lib/epic.js +13 -1
  49. package/lib/esm/commonStateTypes/coaBalance/coaBalanceType.js +5 -0
  50. package/lib/esm/commonStateTypes/currencyHelper.js +5 -0
  51. package/lib/esm/commonStateTypes/reduceFetchState.js +25 -0
  52. package/lib/esm/entity/account/accountPayload.js +2 -0
  53. package/lib/esm/entity/customer/customerState.js +1 -4
  54. package/lib/esm/entity/depositAccount/depositAccount.js +8 -1
  55. package/lib/esm/entity/jeSchedules/jeSchedulesPayload.js +44 -0
  56. package/lib/esm/entity/jeSchedules/jeSchedulesSelector.js +2 -1
  57. package/lib/esm/entity/reimbursement/reimbursementPayload.js +7 -0
  58. package/lib/esm/entity/snackbar/snackbarTypes.js +1 -0
  59. package/lib/esm/entity/task/taskPayload.js +1 -0
  60. package/lib/esm/entity/tenant/tenantReducer.js +1 -0
  61. package/lib/esm/entity/tenant/tenantSelector.js +7 -0
  62. package/lib/esm/entity/transaction/payloadTypes/transactionPayload.js +11 -0
  63. package/lib/esm/entity/userGroups/userGroupsPayload.js +7 -0
  64. package/lib/esm/entity/userGroups/userGroupsReducer.js +25 -0
  65. package/lib/esm/entity/userGroups/userGroupsSelector.js +8 -0
  66. package/lib/esm/entity/userGroups/userGroupsState.js +1 -0
  67. package/lib/esm/epic.js +13 -1
  68. package/lib/esm/index.js +25 -16
  69. package/lib/esm/reducer.js +6 -0
  70. package/lib/esm/view/aiCfoView/aiCfoViewReducer.js +82 -1
  71. package/lib/esm/view/aiCfoView/aiCfoViewSelector.js +8 -2
  72. package/lib/esm/view/aiCfoView/epics/fetchSuggestedQuestionsEpic.js +29 -0
  73. package/lib/esm/view/arAgingView/arAgingReport/arAgingReducer.js +1 -1
  74. package/lib/esm/view/arAgingView/arAgingReport/arAgingSelector.js +1 -1
  75. package/lib/esm/view/classList/fetchClassListEpic.js +9 -2
  76. package/lib/esm/view/commonVendorView/vendorView/vendorViewSelector.js +18 -5
  77. package/lib/esm/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewSelector.js +6 -2
  78. package/lib/esm/view/expenseAutomationView/bulkUploadTiming.js +10 -0
  79. package/lib/esm/view/expenseAutomationView/epics/accountRecon/saveReconciliationReviewEpic.js +8 -3
  80. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/bulkUploadReceiptsEpic.js +29 -0
  81. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/confirmBulkUploadMatchEpic.js +49 -0
  82. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchDetailsEpic.js +40 -0
  83. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchesEpic.js +47 -0
  84. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchCompletedTransactionsEpic.js +61 -0
  85. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchMoreBatchDetailsEpic.js +33 -0
  86. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchMultipleBatchDetailsEpic.js +56 -0
  87. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/searchTransactionsForManualMatchEpic.js +77 -0
  88. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/uploadMissingReceiptSuccessEpic.js +7 -5
  89. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/watchBulkUploadBatchStatusEpic.js +79 -0
  90. package/lib/esm/view/expenseAutomationView/epics/transactionCategorization/uploadTransactionReceiptSuccessEpic.js +24 -0
  91. package/lib/esm/view/expenseAutomationView/helpers/saveTransactionHelper.js +2 -2
  92. package/lib/esm/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.js +2 -2
  93. package/lib/esm/view/expenseAutomationView/payload/missingReceiptsPayload.js +189 -1
  94. package/lib/esm/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +17 -1
  95. package/lib/esm/view/expenseAutomationView/reducers/missingReceiptsViewReducer.js +433 -2
  96. package/lib/esm/view/expenseAutomationView/reducers/transactionsViewReducer.js +23 -1
  97. package/lib/esm/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +50 -3
  98. package/lib/esm/view/expenseAutomationView/selectors/missingReceiptsSelector.js +245 -2
  99. package/lib/esm/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +2 -1
  100. package/lib/esm/view/expenseAutomationView/types/jeSchedulesViewState.js +17 -1
  101. package/lib/esm/view/expenseAutomationView/types/missingReceiptsViewState.js +44 -0
  102. package/lib/esm/view/expenseAutomationView/types/transactionsViewState.js +2 -1
  103. package/lib/esm/view/financeStatement/financeStatementReducer.js +11 -8
  104. package/lib/esm/view/financeStatement/financeStatementSelector.js +24 -9
  105. package/lib/esm/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelector.js +322 -0
  106. package/lib/esm/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelectorTypes.js +9 -0
  107. package/lib/esm/view/profitAndLossClassesView/profitAndLossClassesViewReducer.js +6 -1
  108. package/lib/esm/view/profitAndLossClassesView/profitAndLossClassesViewSelector.js +2 -29
  109. package/lib/esm/view/profitAndLossClassesView/profitAndLossForTimeframeClassesViewEpic.js +7 -5
  110. package/lib/esm/view/profitAndLossClassesView/profitAndLossHorizontalEnrichment.js +201 -0
  111. package/lib/esm/view/reportUIOptions/updateReportUIOptionCOABalancesRangeEpic.js +9 -7
  112. package/lib/esm/view/spendManagement/billPay/billList/billListSelector.js +10 -0
  113. package/lib/esm/view/spendManagement/billPay/billList/billListState.js +1 -0
  114. package/lib/esm/view/spendManagement/billPay/billPayReview/billPayReviewSelector.js +7 -3
  115. package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/billPaySetupApproverViewSelector.js +5 -5
  116. package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/epic/fetchBillPayApproversDetailsEpic.js +7 -2
  117. package/lib/esm/view/spendManagement/billPay/editBillView/editBillViewSelector.js +13 -6
  118. package/lib/esm/view/spendManagement/chargeCards/chargeCardList/chargeCardList.js +1 -0
  119. package/lib/esm/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.js +2 -0
  120. package/lib/esm/view/spendManagement/reimbursement/editRemiView/editRemiViewSelector.js +7 -4
  121. package/lib/esm/view/spendManagement/reimbursement/remiListView/remiListSelector.js +12 -0
  122. package/lib/esm/view/spendManagement/reimbursement/remiListView/remiListState.js +1 -0
  123. package/lib/esm/view/taskManager/taskDetailView/taskDetailSelector.js +3 -3
  124. package/lib/esm/view/taskManager/taskListView/epics/bulkUpdateTaskListEpic.js +1 -0
  125. package/lib/esm/view/taskManager/taskListView/taskListSelector.js +3 -1
  126. package/lib/esm/view/transactionDetail/epics/saveTransactionHelper.js +2 -2
  127. package/lib/esm/view/transactionDetail/transactionDetailLocalDataHelper.js +16 -14
  128. package/lib/esm/view/userGroupListView/userGroupListViewReducer.js +65 -0
  129. package/lib/esm/view/userGroupListView/userGroupListViewSelector.js +16 -0
  130. package/lib/esm/view/userGroupListView/userGroupListViewState.js +1 -0
  131. package/lib/esm/view/userListView/fetchUserListByTypeEpic.js +11 -0
  132. package/lib/esm/zeniAPI.js +0 -2
  133. package/lib/index.d.ts +31 -21
  134. package/lib/index.js +102 -34
  135. package/lib/reducer.d.ts +6 -0
  136. package/lib/reducer.js +6 -0
  137. package/lib/tsconfig.typecheck.tsbuildinfo +1 -0
  138. package/lib/view/aiCfoView/aiCfoViewPayload.d.ts +7 -0
  139. package/lib/view/aiCfoView/aiCfoViewReducer.d.ts +15 -1
  140. package/lib/view/aiCfoView/aiCfoViewReducer.js +83 -2
  141. package/lib/view/aiCfoView/aiCfoViewSelector.d.ts +4 -1
  142. package/lib/view/aiCfoView/aiCfoViewSelector.js +9 -2
  143. package/lib/view/aiCfoView/aiCfoViewState.d.ts +18 -1
  144. package/lib/view/aiCfoView/epics/fetchSuggestedQuestionsEpic.d.ts +8 -0
  145. package/lib/view/aiCfoView/epics/fetchSuggestedQuestionsEpic.js +33 -0
  146. package/lib/view/arAgingView/arAgingReport/arAgingReducer.js +2 -2
  147. package/lib/view/arAgingView/arAgingReport/arAgingSelector.js +5 -5
  148. package/lib/view/auditReportView/auditReportViewState.d.ts +1 -1
  149. package/lib/view/classList/fetchClassListEpic.d.ts +1 -1
  150. package/lib/view/classList/fetchClassListEpic.js +8 -1
  151. package/lib/view/commonVendorView/vendorView/vendorViewSelector.d.ts +1 -0
  152. package/lib/view/commonVendorView/vendorView/vendorViewSelector.js +18 -5
  153. package/lib/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewSelector.d.ts +1 -0
  154. package/lib/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewSelector.js +6 -2
  155. package/lib/view/expenseAutomationView/bulkUploadTiming.d.ts +10 -0
  156. package/lib/view/expenseAutomationView/bulkUploadTiming.js +13 -0
  157. package/lib/view/expenseAutomationView/epics/accountRecon/saveReconciliationReviewEpic.js +8 -3
  158. package/lib/view/expenseAutomationView/epics/missingReceipts/bulkUploadReceiptsEpic.d.ts +18 -0
  159. package/lib/view/expenseAutomationView/epics/missingReceipts/bulkUploadReceiptsEpic.js +33 -0
  160. package/lib/view/expenseAutomationView/epics/missingReceipts/confirmBulkUploadMatchEpic.d.ts +7 -0
  161. package/lib/view/expenseAutomationView/epics/missingReceipts/confirmBulkUploadMatchEpic.js +53 -0
  162. package/lib/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchDetailsEpic.d.ts +8 -0
  163. package/lib/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchDetailsEpic.js +44 -0
  164. package/lib/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchesEpic.d.ts +7 -0
  165. package/lib/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchesEpic.js +51 -0
  166. package/lib/view/expenseAutomationView/epics/missingReceipts/fetchCompletedTransactionsEpic.d.ts +8 -0
  167. package/lib/view/expenseAutomationView/epics/missingReceipts/fetchCompletedTransactionsEpic.js +65 -0
  168. package/lib/view/expenseAutomationView/epics/missingReceipts/fetchMoreBatchDetailsEpic.d.ts +8 -0
  169. package/lib/view/expenseAutomationView/epics/missingReceipts/fetchMoreBatchDetailsEpic.js +37 -0
  170. package/lib/view/expenseAutomationView/epics/missingReceipts/fetchMultipleBatchDetailsEpic.d.ts +9 -0
  171. package/lib/view/expenseAutomationView/epics/missingReceipts/fetchMultipleBatchDetailsEpic.js +61 -0
  172. package/lib/view/expenseAutomationView/epics/missingReceipts/searchTransactionsForManualMatchEpic.d.ts +14 -0
  173. package/lib/view/expenseAutomationView/epics/missingReceipts/searchTransactionsForManualMatchEpic.js +81 -0
  174. package/lib/view/expenseAutomationView/epics/missingReceipts/uploadMissingReceiptSuccessEpic.js +7 -5
  175. package/lib/view/expenseAutomationView/epics/missingReceipts/watchBulkUploadBatchStatusEpic.d.ts +25 -0
  176. package/lib/view/expenseAutomationView/epics/missingReceipts/watchBulkUploadBatchStatusEpic.js +85 -0
  177. package/lib/view/expenseAutomationView/epics/transactionCategorization/uploadTransactionReceiptSuccessEpic.d.ts +7 -0
  178. package/lib/view/expenseAutomationView/epics/transactionCategorization/uploadTransactionReceiptSuccessEpic.js +28 -0
  179. package/lib/view/expenseAutomationView/helpers/saveTransactionHelper.js +2 -2
  180. package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
  181. package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.js +2 -2
  182. package/lib/view/expenseAutomationView/payload/missingReceiptsPayload.d.ts +118 -0
  183. package/lib/view/expenseAutomationView/payload/missingReceiptsPayload.js +201 -0
  184. package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.d.ts +2 -2
  185. package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +18 -2
  186. package/lib/view/expenseAutomationView/reducers/missingReceiptsViewReducer.d.ts +76 -3
  187. package/lib/view/expenseAutomationView/reducers/missingReceiptsViewReducer.js +434 -2
  188. package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.d.ts +11 -3
  189. package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.js +24 -2
  190. package/lib/view/expenseAutomationView/selectorTypes/jeSchedulesSelectorTypes.d.ts +2 -0
  191. package/lib/view/expenseAutomationView/selectorTypes/missingReceiptsSelectorTypes.d.ts +69 -1
  192. package/lib/view/expenseAutomationView/selectorTypes/transactionsViewSelectorTypes.d.ts +1 -0
  193. package/lib/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +50 -3
  194. package/lib/view/expenseAutomationView/selectors/missingReceiptsSelector.d.ts +1 -1
  195. package/lib/view/expenseAutomationView/selectors/missingReceiptsSelector.js +244 -1
  196. package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +2 -1
  197. package/lib/view/expenseAutomationView/types/jeSchedulesViewState.d.ts +5 -0
  198. package/lib/view/expenseAutomationView/types/jeSchedulesViewState.js +19 -0
  199. package/lib/view/expenseAutomationView/types/missingReceiptsViewState.d.ts +142 -0
  200. package/lib/view/expenseAutomationView/types/missingReceiptsViewState.js +54 -1
  201. package/lib/view/expenseAutomationView/types/transactionsViewState.d.ts +2 -1
  202. package/lib/view/expenseAutomationView/types/transactionsViewState.js +2 -1
  203. package/lib/view/financeStatement/financeStatementReducer.js +11 -8
  204. package/lib/view/financeStatement/financeStatementSelector.d.ts +2 -0
  205. package/lib/view/financeStatement/financeStatementSelector.js +24 -9
  206. package/lib/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelector.d.ts +13 -0
  207. package/lib/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelector.js +326 -0
  208. package/lib/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelectorTypes.d.ts +111 -0
  209. package/lib/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelectorTypes.js +13 -0
  210. package/lib/view/profitAndLossClassesView/profitAndLossClassesViewReducer.d.ts +4 -2
  211. package/lib/view/profitAndLossClassesView/profitAndLossClassesViewReducer.js +7 -2
  212. package/lib/view/profitAndLossClassesView/profitAndLossClassesViewSelector.js +2 -29
  213. package/lib/view/profitAndLossClassesView/profitAndLossClassesViewState.d.ts +4 -0
  214. package/lib/view/profitAndLossClassesView/profitAndLossForTimeframeClassesViewEpic.js +7 -5
  215. package/lib/view/profitAndLossClassesView/profitAndLossHorizontalEnrichment.d.ts +6 -0
  216. package/lib/view/profitAndLossClassesView/profitAndLossHorizontalEnrichment.js +204 -0
  217. package/lib/view/reportUIOptions/updateReportUIOptionCOABalancesRangeEpic.js +8 -6
  218. package/lib/view/scheduleView/scheduleListView/scheduleListTypes.d.ts +1 -1
  219. package/lib/view/spendManagement/billPay/billList/billListSelector.js +10 -0
  220. package/lib/view/spendManagement/billPay/billList/billListState.d.ts +1 -1
  221. package/lib/view/spendManagement/billPay/billList/billListState.js +1 -0
  222. package/lib/view/spendManagement/billPay/billPayReview/billPayReviewSelector.js +7 -3
  223. package/lib/view/spendManagement/billPay/billPaySetupApproverView/billPaySetupApproverViewSelector.js +5 -5
  224. package/lib/view/spendManagement/billPay/billPaySetupApproverView/epic/fetchBillPayApproversDetailsEpic.js +7 -2
  225. package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.js +13 -6
  226. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardList.d.ts +1 -1
  227. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardList.js +1 -0
  228. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.js +2 -0
  229. package/lib/view/spendManagement/reimbursement/editRemiView/editRemiViewSelector.js +6 -3
  230. package/lib/view/spendManagement/reimbursement/remiListView/remiListSelector.d.ts +1 -0
  231. package/lib/view/spendManagement/reimbursement/remiListView/remiListSelector.js +12 -0
  232. package/lib/view/spendManagement/reimbursement/remiListView/remiListState.d.ts +1 -1
  233. package/lib/view/spendManagement/reimbursement/remiListView/remiListState.js +1 -0
  234. package/lib/view/taskManager/taskDetailView/taskDetailSelector.js +3 -3
  235. package/lib/view/taskManager/taskListView/epics/bulkUpdateTaskListEpic.d.ts +1 -0
  236. package/lib/view/taskManager/taskListView/epics/bulkUpdateTaskListEpic.js +1 -0
  237. package/lib/view/taskManager/taskListView/taskListSelector.d.ts +2 -0
  238. package/lib/view/taskManager/taskListView/taskListSelector.js +3 -1
  239. package/lib/view/transactionDetail/epics/saveTransactionHelper.js +2 -2
  240. package/lib/view/transactionDetail/transactionDetailLocalDataHelper.js +16 -14
  241. package/lib/view/userGroupListView/userGroupListViewReducer.d.ts +23 -0
  242. package/lib/view/userGroupListView/userGroupListViewReducer.js +69 -0
  243. package/lib/view/userGroupListView/userGroupListViewSelector.d.ts +7 -0
  244. package/lib/view/userGroupListView/userGroupListViewSelector.js +20 -0
  245. package/lib/view/userGroupListView/userGroupListViewState.d.ts +8 -0
  246. package/lib/view/userGroupListView/userGroupListViewState.js +2 -0
  247. package/lib/view/userListView/fetchUserListByTypeEpic.d.ts +3 -1
  248. package/lib/view/userListView/fetchUserListByTypeEpic.js +11 -0
  249. package/lib/view/userListView/userListViewPayload.d.ts +2 -0
  250. package/lib/zeniAPI.js +0 -2
  251. package/package.json +2 -2
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  var _a;
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.backgroundRefetchReviewTab = exports.syncTransactionCategorizationFromDetailSave = exports.updateSelectedTransactionId = exports.setEntityRecommendationForLineIdsForCategorization = exports.clearExpenseAutomationTransactionsView = exports.clearExpenseAutomationTransactionsViewPerTabView = exports.updateSelectedCheckboxTransactionIds = exports.fetchTransactionCategorizationView = exports.resetOtherTabsFetchState = exports.fetchTransactionCategorizationSuccess = exports.updateTotalCountForTransactionCategorization = exports.setAllItemsToCategoryClassInLocalDataForCategorization = exports.updateSelectedCustomerForTransaction = exports.updateSelectedVendorForTransaction = exports.updateStatusForTransactionNotMiscategorizedUpdateForCategorization = exports.markTransactionAsNotMiscategorized = exports.updateTransactionCategorizationSaveStatus = exports.updateCurrentSelectedTransactionCategorizationTab = exports.updateTransactionCategorization = exports.saveTransactionCategorization = exports.fetchTransactionCategorizationFailure = exports.saveTransactionCategorizationLocalData = exports.initializeTransactionCategorizationViewLocalData = exports.updateTransactionCategorizationUIState = exports.fetchTransactionCategorization = exports.initialState = exports.initialTransactionTabViewState = void 0;
7
+ exports.uploadTransactionCategorizationReceiptSuccess = exports.updateTransactionCategorizationUploadReceiptState = exports.backgroundRefetchReviewTab = exports.syncTransactionCategorizationFromDetailSave = exports.updateSelectedTransactionId = exports.setEntityRecommendationForLineIdsForCategorization = exports.clearExpenseAutomationTransactionsView = exports.clearExpenseAutomationTransactionsViewPerTabView = exports.updateSelectedCheckboxTransactionIds = exports.fetchTransactionCategorizationView = exports.resetOtherTabsFetchState = exports.fetchTransactionCategorizationSuccess = exports.updateTotalCountForTransactionCategorization = exports.setAllItemsToCategoryClassInLocalDataForCategorization = exports.updateSelectedCustomerForTransaction = exports.updateSelectedVendorForTransaction = exports.updateStatusForTransactionNotMiscategorizedUpdateForCategorization = exports.markTransactionAsNotMiscategorized = exports.updateTransactionCategorizationSaveStatus = exports.updateCurrentSelectedTransactionCategorizationTab = exports.updateTransactionCategorization = exports.saveTransactionCategorization = exports.fetchTransactionCategorizationFailure = exports.saveTransactionCategorizationLocalData = exports.initializeTransactionCategorizationViewLocalData = exports.updateTransactionCategorizationUIState = exports.fetchTransactionCategorization = exports.initialState = exports.initialTransactionTabViewState = void 0;
8
8
  const toolkit_1 = require("@reduxjs/toolkit");
9
9
  const get_1 = __importDefault(require("lodash/get"));
10
10
  const uniq_1 = __importDefault(require("lodash/uniq"));
@@ -43,6 +43,7 @@ exports.initialTransactionTabViewState = {
43
43
  transactionIdsBySelectedPeriod: {},
44
44
  selectedCheckBoxTransactionIds: [],
45
45
  transactionIdsWithUnsavedData: [],
46
+ uploadReceiptStatusById: {},
46
47
  selectedTransactionId: undefined,
47
48
  selectedTransactionLineId: undefined,
48
49
  };
@@ -706,6 +707,27 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
706
707
  clearExpenseAutomationTransactionsView(draft) {
707
708
  Object.assign(draft, exports.initialState);
708
709
  },
710
+ updateTransactionCategorizationUploadReceiptState: {
711
+ reducer(draft, action) {
712
+ const { transactionId, fetchStatus, selectedTab } = action.payload;
713
+ draft.transactionCategorizationView[selectedTab].uploadReceiptStatusById[transactionId] = fetchStatus;
714
+ },
715
+ prepare(selectedTab, transactionId, fetchStatus) {
716
+ return { payload: { selectedTab, transactionId, fetchStatus } };
717
+ },
718
+ },
719
+ uploadTransactionCategorizationReceiptSuccess: {
720
+ reducer(draft, action) {
721
+ const { transactionPayload, selectedTab } = action.payload;
722
+ draft.transactionCategorizationView[selectedTab].uploadReceiptStatusById[transactionPayload.transaction_id] = {
723
+ fetchState: 'Completed',
724
+ error: undefined,
725
+ };
726
+ },
727
+ prepare(selectedTab, transactionPayload, updateType = 'merge') {
728
+ return { payload: { selectedTab, transactionPayload, updateType } };
729
+ },
730
+ },
709
731
  syncTransactionCategorizationFromDetailSave: {
710
732
  prepare(transactionId, updatedTransaction, pendingReviewLineIds, uncategorizedIncomeExpense, isUncategorizedExpenseCategoryEnabled) {
711
733
  return {
@@ -777,5 +799,5 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
777
799
  },
778
800
  },
779
801
  });
780
- _a = expenseAutomationTransactionsView.actions, exports.fetchTransactionCategorization = _a.fetchTransactionCategorization, exports.updateTransactionCategorizationUIState = _a.updateTransactionCategorizationUIState, exports.initializeTransactionCategorizationViewLocalData = _a.initializeTransactionCategorizationViewLocalData, exports.saveTransactionCategorizationLocalData = _a.saveTransactionCategorizationLocalData, exports.fetchTransactionCategorizationFailure = _a.fetchTransactionCategorizationFailure, exports.saveTransactionCategorization = _a.saveTransactionCategorization, exports.updateTransactionCategorization = _a.updateTransactionCategorization, exports.updateCurrentSelectedTransactionCategorizationTab = _a.updateCurrentSelectedTransactionCategorizationTab, exports.updateTransactionCategorizationSaveStatus = _a.updateTransactionCategorizationSaveStatus, exports.markTransactionAsNotMiscategorized = _a.markTransactionAsNotMiscategorized, exports.updateStatusForTransactionNotMiscategorizedUpdateForCategorization = _a.updateStatusForTransactionNotMiscategorizedUpdateForCategorization, exports.updateSelectedVendorForTransaction = _a.updateSelectedVendorForTransaction, exports.updateSelectedCustomerForTransaction = _a.updateSelectedCustomerForTransaction, exports.setAllItemsToCategoryClassInLocalDataForCategorization = _a.setAllItemsToCategoryClassInLocalDataForCategorization, exports.updateTotalCountForTransactionCategorization = _a.updateTotalCountForTransactionCategorization, exports.fetchTransactionCategorizationSuccess = _a.fetchTransactionCategorizationSuccess, exports.resetOtherTabsFetchState = _a.resetOtherTabsFetchState, exports.fetchTransactionCategorizationView = _a.fetchTransactionCategorizationView, exports.updateSelectedCheckboxTransactionIds = _a.updateSelectedCheckboxTransactionIds, exports.clearExpenseAutomationTransactionsViewPerTabView = _a.clearExpenseAutomationTransactionsViewPerTabView, exports.clearExpenseAutomationTransactionsView = _a.clearExpenseAutomationTransactionsView, exports.setEntityRecommendationForLineIdsForCategorization = _a.setEntityRecommendationForLineIdsForCategorization, exports.updateSelectedTransactionId = _a.updateSelectedTransactionId, exports.syncTransactionCategorizationFromDetailSave = _a.syncTransactionCategorizationFromDetailSave, exports.backgroundRefetchReviewTab = _a.backgroundRefetchReviewTab;
802
+ _a = expenseAutomationTransactionsView.actions, exports.fetchTransactionCategorization = _a.fetchTransactionCategorization, exports.updateTransactionCategorizationUIState = _a.updateTransactionCategorizationUIState, exports.initializeTransactionCategorizationViewLocalData = _a.initializeTransactionCategorizationViewLocalData, exports.saveTransactionCategorizationLocalData = _a.saveTransactionCategorizationLocalData, exports.fetchTransactionCategorizationFailure = _a.fetchTransactionCategorizationFailure, exports.saveTransactionCategorization = _a.saveTransactionCategorization, exports.updateTransactionCategorization = _a.updateTransactionCategorization, exports.updateCurrentSelectedTransactionCategorizationTab = _a.updateCurrentSelectedTransactionCategorizationTab, exports.updateTransactionCategorizationSaveStatus = _a.updateTransactionCategorizationSaveStatus, exports.markTransactionAsNotMiscategorized = _a.markTransactionAsNotMiscategorized, exports.updateStatusForTransactionNotMiscategorizedUpdateForCategorization = _a.updateStatusForTransactionNotMiscategorizedUpdateForCategorization, exports.updateSelectedVendorForTransaction = _a.updateSelectedVendorForTransaction, exports.updateSelectedCustomerForTransaction = _a.updateSelectedCustomerForTransaction, exports.setAllItemsToCategoryClassInLocalDataForCategorization = _a.setAllItemsToCategoryClassInLocalDataForCategorization, exports.updateTotalCountForTransactionCategorization = _a.updateTotalCountForTransactionCategorization, exports.fetchTransactionCategorizationSuccess = _a.fetchTransactionCategorizationSuccess, exports.resetOtherTabsFetchState = _a.resetOtherTabsFetchState, exports.fetchTransactionCategorizationView = _a.fetchTransactionCategorizationView, exports.updateSelectedCheckboxTransactionIds = _a.updateSelectedCheckboxTransactionIds, exports.clearExpenseAutomationTransactionsViewPerTabView = _a.clearExpenseAutomationTransactionsViewPerTabView, exports.clearExpenseAutomationTransactionsView = _a.clearExpenseAutomationTransactionsView, exports.setEntityRecommendationForLineIdsForCategorization = _a.setEntityRecommendationForLineIdsForCategorization, exports.updateSelectedTransactionId = _a.updateSelectedTransactionId, exports.syncTransactionCategorizationFromDetailSave = _a.syncTransactionCategorizationFromDetailSave, exports.backgroundRefetchReviewTab = _a.backgroundRefetchReviewTab, exports.updateTransactionCategorizationUploadReceiptState = _a.updateTransactionCategorizationUploadReceiptState, exports.uploadTransactionCategorizationReceiptSuccess = _a.uploadTransactionCategorizationReceiptSuccess;
781
803
  exports.default = expenseAutomationTransactionsView.reducer;
@@ -18,10 +18,12 @@ export interface ExpenseAutomationJESchedulesViewSelector extends SelectorView {
18
18
  allDepreciationAccountList: AccountBase[];
19
19
  allDepreciationAccountListNestedAccountHierarchy: NestedAccountHierarchyForReport[];
20
20
  classListNestedAccountHierarchy: NestedClassHierarchyForReport[];
21
+ completedSchedules: JEScheduledTransaction[];
21
22
  completionStatus: CompletionStatusType;
22
23
  draftSchedules: JEScheduledTransaction[];
23
24
  ignoreStatusById: Record<JEScheduleTransactionKey, FetchStateAndError>;
24
25
  jeScheduleLocalDataById: Record<ID, JEScheduleLocalData>;
26
+ ongoingSchedules: JEScheduledTransaction[];
25
27
  postStatusById: Record<ID, FetchStateAndError>;
26
28
  refreshStatus: FetchStateAndError;
27
29
  resolveSchedules: JEScheduledTransactionWithFailedEntries[];
@@ -1,9 +1,77 @@
1
1
  import { CompletionStatusType, FetchStateAndError, ID } from '../../../commonStateTypes/common';
2
+ import { SortOrder } from '../../../commonStateTypes/selectorTypes/sortOrderTypes';
2
3
  import { SelectorView } from '../../../commonStateTypes/viewAndReport/viewAndReport';
3
4
  import { SupportedTransaction } from '../../../entity/transaction/transactionState';
4
- import { MissingReceiptsViewUIState } from '../types/missingReceiptsViewState';
5
+ import type { BatchFileStatus, BatchListItem, BatchStatus, BulkUploadPhase, BulkUploadResultsTab, BulkUploadSortKey, CompletedSubTab, ManualSearchState, MatchSource, MissingReceiptsViewUIState } from '../types/missingReceiptsViewState';
6
+ export interface CompletedTransactionsSelectorData {
7
+ fetchState: FetchStateAndError;
8
+ nextPageToken: string | null;
9
+ totalCount: number;
10
+ transactions: SupportedTransaction[];
11
+ }
12
+ export interface ResolvedCandidate {
13
+ matchScore: number;
14
+ transaction: SupportedTransaction;
15
+ }
16
+ export interface ResolvedBatchFile {
17
+ attachmentId: ID;
18
+ batchId: ID;
19
+ fileDownloadUrl: string | null;
20
+ fileId: ID;
21
+ filename: string;
22
+ filePreviewUrl: string | null;
23
+ status: BatchFileStatus;
24
+ candidates?: ResolvedCandidate[];
25
+ matchedTransaction?: SupportedTransaction;
26
+ matchSource?: MatchSource;
27
+ }
28
+ export interface BulkUploadSelectorData {
29
+ batchDetails: ResolvedBatchDetails | undefined;
30
+ batchDetailsPaginationState: FetchStateAndError;
31
+ batchList: BatchListItem[];
32
+ batchListFetchState: FetchStateAndError;
33
+ batchStatus: BatchStatus | undefined;
34
+ completedSubTab: CompletedSubTab;
35
+ completedTransactions: CompletedTransactionsSelectorData;
36
+ confirmMatchStatus: FetchStateAndError;
37
+ currentResultsTab: BulkUploadResultsTab;
38
+ hasMoreBatchDetails: boolean;
39
+ manualSearch: ManualSearchState;
40
+ /** Bumps when manual search state is cleared — remount manual search inputs. */
41
+ manualSearchUiResetKey: number;
42
+ matchedFiles: ResolvedBatchFile[];
43
+ pastBatches: BatchListItem[];
44
+ pastUnmatchedFiles: ResolvedBatchFile[];
45
+ phase: BulkUploadPhase;
46
+ progress: {
47
+ percentage: number;
48
+ processed: number;
49
+ total: number;
50
+ };
51
+ sortKey: BulkUploadSortKey;
52
+ sortOrder: SortOrder;
53
+ unmatchedFiles: ResolvedBatchFile[];
54
+ uploadProgress: number;
55
+ uploadStatus: FetchStateAndError;
56
+ }
57
+ export interface ResolvedBatchDetails {
58
+ batchId: ID;
59
+ createdAt: string;
60
+ files: ResolvedBatchFile[];
61
+ status: string;
62
+ summary: {
63
+ failed: number;
64
+ matched: number;
65
+ noMatch: number;
66
+ possibleMatches: number;
67
+ total: number;
68
+ };
69
+ }
5
70
  export interface ExpenseAutomationMissingReceiptsViewSelector extends SelectorView {
71
+ bulkUpload: BulkUploadSelectorData;
6
72
  completionStatus: CompletionStatusType;
73
+ /** When set, UI should switch bulk-upload sub-tab once (e.g. Unmatched on batch completion). */
74
+ pendingMissingReceiptsTabNavigation: BulkUploadResultsTab | null;
7
75
  refreshStatus: FetchStateAndError;
8
76
  transactions: SupportedTransaction[];
9
77
  uiState: MissingReceiptsViewUIState;
@@ -28,6 +28,7 @@ export interface ExpenseAutomationTransactionViewSelector extends SelectorView {
28
28
  transactions: SupportedTransactionWithCOT[];
29
29
  uiState: TransactionsViewUIState;
30
30
  uncategorizedAccounts: UncategorizedAccounts;
31
+ uploadReceiptStatusById: Record<ID, FetchStateAndError>;
31
32
  selectedTransactionId?: ID;
32
33
  selectedTransactionLineId?: ID;
33
34
  }
@@ -5,6 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.getExpenseAutomationJESchedulesView = getExpenseAutomationJESchedulesView;
7
7
  const omit_1 = __importDefault(require("lodash/omit"));
8
+ const orderBy_1 = __importDefault(require("lodash/orderBy"));
8
9
  const timePeriod_1 = require("../../../commonStateTypes/timePeriod");
9
10
  const accountSelector_1 = require("../../../entity/account/accountSelector");
10
11
  const jeSchedulesSelector_1 = require("../../../entity/jeSchedules/jeSchedulesSelector");
@@ -16,6 +17,42 @@ const scheduleDetailSelector_1 = require("../../scheduleView/scheduleDetailView/
16
17
  const scheduleListHelper_1 = require("../../scheduleView/scheduleListView/scheduleListHelper");
17
18
  const expenseAutomationViewSelectorTypes_1 = require("../selectorTypes/expenseAutomationViewSelectorTypes");
18
19
  const jeAccountSettingsViewSelector_1 = require("./jeAccountSettingsViewSelector");
20
+ function getJEScheduleSortAccessor(sortKey) {
21
+ switch (sortKey) {
22
+ case 'vendor':
23
+ return (s) => s.vendor.name?.toLowerCase();
24
+ case 'category':
25
+ return (s) => s.jeDebit.account?.accountName?.toLowerCase();
26
+ case 'class':
27
+ return (s) => s.jeDebit.accountingClass?.className?.toLowerCase();
28
+ case 'scheduleCategory':
29
+ return (s) => s.jeScheduleType;
30
+ case 'startMonth':
31
+ return (s) => s.startDate?.valueOf();
32
+ case 'type':
33
+ return (s) => s.baseTransaction.typeOfTransaction;
34
+ case 'amortizationPeriod':
35
+ return (s) => s.period;
36
+ case 'jePostingDate':
37
+ return (s) => s.dayOfPostingDate;
38
+ case 'remainingMonths':
39
+ return (s) => s.period;
40
+ case 'runningBalance':
41
+ return (s) => s.balanceAsOfToday?.amount;
42
+ case 'totalAmount':
43
+ return (s) => s.baseTransaction.amount.amount;
44
+ case 'transactionDate':
45
+ return (s) => s.baseTransaction.date.valueOf();
46
+ case 'memo':
47
+ return (s) => s.baseTransaction.memo?.toLowerCase();
48
+ default:
49
+ return (s) => s.startDate?.valueOf();
50
+ }
51
+ }
52
+ function sortJEScheduledTransactions(transactions, sortKey, sortOrder) {
53
+ const accessor = getJEScheduleSortAccessor(sortKey);
54
+ return (0, orderBy_1.default)(transactions, [accessor], [sortOrder === 'ascending' ? 'asc' : 'desc']);
55
+ }
19
56
  function getExpenseAutomationJESchedulesView(state) {
20
57
  const jeScheduledTransaction = [];
21
58
  const failedJeScheduledTransaction = [];
@@ -65,13 +102,21 @@ function getExpenseAutomationJESchedulesView(state) {
65
102
  const jeScheduleDetails = (0, jeSchedulesSelector_1.getJEScheduledTransactionByJEScheduleTransactionKey)(jeScheduleKey, state);
66
103
  failedJeScheduledTransaction.push(jeScheduleDetails);
67
104
  });
68
- const draftSchedules = jeScheduledTransaction.filter((schedule) => schedule.status.code === 'draft');
69
- const resolveSchedules = [];
105
+ const { sortKey, sortOrder } = uiState;
106
+ const draftSchedules = sortJEScheduledTransactions(jeScheduledTransaction.filter((schedule) => schedule.status.code === 'draft'), sortKey, sortOrder);
107
+ const ongoingSchedules = sortJEScheduledTransactions(jeScheduledTransaction.filter((schedule) => schedule.status.code === 'ongoing'), sortKey, sortOrder);
108
+ const completedSchedules = sortJEScheduledTransactions(jeScheduledTransaction.filter((schedule) => schedule.status.code === 'completed' ||
109
+ schedule.status.code === 'marked_as_completed'), sortKey, sortOrder);
110
+ const unsortedResolveSchedules = [];
70
111
  failedJeScheduledTransaction.forEach((schedule) => {
71
112
  schedule.scheduledJournalEntry.forEach((journalEntry) => {
72
- resolveSchedules.push({ ...schedule, scheduledJournalEntry: journalEntry });
113
+ unsortedResolveSchedules.push({
114
+ ...schedule,
115
+ scheduledJournalEntry: journalEntry,
116
+ });
73
117
  });
74
118
  });
119
+ const resolveSchedules = sortJEScheduledTransactions(unsortedResolveSchedules, sortKey, sortOrder);
75
120
  const allSteps = monthYearPeriodId != null
76
121
  ? (0, expenseAutomationViewSelectorTypes_1.getAllSteps)(monthEndCloseChecksState, monthYearPeriodId, currentTenant.tenantId)
77
122
  : [];
@@ -85,7 +130,9 @@ function getExpenseAutomationJESchedulesView(state) {
85
130
  allAccountList: filteredAccounts,
86
131
  accountListNestedAccountHierarchy,
87
132
  allClassList: allClasses,
133
+ completedSchedules,
88
134
  draftSchedules,
135
+ ongoingSchedules,
89
136
  resolveSchedules: resolveSchedules,
90
137
  accountSettingsView,
91
138
  postStatusById: postStatusById,
@@ -1,3 +1,3 @@
1
1
  import { RootState } from '../../../reducer';
2
- import { ExpenseAutomationMissingReceiptsViewSelector } from '../selectorTypes/missingReceiptsSelectorTypes';
2
+ import type { ExpenseAutomationMissingReceiptsViewSelector } from '../selectorTypes/missingReceiptsSelectorTypes';
3
3
  export declare function getExpenseAutomationMissingReceiptsView(state: RootState): ExpenseAutomationMissingReceiptsViewSelector;
@@ -8,7 +8,10 @@ const orderBy_1 = __importDefault(require("lodash/orderBy"));
8
8
  const timePeriod_1 = require("../../../commonStateTypes/timePeriod");
9
9
  const tenantSelector_1 = require("../../../entity/tenant/tenantSelector");
10
10
  const transactionSelector_1 = require("../../../entity/transaction/transactionSelector");
11
+ const missingReceiptsPayload_1 = require("../payload/missingReceiptsPayload");
12
+ const missingReceiptsViewReducer_1 = require("../reducers/missingReceiptsViewReducer");
11
13
  const expenseAutomationViewSelectorTypes_1 = require("../selectorTypes/expenseAutomationViewSelectorTypes");
14
+ const missingReceiptsViewState_1 = require("../types/missingReceiptsViewState");
12
15
  function getExpenseAutomationMissingReceiptsView(state) {
13
16
  const { expenseAutomationMissingReceiptsViewState, expenseAutomationViewState, transactionState, monthEndCloseChecksState, } = state;
14
17
  const currentTenant = (0, tenantSelector_1.getCurrentTenant)(state);
@@ -39,7 +42,7 @@ function getExpenseAutomationMissingReceiptsView(state) {
39
42
  transaction.lines.length > 0 &&
40
43
  transaction.lines[0]
41
44
  ?.class != null
42
- ? transaction.lines[0].class.className.toLowerCase()
45
+ ? transaction.lines[0].class?.className.toLowerCase()
43
46
  : null;
44
47
  case 'vendor':
45
48
  default:
@@ -53,6 +56,131 @@ function getExpenseAutomationMissingReceiptsView(state) {
53
56
  const completionStatus = missingReceiptsCompletionStatus != null
54
57
  ? missingReceiptsCompletionStatus
55
58
  : 'incomplete';
59
+ const { bulkUpload, pendingMissingReceiptsTabNavigation } = expenseAutomationMissingReceiptsViewState;
60
+ const currentBatchStatus = bulkUpload.currentBatchId != null
61
+ ? bulkUpload.batchStatusById[bulkUpload.currentBatchId]
62
+ : undefined;
63
+ const batchList = monthYearPeriodId != null
64
+ ? (bulkUpload.batchListByPeriod[monthYearPeriodId] ?? [])
65
+ : [];
66
+ /**
67
+ * Primary "Unmatched" batch = first completed batch in platform list order, preferring the
68
+ * first batch that still has possible_matches/no_match work when any completed batch has such work.
69
+ * Batches without details yet: wait if the list row still reports unmatched work; otherwise skip
70
+ * so we do not block the whole tab while other rows are not fetched yet.
71
+ */
72
+ const primaryBatchIdFromDetailsOrder = getPrimaryBatchIdFromBatchListOrder(batchList, bulkUpload.batchDetailsById, bulkUpload.failedBatchDetailIds);
73
+ /**
74
+ * During upload/matching, prefer `currentBatchId` only when its batch details are loaded,
75
+ * completed, and still have unmatched-tab work. Otherwise keep `primaryBatchIdFromDetailsOrder`.
76
+ *
77
+ * If we pinned to `currentBatchId` as soon as it was absent from the batch list (in-flight
78
+ * upload), details are often not loaded yet — `unmatchedFiles` would empty while older batches
79
+ * moved to "past", so the primary "Unmatched Receipts" section vanished during auto-matching.
80
+ */
81
+ const unmatchedSectionBatchId = (() => {
82
+ const phase = bulkUpload.phase;
83
+ if (phase !== 'matching' && phase !== 'uploading') {
84
+ return primaryBatchIdFromDetailsOrder;
85
+ }
86
+ const currentId = bulkUpload.currentBatchId;
87
+ if (currentId == null) {
88
+ return primaryBatchIdFromDetailsOrder;
89
+ }
90
+ const currentDetails = bulkUpload.batchDetailsById[currentId];
91
+ if (currentDetails != null &&
92
+ currentDetails.status === 'completed' &&
93
+ batchDetailsHasUnmatchedWork(currentDetails)) {
94
+ return currentId;
95
+ }
96
+ return primaryBatchIdFromDetailsOrder;
97
+ })();
98
+ const completedBatchesInApiOrder = batchList.filter((batchListItem) => (0, missingReceiptsPayload_1.isBatchListStatusCompleted)(batchListItem.status));
99
+ const currentBatchDetails = unmatchedSectionBatchId != null
100
+ ? bulkUpload.batchDetailsById[unmatchedSectionBatchId]
101
+ : undefined;
102
+ const resolvedFiles = currentBatchDetails?.files.map((file) => resolveBatchFile(file, currentBatchDetails.batchId, transactionState));
103
+ const failedIds = new Set(bulkUpload.failedBatchDetailIds);
104
+ const hasMoreBatchDetails = completedBatchesInApiOrder.some((batchListItem) => bulkUpload.batchDetailsById[batchListItem.batchId] == null &&
105
+ !failedIds.has(batchListItem.batchId));
106
+ const getSortValue = (file) => {
107
+ const matchedTransaction = file.matchedTransaction;
108
+ if (matchedTransaction == null) {
109
+ return null;
110
+ }
111
+ switch (bulkUpload.sortKey) {
112
+ case 'vendor':
113
+ return ((matchedTransaction.vendorName ?? matchedTransaction.description)?.toLowerCase() ?? null);
114
+ case 'category': {
115
+ const line = matchedTransaction.lines?.[0];
116
+ return line?.account?.accountName?.toLowerCase() ?? null;
117
+ }
118
+ case 'class': {
119
+ const line = matchedTransaction.lines?.[0];
120
+ return line?.class?.className?.toLowerCase() ?? null;
121
+ }
122
+ case 'date':
123
+ return matchedTransaction.date.valueOf();
124
+ case 'amount':
125
+ return matchedTransaction.amount.amount;
126
+ default:
127
+ return null;
128
+ }
129
+ };
130
+ const bulkUploadSortDirection = bulkUpload.sortOrder === 'ascending' ? 'asc' : 'desc';
131
+ const matchedFiles = (0, orderBy_1.default)(resolvedFiles?.filter((resolvedFile) => resolvedFile.status === 'exact_match') ?? [], getSortValue, bulkUploadSortDirection);
132
+ const unmatchedFiles = (0, orderBy_1.default)(resolvedFiles?.filter((resolvedFile) => (0, missingReceiptsViewState_1.isUnmatchedTabFileStatus)(resolvedFile.status)) ?? [], getSortValue, bulkUploadSortDirection);
133
+ const progress = currentBatchStatus != null
134
+ ? {
135
+ ...currentBatchStatus.progress,
136
+ percentage: currentBatchStatus.progress.total > 0
137
+ ? Math.round((currentBatchStatus.progress.processed /
138
+ currentBatchStatus.progress.total) *
139
+ 100)
140
+ : 0,
141
+ }
142
+ : { total: 0, processed: 0, percentage: 0 };
143
+ const batchListFetchState = bulkUpload.batchListFetchState;
144
+ /**
145
+ * When primary batch is not resolved yet, still aggregate unmatched files from every batch
146
+ * that has details loaded (otherwise past is empty and receipts vanish from the UI).
147
+ */
148
+ const pastBatches = unmatchedSectionBatchId != null
149
+ ? batchList.filter((batchListItem) => batchListItem.batchId !== unmatchedSectionBatchId)
150
+ : batchList;
151
+ const pastUnmatchedFiles = pastBatches.flatMap((pastBatch) => {
152
+ const details = bulkUpload.batchDetailsById[pastBatch.batchId];
153
+ if (details == null) {
154
+ return [];
155
+ }
156
+ return details.files
157
+ .filter((batchFile) => (0, missingReceiptsViewState_1.isUnmatchedTabFileStatus)(batchFile.status))
158
+ .map((batchFile) => resolveBatchFile(batchFile, pastBatch.batchId, transactionState));
159
+ });
160
+ const completedTransactionsCacheKey = monthYearPeriodId != null
161
+ ? (0, missingReceiptsViewReducer_1.getCompletedTransactionsCacheKey)(monthYearPeriodId, bulkUpload.sortKey, bulkUpload.sortOrder, bulkUpload.completedSubTab)
162
+ : undefined;
163
+ const completedTransactionsForPeriod = completedTransactionsCacheKey != null
164
+ ? bulkUpload.completedTransactionsByPeriod[completedTransactionsCacheKey]
165
+ : undefined;
166
+ const completedTransactionIds = completedTransactionsForPeriod?.transactionIds ?? [];
167
+ const resolvedCompletedTransactions = (0, transactionSelector_1.getSupportedTransactionsByIds)(transactionState, completedTransactionIds);
168
+ const resolvedBatchDetails = currentBatchDetails != null && resolvedFiles != null
169
+ ? {
170
+ batchId: currentBatchDetails.batchId,
171
+ createdAt: currentBatchDetails.createdAt,
172
+ files: resolvedFiles,
173
+ status: currentBatchDetails.status,
174
+ summary: currentBatchDetails.summary,
175
+ }
176
+ : undefined;
177
+ const manualSearchResults = bulkUpload.manualSearch.results.map((result) => {
178
+ const transaction = (0, transactionSelector_1.getSupportedTransactionById)(transactionState, result.transactionId);
179
+ return {
180
+ ...result,
181
+ vendorLogo: result.vendorLogo ?? transaction?.logo?.href,
182
+ };
183
+ });
56
184
  return {
57
185
  fetchState,
58
186
  error,
@@ -61,5 +189,120 @@ function getExpenseAutomationMissingReceiptsView(state) {
61
189
  refreshStatus,
62
190
  transactions: sortedTransactions,
63
191
  completionStatus,
192
+ pendingMissingReceiptsTabNavigation: pendingMissingReceiptsTabNavigation ?? null,
193
+ bulkUpload: {
194
+ phase: bulkUpload.phase,
195
+ uploadStatus: bulkUpload.uploadStatus,
196
+ batchStatus: currentBatchStatus,
197
+ batchDetails: resolvedBatchDetails,
198
+ completedSubTab: bulkUpload.completedSubTab,
199
+ completedTransactions: {
200
+ fetchState: completedTransactionsForPeriod?.fetchState ?? {
201
+ fetchState: 'Not-Started',
202
+ error: undefined,
203
+ },
204
+ nextPageToken: completedTransactionsForPeriod?.nextPageToken ?? null,
205
+ totalCount: completedTransactionsForPeriod?.totalCount ?? 0,
206
+ transactions: resolvedCompletedTransactions,
207
+ },
208
+ matchedFiles,
209
+ unmatchedFiles,
210
+ progress,
211
+ currentResultsTab: bulkUpload.currentResultsTab,
212
+ sortKey: bulkUpload.sortKey,
213
+ sortOrder: bulkUpload.sortOrder,
214
+ batchList,
215
+ batchListFetchState,
216
+ pastBatches,
217
+ pastUnmatchedFiles,
218
+ confirmMatchStatus: bulkUpload.confirmMatchStatus,
219
+ manualSearchUiResetKey: bulkUpload.manualSearchUiResetKey,
220
+ hasMoreBatchDetails,
221
+ batchDetailsPaginationState: bulkUpload.batchDetailsPaginationState,
222
+ manualSearch: {
223
+ ...bulkUpload.manualSearch,
224
+ results: manualSearchResults,
225
+ },
226
+ uploadProgress: bulkUpload.uploadProgress,
227
+ },
228
+ };
229
+ }
230
+ function batchDetailsHasUnmatchedWork(details) {
231
+ return details.files.some((file) => (0, missingReceiptsViewState_1.isUnmatchedTabFileStatus)(file.status));
232
+ }
233
+ /** List row summary before batch details load — aligns with unmatched / possible-match work. */
234
+ function batchListItemHasUnmatchedWork(batch) {
235
+ return batch.noMatchCount > 0 || batch.possibleMatchesCount > 0;
236
+ }
237
+ /**
238
+ * `batchList` must match platform order (same sequence as the bulk-upload batches API). Picks the
239
+ * primary batch for the top "Unmatched" section. Skips failed detail fetches.
240
+ *
241
+ * If details are not loaded for an earlier list row but that row reports no unmatched work, we
242
+ * skip it so later rows with loaded details can be primary (avoids an empty tab when the first
243
+ * fetch page only loaded later batches). If the list reports unmatched work but details are still
244
+ * loading, we wait (undefined) so primary order stays correct once details arrive.
245
+ */
246
+ function getPrimaryBatchIdFromBatchListOrder(batchListInPlatformOrder, batchDetailsById, failedBatchDetailIds) {
247
+ const failedIds = new Set(failedBatchDetailIds);
248
+ const anyCompletedBatchHasUnmatchedWork = batchListInPlatformOrder.some((batch) => {
249
+ if (failedIds.has(batch.batchId)) {
250
+ return false;
251
+ }
252
+ const details = batchDetailsById[batch.batchId];
253
+ if (details != null &&
254
+ details.status === 'completed' &&
255
+ batchDetailsHasUnmatchedWork(details)) {
256
+ return true;
257
+ }
258
+ return details == null && batchListItemHasUnmatchedWork(batch);
259
+ });
260
+ for (const batch of batchListInPlatformOrder) {
261
+ if (failedIds.has(batch.batchId)) {
262
+ continue;
263
+ }
264
+ const details = batchDetailsById[batch.batchId];
265
+ if (details == null) {
266
+ if (batchListItemHasUnmatchedWork(batch)) {
267
+ return undefined;
268
+ }
269
+ continue;
270
+ }
271
+ if (details.status !== 'completed') {
272
+ continue;
273
+ }
274
+ if (anyCompletedBatchHasUnmatchedWork) {
275
+ if (batchDetailsHasUnmatchedWork(details)) {
276
+ return batch.batchId;
277
+ }
278
+ continue;
279
+ }
280
+ return batch.batchId;
281
+ }
282
+ return undefined;
283
+ }
284
+ function resolveBatchFile(file, batchId, transactionState) {
285
+ const matchedTransaction = file.matchedTransactionId != null
286
+ ? (0, transactionSelector_1.getSupportedTransactionById)(transactionState, file.matchedTransactionId)
287
+ : undefined;
288
+ const candidates = file.candidates
289
+ ?.map((ref) => {
290
+ const transaction = (0, transactionSelector_1.getSupportedTransactionById)(transactionState, ref.transactionId);
291
+ return transaction != null
292
+ ? { transaction, matchScore: ref.matchScore }
293
+ : undefined;
294
+ })
295
+ .filter((candidate) => candidate != null);
296
+ return {
297
+ attachmentId: file.attachmentId,
298
+ batchId,
299
+ fileDownloadUrl: file.fileDownloadUrl,
300
+ fileId: file.fileId,
301
+ filename: file.filename,
302
+ filePreviewUrl: file.filePreviewUrl,
303
+ status: file.status,
304
+ matchedTransaction,
305
+ candidates: candidates != null && candidates.length > 0 ? candidates : undefined,
306
+ matchSource: file.matchSource,
64
307
  };
65
308
  }
@@ -16,7 +16,7 @@ const expenseAutomationViewSelectorTypes_1 = require("../selectorTypes/expenseAu
16
16
  function getExpenseAutomationTransactionView(state) {
17
17
  const { accountState, classState, classListState, accountListState, expenseAutomationTransactionsViewState, expenseAutomationViewState, transactionState, monthEndCloseChecksState, } = state;
18
18
  const { selectedTransactionCategorizationTab } = expenseAutomationTransactionsViewState;
19
- const { uiState, refreshStatus, saveStatus, markAsNotMiscategorizedStatus, transactionIdsBySelectedPeriod, transactionReviewLocalDataById, selectedCheckBoxTransactionIds, transactionIdsWithUnsavedData, selectedTransactionId, selectedTransactionLineId, } = expenseAutomationTransactionsViewState.transactionCategorizationView[selectedTransactionCategorizationTab];
19
+ const { uiState, refreshStatus, saveStatus, markAsNotMiscategorizedStatus, transactionIdsBySelectedPeriod, transactionReviewLocalDataById, selectedCheckBoxTransactionIds, transactionIdsWithUnsavedData, uploadReceiptStatusById, selectedTransactionId, selectedTransactionLineId, } = expenseAutomationTransactionsViewState.transactionCategorizationView[selectedTransactionCategorizationTab];
20
20
  const uncategorizedIncomeExpense = (0, accountListSelector_1.getUncategorizedAccounts)(accountState, accountListState, 'accountList');
21
21
  const accountList = (0, accountListSelector_1.getAccountList)(accountState, accountListState, 'accountList');
22
22
  const classList = (0, classListSelector_1.getClassList)(classState, classListState);
@@ -100,6 +100,7 @@ function getExpenseAutomationTransactionView(state) {
100
100
  completionStatus,
101
101
  totalCountByTab,
102
102
  fetchStateByTransactionTabs: fetchStateByTab,
103
+ uploadReceiptStatusById,
103
104
  selectedTransactionId,
104
105
  selectedTransactionLineId,
105
106
  };
@@ -1,16 +1,21 @@
1
1
  import { NestedAccountHierarchyForReport } from '../../../commonStateTypes/accountView/nestedAccountID';
2
2
  import { FetchStateAndError, FetchedState, ID } from '../../../commonStateTypes/common';
3
3
  import { Recommendation } from '../../../commonStateTypes/recommendationBase';
4
+ import { SortOrder } from '../../../commonStateTypes/selectorTypes/sortOrderTypes';
4
5
  import { MonthYearPeriodId } from '../../../commonStateTypes/timePeriod';
5
6
  import { AccountBase } from '../../../entity/account/accountState';
6
7
  import { JEScheduleTransactionKey, ScheduleTypes } from '../../../entity/jeSchedules/jeSchedulesTypes';
7
8
  import { VendorBase } from '../../../entity/vendor/vendorState';
9
+ export declare const toJEScheduleSortKey: (v: string) => "vendor" | "type" | "category" | "class" | "memo" | "transactionDate" | "totalAmount" | "runningBalance" | "scheduleCategory" | "startMonth" | "amortizationPeriod" | "jePostingDate" | "remainingMonths";
10
+ export type JEScheduleSortKey = ReturnType<typeof toJEScheduleSortKey>;
8
11
  export interface JESchedulesViewUIState {
9
12
  scrollPosition: {
10
13
  scrollTop: number;
11
14
  scrollLeft?: number;
12
15
  } | undefined;
13
16
  searchString: string;
17
+ sortKey: JEScheduleSortKey;
18
+ sortOrder: SortOrder;
14
19
  totalCount: number;
15
20
  limit?: number;
16
21
  }
@@ -1,2 +1,21 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.toJEScheduleSortKey = void 0;
4
+ const stringToUnion_1 = require("../../../commonStateTypes/stringToUnion");
5
+ const JE_SCHEDULE_SORT_KEYS = [
6
+ 'vendor',
7
+ 'category',
8
+ 'class',
9
+ 'scheduleCategory',
10
+ 'startMonth',
11
+ 'type',
12
+ 'amortizationPeriod',
13
+ 'jePostingDate',
14
+ 'remainingMonths',
15
+ 'runningBalance',
16
+ 'totalAmount',
17
+ 'transactionDate',
18
+ 'memo',
19
+ ];
20
+ const toJEScheduleSortKey = (v) => (0, stringToUnion_1.stringToUnion)(v, JE_SCHEDULE_SORT_KEYS);
21
+ exports.toJEScheduleSortKey = toJEScheduleSortKey;