@zeniai/client-epic-state 5.2.41-beta5MM → 5.2.41-beta7MM

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 (196) hide show
  1. package/lib/entity/billPay/billTransaction/billTransactionReducer.d.ts +5 -1
  2. package/lib/entity/billPay/billTransaction/billTransactionReducer.js +17 -2
  3. package/lib/entity/invoicing/coupon/couponPayload.d.ts +8 -0
  4. package/lib/entity/invoicing/coupon/couponPayload.js +8 -0
  5. package/lib/entity/invoicing/coupon/couponState.d.ts +6 -0
  6. package/lib/entity/invoicing/dunningCase/dunningCaseTypes.d.ts +1 -1
  7. package/lib/entity/invoicing/plan/planSelector.d.ts +20 -0
  8. package/lib/entity/invoicing/plan/planSelector.js +42 -0
  9. package/lib/entity/invoicing/product/productPayload.d.ts +8 -1
  10. package/lib/entity/invoicing/product/productPayload.js +4 -1
  11. package/lib/entity/invoicing/product/productState.d.ts +16 -0
  12. package/lib/entity/jeSchedules/jeSchedulesReducer.d.ts +4 -1
  13. package/lib/entity/jeSchedules/jeSchedulesReducer.js +79 -5
  14. package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
  15. package/lib/entity/snackbar/snackbarTypes.js +1 -0
  16. package/lib/entity/task/taskState.d.ts +1 -1
  17. package/lib/epic.d.ts +4 -1
  18. package/lib/epic.js +10 -4
  19. package/lib/esm/entity/billPay/billTransaction/billTransactionReducer.js +16 -1
  20. package/lib/esm/entity/invoicing/coupon/couponPayload.js +8 -0
  21. package/lib/esm/entity/invoicing/plan/planSelector.js +39 -0
  22. package/lib/esm/entity/invoicing/product/productPayload.js +4 -1
  23. package/lib/esm/entity/jeSchedules/jeSchedulesReducer.js +78 -4
  24. package/lib/esm/entity/snackbar/snackbarTypes.js +1 -0
  25. package/lib/esm/epic.js +10 -4
  26. package/lib/esm/index.js +8 -7
  27. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/actualMatching/ignoreActualMatchingSuggestionEpic.js +3 -2
  28. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/fetchFailedJePostingsEpic.js +39 -0
  29. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulePageEpic.js +14 -1
  30. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +10 -13
  31. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/initializeJeScheduleLocalDataEpic.js +38 -17
  32. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/retryJeSchedulesEpic.js +17 -1
  33. package/lib/esm/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationEpic.js +15 -4
  34. package/lib/esm/view/expenseAutomationView/reducers/actualMatchingViewReducer.js +6 -0
  35. package/lib/esm/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +74 -1
  36. package/lib/esm/view/expenseAutomationView/reducers/reconciliationViewReducer.js +80 -53
  37. package/lib/esm/view/expenseAutomationView/reducers/transactionsViewReducer.js +10 -0
  38. package/lib/esm/view/expenseAutomationView/selectors/actualMatchingViewSelector.js +11 -2
  39. package/lib/esm/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +49 -14
  40. package/lib/esm/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +28 -11
  41. package/lib/esm/view/invoicing/createInvoice/createInvoiceSelector.js +28 -1
  42. package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewPayload.js +67 -35
  43. package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewReducer.js +22 -11
  44. package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewSelector.js +23 -4
  45. package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/invoicingCatalogItemFormHelper.js +1 -7
  46. package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/saveInvoicingCatalogItemEpic.js +19 -5
  47. package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/seedInvoicingCatalogItemFormDraftEpic.js +30 -7
  48. package/lib/esm/view/invoicing/editInvoicingCouponDetailView/editInvoicingCouponDetailViewPayload.js +16 -1
  49. package/lib/esm/view/invoicing/editInvoicingCouponDetailView/editInvoicingCouponDetailViewReducer.js +22 -11
  50. package/lib/esm/view/invoicing/editInvoicingCouponDetailView/editInvoicingCouponDetailViewSelector.js +69 -6
  51. package/lib/esm/view/invoicing/editInvoicingCouponDetailView/editInvoicingCouponDetailViewState.js +22 -0
  52. package/lib/esm/view/invoicing/editInvoicingCouponDetailView/fetchInvoicingCouponDetailPageEpic.js +22 -4
  53. package/lib/esm/view/invoicing/editInvoicingCouponDetailView/saveInvoicingCouponEpic.js +18 -4
  54. package/lib/esm/view/invoicing/editInvoicingCouponDetailView/seedInvoicingCouponFormDraftEpic.js +29 -6
  55. package/lib/esm/view/invoicing/editInvoicingCustomerDetailView/editInvoicingCustomerDetailViewReducer.js +28 -12
  56. package/lib/esm/view/invoicing/editInvoicingCustomerDetailView/editInvoicingCustomerDetailViewSelector.js +37 -2
  57. package/lib/esm/view/invoicing/editInvoicingCustomerDetailView/initializeInvoicingCustomerAddressEpic.js +43 -17
  58. package/lib/esm/view/invoicing/editInvoicingCustomerDetailView/saveInvoicingCustomerEpic.js +1 -1
  59. package/lib/esm/view/invoicing/editInvoicingCustomerDetailView/seedInvoicingCustomerFormDraftEpic.js +29 -6
  60. package/lib/esm/view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewReducer.js +30 -14
  61. package/lib/esm/view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewSelector.js +143 -8
  62. package/lib/esm/view/invoicing/editInvoicingSubscriptionDetailView/fetchInvoicingSubscriptionFormPageEpic.js +4 -1
  63. package/lib/esm/view/invoicing/editInvoicingSubscriptionDetailView/initializeInvoicingSubscriptionAddressEpic.js +44 -18
  64. package/lib/esm/view/invoicing/editInvoicingSubscriptionDetailView/saveInvoicingSubscriptionEpic.js +1 -1
  65. package/lib/esm/view/invoicing/editInvoicingSubscriptionDetailView/seedInvoicingSubscriptionFormDraftEpic.js +29 -8
  66. package/lib/esm/view/invoicing/invoicingCatalogListView/invoicingCatalogListViewSelector.js +12 -0
  67. package/lib/esm/view/invoicing/invoicingDunningCaseListView/invoicingDunningCaseListViewState.js +6 -6
  68. package/lib/esm/view/invoicing/invoicingFormDraft.js +78 -0
  69. package/lib/esm/view/invoicing/invoicingQboView/invoicingQboViewSelector.js +57 -9
  70. package/lib/esm/view/recommendation/recommendationPayload.js +3 -1
  71. package/lib/esm/view/recommendation/recommendationReducer.js +27 -7
  72. package/lib/esm/view/recommendation/recommendationSelector.js +1 -0
  73. package/lib/esm/view/recommendation/submitRecommendationFeedbackEpic.js +20 -8
  74. package/lib/esm/view/spendManagement/billPay/billDetailView/billDetailViewReducer.js +87 -1
  75. package/lib/esm/view/spendManagement/billPay/billDetailView/billDetailViewSelector.js +1 -0
  76. package/lib/esm/view/spendManagement/billPay/billDetailView/billDetailViewState.js +4 -0
  77. package/lib/esm/view/spendManagement/billPay/billDetailView/epics/fetchBillRecommendationsEpic.js +97 -0
  78. package/lib/esm/view/spendManagement/billPay/billDetailView/epics/fetchRecommendationsForBill.js +85 -0
  79. package/lib/esm/view/spendManagement/billPay/editBillView/editBillViewReducer.js +18 -1
  80. package/lib/esm/view/spendManagement/billPay/editBillView/editBillViewSelector.js +3 -0
  81. package/lib/esm/view/spendManagement/billPay/editBillView/epics/applyBillRecommendationsToLocalStoreEpic.js +95 -0
  82. package/lib/index.d.ts +9 -8
  83. package/lib/index.js +54 -48
  84. package/lib/view/expenseAutomationView/epics/jeSchedule/actualMatching/ignoreActualMatchingSuggestionEpic.js +3 -2
  85. package/lib/view/expenseAutomationView/epics/jeSchedule/fetchFailedJePostingsEpic.d.ts +20 -0
  86. package/lib/view/expenseAutomationView/epics/jeSchedule/fetchFailedJePostingsEpic.js +43 -0
  87. package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulePageEpic.d.ts +2 -2
  88. package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulePageEpic.js +13 -0
  89. package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +8 -11
  90. package/lib/view/expenseAutomationView/epics/jeSchedule/initializeJeScheduleLocalDataEpic.js +38 -17
  91. package/lib/view/expenseAutomationView/epics/jeSchedule/retryJeSchedulesEpic.d.ts +2 -2
  92. package/lib/view/expenseAutomationView/epics/jeSchedule/retryJeSchedulesEpic.js +17 -1
  93. package/lib/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationEpic.js +15 -4
  94. package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
  95. package/lib/view/expenseAutomationView/payload/jeSchedulesPayload.d.ts +18 -0
  96. package/lib/view/expenseAutomationView/payload/transactionCategorizationPayload.d.ts +18 -7
  97. package/lib/view/expenseAutomationView/reducers/actualMatchingViewReducer.js +6 -0
  98. package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.d.ts +10 -3
  99. package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +76 -3
  100. package/lib/view/expenseAutomationView/reducers/reconciliationViewReducer.js +80 -53
  101. package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.js +10 -0
  102. package/lib/view/expenseAutomationView/selectorTypes/actualMatchingViewSelectorTypes.d.ts +3 -0
  103. package/lib/view/expenseAutomationView/selectorTypes/jeSchedulesSelectorTypes.d.ts +3 -0
  104. package/lib/view/expenseAutomationView/selectorTypes/transactionsViewSelectorTypes.d.ts +8 -4
  105. package/lib/view/expenseAutomationView/selectors/actualMatchingViewSelector.d.ts +1 -0
  106. package/lib/view/expenseAutomationView/selectors/actualMatchingViewSelector.js +12 -2
  107. package/lib/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +49 -14
  108. package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +27 -10
  109. package/lib/view/expenseAutomationView/types/jeSchedulesViewState.d.ts +16 -0
  110. package/lib/view/expenseAutomationView/types/transactionsViewState.d.ts +8 -5
  111. package/lib/view/invoicing/createInvoice/createInvoiceSelector.d.ts +7 -2
  112. package/lib/view/invoicing/createInvoice/createInvoiceSelector.js +28 -1
  113. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewPayload.d.ts +46 -5
  114. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewPayload.js +69 -36
  115. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewReducer.d.ts +3 -1
  116. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewReducer.js +22 -11
  117. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewSelector.d.ts +17 -0
  118. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewSelector.js +22 -3
  119. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewState.d.ts +2 -1
  120. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/invoicingCatalogItemFormHelper.d.ts +2 -2
  121. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/invoicingCatalogItemFormHelper.js +1 -7
  122. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/saveInvoicingCatalogItemEpic.js +17 -3
  123. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/seedInvoicingCatalogItemFormDraftEpic.d.ts +10 -6
  124. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/seedInvoicingCatalogItemFormDraftEpic.js +29 -6
  125. package/lib/view/invoicing/editInvoicingCouponDetailView/editInvoicingCouponDetailViewPayload.d.ts +5 -1
  126. package/lib/view/invoicing/editInvoicingCouponDetailView/editInvoicingCouponDetailViewPayload.js +16 -1
  127. package/lib/view/invoicing/editInvoicingCouponDetailView/editInvoicingCouponDetailViewReducer.d.ts +3 -1
  128. package/lib/view/invoicing/editInvoicingCouponDetailView/editInvoicingCouponDetailViewReducer.js +22 -11
  129. package/lib/view/invoicing/editInvoicingCouponDetailView/editInvoicingCouponDetailViewSelector.d.ts +46 -0
  130. package/lib/view/invoicing/editInvoicingCouponDetailView/editInvoicingCouponDetailViewSelector.js +68 -5
  131. package/lib/view/invoicing/editInvoicingCouponDetailView/editInvoicingCouponDetailViewState.d.ts +21 -1
  132. package/lib/view/invoicing/editInvoicingCouponDetailView/editInvoicingCouponDetailViewState.js +24 -1
  133. package/lib/view/invoicing/editInvoicingCouponDetailView/fetchInvoicingCouponDetailPageEpic.d.ts +9 -5
  134. package/lib/view/invoicing/editInvoicingCouponDetailView/fetchInvoicingCouponDetailPageEpic.js +22 -4
  135. package/lib/view/invoicing/editInvoicingCouponDetailView/saveInvoicingCouponEpic.js +18 -4
  136. package/lib/view/invoicing/editInvoicingCouponDetailView/seedInvoicingCouponFormDraftEpic.d.ts +10 -6
  137. package/lib/view/invoicing/editInvoicingCouponDetailView/seedInvoicingCouponFormDraftEpic.js +28 -5
  138. package/lib/view/invoicing/editInvoicingCustomerDetailView/editInvoicingCustomerDetailViewReducer.d.ts +5 -1
  139. package/lib/view/invoicing/editInvoicingCustomerDetailView/editInvoicingCustomerDetailViewReducer.js +29 -13
  140. package/lib/view/invoicing/editInvoicingCustomerDetailView/editInvoicingCustomerDetailViewSelector.d.ts +16 -7
  141. package/lib/view/invoicing/editInvoicingCustomerDetailView/editInvoicingCustomerDetailViewSelector.js +37 -2
  142. package/lib/view/invoicing/editInvoicingCustomerDetailView/editInvoicingCustomerDetailViewState.d.ts +8 -1
  143. package/lib/view/invoicing/editInvoicingCustomerDetailView/initializeInvoicingCustomerAddressEpic.d.ts +15 -10
  144. package/lib/view/invoicing/editInvoicingCustomerDetailView/initializeInvoicingCustomerAddressEpic.js +42 -16
  145. package/lib/view/invoicing/editInvoicingCustomerDetailView/saveInvoicingCustomerEpic.js +1 -1
  146. package/lib/view/invoicing/editInvoicingCustomerDetailView/seedInvoicingCustomerFormDraftEpic.d.ts +10 -6
  147. package/lib/view/invoicing/editInvoicingCustomerDetailView/seedInvoicingCustomerFormDraftEpic.js +28 -5
  148. package/lib/view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewReducer.d.ts +5 -1
  149. package/lib/view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewReducer.js +31 -15
  150. package/lib/view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewSelector.d.ts +79 -12
  151. package/lib/view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewSelector.js +145 -9
  152. package/lib/view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewState.d.ts +8 -1
  153. package/lib/view/invoicing/editInvoicingSubscriptionDetailView/fetchInvoicingSubscriptionFormPageEpic.js +4 -1
  154. package/lib/view/invoicing/editInvoicingSubscriptionDetailView/initializeInvoicingSubscriptionAddressEpic.d.ts +15 -11
  155. package/lib/view/invoicing/editInvoicingSubscriptionDetailView/initializeInvoicingSubscriptionAddressEpic.js +42 -16
  156. package/lib/view/invoicing/editInvoicingSubscriptionDetailView/saveInvoicingSubscriptionEpic.js +1 -1
  157. package/lib/view/invoicing/editInvoicingSubscriptionDetailView/seedInvoicingSubscriptionFormDraftEpic.d.ts +10 -6
  158. package/lib/view/invoicing/editInvoicingSubscriptionDetailView/seedInvoicingSubscriptionFormDraftEpic.js +28 -7
  159. package/lib/view/invoicing/invoicingCatalogListView/invoicingCatalogListViewSelector.d.ts +10 -0
  160. package/lib/view/invoicing/invoicingCatalogListView/invoicingCatalogListViewSelector.js +12 -0
  161. package/lib/view/invoicing/invoicingDunningCaseListView/invoicingDunningCaseListViewReducer.d.ts +1 -1
  162. package/lib/view/invoicing/invoicingDunningCaseListView/invoicingDunningCaseListViewState.d.ts +2 -2
  163. package/lib/view/invoicing/invoicingDunningCaseListView/invoicingDunningCaseListViewState.js +6 -6
  164. package/lib/view/invoicing/invoicingFormDraft.d.ts +63 -0
  165. package/lib/view/invoicing/invoicingFormDraft.js +86 -0
  166. package/lib/view/invoicing/invoicingQboView/invoicingQboViewSelector.d.ts +49 -0
  167. package/lib/view/invoicing/invoicingQboView/invoicingQboViewSelector.js +59 -10
  168. package/lib/view/invoicing/invoicingSubscriptionListView/invoicingSubscriptionListViewReducer.d.ts +1 -1
  169. package/lib/view/invoicing/invoicingSubscriptionListView/invoicingSubscriptionListViewState.d.ts +1 -1
  170. package/lib/view/recommendation/recommendationPayload.d.ts +1 -0
  171. package/lib/view/recommendation/recommendationPayload.js +5 -0
  172. package/lib/view/recommendation/recommendationReducer.d.ts +7 -1
  173. package/lib/view/recommendation/recommendationReducer.js +28 -8
  174. package/lib/view/recommendation/recommendationSelector.d.ts +2 -0
  175. package/lib/view/recommendation/recommendationSelector.js +3 -1
  176. package/lib/view/recommendation/recommendationState.d.ts +2 -1
  177. package/lib/view/recommendation/submitRecommendationFeedbackEpic.d.ts +2 -2
  178. package/lib/view/recommendation/submitRecommendationFeedbackEpic.js +18 -6
  179. package/lib/view/spendManagement/billPay/billDetailView/billDetailViewPayload.d.ts +19 -0
  180. package/lib/view/spendManagement/billPay/billDetailView/billDetailViewReducer.d.ts +10 -1
  181. package/lib/view/spendManagement/billPay/billDetailView/billDetailViewReducer.js +88 -2
  182. package/lib/view/spendManagement/billPay/billDetailView/billDetailViewSelector.d.ts +1 -0
  183. package/lib/view/spendManagement/billPay/billDetailView/billDetailViewSelector.js +1 -0
  184. package/lib/view/spendManagement/billPay/billDetailView/billDetailViewState.d.ts +7 -0
  185. package/lib/view/spendManagement/billPay/billDetailView/billDetailViewState.js +4 -0
  186. package/lib/view/spendManagement/billPay/billDetailView/epics/fetchBillRecommendationsEpic.d.ts +37 -0
  187. package/lib/view/spendManagement/billPay/billDetailView/epics/fetchBillRecommendationsEpic.js +104 -0
  188. package/lib/view/spendManagement/billPay/billDetailView/epics/fetchRecommendationsForBill.d.ts +24 -0
  189. package/lib/view/spendManagement/billPay/billDetailView/epics/fetchRecommendationsForBill.js +92 -0
  190. package/lib/view/spendManagement/billPay/editBillView/editBillViewReducer.d.ts +4 -1
  191. package/lib/view/spendManagement/billPay/editBillView/editBillViewReducer.js +19 -2
  192. package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.d.ts +1 -0
  193. package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.js +3 -0
  194. package/lib/view/spendManagement/billPay/editBillView/epics/applyBillRecommendationsToLocalStoreEpic.d.ts +18 -0
  195. package/lib/view/spendManagement/billPay/editBillView/epics/applyBillRecommendationsToLocalStoreEpic.js +102 -0
  196. package/package.json +2 -2
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  var _a;
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.saveNewScheduleFailure = exports.saveNewSchedule = exports.saveAccountSettingsSuccess = exports.saveAccountSettingsLocalData = exports.saveAccountSettingsFailure = exports.saveAccountSettings = exports.retryJeScheduleSuccess = exports.retryJeScheduleFailure = exports.retryJeSchedule = exports.resetNewScheduleLocalData = exports.removeJeScheduleTransactionKey = exports.removeJeAccruedScheduleKey = exports.removeJeScheduleLocalDataById = exports.removeJeOneTimeAccrualLocalData = exports.removeFailedJeScheduleTransactionKey = exports.initializeNewSchedule = exports.initializeJeScheduleLocalData = exports.initializeAccountSettingsView = exports.ignoreRecommendedJeScheduleSuccess = exports.ignoreRecommendedJeScheduleFailure = exports.ignoreRecommendedJeSchedule = exports.fetchRecommendationForAccountSettings = exports.fetchOneTimeAccrualSuccess = exports.fetchOneTimeAccrualFailure = exports.fetchOneTimeAccrual = exports.fetchJeSchedulesSuccess = exports.fetchJeSchedulesPage = exports.fetchJeSchedulesFailure = exports.fetchJeSchedules = exports.fetchAccountSettingsListForAccountTypes = exports.revertOneTimeAccrual = exports.revertJeScheduleSuccess = exports.revertJeScheduleFailure = exports.revertJeSchedule = exports.promoteOneTimeAccrual = exports.oneTimeAccrualActionSuccess = exports.oneTimeAccrualActionFailure = exports.ignoreOneTimeAccrual = exports.createOneTimeAccrualSuccess = exports.createOneTimeAccrualFailure = exports.createOneTimeAccrual = exports.clearSearchTransactionsForNewSchedule = exports.clearJeScheduleLocalData = exports.clearJeAccountSettingsLocalData = exports.clearExpenseAutomationJESchedulesView = exports.initialState = exports.searchTransactionsInitialState = exports.newScheduleInitialState = exports.getBaseNewScheduleLocalData = exports.accountSettingsInitialState = void 0;
5
- exports.updateRecommendationForAccountSettingsFailure = exports.updateRecommendationForAccountSettings = exports.updateNewScheduleLocalData = exports.updateJeScheduleTransactionKeys = exports.updateJeScheduleLocalDataById = exports.updateJeOneTimeAccrualLocalData = exports.updateJEScheduleTypeFilter = exports.updateJESchedulesUIState = exports.updateAccountSettingsListForAccountTypesFailure = exports.updateAccountSettingsListForAccountTypes = exports.toggleJEPendingGroupCollapsed = exports.toggleJECreatedGroupCollapsed = exports.searchTransactionsForNewScheduleSuccess = exports.searchTransactionsForNewScheduleFailure = exports.searchTransactionsForNewSchedule = exports.saveNewScheduleSuccess = void 0;
4
+ exports.saveAccountSettingsLocalData = exports.saveAccountSettingsFailure = exports.saveAccountSettings = exports.retryJeScheduleSuccess = exports.retryJeScheduleFailure = exports.retryJeSchedule = exports.resetNewScheduleLocalData = exports.removeJeScheduleTransactionKey = exports.removeJeAccruedScheduleKey = exports.removeJeScheduleLocalDataById = exports.removeJeOneTimeAccrualLocalData = exports.removeFailedJeScheduleTransactionKey = exports.initializeNewSchedule = exports.initializeJeScheduleLocalData = exports.initializeAccountSettingsView = exports.ignoreRecommendedJeScheduleSuccess = exports.ignoreRecommendedJeScheduleFailure = exports.ignoreRecommendedJeSchedule = exports.fetchRecommendationForAccountSettings = exports.fetchOneTimeAccrualSuccess = exports.fetchOneTimeAccrualFailure = exports.fetchOneTimeAccrual = exports.fetchJeSchedulesSuccess = exports.fetchJeSchedulesPage = exports.fetchJeSchedulesFailure = exports.fetchFailedJePostingsSuccess = exports.fetchFailedJePostingsFailure = exports.fetchFailedJePostings = exports.fetchJeSchedules = exports.fetchAccountSettingsListForAccountTypes = exports.revertOneTimeAccrual = exports.revertJeScheduleSuccess = exports.revertJeScheduleFailure = exports.revertJeSchedule = exports.promoteOneTimeAccrual = exports.oneTimeAccrualActionSuccess = exports.oneTimeAccrualActionFailure = exports.ignoreOneTimeAccrual = exports.createOneTimeAccrualSuccess = exports.createOneTimeAccrualFailure = exports.createOneTimeAccrual = exports.clearSearchTransactionsForNewSchedule = exports.clearJeScheduleLocalData = exports.clearJeAccountSettingsLocalData = exports.clearExpenseAutomationJESchedulesView = exports.initialState = exports.searchTransactionsInitialState = exports.newScheduleInitialState = exports.getBaseNewScheduleLocalData = exports.accountSettingsInitialState = void 0;
5
+ exports.updateRecommendationForAccountSettingsFailure = exports.updateRecommendationForAccountSettings = exports.updateNewScheduleLocalData = exports.updateJeScheduleTransactionKeys = exports.updateJeScheduleLocalDataById = exports.updateJeOneTimeAccrualLocalData = exports.updateJEScheduleTypeFilter = exports.updateJESchedulesUIState = exports.updateAccountSettingsListForAccountTypesFailure = exports.updateAccountSettingsListForAccountTypes = exports.toggleJEPendingGroupCollapsed = exports.toggleJEFailedGroupCollapsed = exports.toggleJECreatedGroupCollapsed = exports.searchTransactionsForNewScheduleSuccess = exports.searchTransactionsForNewScheduleFailure = exports.searchTransactionsForNewSchedule = exports.saveNewScheduleSuccess = exports.saveNewScheduleFailure = exports.saveNewSchedule = exports.saveAccountSettingsSuccess = void 0;
6
6
  const toolkit_1 = require("@reduxjs/toolkit");
