@zeniai/client-epic-state 5.2.11-beta0ND → 5.2.11-betaAM2

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 (191) hide show
  1. package/lib/entity/invoicing/invoicingCommonPayload.d.ts +29 -27
  2. package/lib/entity/invoicing/invoicingCommonPayload.js +75 -37
  3. package/lib/entity/invoicing/product/productPayload.d.ts +0 -10
  4. package/lib/entity/invoicing/product/productPayload.js +2 -14
  5. package/lib/entity/jeSchedules/jeScheduleHelper.d.ts +1 -0
  6. package/lib/entity/jeSchedules/jeScheduleHelper.js +7 -0
  7. package/lib/entity/jeSchedules/jeSchedulesPayload.d.ts +97 -1
  8. package/lib/entity/jeSchedules/jeSchedulesPayload.js +209 -0
  9. package/lib/entity/jeSchedules/jeSchedulesReducer.d.ts +4 -2
  10. package/lib/entity/jeSchedules/jeSchedulesReducer.js +30 -2
  11. package/lib/entity/jeSchedules/jeSchedulesSelector.d.ts +11 -2
  12. package/lib/entity/jeSchedules/jeSchedulesSelector.js +38 -3
  13. package/lib/entity/jeSchedules/jeSchedulesState.d.ts +140 -1
  14. package/lib/entity/jeSchedules/jeSchedulesTypes.d.ts +24 -1
  15. package/lib/entity/jeSchedules/jeSchedulesTypes.js +88 -1
  16. package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
  17. package/lib/entity/snackbar/snackbarTypes.js +3 -0
  18. package/lib/entity/transaction/payloadTypes/scheduleTransactionPayload.d.ts +2 -0
  19. package/lib/entity/transaction/payloadTypes/scheduleTransactionPayload.js +2 -0
  20. package/lib/entity/transaction/stateTypes/scheduleTransaction.d.ts +2 -0
  21. package/lib/epic.d.ts +15 -3
  22. package/lib/epic.js +31 -12
  23. package/lib/esm/entity/invoicing/invoicingCommonPayload.js +73 -33
  24. package/lib/esm/entity/invoicing/product/productPayload.js +2 -14
  25. package/lib/esm/entity/jeSchedules/jeScheduleHelper.js +6 -0
  26. package/lib/esm/entity/jeSchedules/jeSchedulesPayload.js +209 -1
  27. package/lib/esm/entity/jeSchedules/jeSchedulesReducer.js +30 -2
  28. package/lib/esm/entity/jeSchedules/jeSchedulesSelector.js +36 -2
  29. package/lib/esm/entity/jeSchedules/jeSchedulesTypes.js +78 -0
  30. package/lib/esm/entity/snackbar/snackbarTypes.js +3 -0
  31. package/lib/esm/entity/transaction/payloadTypes/scheduleTransactionPayload.js +2 -0
  32. package/lib/esm/epic.js +27 -8
  33. package/lib/esm/index.js +23 -14
  34. package/lib/esm/reducer.js +3 -0
  35. package/lib/esm/view/expenseAutomationView/epics/actualMatching/fetchActualMatchingEpic.js +46 -0
  36. package/lib/esm/view/expenseAutomationView/epics/actualMatching/fetchActualMatchingPageEpic.js +7 -0
  37. package/lib/esm/view/expenseAutomationView/epics/actualMatching/matchAndReverseAccrualsEpic.js +50 -0
  38. package/lib/esm/view/expenseAutomationView/epics/actualMatching/searchMatchAccrualsEpic.js +44 -0
  39. package/lib/esm/view/expenseAutomationView/epics/actualMatching/searchMatchTransactionsEpic.js +44 -0
  40. package/lib/esm/view/expenseAutomationView/epics/common/fetchAllExpenseAutomationTabsEpic.js +30 -10
  41. package/lib/esm/view/expenseAutomationView/epics/common/refreshExpenseAutomationCurrentTabEpic.js +9 -1
  42. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulePageEpic.js +9 -1
  43. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +41 -5
  44. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/fetchOneTimeAccrualEpic.js +45 -0
  45. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/ignoreRecommendedJeScheduleEpic.js +14 -2
  46. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/newSchedule/createOneTimeAccrualEpic.js +104 -0
  47. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/newSchedule/initializeNewScheduleEpic.js +25 -0
  48. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/newSchedule/saveNewScheduleEpic.js +136 -0
  49. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/newSchedule/searchTransactionsForNewScheduleEpic.js +79 -0
  50. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/oneTimeAccrualActionsEpic.js +180 -0
  51. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/revertJeScheduleEpic.js +111 -0
  52. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/switchJESchedulesTabEpic.js +33 -0
  53. package/lib/esm/view/expenseAutomationView/expenseAutomationViewSelector.js +22 -7
  54. package/lib/esm/view/expenseAutomationView/helpers/newScheduleLocalDataHelper.js +140 -0
  55. package/lib/esm/view/expenseAutomationView/payload/actualMatchingPayload.js +35 -0
  56. package/lib/esm/view/expenseAutomationView/payload/jeSchedulesPayload.js +55 -0
  57. package/lib/esm/view/expenseAutomationView/reducers/actualMatchingViewReducer.js +260 -0
  58. package/lib/esm/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +319 -29
  59. package/lib/esm/view/expenseAutomationView/selectorTypes/jeNewScheduleViewSelectorTypes.js +1 -0
  60. package/lib/esm/view/expenseAutomationView/selectors/actualMatchingViewSelector.js +162 -0
  61. package/lib/esm/view/expenseAutomationView/selectors/jeAccountSettingsViewSelector.js +1 -0
  62. package/lib/esm/view/expenseAutomationView/selectors/jeNewScheduleViewSelector.js +106 -0
  63. package/lib/esm/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +297 -22
  64. package/lib/esm/view/expenseAutomationView/types/actualMatchingViewState.js +22 -0
  65. package/lib/esm/view/expenseAutomationView/types/jeSchedulesViewState.js +8 -5
  66. package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewPayload.js +9 -25
  67. package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/saveInvoicingCatalogItemEpic.js +1 -6
  68. package/lib/esm/view/invoicing/invoicingQboView/invoicingQboViewSelector.js +0 -40
  69. package/lib/esm/view/invoicing/settingsView/settingsViewEpics.js +92 -0
  70. package/lib/esm/view/invoicing/settingsView/settingsViewReducer.js +1 -25
  71. package/lib/esm/view/invoicing/settingsView/settingsViewSelector.js +0 -41
  72. package/lib/esm/view/recommendation/recommendationReducer.js +1 -16
  73. package/lib/esm/view/scheduleView/scheduleListView/epics/fetchAccruedScheduleListEpic.js +1 -1
  74. package/lib/esm/view/scheduleView/scheduleListView/epics/fetchDownloadSchedulesEpic.js +7 -2
  75. package/lib/esm/view/scheduleView/scheduleListView/scheduleListReducer.js +5 -3
  76. package/lib/index.d.ts +29 -22
  77. package/lib/index.js +116 -56
  78. package/lib/reducer.d.ts +1 -0
  79. package/lib/reducer.js +3 -0
  80. package/lib/rootStateTypes.d.ts +2 -0
  81. package/lib/view/expenseAutomationView/epics/actualMatching/fetchActualMatchingEpic.d.ts +9 -0
  82. package/lib/view/expenseAutomationView/epics/actualMatching/fetchActualMatchingEpic.js +50 -0
  83. package/lib/view/expenseAutomationView/epics/actualMatching/fetchActualMatchingPageEpic.d.ts +5 -0
  84. package/lib/view/expenseAutomationView/epics/actualMatching/fetchActualMatchingPageEpic.js +11 -0
  85. package/lib/view/expenseAutomationView/epics/actualMatching/matchAndReverseAccrualsEpic.d.ts +8 -0
  86. package/lib/view/expenseAutomationView/epics/actualMatching/matchAndReverseAccrualsEpic.js +54 -0
  87. package/lib/view/expenseAutomationView/epics/actualMatching/searchMatchAccrualsEpic.d.ts +8 -0
  88. package/lib/view/expenseAutomationView/epics/actualMatching/searchMatchAccrualsEpic.js +48 -0
  89. package/lib/view/expenseAutomationView/epics/actualMatching/searchMatchTransactionsEpic.d.ts +8 -0
  90. package/lib/view/expenseAutomationView/epics/actualMatching/searchMatchTransactionsEpic.js +48 -0
  91. package/lib/view/expenseAutomationView/epics/common/fetchAllExpenseAutomationTabsEpic.d.ts +2 -1
  92. package/lib/view/expenseAutomationView/epics/common/fetchAllExpenseAutomationTabsEpic.js +30 -10
  93. package/lib/view/expenseAutomationView/epics/common/refreshExpenseAutomationCurrentTabEpic.d.ts +2 -1
  94. package/lib/view/expenseAutomationView/epics/common/refreshExpenseAutomationCurrentTabEpic.js +9 -1
  95. package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulePageEpic.js +9 -1
  96. package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.d.ts +3 -2
  97. package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +39 -3
  98. package/lib/view/expenseAutomationView/epics/jeSchedule/fetchOneTimeAccrualEpic.d.ts +21 -0
  99. package/lib/view/expenseAutomationView/epics/jeSchedule/fetchOneTimeAccrualEpic.js +49 -0
  100. package/lib/view/expenseAutomationView/epics/jeSchedule/ignoreRecommendedJeScheduleEpic.js +14 -2
  101. package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/createOneTimeAccrualEpic.d.ts +9 -0
  102. package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/createOneTimeAccrualEpic.js +108 -0
  103. package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/initializeNewScheduleEpic.d.ts +8 -0
  104. package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/initializeNewScheduleEpic.js +29 -0
  105. package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/saveNewScheduleEpic.d.ts +9 -0
  106. package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/saveNewScheduleEpic.js +140 -0
  107. package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/searchTransactionsForNewScheduleEpic.d.ts +8 -0
  108. package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/searchTransactionsForNewScheduleEpic.js +83 -0
  109. package/lib/view/expenseAutomationView/epics/jeSchedule/oneTimeAccrualActionsEpic.d.ts +13 -0
  110. package/lib/view/expenseAutomationView/epics/jeSchedule/oneTimeAccrualActionsEpic.js +187 -0
  111. package/lib/view/expenseAutomationView/epics/jeSchedule/revertJeScheduleEpic.d.ts +65 -0
  112. package/lib/view/expenseAutomationView/epics/jeSchedule/revertJeScheduleEpic.js +115 -0
  113. package/lib/view/expenseAutomationView/epics/jeSchedule/switchJESchedulesTabEpic.d.ts +7 -0
  114. package/lib/view/expenseAutomationView/epics/jeSchedule/switchJESchedulesTabEpic.js +37 -0
  115. package/lib/view/expenseAutomationView/expenseAutomationViewSelector.js +22 -7
  116. package/lib/view/expenseAutomationView/helpers/newScheduleLocalDataHelper.d.ts +36 -0
  117. package/lib/view/expenseAutomationView/helpers/newScheduleLocalDataHelper.js +145 -0
  118. package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
  119. package/lib/view/expenseAutomationView/payload/actualMatchingPayload.d.ts +66 -0
  120. package/lib/view/expenseAutomationView/payload/actualMatchingPayload.js +40 -0
  121. package/lib/view/expenseAutomationView/payload/jeSchedulesPayload.d.ts +86 -3
  122. package/lib/view/expenseAutomationView/payload/jeSchedulesPayload.js +58 -1
  123. package/lib/view/expenseAutomationView/reducers/actualMatchingViewReducer.d.ts +53 -0
  124. package/lib/view/expenseAutomationView/reducers/actualMatchingViewReducer.js +264 -0
  125. package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.d.ts +93 -12
  126. package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +321 -29
  127. package/lib/view/expenseAutomationView/reducers/missingReceiptsViewReducer.d.ts +1 -1
  128. package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.d.ts +2 -2
  129. package/lib/view/expenseAutomationView/selectorTypes/actualMatchingViewSelectorTypes.d.ts +58 -0
  130. package/lib/view/expenseAutomationView/selectorTypes/expenseAutomationViewSelectorTypes.d.ts +2 -0
  131. package/lib/view/expenseAutomationView/selectorTypes/jeAccountSettingsViewSelectorTypes.d.ts +1 -0
  132. package/lib/view/expenseAutomationView/selectorTypes/jeNewScheduleViewSelectorTypes.d.ts +42 -0
  133. package/lib/view/expenseAutomationView/selectorTypes/jeNewScheduleViewSelectorTypes.js +2 -0
  134. package/lib/view/expenseAutomationView/selectorTypes/jeSchedulesSelectorTypes.d.ts +36 -7
  135. package/lib/view/expenseAutomationView/selectors/actualMatchingViewSelector.d.ts +9 -0
  136. package/lib/view/expenseAutomationView/selectors/actualMatchingViewSelector.js +172 -0
  137. package/lib/view/expenseAutomationView/selectors/jeAccountSettingsViewSelector.js +1 -0
  138. package/lib/view/expenseAutomationView/selectors/jeNewScheduleViewSelector.d.ts +21 -0
  139. package/lib/view/expenseAutomationView/selectors/jeNewScheduleViewSelector.js +112 -0
  140. package/lib/view/expenseAutomationView/selectors/jeSchedulesViewSelector.d.ts +34 -0
  141. package/lib/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +305 -21
  142. package/lib/view/expenseAutomationView/types/actualMatchingViewState.d.ts +76 -0
  143. package/lib/view/expenseAutomationView/types/actualMatchingViewState.js +27 -0
  144. package/lib/view/expenseAutomationView/types/completedSubTab.d.ts +1 -1
  145. package/lib/view/expenseAutomationView/types/jeSchedulesViewState.d.ts +83 -8
  146. package/lib/view/expenseAutomationView/types/jeSchedulesViewState.js +11 -7
  147. package/lib/view/expenseAutomationView/types/reconciliationViewState.d.ts +2 -2
  148. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewPayload.d.ts +1 -12
  149. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewPayload.js +9 -25
  150. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/saveInvoicingCatalogItemEpic.js +1 -6
  151. package/lib/view/invoicing/invoicingQboView/invoicingQboViewSelector.d.ts +1 -10
  152. package/lib/view/invoicing/invoicingQboView/invoicingQboViewSelector.js +1 -43
  153. package/lib/view/invoicing/settingsView/settingsViewEpics.d.ts +12 -0
  154. package/lib/view/invoicing/settingsView/settingsViewEpics.js +99 -0
  155. package/lib/view/invoicing/settingsView/settingsViewReducer.d.ts +1 -4
  156. package/lib/view/invoicing/settingsView/settingsViewReducer.js +2 -26
  157. package/lib/view/invoicing/settingsView/settingsViewSelector.d.ts +0 -35
  158. package/lib/view/invoicing/settingsView/settingsViewSelector.js +1 -43
  159. package/lib/view/invoicing/settingsView/settingsViewState.d.ts +0 -8
  160. package/lib/view/recommendation/recommendationPayload.d.ts +0 -34
  161. package/lib/view/recommendation/recommendationReducer.d.ts +1 -2
  162. package/lib/view/recommendation/recommendationReducer.js +2 -17
  163. package/lib/view/scheduleView/scheduleListView/epics/fetchAccruedScheduleListEpic.js +1 -1
  164. package/lib/view/scheduleView/scheduleListView/epics/fetchDownloadSchedulesEpic.js +7 -2
  165. package/lib/view/scheduleView/scheduleListView/scheduleListReducer.d.ts +4 -2
  166. package/lib/view/scheduleView/scheduleListView/scheduleListReducer.js +5 -3
  167. package/package.json +1 -1
  168. package/lib/esm/view/invoicing/settingsView/epics/connectInvoicingStripeEpic.js +0 -27
  169. package/lib/esm/view/invoicing/settingsView/epics/disconnectInvoicingStripeEpic.js +0 -19
  170. package/lib/esm/view/invoicing/settingsView/epics/fetchInvoicingSettingsEpic.js +0 -19
  171. package/lib/esm/view/invoicing/settingsView/epics/saveInvoicingSettingsEpic.js +0 -39
  172. package/lib/esm/view/invoicing/settingsView/epics/submitInvoicingQboSettingsEpic.js +0 -25
  173. package/lib/esm/view/invoicing/settingsView/invoicingQboSettingsFormConfig.js +0 -48
  174. package/lib/esm/view/recommendation/submitRecommendationFeedbackEpic.js +0 -52
  175. package/lib/view/invoicing/settingsView/epics/connectInvoicingStripeEpic.d.ts +0 -6
  176. package/lib/view/invoicing/settingsView/epics/connectInvoicingStripeEpic.js +0 -31
  177. package/lib/view/invoicing/settingsView/epics/disconnectInvoicingStripeEpic.d.ts +0 -6
  178. package/lib/view/invoicing/settingsView/epics/disconnectInvoicingStripeEpic.js +0 -23
  179. package/lib/view/invoicing/settingsView/epics/fetchInvoicingSettingsEpic.d.ts +0 -6
  180. package/lib/view/invoicing/settingsView/epics/fetchInvoicingSettingsEpic.js +0 -23
  181. package/lib/view/invoicing/settingsView/epics/saveInvoicingSettingsEpic.d.ts +0 -6
  182. package/lib/view/invoicing/settingsView/epics/saveInvoicingSettingsEpic.js +0 -43
  183. package/lib/view/invoicing/settingsView/epics/settingsViewActionType.d.ts +0 -5
  184. package/lib/view/invoicing/settingsView/epics/submitInvoicingQboSettingsEpic.d.ts +0 -11
  185. package/lib/view/invoicing/settingsView/epics/submitInvoicingQboSettingsEpic.js +0 -29
  186. package/lib/view/invoicing/settingsView/invoicingQboSettingsFormConfig.d.ts +0 -34
  187. package/lib/view/invoicing/settingsView/invoicingQboSettingsFormConfig.js +0 -53
  188. package/lib/view/recommendation/submitRecommendationFeedbackEpic.d.ts +0 -7
  189. package/lib/view/recommendation/submitRecommendationFeedbackEpic.js +0 -56
  190. /package/lib/esm/view/{invoicing/settingsView/epics/settingsViewActionType.js → expenseAutomationView/selectorTypes/actualMatchingViewSelectorTypes.js} +0 -0
  191. /package/lib/view/{invoicing/settingsView/epics/settingsViewActionType.js → expenseAutomationView/selectorTypes/actualMatchingViewSelectorTypes.js} +0 -0