7
7
  const getNestedAccountIDHierarchyForReport_1 = require("../../../commonStateTypes/accountView/getNestedAccountIDHierarchyForReport");
8
8
  const timePeriod_1 = require("../../../commonStateTypes/timePeriod");
@@ -68,6 +68,11 @@ exports.initialState = {
68
68
  jeScheduleAccruedKeysByPeriodAndTab: {},
69
69
  jeScheduleOneTimeAccrualKeysByPeriodAndTab: {},
70
70
  failedJeScheduleTransactionKeysByPeriodAndTab: {},
71
+ failedJePostings: {
72
+ fetchState: { fetchState: 'Not-Started', error: undefined },
73
+ jeScheduleTransactionKeys: [],
74
+ scheduledJournalEntryIDs: [],
75
+ },
71
76
  postStatusById: {},
72
77
  ignoreStatusById: {},
73
78
  revertStatusById: {},
@@ -77,6 +82,9 @@ exports.initialState = {
77
82
  oneTimeAccrualFetchStatusById: {},
78
83
  uiState: {
79
84
  createdGroupCollapsed: false,
85
+ // Expanded, like the other two. A failed posting is the only thing on this page that is
86
+ // actively wrong, so folding it away by default would hide the reason to open the tab.
87
+ failedGroupCollapsed: false,
80
88
  pendingGroupCollapsed: false,
81
89
  scrollPosition: { scrollTop: 0, scrollLeft: undefined },
82
90
  searchString: '',
@@ -148,6 +156,59 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
148
156
  };
149
157
  },
150
158
  },
159
+ /**
160
+ * The Failed Postings list, fetched separately from the schedules it belongs to.
161
+ *
162
+ * No period and no tab in any of these three: the endpoint applies no date window, so there is
163
+ * one list per tenant and one slot to hold it. `refreshInBackground` keeps a silent refetch
164
+ * from dropping a skeleton over rows already on screen, the same way refreshStatus does for
165
+ * the schedules list.
166
+ */
167
+ fetchFailedJePostings: {
168
+ reducer(draft, action) {
169
+ if (!action.payload.refreshInBackground) {
170
+ draft.failedJePostings.fetchState = {
171
+ fetchState: 'In-Progress',
172
+ error: undefined,
173
+ };
174
+ }
175
+ },
176
+ prepare(refreshInBackground = false) {
177
+ return { payload: { refreshInBackground } };
178
+ },
179
+ },
180
+ fetchFailedJePostingsSuccess: {
181
+ reducer(draft, action) {
182
+ // Both lists are replaced, never merged: this response is the whole current answer to
183
+ // "what is failing right now", so an entry it no longer names has stopped failing --
184
+ // resolved by someone else, or posted since -- and must drop out of the group.
185
+ draft.failedJePostings = {
186
+ fetchState: { fetchState: 'Completed', error: undefined },
187
+ jeScheduleTransactionKeys: action.payload.failedJeSchedules.map((schedule) => (0, jeSchedulesPayload_1.getJEScheduleTransactionDetailKeyPayload)(schedule.base_transaction)),
188
+ // `?? ''` mirrors toScheduledJournalEntryState, so an entry the server sent without an
189
+ // id lands on the same value on both sides and still matches itself.
190
+ scheduledJournalEntryIDs: action.payload.failedScheduledJournalEntries.map((journalEntry) => journalEntry.scheduled_journal_entry_id ?? ''),
191
+ };
192
+ },
193
+ prepare(failedJeSchedules, failedScheduledJournalEntries) {
194
+ return { payload: { failedJeSchedules, failedScheduledJournalEntries } };
195
+ },
196
+ },
197
+ fetchFailedJePostingsFailure: {
198
+ reducer(draft, action) {
199
+ // Keys are deliberately left alone. The schedules list clears its buckets on failure so an
200
+ // errored tab cannot read as "these are all the schedules there are", but this list is a
201
+ // set of outstanding problems -- showing the last known ones beside an error beats
202
+ // implying there are none.
203
+ draft.failedJePostings.fetchState = {
204
+ fetchState: 'Error',
205
+ error: action.payload.status,
206
+ };
207
+ },
208
+ prepare(status) {
209
+ return { payload: { status } };
210
+ },
211
+ },
151
212
  fetchJeSchedulesSuccess(draft, action) {
152
213
  const { jeSchedules, selectedPeriod, selectedPageTab, failedJeSchedules, accruedJeSchedules, oneTimeAccruals, refreshViewInBackground, } = action.payload;
153
214
  const periodTabKey = (0, jeSchedulesViewState_1.getJESchedulePeriodTabKey)(selectedPageTab, (0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod));
@@ -210,6 +271,13 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
210
271
  error: undefined,
211
272
  },