@@ -5,18 +5,34 @@ import { getClassById } from '../class/classSelector';
5
5
  import { getScheduleTransactionById } from '../transaction/transactionSelector';
6
6
  import { getUserByUserId } from '../user/userSelector';
7
7
  import { getVendorByVendorId } from '../vendor/vendorSelector';
8
+ // Takes the slice, not RootState: an accrual denormalizes its vendor, account and class names, so
9
+ // unlike getJEAccruedScheduleByJEScheduleKey this joins nothing.
10
+ //
11
+ // Spreads the stored entity rather than rebuilding it field by field. That is deliberate — the
12
+ // accrued joiner listed every field explicitly and silently dropped jeScheduleType, which made a
13
+ // whole tab render empty while its reducer test still passed. A spread cannot lose a field.
14
+ export const getJEOneTimeAccrualByKey = (jeOneTimeAccrualKey, jeSchedulesState) => {
15
+ const accrual = recordGet(jeSchedulesState.oneTimeAccrualsByKey, jeOneTimeAccrualKey);
16
+ if (accrual == null) {
17
+ return undefined;
18
+ }
19
+ return { ...accrual, jeOneTimeAccrualKey };
20
+ };
8
21
  export const getJEAccruedScheduleByJEScheduleKey = (JEScheduleKey, state) => {
9
22
  const { jeSchedulesState, vendorState, accountState, userState, classState } = state;
10
23
  const JEAccruedScheduleState = recordGet(jeSchedulesState.schedulesByAccruedJEScheduleKey, JEScheduleKey);
11
24
  if (JEAccruedScheduleState == null) {
12
25
  return undefined;
13
26
  }
14
- const { period, updatedByUserID: updatedBy, vendorId, jeCredit, jeDebit, currencyCode, currencySymbol, balanceAsOfToday, startDate, endDate, status, updatedAt, jeScheduleId, scheduledJournalEntry, dayOfPostingDate: postingDate, lastDayOfMonth, memo, recurringAmount, createTime, otherAttributes, } = JEAccruedScheduleState;
27
+ const { period, updatedByUserID: updatedBy, createdByUserID: createdBy, vendorId, jeCredit, jeDebit, currencyCode, currencySymbol, balanceAsOfToday, startDate, endDate, status, updatedAt, jeScheduleId, scheduledJournalEntry, dayOfPostingDate: postingDate, lastDayOfMonth, memo, recurringAmount, createTime, otherAttributes, jeScheduleType, } = JEAccruedScheduleState;
15
28
  const vendorDetails = getVendorByVendorId(vendorState, vendorId);
16
29
  if (vendorDetails == null) {
17
30
  throw new Error(`Vendor with ${vendorId} doesn't exist`);
18
31
  }
19
32
  const userDetails = updatedBy != null ? getUserByUserId(userState, updatedBy) : undefined;
33
+ // Resolved the same way the prepaid / fixed joiner does. Without it every accrued row rendered a
34
+ // hyphen under "Created by", even though the payload carries created_by.
35
+ const createdByUserDetails = createdBy != null ? getUserByUserId(userState, createdBy) : undefined;
20
36
  const accountCredit = jeCredit.accountId != null
21
37
  ? getAccountBase(accountState, jeCredit.accountId, 'account_list')
22
38
  : undefined;
@@ -35,14 +51,19 @@ export const getJEAccruedScheduleByJEScheduleKey = (JEScheduleKey, state) => {
35
51
  reportId: 'class_list',
36
52
  })
37
53
  : undefined;