212
273
  };
274
+ // This posting has just succeeded, so it is no longer part of the failing set. Removing the
275
+ // entry from the schedule entity is not enough on its own: a later detail or Quick View
276
+ // fetch re-adds that month from the server, and because is_posting_failed is never cleared
277
+ // it can still arrive carrying its old error array. With the id left in place the selector
278
+ // would match it again and put a Retry button back on a posting that already went through.
279
+ draft.failedJePostings.scheduledJournalEntryIDs =
280
+ draft.failedJePostings.scheduledJournalEntryIDs.filter((failedEntryID) => failedEntryID !== scheduledJournalEntryID);
213
281
  },
214
282
  retryJeScheduleFailure(draft, action) {
215
283
  const { status, scheduledJournalEntryID } = action.payload;
@@ -364,6 +432,8 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
364
432
  reducer(draft, action) {
365
433
  const { failedJeScheduleKey } = action.payload;
366
434
  removeKeyFromEveryTabSlot(draft.failedJeScheduleTransactionKeysByPeriodAndTab, failedJeScheduleKey);
435
+ draft.failedJePostings.jeScheduleTransactionKeys =
436
+ draft.failedJePostings.jeScheduleTransactionKeys.filter((jeScheduleKey) => jeScheduleKey !== failedJeScheduleKey);
367
437
  },
368
438
  },
369
439
  initializeJeScheduleLocalData: {
@@ -706,6 +776,9 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
706
776
  draft.uiState.createdGroupCollapsed =
707
777
  !draft.uiState.createdGroupCollapsed;
708
778
  },
779
+ toggleJEFailedGroupCollapsed(draft) {
780
+ draft.uiState.failedGroupCollapsed = !draft.uiState.failedGroupCollapsed;
781
+ },
709
782
  clearExpenseAutomationJESchedulesView(draft) {
710
783
  Object.assign(draft, exports.initialState);
711
784
  },
@@ -716,7 +789,7 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
716
789
  });
717
790
  },
718
791
  });
719
- _a = expenseAutomationJESchedulesView.actions, exports.clearExpenseAutomationJESchedulesView = _a.clearExpenseAutomationJESchedulesView, exports.clearJeAccountSettingsLocalData = _a.clearJeAccountSettingsLocalData, exports.clearJeScheduleLocalData = _a.clearJeScheduleLocalData, exports.clearSearchTransactionsForNewSchedule = _a.clearSearchTransactionsForNewSchedule, exports.createOneTimeAccrual = _a.createOneTimeAccrual, exports.createOneTimeAccrualFailure = _a.createOneTimeAccrualFailure, exports.createOneTimeAccrualSuccess = _a.createOneTimeAccrualSuccess, exports.ignoreOneTimeAccrual = _a.ignoreOneTimeAccrual, exports.oneTimeAccrualActionFailure = _a.oneTimeAccrualActionFailure, exports.oneTimeAccrualActionSuccess = _a.oneTimeAccrualActionSuccess, exports.promoteOneTimeAccrual = _a.promoteOneTimeAccrual, exports.revertJeSchedule = _a.revertJeSchedule, exports.revertJeScheduleFailure = _a.revertJeScheduleFailure, exports.revertJeScheduleSuccess = _a.revertJeScheduleSuccess, exports.revertOneTimeAccrual = _a.revertOneTimeAccrual, exports.fetchAccountSettingsListForAccountTypes = _a.fetchAccountSettingsListForAccountTypes, exports.fetchJeSchedules = _a.fetchJeSchedules, exports.fetchJeSchedulesFailure = _a.fetchJeSchedulesFailure, exports.fetchJeSchedulesPage = _a.fetchJeSchedulesPage, exports.fetchJeSchedulesSuccess = _a.fetchJeSchedulesSuccess, exports.fetchOneTimeAccrual = _a.fetchOneTimeAccrual, exports.fetchOneTimeAccrualFailure = _a.fetchOneTimeAccrualFailure, exports.fetchOneTimeAccrualSuccess = _a.fetchOneTimeAccrualSuccess, exports.fetchRecommendationForAccountSettings = _a.fetchRecommendationForAccountSettings, exports.ignoreRecommendedJeSchedule = _a.ignoreRecommendedJeSchedule, exports.ignoreRecommendedJeScheduleFailure = _a.ignoreRecommendedJeScheduleFailure, exports.ignoreRecommendedJeScheduleSuccess = _a.ignoreRecommendedJeScheduleSuccess, exports.initializeAccountSettingsView = _a.initializeAccountSettingsView, exports.initializeJeScheduleLocalData = _a.initializeJeScheduleLocalData, exports.initializeNewSchedule = _a.initializeNewSchedule, exports.removeFailedJeScheduleTransactionKey = _a.removeFailedJeScheduleTransactionKey, exports.removeJeOneTimeAccrualLocalData = _a.removeJeOneTimeAccrualLocalData, exports.removeJeScheduleLocalDataById = _a.removeJeScheduleLocalDataById, exports.removeJeAccruedScheduleKey = _a.removeJeAccruedScheduleKey, exports.removeJeScheduleTransactionKey = _a.removeJeScheduleTransactionKey, exports.resetNewScheduleLocalData = _a.resetNewScheduleLocalData, exports.retryJeSchedule = _a.retryJeSchedule, exports.retryJeScheduleFailure = _a.retryJeScheduleFailure, exports.retryJeScheduleSuccess = _a.retryJeScheduleSuccess, exports.saveAccountSettings = _a.saveAccountSettings, exports.saveAccountSettingsFailure = _a.saveAccountSettingsFailure, exports.saveAccountSettingsLocalData = _a.saveAccountSettingsLocalData, exports.saveAccountSettingsSuccess = _a.saveAccountSettingsSuccess, exports.saveNewSchedule = _a.saveNewSchedule, exports.saveNewScheduleFailure = _a.saveNewScheduleFailure, exports.saveNewScheduleSuccess = _a.saveNewScheduleSuccess, exports.searchTransactionsForNewSchedule = _a.searchTransactionsForNewSchedule, exports.searchTransactionsForNewScheduleFailure = _a.searchTransactionsForNewScheduleFailure, exports.searchTransactionsForNewScheduleSuccess = _a.searchTransactionsForNewScheduleSuccess, exports.toggleJECreatedGroupCollapsed = _a.toggleJECreatedGroupCollapsed, exports.toggleJEPendingGroupCollapsed = _a.toggleJEPendingGroupCollapsed, exports.updateAccountSettingsListForAccountTypes = _a.updateAccountSettingsListForAccountTypes, exports.updateAccountSettingsListForAccountTypesFailure = _a.updateAccountSettingsListForAccountTypesFailure, exports.updateJESchedulesUIState = _a.updateJESchedulesUIState, exports.updateJEScheduleTypeFilter = _a.updateJEScheduleTypeFilter, exports.updateJeOneTimeAccrualLocalData = _a.updateJeOneTimeAccrualLocalData, exports.updateJeScheduleLocalDataById = _a.updateJeScheduleLocalDataById, exports.updateJeScheduleTransactionKeys = _a.updateJeScheduleTransactionKeys, exports.updateNewScheduleLocalData = _a.updateNewScheduleLocalData, exports.updateRecommendationForAccountSettings = _a.updateRecommendationForAccountSettings, exports.updateRecommendationForAccountSettingsFailure = _a.updateRecommendationForAccountSettingsFailure;
792
+ _a = expenseAutomationJESchedulesView.actions, exports.clearExpenseAutomationJESchedulesView = _a.clearExpenseAutomationJESchedulesView, exports.clearJeAccountSettingsLocalData = _a.clearJeAccountSettingsLocalData, exports.clearJeScheduleLocalData = _a.clearJeScheduleLocalData, exports.clearSearchTransactionsForNewSchedule = _a.clearSearchTransactionsForNewSchedule, exports.createOneTimeAccrual = _a.createOneTimeAccrual, exports.createOneTimeAccrualFailure = _a.createOneTimeAccrualFailure, exports.createOneTimeAccrualSuccess = _a.createOneTimeAccrualSuccess, exports.ignoreOneTimeAccrual = _a.ignoreOneTimeAccrual, exports.oneTimeAccrualActionFailure = _a.oneTimeAccrualActionFailure, exports.oneTimeAccrualActionSuccess = _a.oneTimeAccrualActionSuccess, exports.promoteOneTimeAccrual = _a.promoteOneTimeAccrual, exports.revertJeSchedule = _a.revertJeSchedule, exports.revertJeScheduleFailure = _a.revertJeScheduleFailure, exports.revertJeScheduleSuccess = _a.revertJeScheduleSuccess, exports.revertOneTimeAccrual = _a.revertOneTimeAccrual, exports.fetchAccountSettingsListForAccountTypes = _a.fetchAccountSettingsListForAccountTypes, exports.fetchJeSchedules = _a.fetchJeSchedules, exports.fetchFailedJePostings = _a.fetchFailedJePostings, exports.fetchFailedJePostingsFailure = _a.fetchFailedJePostingsFailure, exports.fetchFailedJePostingsSuccess = _a.fetchFailedJePostingsSuccess, exports.fetchJeSchedulesFailure = _a.fetchJeSchedulesFailure, exports.fetchJeSchedulesPage = _a.fetchJeSchedulesPage, exports.fetchJeSchedulesSuccess = _a.fetchJeSchedulesSuccess, exports.fetchOneTimeAccrual = _a.fetchOneTimeAccrual, exports.fetchOneTimeAccrualFailure = _a.fetchOneTimeAccrualFailure, exports.fetchOneTimeAccrualSuccess = _a.fetchOneTimeAccrualSuccess, exports.fetchRecommendationForAccountSettings = _a.fetchRecommendationForAccountSettings, exports.ignoreRecommendedJeSchedule = _a.ignoreRecommendedJeSchedule, exports.ignoreRecommendedJeScheduleFailure = _a.ignoreRecommendedJeScheduleFailure, exports.ignoreRecommendedJeScheduleSuccess = _a.ignoreRecommendedJeScheduleSuccess, exports.initializeAccountSettingsView = _a.initializeAccountSettingsView, exports.initializeJeScheduleLocalData = _a.initializeJeScheduleLocalData, exports.initializeNewSchedule = _a.initializeNewSchedule, exports.removeFailedJeScheduleTransactionKey = _a.removeFailedJeScheduleTransactionKey, exports.removeJeOneTimeAccrualLocalData = _a.removeJeOneTimeAccrualLocalData, exports.removeJeScheduleLocalDataById = _a.removeJeScheduleLocalDataById, exports.removeJeAccruedScheduleKey = _a.removeJeAccruedScheduleKey, exports.removeJeScheduleTransactionKey = _a.removeJeScheduleTransactionKey, exports.resetNewScheduleLocalData = _a.resetNewScheduleLocalData, exports.retryJeSchedule = _a.retryJeSchedule, exports.retryJeScheduleFailure = _a.retryJeScheduleFailure, exports.retryJeScheduleSuccess = _a.retryJeScheduleSuccess, exports.saveAccountSettings = _a.saveAccountSettings, exports.saveAccountSettingsFailure = _a.saveAccountSettingsFailure, exports.saveAccountSettingsLocalData = _a.saveAccountSettingsLocalData, exports.saveAccountSettingsSuccess = _a.saveAccountSettingsSuccess, exports.saveNewSchedule = _a.saveNewSchedule, exports.saveNewScheduleFailure = _a.saveNewScheduleFailure, exports.saveNewScheduleSuccess = _a.saveNewScheduleSuccess, exports.searchTransactionsForNewSchedule = _a.searchTransactionsForNewSchedule, exports.searchTransactionsForNewScheduleFailure = _a.searchTransactionsForNewScheduleFailure, exports.searchTransactionsForNewScheduleSuccess = _a.searchTransactionsForNewScheduleSuccess, exports.toggleJECreatedGroupCollapsed = _a.toggleJECreatedGroupCollapsed, exports.toggleJEFailedGroupCollapsed = _a.toggleJEFailedGroupCollapsed, exports.toggleJEPendingGroupCollapsed = _a.toggleJEPendingGroupCollapsed, exports.updateAccountSettingsListForAccountTypes = _a.updateAccountSettingsListForAccountTypes, exports.updateAccountSettingsListForAccountTypesFailure = _a.updateAccountSettingsListForAccountTypesFailure, exports.updateJESchedulesUIState = _a.updateJESchedulesUIState, exports.updateJEScheduleTypeFilter = _a.updateJEScheduleTypeFilter, exports.updateJeOneTimeAccrualLocalData = _a.updateJeOneTimeAccrualLocalData, exports.updateJeScheduleLocalDataById = _a.updateJeScheduleLocalDataById, exports.updateJeScheduleTransactionKeys = _a.updateJeScheduleTransactionKeys, exports.updateNewScheduleLocalData = _a.updateNewScheduleLocalData, exports.updateRecommendationForAccountSettings = _a.updateRecommendationForAccountSettings, exports.updateRecommendationForAccountSettingsFailure = _a.updateRecommendationForAccountSettingsFailure;
720
793
  exports.default = expenseAutomationJESchedulesView.reducer;