54
+ const postedCount = scheduledJournalEntry.filter((sje) => sje.status.code === 'posted' || sje.status.code === 'recorded').length;
55
+ const lifecycleTotal = period ?? scheduledJournalEntry.length;
38
56
  return {
39
57
  jeScheduleId,
40
58
  otherAttributes,
41
59
  vendor: vendorDetails,
42
60
  updatedByUser: userDetails,
61
+ createdByUser: createdByUserDetails,
43
62
  updatedAt,
44
63
  currencyCode,
45
64
  currencySymbol,
65
+ lifecycleTotal,
66
+ postedCount,
46
67
  jeCredit: {
47
68
  accountingClass: classCredit,
48
69
  account: accountCredit,
@@ -60,6 +81,7 @@ export const getJEAccruedScheduleByJEScheduleKey = (JEScheduleKey, state) => {
60
81
  memo,
61
82
  createTime,
62
83
  recurringAmount,
84
+ jeScheduleType,
63
85
  jeAccruedScheduleKey: JEScheduleKey,
64
86
  balanceAsOfToday: balanceAsOfToday != null
65
87
  ? toAmount(balanceAsOfToday, currencyCode, currencySymbol)
@@ -70,7 +92,7 @@ export const getJEAccruedScheduleByJEScheduleKey = (JEScheduleKey, state) => {
70
92
  export const getJEScheduledTransactionByJEScheduleTransactionKey = (jeScheduleTransactionKey, state) => {
71
93
  const { jeSchedulesState, vendorState, accountState, userState, classState, transactionState, } = state;
72
94
  const jeScheduleTransactionState = recordGet(jeSchedulesState.schedulesByTransactionKey, jeScheduleTransactionKey);
73
- const { period, updatedByUserID: updatedBy, createdByUserID: createdBy, vendorId, jeCredit, jeDebit, currencyCode, currencySymbol, balanceAsOfToday, baseTransaction, startDate, endDate, status, updatedAt, jeScheduleId, scheduledJournalEntry, dayOfPostingDate: postingDate, lastDayOfMonth, otherAttributes, jeScheduleType, aiSummaries, recommendations, } = jeScheduleTransactionState;
95
+ const { period, updatedByUserID: updatedBy, createdByUserID: createdBy, createTime, vendorId, jeCredit, jeDebit, currencyCode, currencySymbol, balanceAsOfToday, baseTransaction, startDate, endDate, status, updatedAt, jeScheduleId, scheduledJournalEntry, dayOfPostingDate: postingDate, lastDayOfMonth, otherAttributes, jeScheduleType, aiSummaries, confidenceScore, recommendations, recurringAmount, postedCount: postedCountFromServer, } = jeScheduleTransactionState;
74
96
  const vendorDetails = getVendorByVendorId(vendorState, vendorId);
75
97
  if (vendorDetails == null) {
76
98
  throw new Error(`Vendor with ${vendorId} doesn't exist`);
@@ -99,14 +121,24 @@ export const getJEScheduledTransactionByJEScheduleTransactionKey = (jeScheduleTr
99
121
  reportId: 'class_list',
100
122
  })
101
123
  : undefined;
124
+ // The expense-automation response carries no scheduled journal entries for these rows, so the
125
+ // filter below counts an empty array and every schedule reported 0 posted. Prefer the count the
126
+ // server derives, and keep the filter for callers that do have entries (the detail page, and
127
+ // failed postings, which come with theirs).
128
+ const postedCount = postedCountFromServer ??
129
+ scheduledJournalEntry.filter((sje) => sje.status.code === 'posted' || sje.status.code === 'recorded').length;
130
+ const lifecycleTotal = period ?? scheduledJournalEntry.length;
102
131
  return {
103
132
  jeScheduleId,
104
133
  jeScheduleType,
134
+ recurringAmount,
105
135
  jeScheduleTransactionKey: jeScheduleTransactionKey,
106
136
  vendor: vendorDetails,
107
137
  updatedByUser: userDetails,
108
138
  updatedAt: updatedAt,
109
139
  period,
140
+ lifecycleTotal,
141
+ postedCount,
110
142
  balanceAsOfToday: balanceAsOfToday != null
111
143
  ? toAmount(balanceAsOfToday, currencyCode, currencySymbol)
112
144
  : undefined,
@@ -129,7 +161,9 @@ export const getJEScheduledTransactionByJEScheduleTransactionKey = (jeScheduleTr
129
161
  },
130
162
  scheduledJournalEntry,
131
163
  aiSummaries,
164
+ confidenceScore,
132
165
  createdByUser: createdByUserDetails,
166
+ createTime,
133
167
  recommendations,
134
168
  };
135
169
  };
@@ -24,6 +24,84 @@ const SCHEDULE_STATUS_CODE = [
24
24
  'draft',
25
25
  ];
26
26
  export const toScheduleStatusCodeType = (v) => stringToUnion(v, SCHEDULE_STATUS_CODE);
27
+ // One-time accruals come from agent-je's Mongo `accruals` collection, not the JE schedule
28
+ // datastore, so they carry their own status vocabulary rather than SCHEDULE_STATUS_CODE.
29
+ // `posting` and `reversing` are transient claims held while a JE posts.
30
+ const ONE_TIME_ACCRUAL_STATUS_CODE = [
31
+ 'draft',
32
+ 'posting',
33
+ 'posted',
34
+ 'posting_blocked',
35
+ 'reversing',
36
+ 'reversed',
37
+ ];
38
+ export const toOneTimeAccrualStatusCodeType = (v) => stringToUnion(v, ONE_TIME_ACCRUAL_STATUS_CODE);
39
+ // Who created the accrual. This — not the creator's email — is the authoritative
40
+ // AI-vs-manual signal for the Method column.
41
+ const ONE_TIME_ACCRUAL_ORIGIN = ['agent', 'human'];
42
+ export const toOneTimeAccrualOriginType = (v) => stringToUnion(v, ONE_TIME_ACCRUAL_ORIGIN);
43
+ const ONE_TIME_ACCRUAL_AUTOMATION_TIER = ['manual', 'draft', 'auto'];
44
+ export const toOneTimeAccrualAutomationTierType = (v) => stringToUnion(v, ONE_TIME_ACCRUAL_AUTOMATION_TIER);
45
+ // How the accrual is allowed to reverse. The two are exclusive: a scheduled row reverses on
46
+ // expectedReversalDate and bills never drive it; an on_bill_match row reverses only when a bill
47
+ // is matched, which is why its lifecycle reads "Reverses on match" rather than showing a date.
48
+ const ONE_TIME_ACCRUAL_REVERSAL_POLICY = [
49
+ 'on_bill_match',
50
+ 'scheduled_date',
51
+ ];
52
+ export const toOneTimeAccrualReversalPolicyType = (v) => stringToUnion(v, ONE_TIME_ACCRUAL_REVERSAL_POLICY);
53
+ // What actually caused a reverse. Distinct from a *revert*, which soft-deletes the row and
54
+ // never sets this.
55
+ const ONE_TIME_ACCRUAL_REVERSAL_TRIGGER = [
56
+ 'bill_match',
57
+ 'scheduled_date',
58
+ 'manual_reverse',
59
+ ];
60
+ export const toOneTimeAccrualReversalTriggerType = (v) => stringToUnionStrict(v ?? '', ONE_TIME_ACCRUAL_REVERSAL_TRIGGER);
61
+ // Why a human told the AI Accountant not to accrue this month. The gateway validates against
62
+ // exactly this set, so it is a union rather than a free-text string.
63
+ const ONE_TIME_ACCRUAL_IGNORE_REASON = [
64
+ 'no_activity',
65
+ 'paused',
66
+ 'too_small',
67
+ 'need_invoice',
68
+ 'other_ignore',
69
+ ];
70
+ export const toOneTimeAccrualIgnoreReasonType = (v) => stringToUnion(v, ONE_TIME_ACCRUAL_IGNORE_REASON);
71
+ export const ALL_ONE_TIME_ACCRUAL_IGNORE_REASONS = ONE_TIME_ACCRUAL_IGNORE_REASON;
72
+ // Why a recommended prepaid / fixed-asset schedule is being dismissed. A different set from the
73
+ // accrual ignore reasons: the gateway validates each against its own list.
74
+ const JE_SCHEDULE_IGNORE_REASON = [
75
+ 'not_needed',
76
+ 'wrong_account',
77
+ 'duplicate',
78
+ 'already_handled',
79
+ 'other_ignore',
80
+ ];
81
+ export const toJEScheduleIgnoreReasonType = (v) => stringToUnion(v, JE_SCHEDULE_IGNORE_REASON);
82
+ export const ALL_JE_SCHEDULE_IGNORE_REASONS = JE_SCHEDULE_IGNORE_REASON;
83
+ // Why a posted prepaid / fixed-asset schedule is being undone. Note `not_accrual` is accrual-only
84
+ // and rejected here, and `created_by_mistake` is schedule-only.
85
+ const JE_SCHEDULE_REVERT_REASON = [
86
+ 'amount_off',
87
+ 'wrong_period',
88
+ 'duplicate',
89
+ 'created_by_mistake',
90
+ 'other_revert',
91
+ ];
92
+ export const toJEScheduleRevertReasonType = (v) => stringToUnion(v, JE_SCHEDULE_REVERT_REASON);
93
+ export const ALL_JE_SCHEDULE_REVERT_REASONS = JE_SCHEDULE_REVERT_REASON;
94
+ // Why a posted accrual is being undone. A disjoint set from the ignore reasons — the gateway
95
+ // validates each action against its own list and rejects the other's values.
96
+ const ONE_TIME_ACCRUAL_REVERT_REASON = [
97
+ 'amount_off',
98
+ 'wrong_period',
99
+ 'not_accrual',
100
+ 'duplicate',
101
+ 'other_revert',
102
+ ];
103
+ export const toOneTimeAccrualRevertReasonType = (v) => stringToUnion(v, ONE_TIME_ACCRUAL_REVERT_REASON);
104
+ export const ALL_ONE_TIME_ACCRUAL_REVERT_REASONS = ONE_TIME_ACCRUAL_REVERT_REASON;
27
105
  const JOURNAL_ENTRY_ERROR_CODE = [
28
106
  'vendor_deleted',
29
107
  'debit_category_deleted',
@@ -116,6 +116,9 @@ const ALL_SNACKBAR_MESSAGE_SECTIONS = [
116
116
  'save_schedule',
117
117
  'delete_schedule',
118
118
  'ignore_schedule',
119
+ 'revert_schedule',
120
+ 'ignore_accrual',
121
+ 'revert_accrual',
119
122
  'save_task_detail',
120
123
  'fetch_task_detail',
121
124
  'delete_task',
@@ -30,5 +30,7 @@ export const toScheduleTransaction = (payload, currency_code, currency_symbol) =
30
30
  currencySymbol: currency_symbol,
31
31
  },
32
32
  description: payload.transaction_description ?? undefined,
33
+ vendorId: payload.vendor_id ?? undefined,
34
+ vendorName: payload.vendor_name ?? undefined,
33
35
  };
34
36
  };
package/lib/esm/epic.js CHANGED
@@ -185,6 +185,11 @@ import { updateCombinedStatementInfoEpic, } from './view/expenseAutomationView/e
185
185
  import { updateReconcileTabLocalDataEpic as updateExpenseAutomationReconciliationBalanceLocalDataEpic, } from './view/expenseAutomationView/epics/accountRecon/updateReconcileTabLocalDataEpic';
186
186
  import { updateStatementInfoEpic, } from './view/expenseAutomationView/epics/accountRecon/updateStatementInfoEpic';
187
187
  import { uploadAccountStatementEpic, } from './view/expenseAutomationView/epics/accountRecon/uploadAccountStatementEpic';
188
+ import { fetchActualMatchingEpic as fetchExpenseAutomationActualMatchingEpic, } from './view/expenseAutomationView/epics/actualMatching/fetchActualMatchingEpic';
189
+ import { fetchActualMatchingPageEpic as fetchExpenseAutomationActualMatchingPageEpic, } from './view/expenseAutomationView/epics/actualMatching/fetchActualMatchingPageEpic';
190
+ import { matchAndReverseAccrualsEpic, } from './view/expenseAutomationView/epics/actualMatching/matchAndReverseAccrualsEpic';
191
+ import { searchMatchAccrualsEpic, } from './view/expenseAutomationView/epics/actualMatching/searchMatchAccrualsEpic';
192
+ import { searchMatchTransactionsEpic, } from './view/expenseAutomationView/epics/actualMatching/searchMatchTransactionsEpic';
188
193
  import { fetchAllExpenseAutomationTabsEpic, } from './view/expenseAutomationView/epics/common/fetchAllExpenseAutomationTabsEpic';
189
194
  import { refreshExpenseAutomationCurrentTabEpic, } from './view/expenseAutomationView/epics/common/refreshExpenseAutomationCurrentTabEpic';
190
195
  import { fetchFluxAnalysisViewEpic as fetchExpenseAutomationFluxAnalysisViewEpic, } from './view/expenseAutomationView/epics/fluxAnalysis/fetchFluxAnalysisViewEpic';
@@ -195,9 +200,17 @@ import { initializeAccountSettingsViewEpic, } from './view/expenseAutomationView
195
200
  import { saveAccountSettingsViewEpic, } from './view/expenseAutomationView/epics/jeSchedule/accountSettings/saveAccountSettingsViewEpic';
196
201
  import { fetchJeSchedulesPageEpic as fetchExpenseAutomationJESchedulesPageEpic, } from './view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulePageEpic';
197
202
  import { fetchJeSchedulesEpic as fetchExpenseAutomationJeSchedulesEpic, } from './view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic';
203
+ import { fetchOneTimeAccrualEpic, } from './view/expenseAutomationView/epics/jeSchedule/fetchOneTimeAccrualEpic';
198
204
  import { ignoreRecommendedJeScheduleEpic as ignoreExpenseAutomationJEScheduleEpic, } from './view/expenseAutomationView/epics/jeSchedule/ignoreRecommendedJeScheduleEpic';
199
205
  import { initializeJeScheduleLocalDataEpic as initializeExpenseAutomationJeScheduleLocalDataEpic, } from './view/expenseAutomationView/epics/jeSchedule/initializeJeScheduleLocalDataEpic';
206
+ import { createOneTimeAccrualEpic, } from './view/expenseAutomationView/epics/jeSchedule/newSchedule/createOneTimeAccrualEpic';
207
+ import { initializeNewScheduleEpic, } from './view/expenseAutomationView/epics/jeSchedule/newSchedule/initializeNewScheduleEpic';
208
+ import { saveNewScheduleEpic, } from './view/expenseAutomationView/epics/jeSchedule/newSchedule/saveNewScheduleEpic';
209
+ import { searchTransactionsForNewScheduleEpic, } from './view/expenseAutomationView/epics/jeSchedule/newSchedule/searchTransactionsForNewScheduleEpic';
210
+ import { oneTimeAccrualActionsEpic, } from './view/expenseAutomationView/epics/jeSchedule/oneTimeAccrualActionsEpic';
200
211
  import { retryJeScheduleEpic as retryExpenseAutomationJEScheduleEpic, } from './view/expenseAutomationView/epics/jeSchedule/retryJeSchedulesEpic';
212
+ import { revertJeScheduleEpic, } from './view/expenseAutomationView/epics/jeSchedule/revertJeScheduleEpic';
213
+ import { switchJESchedulesTabEpic as switchExpenseAutomationJESchedulesTabEpic, } from './view/expenseAutomationView/epics/jeSchedule/switchJESchedulesTabEpic';
201
214
  import { bulkUploadMatchResultToastEpic, } from './view/expenseAutomationView/epics/missingReceipts/bulkUploadMatchResultToastEpic';
202
215
  import { bulkUploadReceiptsEpic, } from './view/expenseAutomationView/epics/missingReceipts/bulkUploadReceiptsEpic';
203
216
  import { confirmBulkUploadMatchEpic, } from './view/expenseAutomationView/epics/missingReceipts/confirmBulkUploadMatchEpic';
@@ -310,12 +323,8 @@ import { issueCreditNoteEpic } from './view/invoicing/issueCreditNote/issueCredi
310
323
  import { runInvoicingPaymentActionEpic, } from './view/invoicing/paymentAction/paymentActionEpic';
311
324
  import { addPromotionalCreditsEpic, } from './view/invoicing/promotionalCreditAction/promotionalCreditActionEpic';
312
325
  import { recordPaymentEpic, } from './view/invoicing/recordPayment/recordPaymentEpic';
313
- import { connectInvoicingStripeEpic } from './view/invoicing/settingsView/epics/connectInvoicingStripeEpic';
314
- import { disconnectInvoicingStripeEpic } from './view/invoicing/settingsView/epics/disconnectInvoicingStripeEpic';
315
- import { fetchInvoicingSettingsEpic } from './view/invoicing/settingsView/epics/fetchInvoicingSettingsEpic';
316
- import { saveInvoicingSettingsEpic } from './view/invoicing/settingsView/epics/saveInvoicingSettingsEpic';
317
- import { submitInvoicingQboSettingsEpic } from './view/invoicing/settingsView/epics/submitInvoicingQboSettingsEpic';
318
326
  import { initializeInvoicingBrandingAddressEpic, submitInvoicingBrandingFormEpic, } from './view/invoicing/settingsView/invoicingBrandingFormEpics';
327
+ import { connectInvoicingStripeEpic, disconnectInvoicingStripeEpic, fetchInvoicingSettingsEpic, saveInvoicingSettingsEpic, } from './view/invoicing/settingsView/settingsViewEpics';
319
328
  import { runInvoicingSubscriptionActionEpic, } from './view/invoicing/subscriptionAction/subscriptionActionEpic';
320
329
  import { fetchMonthClosePerformanceTrendEpic, } from './view/monthEndCloseChecksView/epics/fetchMonthClosePerformanceTrendEpic';
321
330
  import { fetchMonthEndCloseChecksEpic, } from './view/monthEndCloseChecksView/epics/fetchMonthEndCloseChecksEpic';
@@ -390,7 +399,6 @@ import { fetchEntityRecommendationsByTransactionIdEpic, } from './view/recommend
390
399
  import { fetchEntityRecommendationsForLineUpdateEpic, } from './view/recommendation/fetchEntityRecommendationsForLineUpdateEpic';
391
400
  import { fetchRecommendationByEntityIdEpic, } from './view/recommendation/fetchRecommendationByEntityIdEpic';
392
401
  import { fetchRecommendationByEntityNameEpic, } from './view/recommendation/fetchRecommendationByEntityNameEpic';
393
- import { submitRecommendationFeedbackEpic, } from './view/recommendation/submitRecommendationFeedbackEpic';
394
402
  import { fetchReferralsEpic, } from './view/referralView/epics/fetchReferralsEpic';
395
403
  import { fetchRewardsPlanEpic, } from './view/referralView/epics/fetchRewardsPlanEpic';
396
404
  import { resendReferralInviteEpic, } from './view/referralView/epics/resendReferralInviteEpic';
@@ -784,6 +792,7 @@ const ALL_EPICS = [
784
792
  createNewSchedulesAccruedEpic,
785
793
  createNewSchedulesEpic,
786
794
  createNewTaskGroupEpic,
795
+ createOneTimeAccrualEpic,
787
796
  createPaymentInstrumentEpic,
788
797
  createSessionAndSubmitEpic,
789
798
  createSessionEpic,
@@ -955,6 +964,8 @@ const ALL_EPICS = [
955
964
  fetchEntityRecommendationsByTransactionIdEpic,
956
965
  fetchEntityRecommendationsForLineUpdateEpic,
957
966
  fetchExcludedResourcesEpic,
967
+ fetchExpenseAutomationActualMatchingEpic,
968
+ fetchExpenseAutomationActualMatchingPageEpic,
958
969
  fetchExpenseAutomationFluxAnalysisViewEpic,
959
970
  fetchExpenseAutomationInitializeTransactionCategorizationViewLocalDataEpic,
960
971
  fetchExpenseAutomationJeSchedulesEpic,
@@ -1063,6 +1074,7 @@ const ALL_EPICS = [
1063
1074
  fetchOnboardingCustomerSetupViewEpic,
1064
1075
  fetchOnboardingCustomerViewEpic,
1065
1076
  fetchOnboardingViewEpic,
1077
+ fetchOneTimeAccrualEpic,
1066
1078
  fetchOpExByVendorEpic,
1067
1079
  fetchOpExByVendorReportForTimeframeEpic,
1068
1080
  fetchOpExByVendorReportSummaryEpic,
@@ -1217,6 +1229,7 @@ const ALL_EPICS = [
1217
1229
  initializeInvoicingCustomerAddressEpic,
1218
1230
  initializeInvoicingSubscriptionAddressEpic,
1219
1231
  initializeMyProfileLocalDataEpic,
1232
+ initializeNewScheduleEpic,
1220
1233
  initializeOnboardingCustomerViewUpdateDataEpic,
1221
1234
  initializeRemiSetupApproverViewUpdateDataEpic,
1222
1235
  initializeRemiToLocalStoreEpic,
@@ -1238,7 +1251,9 @@ const ALL_EPICS = [
1238
1251
  lockChargeCardsEpic,
1239
1252
  markAsCompleteScheduleDetailEpic,
1240
1253
  markTransactionAsNotMiscategorizedEpic,
1254
+ matchAndReverseAccrualsEpic,
1241
1255
  notifyMeForFeatureEpic,
1256
+ oneTimeAccrualActionsEpic,
1242
1257
  parallelFetchAccountTransactionListEpic,
1243
1258
  parallelFetchClassTransactionListEpic,
1244
1259
  parallelFetchEntityTransactionListEpic,
@@ -1282,6 +1297,7 @@ const ALL_EPICS = [
1282
1297
  retryExpenseAutomationJEScheduleEpic,
1283
1298
  retryInvoicingQboSyncTaskEpic,
1284
1299
  retryOrRefundBillEpic,
1300
+ revertJeScheduleEpic,
1285
1301
  reviewDraftRemisBulkActionEpic,
1286
1302
  reviewExpenseAutomationFluxAnalysisViewEpic,
1287
1303
  revokeCardInviteEpic,
@@ -1317,6 +1333,7 @@ const ALL_EPICS = [
1317
1333
  saveInvoicingSubscriptionEpic,
1318
1334
  saveMagicLinkBankAccountEpic,
1319
1335
  saveNewAddressEpic,
1336
+ saveNewScheduleEpic,
1320
1337
  saveNotificationPreferencesEpic,
1321
1338
  saveNotificationSettingsEpic,
1322
1339
  saveOAuthConnectionEpic,
@@ -1340,7 +1357,10 @@ const ALL_EPICS = [
1340
1357
  saveVendorFirstReviewViewEpic,
1341
1358
  saveVendorsTabVendorEpic,
1342
1359
  scheduleTenantCreditScoreCronEpic,
1360
+ searchMatchAccrualsEpic,
1361
+ searchMatchTransactionsEpic,
1343
1362
  searchTransactionsForManualMatchEpic,
1363
+ searchTransactionsForNewScheduleEpic,
1344
1364
  seedAiCardCreationFormDraftEpic,
1345
1365
  seedAiCardPolicyFormDraftEpic,
1346
1366
  sendCompanyMonthEndReportEpic,
@@ -1362,9 +1382,8 @@ const ALL_EPICS = [
1362
1382
  submitFeedbackEpic,
1363
1383
  submitIntlVerificationEpic,
1364
1384
  submitInvoicingBrandingFormEpic,
1365
- submitInvoicingQboSettingsEpic,
1366
1385
  submitQuestionEpic,
1367
- submitRecommendationFeedbackEpic,
1386
+ switchExpenseAutomationJESchedulesTabEpic,
1368
1387
  syncInvoicingSubscriptionCouponsEpic,
1369
1388
  syncTabsAfterAutomatchEpic,
1370
1389
  toggleReportUIOptionForecastModeEpic,
package/lib/esm/index.js CHANGED
@@ -60,7 +60,7 @@ import { getForecast } from './entity/forecast/forecastSelector';
60
60
  import { toEntityType, } from './entity/genericEntity/entity';
61
61
  import { updateEntities } from './entity/genericEntity/entityReducer';
62
62
  import { getEntityByEntityIDs } from './entity/genericEntity/entitySelector';
63
- import { ALL_SCHEDULES_TYPES, getJEScheduleTransactionKey, toScheduleTypesType, toScheduleTypesTypeStrict, } from './entity/jeSchedules/jeSchedulesTypes';
63
+ import { ALL_JE_SCHEDULE_IGNORE_REASONS, ALL_JE_SCHEDULE_REVERT_REASONS, ALL_ONE_TIME_ACCRUAL_IGNORE_REASONS, ALL_ONE_TIME_ACCRUAL_REVERT_REASONS, ALL_SCHEDULES_TYPES, getJEScheduleTransactionKey, toScheduleTypesType, toScheduleTypesTypeStrict, } from './entity/jeSchedules/jeSchedulesTypes';
64
64
  import { ALL_MONTH_END_CLOSE_CHECKS_FREQUENCY, } from './entity/monthEndCloseChecks/monthEndCloseChecksState';
65
65
  import { updateCommentsNotifications, updateCommentsNotificationsStatuses, } from './entity/notification/notificationReducer';
66
66
  import { toNotificationModeStrict, } from './entity/notification/types/notificationTypes';
@@ -83,7 +83,7 @@ import { isTransferTransaction, } from './entity/transaction/stateTypes/otherTra
83
83
  import { toPlatformLineDetailType, } from './entity/transaction/stateTypes/transactionLine';
84
84
  import { toTransactionCategory, toTransactionType, toTransactionTypeStrict, } from './entity/transaction/stateTypes/transactionType';
85
85
  import { isVendorTransaction, isVendorTransactionWithCustomer, } from './entity/transaction/stateTypes/vendorTransaction';
86
- import { getSupportedTransactionById } from './entity/transaction/transactionSelector';
86
+ import { getScheduleTransactionById, getSupportedTransactionById, } from './entity/transaction/transactionSelector';
87
87
  import { getUserRoleByUserId, getUserRoleByUserIds, } from './entity/userRole/userRoleSelector';
88
88
  import { hasBillPayAccessible, hasBillPayFallbackAdminLevelAccess, hasChargeCardAccessible, hasReimbursementAccessible, hasReimbursementUserAccess, hasRemiFallbackAdminLevelAccess, hasTreasuryAccessible, hasZeniAccountsAccessible, isZeniSignedInUser, } from './entity/userRole/userRoleTenantAccess';
89
89
  import { getUserRoleMap, hasAICFOAccess, hasAdminLevelAccess, hasAnyCompanyRole, hasAnyFinOpRole, hasBillPayAccess, hasBillPayAdminLevelAccess, hasBookKeepingAdminLevelAccess, hasBookKeepingUserLevelAccess, hasChargeCardAccess, hasChargeCardAdminLevelAccess, hasEmployeeLevelAccess, hasFullOrAdminLevelAccess, hasInvestorBankerLevelAccess, hasInvoicingAdminLevelAccess, hasOnlyBillPayAccess, hasOnlyChargeCardAccess, hasOnlyReimbursementAccess, hasOnlyZeniAccountsAccess, hasReimbursementAccess, hasReimbursementAdminLevelAccess, hasSpendManagementAccess, hasSpendManagementAdminLevelAccess, hasSuperAdminLevelAccess, hasTreasuryAccess, hasTreasuryAdminLevelAccess, hasZeniAccountsAccess, hasZeniAccountsAdminLevelAccess, hasZeniRoleOrCompanyOfficerAccess, isFinOpsUserRoleType, isNonZeniRole, toUserRoleType, toUserRoleTypeStrict, } from './entity/userRole/userRoleType';
@@ -181,20 +181,24 @@ import uploadAccountStatementIntoDocumentAI from './view/expenseAutomationView/e
181
181
  import { fetchAllExpenseAutomationTabs, refreshExpenseAutomationCurrentTab, updateCurrentSelectedPeriod, updateCurrentSelectedView, } from './view/expenseAutomationView/expenseAutomationViewReducer';
182
182
  import { getExpenseAutomationView } from './view/expenseAutomationView/expenseAutomationViewSelector';
183
183
  import { toExpenseAutomationViewType, } from './view/expenseAutomationView/expenseAutomationViewState';
184
+ import { computeNewScheduleJeDetails } from './view/expenseAutomationView/helpers/newScheduleLocalDataHelper';
184
185
  import { isReviewTransactionBankTransferType, isReviewTransactionBillPaymentType, isReviewTransactionCreditCardCreditType, isReviewTransactionCreditCardPaymentType, isReviewTransactionDepositType, isReviewTransactionExpenseType, } from './view/expenseAutomationView/helpers/reconciliationHelpers';
185
186
  import { MAX_SELECTION_LIMIT, checkIfAllLineItemsAreCategoryClassFilled, getLineItemsByTransactionIdsFromLocalData, isAnyItemWithUncategorizedExpenseAccount, } from './view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper';
187
+ import { clearActualMatchingView as clearExpenseAutomationActualMatchingView, clearMatchNewModal, closeMatchNewModal, fetchActualMatching as fetchExpenseAutomationActualMatching, fetchActualMatchingPage as fetchExpenseAutomationActualMatchingPage, matchAndReverseAccruals, openMatchNewModal, searchMatchAccruals, searchMatchTransactions, updateActualMatchingUIState as updateExpenseAutomationActualMatchingUIState, } from './view/expenseAutomationView/reducers/actualMatchingViewReducer';
186
188
  import { clearExpenseAutomationFluxAnalysisView, fetchFluxAnalysisView, reviewFluxAnalysisView, updateFluxAnalysisViewPageMetaData, updateFluxAnalysisViewUIState, updateOperatingExpensesIdsForReview, updateSelectedSectionIdsForReview, } from './view/expenseAutomationView/reducers/fluxAnalysisViewReducer';
187
- import { clearJeScheduleLocalData as clearExpenseAutomationJEScheduleLocalData, clearExpenseAutomationJESchedulesView, fetchJeSchedulesPage as fetchExpenseAutomationJESchedulesPage, ignoreRecommendedJeSchedule as ignoreExpenseAutomationJESchedule, initializeAccountSettingsView as initializeJeAccountSettingsView, initializeJeScheduleLocalData, removeJeScheduleTransactionKey, retryJeSchedule as retryExpenseAutomationJESchedule, saveAccountSettings as saveJeAccountSettings, saveAccountSettingsLocalData as saveJeAccountSettingsLocalData, updateJESchedulesUIState as updateExpenseAutomationJESchedulesUIState, updateJeScheduleLocalDataById, updateJeScheduleTransactionKeys, } from './view/expenseAutomationView/reducers/jeSchedulesViewReducer';
189
+ import { clearJeScheduleLocalData as clearExpenseAutomationJEScheduleLocalData, clearExpenseAutomationJESchedulesView, clearSearchTransactionsForNewSchedule as clearJeSearchTransactionsForNewSchedule, createOneTimeAccrual, createOneTimeAccrualFailure, createOneTimeAccrualSuccess, fetchJeSchedulesPage as fetchExpenseAutomationJESchedulesPage, fetchOneTimeAccrual, ignoreRecommendedJeSchedule as ignoreExpenseAutomationJESchedule, ignoreOneTimeAccrual, initializeAccountSettingsView as initializeJeAccountSettingsView, initializeNewSchedule as initializeJeNewSchedule, initializeJeScheduleLocalData, promoteOneTimeAccrual, removeJeScheduleTransactionKey, resetNewScheduleLocalData as resetJeNewScheduleLocalData, retryJeSchedule as retryExpenseAutomationJESchedule, revertJeSchedule, revertOneTimeAccrual, saveAccountSettings as saveJeAccountSettings, saveAccountSettingsLocalData as saveJeAccountSettingsLocalData, saveNewSchedule as saveJeNewSchedule, saveNewScheduleFailure as saveJeNewScheduleFailure, saveNewScheduleSuccess as saveJeNewScheduleSuccess, searchTransactionsForNewSchedule as searchJeTransactionsForNewSchedule, searchTransactionsForNewScheduleFailure as searchJeTransactionsForNewScheduleFailure, searchTransactionsForNewScheduleSuccess as searchJeTransactionsForNewScheduleSuccess, toggleJECreatedGroupCollapsed, toggleJEPendingGroupCollapsed, updateJESchedulesUIState as updateExpenseAutomationJESchedulesUIState, updateJEScheduleTypeFilter, updateNewScheduleLocalData as updateJeNewScheduleLocalData, updateJeScheduleLocalDataById, updateJeScheduleTransactionKeys, } from './view/expenseAutomationView/reducers/jeSchedulesViewReducer';
188
190
  import { acknowledgeBulkUploadConfirmMatchComplete, bulkUploadAutomatchingTimedOut, bulkUploadReceipts, bulkUploadReceiptsFailure, bulkUploadReceiptsSuccess, clearBulkUpload, clearBulkUploadBatchDetailsForScopeChange, clearManualSearchResults, clearMissingReceiptsTabNavigation, confirmBulkUploadMatch, confirmBulkUploadMatchFailure, confirmBulkUploadMatchSuccess, fetchBulkUploadBatchDetails, fetchBulkUploadBatchDetailsFailure, fetchBulkUploadBatchDetailsSuccess, fetchBulkUploadBatches, fetchBulkUploadBatchesFailure, fetchBulkUploadBatchesSuccess, fetchCompletedTransactions, fetchCompletedTransactionsFailure, fetchCompletedTransactionsSuccess, fetchMissingReceipts as fetchExpenseAutomationMissingReceipts, fetchMoreBatchDetails, fetchMoreBatchDetailsComplete, fetchMoreBatchDetailsFailure, markBatchDetailRefreshAttempted, markMissingReceiptAsDone as markExpenseAutomationMissingReceiptAsDone, pusherBatchStatusUpdate, refreshBatchDetailsForBatchId, requestMissingReceiptsTabNavigation, restoreBulkUploadAutomatchingOnMount, restoreBulkUploadMatchingState, searchTransactionsForManualMatch, searchTransactionsForManualMatchFailure, searchTransactionsForManualMatchSuccess, setBulkUploadCompletedSubTab, setBulkUploadResultsTab, setBulkUploadSortConfig, setBulkUploadUploadedFileCount, storeBatchDetails, updateBulkUploadProgress, updateMissingReceiptUploadState as updateExpenseAutomationMissingReceiptUploadState, updateMissingReceiptsUIState as updateExpenseAutomationMissingReceiptsUIState, uploadMissingReceiptSuccess as uploadExpenseAutomationMissingReceiptSuccess, } from './view/expenseAutomationView/reducers/missingReceiptsViewReducer';
189
191
  import { clearStatementDateConflict, confirmStatementMapping, deleteAccountStatement, excludeAccountFromReconciliation, fetchReconciliation as fetchReconciliationView, includeAccountInReconciliation, parseCombinedStatement, parseStatement, parseStatementFailure, parseStatementSuccess, reparseStatement, reparseStatementFailure, reparseStatementSuccess, resetReparseStatementStatus, saveReconciliationDetail as saveExpenseAutomationReconciliationDetail, saveReconciliationReview as saveExpenseAutomationReconciliationReview, setConnectionInProgressForAccount as setConnectionInProgressForAccountReconciliation, setStatementParseInProgress, setStatementProcessingDismissedToBackground, submitCombinedStatementUpdate, submitStatementUpdate, updateAccountReconciliationLocalData as updateExpenseAutomationAccountReconciliationLocalData, updateSelectedAccountId as updateExpenseAutomationAccountReconciliationSelectedAccountId, updateSelectedTab as updateExpenseAutomationAccountReconciliationSelectedTab, updateReconListScrollPosition as updateExpenseAutomationReconListScrollPosition, updateReviewTabSortState as updateExpenseAutomationReconReviewTabListSortState, updateReviewTabLocalData as updateExpenseAutomationReconReviewTabLocalData, updateReconcileTabListScrollState as updateExpenseAutomationReconcileTabListScrollState, updateReconcileTabListSortState as updateExpenseAutomationReconcileTabListSortState, updateReconcileTabLocalData as updateExpenseAutomationReconcileTabLocalData, updateSelectedDrawerAccountId as updateExpenseAutomationSelectedDrawerAccountId, updateNodeCollapseState, updateParsedStatementData, updateStatementProcessingBackgroundCompletedSteps, updateStatementProcessingFailed, updateStatementUpdateLocalData, updateStatementUploadChosen, uploadAccountStatement, } from './view/expenseAutomationView/reducers/reconciliationViewReducer';
190
192
  import { backgroundRefetchReviewTab, clearExpenseAutomationTransactionsView, fetchTransactionCategorization, fetchTransactionCategorizationFailure, fetchTransactionCategorizationView, initializeTransactionCategorizationViewLocalData, markCategoryClassRecommendationsFailureForCategorization, markTransactionAsNotMiscategorized, removeTransactionFromAllTabs, saveTransactionCategorization, saveTransactionCategorizationLocalData, setAllItemsToCategoryClassInLocalDataForCategorization, setEntityRecommendationForLineIdsForCategorization, syncTransactionCategorizationFromDetailSave, updateCurrentSelectedTransactionCategorizationTab, updateSelectedCheckboxTransactionIds, updateSelectedCustomerForTransaction, updateSelectedTransactionId, updateSelectedVendorForTransaction, updateTransactionCategorization, updateTransactionCategorizationCompletedSubTab, updateTransactionCategorizationSaveStatus, updateTransactionCategorizationUIState, updateTransactionCategorizationUploadReceiptState, updateTransactionFilters, updateTransactionGroup, uploadTransactionCategorizationReceiptSuccess, } from './view/expenseAutomationView/reducers/transactionsViewReducer';
191
193
  import { getExpenseAutomationFluxAnalysisView } from './view/expenseAutomationView/selectors/fluxAnalysisViewSelector';
194
+ import { getNewAccrualAccountsView as getJeNewAccrualAccountsView, getNewScheduleSearchTransactionsView as getJeNewScheduleSearchTransactionsView, getNewScheduleView as getJeNewScheduleView, } from './view/expenseAutomationView/selectors/jeNewScheduleViewSelector';
192
195
  import { getExpenseAutomationReconciliationView, getLedgerAccountsForCombinedStatementMapping, getReparseStatementStatusByAccountId, getUnavailableLedgerAccountIds, isAccountReconReport, } from './view/expenseAutomationView/selectors/reconciliationViewSelector';
193
196
  import { getExpenseAutomationTransactionView, getLastTransferEntryReplacement, } from './view/expenseAutomationView/selectors/transactionCategorizationSelector';
194
197
  import { applyTransactionFilters } from './view/expenseAutomationView/transactionFilterHelpers';
195
198
  import { TRANSACTION_FILTER_CATEGORIES, } from './view/expenseAutomationView/transactionFilterTypes';
199
+ import { MATCH_ACCRUAL_SEARCH_LIMIT, MATCH_SEARCH_DEBOUNCE_MS, MATCH_TRANSACTION_SEARCH_PAGE_SIZE, toActualMatchingSortKey as toExpenseAutomationActualMatchingSortKey, toMatchAndReverseResultStatus, } from './view/expenseAutomationView/types/actualMatchingViewState';
196
200
  import { DEFAULT_COMPLETED_SUB_TAB, toCompletedSubTab, } from './view/expenseAutomationView/types/completedSubTab';
197
- import { toJEScheduleMainTab as toExpenseAutomationJEScheduleMainTab, toJEScheduleSortKey as toExpenseAutomationJEScheduleSortKey, } from './view/expenseAutomationView/types/jeSchedulesViewState';
201
+ import { ALL_JE_PAGE_TABS, toJEScheduleSortKey as toExpenseAutomationJEScheduleSortKey, toJEPageTab, } from './view/expenseAutomationView/types/jeSchedulesViewState';
198
202
  import { BATCH_FILE_STATUSES, isUnmatchedTabFileStatus, toBatchFileStatus, toBatchStatusValue, toBulkUploadPhase, toBulkUploadResultsTab, toBulkUploadSortKey, toMatchSource, toMissingReceiptsTab, } from './view/expenseAutomationView/types/missingReceiptsViewState';
199
203
  import { toMissingReceiptsSortKey as toExpenseAutomationMissingReceiptsSortKey, } from './view/expenseAutomationView/types/missingReceiptsViewState';
200
204
  import { toReconciliationTabsType, } from './view/expenseAutomationView/types/reconciliationViewState';
@@ -264,7 +268,7 @@ import { fetchProfitAndLossForTimeframeProjectView, fetchProfitAndLossProjectVie
264
268
  import { getProfitAndLossProjectView } from './view/profitAndLossProjectView/profitAndLossProjectViewSelector';
265
269
  import { fetchProjectList } from './view/projectList/projectListReducer';
266
270
  import { getProjectList, } from './view/projectList/projectListSelector';
267
- import { fetchEntityRecommendationsByTransactionId, fetchEntityRecommendationsForLineUpdate, fetchRecommendationByEntityId, fetchRecommendationByEntityName, submitRecommendationFeedback, } from './view/recommendation/recommendationReducer';
271
+ import { fetchEntityRecommendationsByTransactionId, fetchEntityRecommendationsForLineUpdate, fetchRecommendationByEntityId, fetchRecommendationByEntityName, } from './view/recommendation/recommendationReducer';
268
272
  import { DEFAULT_REFERRER_AMOUNT, clearReferrals, fetchReferrals, fetchRewardsPlan, resendReferralInvite, saveReferralFormDataInLocalStore, sendReferralInvite, updateReferViewed, updateReferralListSortUiState, } from './view/referralView/referralReducer';
269
273
  import { getInviteFormView, getReferralListView, getRewardsPlanCard, } from './view/referralView/referralSelector';
270
274
  import { AmountStatusTypes, StatusTypes, toReferralListViewSortKeyType, } from './view/referralView/referralState';
@@ -483,9 +487,10 @@ export { stringToUnion, stringToUnionStrict };
483
487
  export { fetchMonthEndCloseChecks, fetchMonthClosePerformanceTrend, getMonthEndCloseChecksViewByTenantId, ALL_MONTH_END_CLOSE_CHECKS_FREQUENCY, };
484
488
  export {
485
489
  // Bulk Upload Types
486
- BATCH_FILE_STATUSES, isUnmatchedTabFileStatus, DEFAULT_COMPLETED_SUB_TAB, DEFAULT_TRANSACTION_GROUP, TRANSACTION_GROUPS, toTransactionGroup, toBatchFileStatus, toBatchStatusValue, toBulkUploadPhase, toBulkUploadResultsTab, toBulkUploadSortKey, toCompletedSubTab, toMatchSource, toMissingReceiptsTab, toExpenseAutomationJEScheduleMainTab, toExpenseAutomationJEScheduleSortKey, getExpenseAutomationView, toExpenseAutomationMissingReceiptsSortKey, toExpenseAutomationTransactionsTabKey, toExpenseAutomationViewType, uploadExpenseAutomationMissingReceiptSuccess, markExpenseAutomationMissingReceiptAsDone, fetchAllExpenseAutomationTabs, refreshExpenseAutomationCurrentTab, updateCurrentSelectedTransactionCategorizationTab, updateTransactionCategorizationCompletedSubTab, updateTransactionGroup, fetchExpenseAutomationMissingReceipts,
490
+ BATCH_FILE_STATUSES, isUnmatchedTabFileStatus, DEFAULT_COMPLETED_SUB_TAB, DEFAULT_TRANSACTION_GROUP, TRANSACTION_GROUPS, toTransactionGroup, toBatchFileStatus, toBatchStatusValue, toBulkUploadPhase, toBulkUploadResultsTab, toBulkUploadSortKey, toCompletedSubTab, toMatchSource, toMissingReceiptsTab, ALL_JE_PAGE_TABS, MATCH_ACCRUAL_SEARCH_LIMIT, MATCH_SEARCH_DEBOUNCE_MS, MATCH_TRANSACTION_SEARCH_PAGE_SIZE, toExpenseAutomationJEScheduleSortKey, toExpenseAutomationActualMatchingSortKey, toJEPageTab, toMatchAndReverseResultStatus, toggleJECreatedGroupCollapsed, toggleJEPendingGroupCollapsed, updateJEScheduleTypeFilter, getExpenseAutomationView, toExpenseAutomationMissingReceiptsSortKey, toExpenseAutomationTransactionsTabKey, toExpenseAutomationViewType, uploadExpenseAutomationMissingReceiptSuccess, markExpenseAutomationMissingReceiptAsDone, fetchAllExpenseAutomationTabs, refreshExpenseAutomationCurrentTab, updateCurrentSelectedTransactionCategorizationTab, updateTransactionCategorizationCompletedSubTab, updateTransactionGroup, fetchExpenseAutomationMissingReceipts,
487
491
  // Bulk Upload Actions
488
492
  bulkUploadReceipts, bulkUploadAutomatchingTimedOut, bulkUploadReceiptsSuccess, bulkUploadReceiptsFailure, restoreBulkUploadAutomatchingOnMount, restoreBulkUploadMatchingState, updateBulkUploadProgress, pusherBatchStatusUpdate, requestMissingReceiptsTabNavigation, clearMissingReceiptsTabNavigation, fetchBulkUploadBatchDetails, fetchBulkUploadBatchDetailsSuccess, fetchBulkUploadBatchDetailsFailure, storeBatchDetails, fetchMoreBatchDetails, fetchMoreBatchDetailsComplete, fetchMoreBatchDetailsFailure, fetchBulkUploadBatches, fetchBulkUploadBatchesSuccess, fetchBulkUploadBatchesFailure, clearBulkUploadBatchDetailsForScopeChange, markBatchDetailRefreshAttempted, refreshBatchDetailsForBatchId, confirmBulkUploadMatch, confirmBulkUploadMatchSuccess, confirmBulkUploadMatchFailure, setBulkUploadResultsTab, setBulkUploadCompletedSubTab, setBulkUploadSortConfig, setBulkUploadUploadedFileCount, clearBulkUpload, searchTransactionsForManualMatch, searchTransactionsForManualMatchSuccess, searchTransactionsForManualMatchFailure, clearManualSearchResults, acknowledgeBulkUploadConfirmMatchComplete, fetchCompletedTransactions, fetchCompletedTransactionsSuccess, fetchCompletedTransactionsFailure, fetchFluxAnalysisView, clearExpenseAutomationFluxAnalysisView, updateOperatingExpensesIdsForReview as updateFluxOperatingExpensesIdsForReview, updateSelectedSectionIdsForReview as updateFluxAnalysisSelectedSectionIdsForReview, reviewFluxAnalysisView, updateExpenseAutomationMissingReceiptUploadState, updateExpenseAutomationMissingReceiptsUIState, updateTransactionCategorizationUploadReceiptState, uploadTransactionCategorizationReceiptSuccess, getExpenseAutomationFluxAnalysisView, updateCurrentSelectedView, updateCurrentSelectedPeriod, getExpenseAutomationTransactionView, getLastTransferEntryReplacement, updateFluxAnalysisViewUIState, updateFluxAnalysisViewPageMetaData, MAX_SELECTION_LIMIT, checkIfAllLineItemsAreCategoryClassFilled, getLineItemsByTransactionIdsFromLocalData, isAnyItemWithUncategorizedExpenseAccount, excludeAccountFromReconciliation, includeAccountInReconciliation, saveExpenseAutomationReconciliationDetail, updateExpenseAutomationReconcileTabListScrollState, updateExpenseAutomationReconReviewTabListSortState, updateExpenseAutomationReconcileTabListSortState, updateExpenseAutomationReconcileTabLocalData, updateExpenseAutomationAccountReconciliationSelectedTab, updateExpenseAutomationAccountReconciliationSelectedAccountId, getExpenseAutomationReconciliationView, getLedgerAccountsForCombinedStatementMapping, getReparseStatementStatusByAccountId, getUnavailableLedgerAccountIds, fetchReconciliationView, uploadAccountStatementIntoDocumentAI, updateExpenseAutomationReconListScrollPosition, setConnectionInProgressForAccountReconciliation, getAccountReconByAccountIdAndSelectedPeriod, toReconciliationTabsType, isAccountReconReport, updateExpenseAutomationReconReviewTabLocalData, updateExpenseAutomationSelectedDrawerAccountId, updateStatementProcessingFailed, saveExpenseAutomationReconciliationReview, updateExpenseAutomationAccountReconciliationLocalData, toReconciliationAccountSource, deleteAccountStatement, uploadAccountStatement, parseCombinedStatement, parseStatement, parseStatementSuccess, parseStatementFailure, reparseStatement, reparseStatementSuccess, reparseStatementFailure, resetReparseStatementStatus, updateParsedStatementData, updateNodeCollapseState, updateStatementUploadChosen, submitCombinedStatementUpdate, submitStatementUpdate, clearStatementDateConflict, confirmStatementMapping, updateStatementUpdateLocalData, isReviewTransactionBankTransferType, isReviewTransactionBillPaymentType, isReviewTransactionCreditCardPaymentType, isReviewTransactionDepositType, isReviewTransactionExpenseType, isReviewTransactionCreditCardCreditType, setStatementParseInProgress, setStatementProcessingDismissedToBackground, updateStatementProcessingBackgroundCompletedSteps, };
493
+ export { computeNewScheduleJeDetails, createOneTimeAccrual, createOneTimeAccrualFailure, createOneTimeAccrualSuccess, fetchOneTimeAccrual, getJeNewAccrualAccountsView, ignoreOneTimeAccrual, promoteOneTimeAccrual, revertJeSchedule, revertOneTimeAccrual, getJeNewScheduleSearchTransactionsView, getJeNewScheduleView, };
489
494
  export { fetchTransactionCategorization, fetchTransactionCategorizationView, updateTransactionCategorizationUIState, updateTransactionFilters, updateSelectedCheckboxTransactionIds, markCategoryClassRecommendationsFailureForCategorization, setEntityRecommendationForLineIdsForCategorization, initializeTransactionCategorizationViewLocalData, setAllItemsToCategoryClassInLocalDataForCategorization, saveTransactionCategorizationLocalData, fetchTransactionCategorizationFailure, saveTransactionCategorization, updateTransactionCategorization, updateTransactionCategorizationSaveStatus, markTransactionAsNotMiscategorized, updateSelectedVendorForTransaction, updateSelectedCustomerForTransaction, updateSelectedTransactionId, syncTransactionCategorizationFromDetailSave, backgroundRefetchReviewTab, createTransferEntry, createTransferEntryFailure, createTransferEntryReplacedTransaction, createTransferEntrySuccess, resetCreateTransferEntryStatus, clearTransferEntryRouteReplacement, fetchAccountsForTransferFlow, removeTransactionFromAllTabs, clearExpenseAutomationTransactionsView, toTransactionsSortKey, };
490
495
  export { TOP_EX_TIME_PERIODS };
491
496
  export { toTimeframeTick, mapTimePeriodtoTimeframeTick, toTimePeriod, toAbsoluteDay, toMonthYearPeriodId, convertToPeriod, };
@@ -541,7 +546,7 @@ export { toTransactionType, toTransactionTypeStrict, toTransactionCategory, };
541
546
  export { defaultVendorCurrency, updateVendors };
542
547
  export { isVendorTransaction, isVendorTransactionWithCustomer, };
543
548
  export { isTransferTransaction };
544
- export { getSupportedTransactionById, };
549
+ export { getScheduleTransactionById, getSupportedTransactionById, };
545
550
  export { updateLatestTransactionId, parallelFetchAccountTransactionList, parallelFetchEntityTransactionList, fetchAccountTransactionList, updateTransactionListByAccount, updateTransactionListByAccountFailure, updateTransactionListByAccountUIState, parallelFetchClassTransactionList, updateTransactionListByClassUIState, updateTransactionListByClass, parallelFetchProjectTransactionList, updateTransactionListByProjectUIState, updateTransactionListByProject, updateTransactionListUIStateByCategoryType, parallelFetchTransactionListByCategoryType, };
546
551
  export { getTransactionListByAccount, getTransactionListUIStateByAccountKey, };
547
552
  export { fetchEntityTransactionList, updateTransactionListByEntity, saveTransactionDetailLocalData, clearTransactionDetailSaveStatus, updateTransactionListByEntityFailure, resetLineItemsCategoryClassInLocalData, setAllLineItemsToCategoryClassInLocalData, saveTransactionDetail, setAllLineItemsLocalDataIsUpdateAllChecked, initializeTransactionDetailLocalData, markCategoryClassRecommendationsFailureForTransactionDetail, removeEntityRecommendationForLineIdForTransactionDetail, updateSelectedVendor, updateSelectedCustomer, resetSelectedCustomer, resetVendor, updateLocalDataWithTransactionsUpdateWithVendorCheckbox, updateVendorToAllLineItems, resetAllLineItemsToVendor, updateLatestSelectedEntity, updateVendorBulkRecommendationsFetchStatus, setIsVendorUpdateAllChecked, addSplitLine, deleteSplitLine, toggleSplitEditMode, };
@@ -629,7 +634,7 @@ export { getSpendManagementEffectiveListPeriod, getSelectedCompanyOfficer, showB
629
634
  export { canSendMonthEndEmailReport, shouldEnableCalendarPickerForLastReportSent, };
630
635
  export { getInternationalSubConfigCodeKey, BILL_NEW_PAYMENT_METHODS, NEW_INTERNATIONAL_METHOD_SUBTEXT, SWIFT_OUR_INTERNATIONAL_METHOD_SUBTEXT, LOCAL_CURRENCY_INTERNATIONAL_METHOD_SUBTEXT, };
631
636
  export { getVendorList, updateSortUiState, updatePageToken, updateYTDSelectionUIState, isColumnYTDSpend, isVendorsTabVisible, toVendorReportIDType, getVendorFiling1099List, fetchVendorsFiling1099Download, };
632
- export { fetchEntityRecommendationsByTransactionId, fetchEntityRecommendationsForLineUpdate, fetchRecommendationByEntityId, fetchRecommendationByEntityName, submitRecommendationFeedback, };
637
+ export { fetchEntityRecommendationsByTransactionId, fetchEntityRecommendationsForLineUpdate, fetchRecommendationByEntityId, fetchRecommendationByEntityName, };
633
638
  export { fetchOwnerList };
634
639
  export { getZeniAccountsConfigDetail, getZeniAccountList, fetchZeniAccountList, fetchAccountList, createCheckingAccount, fetchPaymentAccountList, unlinkPaymentAccount, getDepositAccountDetail, getAllDepositAccounts, getDepositAccountDetailForPDF, fetchDepositAccount, fetchZeniAccountsConfig, updateTransferMoneyLocalData, updateTransferToLocalData, updateDepositToLocalData, transferMoney, getTransferDetail, clearTransferDetail, clearReviewTransferDetail, fetchReviewTransferDetail, fetchDepositAccountDetail, depositCheck, updateCheckDepositLocalData, clearCheckDeposit, getCheckDepositDetail, updateDepositAccount, fetchDepositAccountHistorySuccess, fetchDepositAccountHistoryFailure, fetchZeniAccStatementPage, getZeniAccStatements, };
635
640
  export { fetchDepositAccountTransactionList, getDepositAccountTransactionList, };
@@ -652,9 +657,10 @@ export { updateChargeCardTransactionAttachments, updateChargeCardStatusFromPushe
652
657
  export { TIME_SERIES_DURATIONS, convertToTimeSeriesSelectionRange, toTimeSeriesDuration, fetchAggregatedReport, aggregatedReportView, };
653
658
  export { fetchApAging, getApAgingReport, updateApAgingUIState, };
654
659
  export { fetchApAgingDetail, getApAgingDetailForVendor, updateApAgingDetailUIState, };
655
- export { clearExpenseAutomationJEScheduleLocalData, clearExpenseAutomationJESchedulesView, fetchExpenseAutomationJESchedulesPage, ignoreExpenseAutomationJESchedule, initializeJeAccountSettingsView, initializeJeScheduleLocalData, removeJeScheduleTransactionKey, retryExpenseAutomationJESchedule, updateExpenseAutomationJESchedulesUIState, updateJeScheduleLocalDataById, updateJeScheduleTransactionKeys, };
660
+ export { clearExpenseAutomationJEScheduleLocalData, clearExpenseAutomationJESchedulesView, clearJeSearchTransactionsForNewSchedule, fetchExpenseAutomationJESchedulesPage, ignoreExpenseAutomationJESchedule, initializeJeAccountSettingsView, initializeJeNewSchedule, initializeJeScheduleLocalData, removeJeScheduleTransactionKey, resetJeNewScheduleLocalData, retryExpenseAutomationJESchedule, saveJeNewSchedule, saveJeNewScheduleFailure, saveJeNewScheduleSuccess, searchJeTransactionsForNewSchedule, searchJeTransactionsForNewScheduleFailure, searchJeTransactionsForNewScheduleSuccess, updateExpenseAutomationJESchedulesUIState, updateJeNewScheduleLocalData, updateJeScheduleLocalDataById, updateJeScheduleTransactionKeys, };
661
+ export { clearExpenseAutomationActualMatchingView, closeMatchNewModal, clearMatchNewModal, fetchExpenseAutomationActualMatching, fetchExpenseAutomationActualMatchingPage, matchAndReverseAccruals, openMatchNewModal, searchMatchAccruals, searchMatchTransactions, updateExpenseAutomationActualMatchingUIState, };
656
662
  export { createNewSchedulesAccrued, deleteScheduleAccruedDetail, cancelScheduleAccruedJournalEntry, fetchScheduleAccruedDetails, fetchScheduleAccruedDetailsPage, resetJEAccruedLinkInLocalData, saveScheduleAccruedDetails, updateAmountsInScheduleAccruedDetail, updatedJEAccruedLinkWithRecommendedLocalData, updatedJELinkInLocalDataAccruedExpenses, fetchRecommendedTransactionRowIndex, clearSelectedJELinkRowIndex, updateLinkBillExpenseLocalData, updateScheduleAccruedDetailsLocalData, updateSelectedJEAccruedScheduleKey, resetSelectedJEAccruedScheduleKey, resetAccruedDetailNewScheduleState, };
657
- export { getJEScheduleTransactionKey, ALL_SCHEDULES_TYPES, getScheduleListReport, getAccruedScheduleListReport, fetchScheduleList, fetchAccruedScheduleList, fetchDownloadSchedules, fetchSchedulesAccount, updateScheduleListLocalData, getFetchStateForScheduleAccountList, toScheduleTypesType, toScheduleTypesTypeStrict, toScheduleListTabsFileTypeStrict, toScheduleSubTabType, updateScheduleListSubTab, updateScheduleListSearchText, updateScheduleListScrollState, updateScheduleListSortState, updateSelectedJEScheduleKey, fetchScheduleDetails, getScheduleDetailsView, getAccruedScheduleDetailsView, fetchScheduleDetailsPage, saveScheduleDetails, deleteScheduleDetail, createNewSchedules, updateScheduleDetailsLocalData, updateScheduleListDownloadState, updateAccruedJEScheduleAccruedByListKey, updatedSelectedJELinkRowIndex, getQBOUrlForLink, getThirdPartyIDFromQBOURL, updatedJELinkInLocalData, updateAmountsInScheduleDetail, resetJELinkInLocalData, updatedJELinkWithRecommendedLocalData, getFetchStateForScheduleListByType, getDefaultSelectedTimeframeForScheduleType, markAsCompleteScheduleDetail, resetMarkAsCompleteStatus, fetchVendorTabView, updateVendorTabViewTab, getVendorTabView, };
663
+ export { getJEScheduleTransactionKey, ALL_JE_SCHEDULE_IGNORE_REASONS, ALL_JE_SCHEDULE_REVERT_REASONS, ALL_ONE_TIME_ACCRUAL_IGNORE_REASONS, ALL_ONE_TIME_ACCRUAL_REVERT_REASONS, ALL_SCHEDULES_TYPES, getScheduleListReport, getAccruedScheduleListReport, fetchScheduleList, fetchAccruedScheduleList, fetchDownloadSchedules, fetchSchedulesAccount, updateScheduleListLocalData, getFetchStateForScheduleAccountList, toScheduleTypesType, toScheduleTypesTypeStrict, toScheduleListTabsFileTypeStrict, toScheduleSubTabType, updateScheduleListSubTab, updateScheduleListSearchText, updateScheduleListScrollState, updateScheduleListSortState, updateSelectedJEScheduleKey, fetchScheduleDetails, getScheduleDetailsView, getAccruedScheduleDetailsView, fetchScheduleDetailsPage, saveScheduleDetails, deleteScheduleDetail, createNewSchedules, updateScheduleDetailsLocalData, updateScheduleListDownloadState, updateAccruedJEScheduleAccruedByListKey, updatedSelectedJELinkRowIndex, getQBOUrlForLink, getThirdPartyIDFromQBOURL, updatedJELinkInLocalData, updateAmountsInScheduleDetail, resetJELinkInLocalData, updatedJELinkWithRecommendedLocalData, getFetchStateForScheduleListByType, getDefaultSelectedTimeframeForScheduleType, markAsCompleteScheduleDetail, resetMarkAsCompleteStatus, fetchVendorTabView, updateVendorTabViewTab, getVendorTabView, };
658
664
  export { toVendorFirstReviewViewColumnKeyType, getGlobalMerchantAutoCompleteResults, getVendorFirstReviewView, getVendorFirstReviewAttachmentView, fetchVendorFirstReviewView, fetchVendorFirstReviewAttachments, updateVendorFirstReviewViewScrollYOffset, resetVendorFirstReviewLocalData, updateVendorFirstReviewViewPageToken, clearRecentlySavedErroredVendorData, saveVendorFirstReviewView, updateVendorFirstReviewViewLocalData, updateVendorFirstReviewSortUiState, fetchGlobalMerchantAutoCompleteView, clearGlobalMerchantAutoCompleteResults, updateReviewVendorDetailLocalData, saveVendorDetailsView, getVendorDetailSelectorView, };
659
665
  export { fetchGlobalMerchantRecommendation, createGlobalMerchant, updateCreateGlobalMerchantLocalData, clearGlobalMerchantView, getGlobalMerchantView, };
660
666
  export { approveVendorGlobalReview, rejectVendorGlobalReview, fetchVendorGlobalReviewView, updateSelectedGlobalMerchant, updateVendorGlobalReviewViewUIState, getVendorGlobalReviewView, getTenantMerchantByMerchantId, toVendorGlobalReviewColumnSortKeyType, updateVendorGlobalReviewViewLocalData, };
@@ -849,17 +855,20 @@ export { getInvoicingCatalogItemDetail } from './view/invoicing/invoicingCatalog
849
855
  export { getInvoicingPlanById } from './entity/invoicing/plan/planSelector';
850
856
  export { getInvoicingProductById } from './entity/invoicing/product/productSelector';
851
857
  // ── Invoicing: settings ───────────────────────────────────────────────────────
852
- export { connectInvoicingStripe, disconnectInvoicingStripe, fetchInvoicingSettings, resetInvoicingBrandingFormDraft, resetInvoicingQboSettingsDraft, resetSaveInvoicingSettings, saveInvoicingSettings, submitInvoicingBrandingForm, submitInvoicingQboSettings, updateInvoicingBrandingFormDraft, updateInvoicingQboSettingsDraft, updateInvoicingSettings, } from './view/invoicing/settingsView/settingsViewReducer';
853
- export { getInvoicingBrandingFormView, getInvoicingQboSettingsFormView, getInvoicingSettings, getInvoicingSettingsFetchState, getInvoicingSettingsHubView, getInvoicingSettingsView, } from './view/invoicing/settingsView/settingsViewSelector';
854
- export { entityToInvoicingQboSettingsLocalData, initialInvoicingQboSettingsLocalData, invoicingQboSettingsLocalDataToPayload, } from './view/invoicing/settingsView/invoicingQboSettingsFormConfig';
858
+ export { connectInvoicingStripe, disconnectInvoicingStripe, fetchInvoicingSettings, resetInvoicingBrandingFormDraft, resetSaveInvoicingSettings, saveInvoicingSettings, submitInvoicingBrandingForm, updateInvoicingBrandingFormDraft, updateInvoicingSettings, } from './view/invoicing/settingsView/settingsViewReducer';
859
+ export { getInvoicingBrandingFormView, getInvoicingSettings, getInvoicingSettingsFetchState, getInvoicingSettingsHubView, getInvoicingSettingsView, } from './view/invoicing/settingsView/settingsViewSelector';
855
860
  export { INVOICING_BUSINESS_ADDRESS_TYPE, entityToInvoicingBrandingFormLocalData, initialInvoicingBrandingFormLocalData, } from './view/invoicing/settingsView/invoicingBrandingFormConfig';
856
861
  export { isStripeConnectedFromSettings } from './view/invoicing/settingsView/invoicingSettingsHelpers';
857
862
  // ── Invoicing: QBO integration ────────────────────────────────────────────────
858
863
  export { fetchInvoicingAccountingPickers, fetchInvoicingQboConnection, fetchInvoicingQboSyncHealth, retryInvoicingQboSyncTask, startInvoicingQboBackfill, } from './view/invoicing/invoicingQboView/invoicingQboViewReducer';
859
864
  export { INVOICING_INCOME_ACCOUNT_TYPES, invoicingAccountsForQboAccountTypes, } from './view/invoicing/invoicingQboView/invoicingQboViewSelector';
860
865
  export { getInvoicingQboView } from './view/invoicing/invoicingQboView/invoicingQboViewSelector';
861
- export { INVOICING_QBO_CUSTOMER_MATCHING_MODES, getInvoicingQboAccountMappingId, toInvoicingNamedOptionsByKey, toInvoicingQboCustomerMatchingMode, } from './entity/invoicing/invoicingCommonPayload';
866
+ export { INVOICING_QBO_CUSTOMER_MATCHING_MODES, getInvoicingQboAccountMappingId, toInvoicingNamedOptionsByKey, toInvoicingQboCustomerMatchingMode, withInvoicingQboAccountMappingId, } from './entity/invoicing/invoicingCommonPayload';
862
867
  // ── Invoicing: config ─────────────────────────────────────────────────────────
863
868
  export { acceptInvoicingTerms, enableInvoicing, fetchInvoicingConfig, resetInvoicingConfigActionStates, updateInvoicingConfig, } from './view/invoicing/invoicingConfigView/invoicingConfigViewReducer';
864
869
  export { getInvoicingConfigView } from './view/invoicing/invoicingConfigView/invoicingConfigViewSelector';
865
870
  export { getInvoicingOnboardingGateView } from './view/invoicing/invoicingConfigView/invoicingConfigViewSelector';
871
+ // Accrued JE schedules are not a discriminated union member, so consumers need this guard to
872
+ // narrow a JEScheduleRow before reading baseTransaction / recurringAmount.
873
+ export { getExpenseAutomationJEOneTimeAccrualDetailView, getJEScheduleRowType, isAccruedScheduleRow, isAiAccountantSchedule, isExistingTabRow, isOneTimeAccrualRow, isRenderableOneTimeAccrual, isPendingReviewRow, } from './view/expenseAutomationView/selectors/jeSchedulesViewSelector';
874
+ export { getActualMatchingAmount, getActualMatchingReversalDate, getExpenseAutomationActualMatchingView, isAutoReversedAccrual, isPendingReviewAccrual, } from './view/expenseAutomationView/selectors/actualMatchingViewSelector';
@@ -116,6 +116,7 @@ import creditAgentView, { initialState as initialCreditAgentViewState, } from '.
116
116
  import dashboard, { initialState as initialDashboardState, } from './view/dashboard/dashboardReducer';
117
117
  import dashboardLayout, { initialState as initialDashboardLayoutState, } from './view/dashboardLayout/dashboardLayoutReducer';
118
118
  import expenseAutomationView, { initialState as initialExpenseAutomationViewState, } from './view/expenseAutomationView/expenseAutomationViewReducer';
119
+ import expenseAutomationActualMatchingView, { initialState as initialExpenseAutomationActualMatchingViewState, } from './view/expenseAutomationView/reducers/actualMatchingViewReducer';
119
120
  import expenseAutomationFluxAnalysisView, { initialState as initialExpenseAutomationFluxAnalysisViewState, } from './view/expenseAutomationView/reducers/fluxAnalysisViewReducer';
120
121
  import expenseAutomationJESchedulesView, { initialState as initialExpenseAutomationJESchedulesViewState, } from './view/expenseAutomationView/reducers/jeSchedulesViewReducer';
121
122
  import expenseAutomationMissingReceiptsView, { initialState as initialExpenseAutomationMissingReceiptsViewState, } from './view/expenseAutomationView/reducers/missingReceiptsViewReducer';
@@ -429,6 +430,7 @@ const initialViewsState = {
429
430
  entityAutoCompleteState: initialEntityAutoCompleteState,
430
431
  entityRecommendationState: initialEntityRecommendationState,
431
432
  expenseAutomationFluxAnalysisViewState: initialExpenseAutomationFluxAnalysisViewState,
433
+ expenseAutomationActualMatchingViewState: initialExpenseAutomationActualMatchingViewState,
432
434
  expenseAutomationJESchedulesViewState: initialExpenseAutomationJESchedulesViewState,
433
435
  expenseAutomationMissingReceiptsViewState: initialExpenseAutomationMissingReceiptsViewState,
434
436
  expenseAutomationReconciliationViewState: initialExpenseAutomationReconciliationViewState,
@@ -723,6 +725,7 @@ const viewReducers = {
723
725
  entityAutoCompleteState: entityAutoComplete,
724
726
  entityRecommendationState: recommendation,
725
727
  expenseAutomationFluxAnalysisViewState: expenseAutomationFluxAnalysisView,
728
+ expenseAutomationActualMatchingViewState: expenseAutomationActualMatchingView,
726
729
  expenseAutomationJESchedulesViewState: expenseAutomationJESchedulesView,
727
730
  expenseAutomationMissingReceiptsViewState: expenseAutomationMissingReceiptsView,
728
731
  expenseAutomationReconciliationViewState: expenseAutomationReconciliationView,
@@ -0,0 +1,46 @@
1
+ import { from, of } from 'rxjs';
2
+ import { catchError, filter, mergeMap, takeUntil } from 'rxjs/operators';
3
+ import { updateJEOneTimeAccruals } from '../../../../entity/jeSchedules/jeSchedulesReducer';
4
+ import { getCurrentTenant } from '../../../../entity/tenant/tenantSelector';
5
+ import { createZeniAPIStatus, isSuccessResponse, } from '../../../../responsePayload';
6
+ import { clearAll } from '../../../../rootActions';
7
+ import { toServiceMonthFromPeriod, } from '../../payload/actualMatchingPayload';
8
+ import { fetchActualMatching, fetchActualMatchingFailure, fetchActualMatchingSuccess, } from '../../reducers/actualMatchingViewReducer';
9
+ export const fetchActualMatchingEpic = (actions$, state$, zeniAPI) => actions$.pipe(filter(fetchActualMatching.match), mergeMap((action) => {
10
+ const state = state$.value;
11
+ const { period, refreshViewInBackground } = action.payload;
12
+ const currentTenant = getCurrentTenant(state);
13
+ const selectedPeriod = state.expenseAutomationViewState
14
+ .selectedPeriodByTenantId[currentTenant.tenantId] ?? {
15
+ month: period.start.month,
16
+ year: period.start.year,
17
+ };
18
+ const serviceMonth = toServiceMonthFromPeriod(period);
19
+ return zeniAPI
20
+ .getJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/accruals?service_month=${encodeURIComponent(serviceMonth)}&view=actual_matching`)
21
+ .pipe(mergeMap((response) => {
22
+ if (isSuccessResponse(response) && response.data != null) {
23
+ const accruals = response.data.accruals ?? [];
24
+ const updateActions = [];
25
+ if (accruals.length > 0) {
26
+ updateActions.push(updateJEOneTimeAccruals(accruals));
27
+ }
28
+ updateActions.push(fetchActualMatchingSuccess({
29
+ accruals,
30
+ selectedPeriod,
31
+ refreshViewInBackground,
32
+ }));
33
+ return from(updateActions);
34
+ }
35
+ return of(fetchActualMatchingFailure({
36
+ status: response.status,
37
+ selectedPeriod,
38
+ refreshViewInBackground,
39
+ }));
40
+ }), catchError((error) => of(fetchActualMatchingFailure({
41
+ status: createZeniAPIStatus('Unexpected Error', 'fetch actual matching REST API call errored out' +
42
+ JSON.stringify(error)),
43
+ selectedPeriod,
44
+ refreshViewInBackground,
45
+ }))), takeUntil(actions$.pipe(filter(clearAll.match))));
46
+ }));
@@ -0,0 +1,7 @@
1
+ import { of } from 'rxjs';
2
+ import { filter, mergeMap } from 'rxjs/operators';
3
+ import { fetchActualMatching, fetchActualMatchingPage, } from '../../reducers/actualMatchingViewReducer';
4
+ export const fetchActualMatchingPageEpic = (actions$) => actions$.pipe(filter(fetchActualMatchingPage.match), mergeMap((action) => {
5
+ const { period, refreshViewInBackground } = action.payload;
6
+ return of(fetchActualMatching(period, refreshViewInBackground));
7
+ }));