721
794
  const doUpdateRecommendationForAccountSettings = (draft, payload) => {
722
795
  const { prepaidExpensesRecommendations, fixedAssetsRecommendations, accruedExpensesRecommendations, } = (0, accountTypeRecommendationPayload_1.mapAccountTypeRecommendationPayloadToAccountRecommendationByType)(payload);
@@ -107,32 +107,27 @@ const expenseAutomationReconciliationView = (0, toolkit_1.createSlice)({
107
107
  draft.selectedTab = 'review';
108
108
  draft.selectedAccountId = action.payload.accountId;
109
109
  }
110
- const accountReconciliationRecords = draft.accountReconciliationRecordsBySelectedPeriod[(0, timePeriod_1.toMonthYearPeriodId)(action.payload.selectedPeriod)];
111
- const { transactionFetchState } = accountReconciliationRecords.reconciliationByAccountID[action.payload.accountId];
112
- if (transactionFetchState.fetchState !== 'Completed' ||
110
+ const accountRecon = draft.accountReconciliationRecordsBySelectedPeriod[(0, timePeriod_1.toMonthYearPeriodId)(action.payload.selectedPeriod)]?.reconciliationByAccountID[action.payload.accountId];
111
+ if (accountRecon == null) {
112
+ return;
113
+ }
114
+ if (accountRecon.transactionFetchState.fetchState !== 'Completed' ||
113
115
  action.payload.cacheOverride === true) {
114
- const data = accountReconciliationRecords.reconciliationByAccountID[action.payload.accountId];
115
116
  if (action.payload.refreshViewInBackground === true) {
116
- accountReconciliationRecords.reconciliationByAccountID[action.payload.accountId] = {
117
- ...data,
118
- refreshStatus: {
119
- fetchState: 'In-Progress',
120
- error: undefined,
121
- },
122
- accountId: action.payload.accountId,
123
- reconciliationId: undefined,
117
+ accountRecon.refreshStatus = {
118
+ fetchState: 'In-Progress',
119
+ error: undefined,
124
120
  };
121
+ accountRecon.accountId = action.payload.accountId;
122
+ accountRecon.reconciliationId = undefined;
125
123
  }
126
124
  else {
127
- accountReconciliationRecords.reconciliationByAccountID[action.payload.accountId] = {
128
- ...data,
129
- transactionFetchState: {
130
- fetchState: 'In-Progress',
131
- error: undefined,
132
- },
133
- accountId: action.payload.accountId,
134
- reconciliationId: undefined,
125
+ accountRecon.transactionFetchState = {
126
+ fetchState: 'In-Progress',
127
+ error: undefined,
135
128
  };
129
+ accountRecon.accountId = action.payload.accountId;
130
+ accountRecon.reconciliationId = undefined;
136
131
  }
137
132
  }
138
133
  }
@@ -184,14 +179,17 @@ const expenseAutomationReconciliationView = (0, toolkit_1.createSlice)({
184
179
  }
185
180
  }
186
181
  else {
187
- const accountReconciliationRecords = draft.accountReconciliationRecordsBySelectedPeriod[(0, timePeriod_1.toMonthYearPeriodId)(action.payload.selectedPeriod)];
182
+ const accountRecon = draft.accountReconciliationRecordsBySelectedPeriod[(0, timePeriod_1.toMonthYearPeriodId)(action.payload.selectedPeriod)]?.reconciliationByAccountID[action.payload.accountId];
183
+ if (accountRecon == null) {
184
+ return;
185
+ }
188
186
  if (action.payload.refreshViewInBackground === true) {
189
- accountReconciliationRecords.reconciliationByAccountID[action.payload.accountId].refreshStatus.error = action.payload.error;
190
- accountReconciliationRecords.reconciliationByAccountID[action.payload.accountId].refreshStatus.fetchState = 'Error';
187
+ accountRecon.refreshStatus.error = action.payload.error;
188
+ accountRecon.refreshStatus.fetchState = 'Error';
191
189
  }
192
190
  else {
193
- accountReconciliationRecords.reconciliationByAccountID[action.payload.accountId].transactionFetchState.error = action.payload.error;
194
- accountReconciliationRecords.reconciliationByAccountID[action.payload.accountId].transactionFetchState.fetchState = 'Error';
191
+ accountRecon.transactionFetchState.error = action.payload.error;
192
+ accountRecon.transactionFetchState.fetchState = 'Error';
195
193
  }
196
194
  }
197
195
  },
@@ -396,8 +394,11 @@ const expenseAutomationReconciliationView = (0, toolkit_1.createSlice)({
396
394
  },
397
395
  setStatementParseInProgress: (draft, action) => {
398
396
  const { accountId, selectedPeriod, statementParseInProgress } = action.payload;
399
- draft.accountReconciliationRecordsBySelectedPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)].reconciliationByAccountID[accountId].statementParseInProgress =
400
- statementParseInProgress;
397
+ const accountRecon = draft.accountReconciliationRecordsBySelectedPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)]?.reconciliationByAccountID[accountId];
398
+ if (accountRecon == null) {
399
+ return;
400
+ }
401
+ accountRecon.statementParseInProgress = statementParseInProgress;
401
402
  },
402
403
  setStatementProcessingDismissedToBackground: (draft, action) => {
403
404
  const { accountId, selectedPeriod, dismissedToBackground } = action.payload;
@@ -481,15 +482,23 @@ const expenseAutomationReconciliationView = (0, toolkit_1.createSlice)({
481
482
  },
482
483
  uploadAccountStatementSuccess: (draft, action) => {
483
484
  const { accountId, selectedPeriod } = action.payload;
484
- draft.accountReconciliationRecordsBySelectedPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)].reconciliationByAccountID[accountId].statementUploadStatus = {
485
+ const accountRecon = draft.accountReconciliationRecordsBySelectedPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)]?.reconciliationByAccountID[accountId];
486
+ if (accountRecon == null) {
487
+ return;
488
+ }
489
+ accountRecon.statementUploadStatus = {
485
490
  fetchState: 'Completed',
486
491
  error: undefined,
487
492
  };
488
- draft.accountReconciliationRecordsBySelectedPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)].reconciliationByAccountID[accountId].statementParseInProgress = true;
493
+ accountRecon.statementParseInProgress = true;
489
494
  },
490
495
  uploadAccountStatementFailure: (draft, action) => {
491
496
  const { accountId, selectedPeriod } = action.payload;
492
- draft.accountReconciliationRecordsBySelectedPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)].reconciliationByAccountID[accountId].statementUploadStatus = {
497
+ const accountRecon = draft.accountReconciliationRecordsBySelectedPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)]?.reconciliationByAccountID[accountId];
498
+ if (accountRecon == null) {
499
+ return;
500
+ }
501
+ accountRecon.statementUploadStatus = {
493
502
  fetchState: 'Error',
494
503
  error: action.payload.error,
495
504
  };
@@ -682,23 +691,34 @@ const expenseAutomationReconciliationView = (0, toolkit_1.createSlice)({
682
691
  },
683
692
  reparseStatementFailure: (draft, action) => {
684
693
  const { accountId, selectedPeriod } = action.payload;
685
- draft.accountReconciliationRecordsBySelectedPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)].reconciliationByAccountID[accountId].reparseStatementStatus = {
694
+ const accountRecon = draft.accountReconciliationRecordsBySelectedPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)]?.reconciliationByAccountID[accountId];
695
+ if (accountRecon == null) {
696
+ return;
697
+ }
698
+ accountRecon.reparseStatementStatus = {
686
699
  fetchState: 'Error',
687
700
  error: action.payload.error,
688
701
  };
689
- draft.accountReconciliationRecordsBySelectedPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)].reconciliationByAccountID[accountId].statementProcessingFailed = true;
702
+ accountRecon.statementProcessingFailed = true;
690
703
  },
691
704
  resetReparseStatementStatus: (draft, action) => {
692
705
  const { accountId, selectedPeriod } = action.payload;
693
- draft.accountReconciliationRecordsBySelectedPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)].reconciliationByAccountID[accountId].reparseStatementStatus = {
706
+ const accountRecon = draft.accountReconciliationRecordsBySelectedPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)]?.reconciliationByAccountID[accountId];
707
+ if (accountRecon == null) {
708
+ return;
709
+ }
710
+ accountRecon.reparseStatementStatus = {
694
711
  fetchState: 'Not-Started',
695
712
  error: undefined,
696
713
  };
697
714
  },
698
715
  updateParsedStatementData: (draft, action) => {
699
716
  const { accountId, selectedPeriod, parsedStatementData } = action.payload;
700
- draft.accountReconciliationRecordsBySelectedPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)].reconciliationByAccountID[accountId].parsedStatementData =
701
- parsedStatementData;
717
+ const accountRecon = draft.accountReconciliationRecordsBySelectedPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)]?.reconciliationByAccountID[accountId];
718
+ if (accountRecon == null) {
719
+ return;
720
+ }
721
+ accountRecon.parsedStatementData = parsedStatementData;
702
722
  },
703
723
  updateStatementUpdateLocalData: (draft, action) => {
704
724
  const { accountId, selectedPeriod, statementUpdateLocalData, statementUploadId, } = action.payload;
@@ -824,17 +844,21 @@ const expenseAutomationReconciliationView = (0, toolkit_1.createSlice)({
824
844
  },
825
845
  updateAccountReconciliationLocalData: (draft, action) => {
826
846
  const { accountId, selectedPeriod, localData } = action.payload;
827
- const oldLocalData = draft.accountReconciliationRecordsBySelectedPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)].reconciliationByAccountID[accountId].localData;
847
+ const accountRecon = draft.accountReconciliationRecordsBySelectedPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)]?.reconciliationByAccountID[accountId];
848
+ if (accountRecon == null) {
849
+ return;
850
+ }
851
+ const oldLocalData = accountRecon.localData;
828
852
  if (oldLocalData == null) {
829
- draft.accountReconciliationRecordsBySelectedPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)].reconciliationByAccountID[accountId].localData = localData;
853
+ accountRecon.localData = localData;
830
854
  }
831
855
  else {
832
- draft.accountReconciliationRecordsBySelectedPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)].reconciliationByAccountID[accountId].localData = {
856
+ accountRecon.localData = {
833
857
  ...oldLocalData,
834
858
  ...localData,
835
859
  };
836
860
  }
837
- draft.accountReconciliationRecordsBySelectedPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)].reconciliationByAccountID[accountId].localData = {
861
+ accountRecon.localData = {
838
862
  ...oldLocalData,
839
863
  ...localData,
840
864
  };
@@ -1124,7 +1148,10 @@ function updateAllReconciliation(draft, accounts, selectedPeriod, reconciliation
1124
1148
  }
1125
1149
  }
1126
1150
  function updateReconciliationByAccountID(draft, accounts, selectedPeriod, accountId, reconciliationData, refreshViewInBackground) {
1127
- const oldRecord = draft.accountReconciliationRecordsBySelectedPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)].reconciliationByAccountID[accountId];
1151
+ const accountRecon = draft.accountReconciliationRecordsBySelectedPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)]?.reconciliationByAccountID[accountId];
1152
+ if (accountRecon == null) {
1153
+ return;
1154
+ }
1128
1155
  const oldConnectionStatus = draft.accountConnectionStatusByAccountID[accountId];
1129
1156
  draft.accountConnectionStatusByAccountID[accountId] = {
1130
1157
  status: (0, accountReconState_1.toBankStatusCodeType)(reconciliationData.bank_status.code),
@@ -1134,21 +1161,17 @@ function updateReconciliationByAccountID(draft, accounts, selectedPeriod, accoun
1134
1161
  : false,
1135
1162
  paymentAccountId: accounts.payment_account_id ?? undefined,
1136
1163
  };
1137
- const statementParseInProgress = resolveStatementParseInProgressAfterFetch(oldRecord, reconciliationData);
1164
+ const statementParseInProgress = resolveStatementParseInProgressAfterFetch(accountRecon, reconciliationData);
1165
+ accountRecon.reconciliationId =
1166
+ reconciliationData.reconciliation_id ?? undefined;
1167
+ accountRecon.statementParseInProgress = statementParseInProgress;
1138
1168
  if (refreshViewInBackground === true) {
1139
- draft.accountReconciliationRecordsBySelectedPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)].reconciliationByAccountID[accountId] = {
1140
- ...oldRecord,
1141
- reconciliationId: reconciliationData.reconciliation_id ?? undefined,
1142
- refreshStatus: { fetchState: 'Completed', error: undefined },
1143
- statementParseInProgress,
1144
- };
1169
+ accountRecon.refreshStatus = { fetchState: 'Completed', error: undefined };
1145
1170
  }
1146
1171
  else {
1147
- draft.accountReconciliationRecordsBySelectedPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)].reconciliationByAccountID[accountId] = {
1148
- ...oldRecord,
1149
- statementParseInProgress,
1150
- reconciliationId: reconciliationData.reconciliation_id ?? undefined,
1151
- transactionFetchState: { fetchState: 'Completed', error: undefined },
1172
+ accountRecon.transactionFetchState = {
1173
+ fetchState: 'Completed',
1174
+ error: undefined,
1152
1175
  };
1153
1176
  }
1154
1177
  }
@@ -1178,7 +1201,11 @@ const updateExcludedAccountExclusionInfo = (draft, account) => {
1178
1201
  };
1179
1202
  };
1180
1203
  const updateReconciliationByAccountIDOnIncludeAccount = (draft, accountId, reconciliation, monthYearPeriodId) => {
1181
- draft.accountReconciliationRecordsBySelectedPeriod[monthYearPeriodId].reconciliationByAccountID[accountId] = {
1204
+ const accountReconciliationRecords = draft.accountReconciliationRecordsBySelectedPeriod[monthYearPeriodId];
1205
+ if (accountReconciliationRecords == null) {
1206
+ return;
1207
+ }
1208
+ accountReconciliationRecords.reconciliationByAccountID[accountId] = {
1182
1209
  accountId,
1183
1210
  reconciliationId: reconciliation.reconciliation_id ?? undefined,
1184
1211
  transactionFetchState: { fetchState: 'Not-Started', error: undefined },
@@ -380,6 +380,16 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
380
380
  if (cached != null) {
381
381
  autoCat.uiState.pageToken = cached.pageToken;
382
382
  autoCat.uiState.totalCount = { ...cached.totalCount };
383
+ // Keep the stored badge in step with the restored sub-tab: the selector
384
+ // falls back to it for any period this sub-tab has not loaded. Merged,
385
+ // not replaced -- the snapshot only holds periods this sub-tab actually
386
+ // loaded, while the badge map also carries periods filled from a Review
387
+ // response's `other_tab_total_count`. Overwriting would drop those and
388
+ // leave the badge at 0 for any period this sub-tab never visited.
389
+ draft.parentTotalCountByTab.autoCategorized = {
390
+ ...draft.parentTotalCountByTab.autoCategorized,
391
+ ...cached.totalCount,
392
+ };
383
393
  autoCat.uiState.scrollPosition = cached.scrollPosition;
384
394
  autoCat.transactionIdsBySelectedPeriod = {
385
395
  ...cached.transactionIdsBySelectedPeriod,
@@ -43,6 +43,9 @@ export interface ActualMatchingKpiSummary {
43
43
  count: number;
44
44
  estimatedMinutesToClear: number;
45
45
  };
46
+ reversed: {
47
+ count: number;
48
+ };
46
49
  variance: {
47
50
  averagePercentPerMatch: number;
48
51
  netAmount: number;
@@ -47,6 +47,8 @@ export interface ExpenseAutomationJESchedulesViewSelector extends SelectorView {
47
47
  completionStatus: CompletionStatusType;
48
48
  createdSchedules: JEScheduleRow[];
49
49
  createdTotal: number;
50
+ failedPostings: JEScheduledTransactionWithFailedEntries[];
51
+ failedPostingsFetchState: FetchStateAndError;
50
52
  hasLoadedForSelectedTab: boolean;
51
53
  ignoreStatusById: Record<JEScheduleTransactionKey, FetchStateAndError>;
52
54
  jeScheduleLocalDataById: Record<ID, JEScheduleLocalData>;
@@ -61,6 +63,7 @@ export interface ExpenseAutomationJESchedulesViewSelector extends SelectorView {
61
63
  pendingReviewTotal: number;
62
64
  postStatusById: Record<ID, FetchStateAndError>;
63
65
  refreshStatus: FetchStateAndError;
66
+ /** @deprecated Alias of `failedPostings`. Remove once webc and app-ui are repointed. */
64
67
  resolveSchedules: JEScheduledTransactionWithFailedEntries[];
65
68
  revertStatusById: Record<JEScheduleKey | JEScheduleTransactionKey, FetchStateAndError>;
66
69
  scheduleCountsByTab: Partial<Record<JEPageTab, number>>;
@@ -28,10 +28,14 @@ export interface ExpenseAutomationTransactionViewSelector extends SelectorView {
28
28
  isAccountingProjectsEnabled: boolean;
29
29
  markAsNotMiscategorizedStatus: FetchStateAndError;
30
30
  /**
31
- * Parent tab badge counts, sourced from the listing response's
32
- * `parent_tab_total_count`. Used exclusively to drive the navbar / tab
33
- * strip badge labels — every other count consumer (pagination, in-list
34
- * "showing X of Y", save flows) keeps reading {@link totalCountByTab}.
31
+ * Tab badge counts under the filters currently applied to the list
32
+ * (transaction group + Completed sub-tab + search), so each badge matches
33
+ * the rows its tab renders. The active tab's entry is {@link totalCountByTab}
34
+ * itself, so it cannot drift when a cache hit skips the fetch; the inactive
35
+ * tab's comes from the listing response's `other_tab_total_count`. Used
36
+ * exclusively to drive the navbar / tab strip badge labels — every other
37
+ * count consumer (pagination, in-list "showing X of Y", save flows) keeps
38
+ * reading {@link totalCountByTab}.
35
39
  */
36
40
  parentTabTotalCountByTab: Record<TransactionsTab, number>;
37
41
  projectList: ProjectListSelectorView;
@@ -36,4 +36,5 @@ export interface ExpenseAutomationActualMatchingMatchView {
36
36
  export declare function getExpenseAutomationActualMatchingMatchView(state: RootState, matchId: ActualMatchingMatchId): ExpenseAutomationActualMatchingMatchView;
37
37
  export declare function getCloseMatchAfterUndo(state: RootState): boolean;
38
38
  export declare function getCloseMatchAfterIgnoreMatchId(state: RootState): ActualMatchingMatchId | undefined;
39
+ export declare function getActualMatchingMatchModalConfirmStatus(state: RootState): FetchStateAndError;
39
40
  export declare function getExpenseAutomationActualMatchingView(state: RootState): ExpenseAutomationActualMatchingViewSelector;
@@ -17,6 +17,7 @@ exports.buildActualMatchingKpiSummary = buildActualMatchingKpiSummary;
17
17
  exports.getExpenseAutomationActualMatchingMatchView = getExpenseAutomationActualMatchingMatchView;
18
18
  exports.getCloseMatchAfterUndo = getCloseMatchAfterUndo;
19
19
  exports.getCloseMatchAfterIgnoreMatchId = getCloseMatchAfterIgnoreMatchId;
20
+ exports.getActualMatchingMatchModalConfirmStatus = getActualMatchingMatchModalConfirmStatus;
20
21
  exports.getExpenseAutomationActualMatchingView = getExpenseAutomationActualMatchingView;
21
22
  const orderBy_1 = __importDefault(require("lodash/orderBy"));
22
23
  const timePeriod_1 = require("../../../commonStateTypes/timePeriod");
@@ -247,6 +248,7 @@ function emptyKpiSummary() {
247
248
  actualsReceived: { count: 0, expectedCount: 0, vendorsPending: 0 },
248
249
  autoReversed: { count: 0, percent: 0, clearedAmount: 0 },
249
250
  pendingReview: { count: 0, amount: 0, estimatedMinutesToClear: 0 },
251
+ reversed: { count: 0 },
250
252
  variance: { percent: 0, averagePercentPerMatch: 0, netAmount: 0 },
251
253
  };
252
254
  }
@@ -302,6 +304,7 @@ function buildActualMatchingKpiSummary(rows, displayCurrencyCode) {
302
304
  }
303
305
  const autoReversed = kpiRows.filter((row) => row.kind === 'auto_reversed');
304
306
  const pendingReview = kpiRows.filter((row) => row.kind === 'pending_review');
307
+ const reversed = kpiRows.filter((row) => isReversedMatchKind(row.kind));
305
308
  const receivedCount = kpiRows.length;
306
309
  const rowsWithActual = kpiRows.filter((row) => row.actualAmount?.amount != null);
307
310
  const accruedTotal = rowsWithActual.reduce((sum, row) => sum + (row.accruedAmount?.amount ?? row.estimatedAmount.amount), 0);
@@ -327,6 +330,9 @@ function buildActualMatchingKpiSummary(rows, displayCurrencyCode) {
327
330
  amount: sumRowAmounts(pendingReview, displayCurrencyCode),
328
331
  estimatedMinutesToClear: pendingReview.length * ESTIMATED_MINUTES_PER_PENDING_MATCH,
329
332
  },
333
+ reversed: {
334
+ count: reversed.length,
335
+ },
330
336
  variance: {
331
337
  percent: accruedTotal === 0
332
338
  ? 0
@@ -348,6 +354,7 @@ function toActualMatchingMatchView(match) {
348
354
  : match.leftovers.map(toMatchModalAccrual),
349
355
  };
350
356
  }
357
+ const EMPTY_ACTUAL_MATCHING_ROWS = [];
351
358
  function getExpenseAutomationActualMatchingMatchView(state, matchId) {
352
359
  const view = state.expenseAutomationActualMatchingViewState;
353
360
  const match = (0, actualMatchingSelector_1.getActualMatchingMatchById)(state.actualMatchingState, matchId);
@@ -368,6 +375,9 @@ function getCloseMatchAfterIgnoreMatchId(state) {
368
375
  return state.expenseAutomationActualMatchingViewState
369
376
  .closeMatchAfterIgnoreMatchId;
370
377
  }
378
+ function getActualMatchingMatchModalConfirmStatus(state) {
379
+ return state.expenseAutomationActualMatchingViewState.matchModal.confirmStatus;
380
+ }
371
381
  function getExpenseAutomationActualMatchingView(state) {
372
382
  const { expenseAutomationActualMatchingViewState } = state;
373
383
  const { matchIdsByPeriod, fetchState, error, refreshStatus, uiState, matchModal, ignoreStatusByMatchId, undoReversalStatusByMatchId, } = expenseAutomationActualMatchingViewState;
@@ -384,10 +394,10 @@ function getExpenseAutomationActualMatchingView(state) {
384
394
  const includeReversed = uiState.statusFilter !== 'pending_review';
385
395
  const reversed = includeReversed
386
396
  ? sortActualMatchingRows(rows.filter((row) => isReversedMatchKind(row.kind)), uiState)
387
- : [];
397
+ : EMPTY_ACTUAL_MATCHING_ROWS;
388
398
  const pendingReview = includePendingReview
389
399
  ? sortActualMatchingRows(rows.filter((row) => row.kind === 'pending_review'), uiState)
390
- : [];
400
+ : EMPTY_ACTUAL_MATCHING_ROWS;
391
401
  const kpiSummary = buildActualMatchingKpiSummary(allRows, getTenantDisplayCurrency(state)?.currencyCode);
392
402
  const searchedAccruals = matchModal.accrualSearch.results
393
403
  .map((key) => (0, jeSchedulesSelector_1.getJEOneTimeAccrualByKey)(key, state.jeSchedulesState))