@zeniai/client-epic-state 5.2.11-betaRD1 → 5.2.12

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 (174) hide show
  1. package/lib/entity/invoicing/invoicingCommonPayload.d.ts +27 -29
  2. package/lib/entity/invoicing/invoicingCommonPayload.js +37 -75
  3. package/lib/entity/invoicing/product/productPayload.d.ts +10 -0
  4. package/lib/entity/invoicing/product/productPayload.js +14 -2
  5. package/lib/entity/jeSchedules/jeScheduleHelper.d.ts +0 -1
  6. package/lib/entity/jeSchedules/jeScheduleHelper.js +0 -7
  7. package/lib/entity/jeSchedules/jeSchedulesPayload.d.ts +1 -66
  8. package/lib/entity/jeSchedules/jeSchedulesPayload.js +0 -135
  9. package/lib/entity/jeSchedules/jeSchedulesReducer.d.ts +2 -4
  10. package/lib/entity/jeSchedules/jeSchedulesReducer.js +2 -30
  11. package/lib/entity/jeSchedules/jeSchedulesSelector.d.ts +2 -11
  12. package/lib/entity/jeSchedules/jeSchedulesSelector.js +3 -38
  13. package/lib/entity/jeSchedules/jeSchedulesState.d.ts +1 -79
  14. package/lib/entity/jeSchedules/jeSchedulesTypes.d.ts +1 -24
  15. package/lib/entity/jeSchedules/jeSchedulesTypes.js +1 -88
  16. package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
  17. package/lib/entity/snackbar/snackbarTypes.js +0 -3
  18. package/lib/entity/transaction/payloadTypes/scheduleTransactionPayload.d.ts +0 -2
  19. package/lib/entity/transaction/payloadTypes/scheduleTransactionPayload.js +0 -2
  20. package/lib/entity/transaction/stateTypes/scheduleTransaction.d.ts +0 -2
  21. package/lib/epic.d.ts +2 -10
  22. package/lib/epic.js +10 -21
  23. package/lib/esm/entity/invoicing/invoicingCommonPayload.js +33 -73
  24. package/lib/esm/entity/invoicing/product/productPayload.js +14 -2
  25. package/lib/esm/entity/jeSchedules/jeScheduleHelper.js +0 -6
  26. package/lib/esm/entity/jeSchedules/jeSchedulesPayload.js +1 -135
  27. package/lib/esm/entity/jeSchedules/jeSchedulesReducer.js +2 -30
  28. package/lib/esm/entity/jeSchedules/jeSchedulesSelector.js +2 -36
  29. package/lib/esm/entity/jeSchedules/jeSchedulesTypes.js +0 -78
  30. package/lib/esm/entity/snackbar/snackbarTypes.js +0 -3
  31. package/lib/esm/entity/transaction/payloadTypes/scheduleTransactionPayload.js +0 -2
  32. package/lib/esm/epic.js +6 -17
  33. package/lib/esm/index.js +13 -18
  34. package/lib/esm/view/expenseAutomationView/epics/common/fetchAllExpenseAutomationTabsEpic.js +3 -6
  35. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +5 -41
  36. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/ignoreRecommendedJeScheduleEpic.js +2 -14
  37. package/lib/esm/view/expenseAutomationView/payload/jeSchedulesPayload.js +0 -55
  38. package/lib/esm/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +29 -306
  39. package/lib/esm/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +22 -294
  40. package/lib/esm/view/expenseAutomationView/types/jeSchedulesViewState.js +6 -5
  41. package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewPayload.js +25 -9
  42. package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/saveInvoicingCatalogItemEpic.js +6 -1
  43. package/lib/esm/view/invoicing/invoicingQboView/invoicingQboViewSelector.js +40 -0
  44. package/lib/esm/view/invoicing/settingsView/epics/connectInvoicingStripeEpic.js +27 -0
  45. package/lib/esm/view/invoicing/settingsView/epics/disconnectInvoicingStripeEpic.js +19 -0
  46. package/lib/esm/view/invoicing/settingsView/epics/fetchInvoicingSettingsEpic.js +19 -0
  47. package/lib/esm/view/invoicing/settingsView/epics/saveInvoicingSettingsEpic.js +39 -0
  48. package/lib/esm/view/invoicing/settingsView/epics/submitInvoicingQboSettingsEpic.js +25 -0
  49. package/lib/esm/view/invoicing/settingsView/invoicingQboSettingsFormConfig.js +48 -0
  50. package/lib/esm/view/invoicing/settingsView/settingsViewReducer.js +25 -1
  51. package/lib/esm/view/invoicing/settingsView/settingsViewSelector.js +41 -0
  52. package/lib/esm/view/scheduleView/scheduleListView/epics/fetchAccruedScheduleListEpic.js +1 -1
  53. package/lib/esm/view/scheduleView/scheduleListView/epics/fetchDownloadSchedulesEpic.js +2 -7
  54. package/lib/esm/view/scheduleView/scheduleListView/scheduleListReducer.js +3 -5
  55. package/lib/index.d.ts +19 -22
  56. package/lib/index.js +59 -96
  57. package/lib/view/expenseAutomationView/epics/common/fetchAllExpenseAutomationTabsEpic.js +3 -6
  58. package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.d.ts +2 -3
  59. package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +3 -39
  60. package/lib/view/expenseAutomationView/epics/jeSchedule/ignoreRecommendedJeScheduleEpic.js +2 -14
  61. package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
  62. package/lib/view/expenseAutomationView/payload/jeSchedulesPayload.d.ts +3 -72
  63. package/lib/view/expenseAutomationView/payload/jeSchedulesPayload.js +1 -58
  64. package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.d.ts +12 -91
  65. package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +29 -308
  66. package/lib/view/expenseAutomationView/reducers/missingReceiptsViewReducer.d.ts +1 -1
  67. package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.d.ts +2 -2
  68. package/lib/view/expenseAutomationView/selectorTypes/jeSchedulesSelectorTypes.d.ts +7 -36
  69. package/lib/view/expenseAutomationView/selectors/jeSchedulesViewSelector.d.ts +0 -34
  70. package/lib/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +21 -302
  71. package/lib/view/expenseAutomationView/types/completedSubTab.d.ts +1 -1
  72. package/lib/view/expenseAutomationView/types/jeSchedulesViewState.d.ts +8 -82
  73. package/lib/view/expenseAutomationView/types/jeSchedulesViewState.js +8 -8
  74. package/lib/view/expenseAutomationView/types/reconciliationViewState.d.ts +2 -2
  75. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewPayload.d.ts +12 -1
  76. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewPayload.js +25 -9
  77. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/saveInvoicingCatalogItemEpic.js +6 -1
  78. package/lib/view/invoicing/invoicingQboView/invoicingQboViewSelector.d.ts +10 -1
  79. package/lib/view/invoicing/invoicingQboView/invoicingQboViewSelector.js +43 -1
  80. package/lib/view/invoicing/settingsView/epics/connectInvoicingStripeEpic.d.ts +6 -0
  81. package/lib/view/invoicing/settingsView/epics/connectInvoicingStripeEpic.js +31 -0
  82. package/lib/view/invoicing/settingsView/epics/disconnectInvoicingStripeEpic.d.ts +6 -0
  83. package/lib/view/invoicing/settingsView/epics/disconnectInvoicingStripeEpic.js +23 -0
  84. package/lib/view/invoicing/settingsView/epics/fetchInvoicingSettingsEpic.d.ts +6 -0
  85. package/lib/view/invoicing/settingsView/epics/fetchInvoicingSettingsEpic.js +23 -0
  86. package/lib/view/invoicing/settingsView/epics/saveInvoicingSettingsEpic.d.ts +6 -0
  87. package/lib/view/invoicing/settingsView/epics/saveInvoicingSettingsEpic.js +43 -0
  88. package/lib/view/invoicing/settingsView/epics/settingsViewActionType.d.ts +5 -0
  89. package/lib/view/invoicing/settingsView/epics/submitInvoicingQboSettingsEpic.d.ts +11 -0
  90. package/lib/view/invoicing/settingsView/epics/submitInvoicingQboSettingsEpic.js +29 -0
  91. package/lib/view/invoicing/settingsView/invoicingQboSettingsFormConfig.d.ts +34 -0
  92. package/lib/view/invoicing/settingsView/invoicingQboSettingsFormConfig.js +53 -0
  93. package/lib/view/invoicing/settingsView/settingsViewReducer.d.ts +4 -1
  94. package/lib/view/invoicing/settingsView/settingsViewReducer.js +26 -2
  95. package/lib/view/invoicing/settingsView/settingsViewSelector.d.ts +35 -0
  96. package/lib/view/invoicing/settingsView/settingsViewSelector.js +43 -1
  97. package/lib/view/invoicing/settingsView/settingsViewState.d.ts +8 -0
  98. package/lib/view/scheduleView/scheduleListView/epics/fetchAccruedScheduleListEpic.js +1 -1
  99. package/lib/view/scheduleView/scheduleListView/epics/fetchDownloadSchedulesEpic.js +2 -7
  100. package/lib/view/scheduleView/scheduleListView/scheduleListReducer.d.ts +2 -4
  101. package/lib/view/scheduleView/scheduleListView/scheduleListReducer.js +3 -5
  102. package/package.json +1 -1
  103. package/lib/commonStateTypes/selectorTypes/pickAndMergeForecastSection.d.ts +0 -0
  104. package/lib/commonStateTypes/selectorTypes/pickAndMergeForecastSection.js +0 -1
  105. package/lib/entity/invoicing/coupon/couponConstants.d.ts +0 -11
  106. package/lib/entity/invoicing/coupon/couponConstants.js +0 -29
  107. package/lib/esm/commonStateTypes/selectorTypes/pickAndMergeForecastSection.js +0 -1
  108. package/lib/esm/entity/invoicing/coupon/couponConstants.js +0 -26
  109. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/fetchOneTimeAccrualEpic.js +0 -45
  110. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/newSchedule/createOneTimeAccrualEpic.js +0 -99
  111. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/newSchedule/initializeNewScheduleEpic.js +0 -25
  112. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/newSchedule/saveNewScheduleEpic.js +0 -110
  113. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/newSchedule/searchTransactionsForNewScheduleEpic.js +0 -79
  114. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/oneTimeAccrualActionsEpic.js +0 -139
  115. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/revertJeScheduleEpic.js +0 -106
  116. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/switchJESchedulesTabEpic.js +0 -22
  117. package/lib/esm/view/expenseAutomationView/helpers/newScheduleLocalDataHelper.js +0 -140
  118. package/lib/esm/view/expenseAutomationView/selectors/jeNewScheduleViewSelector.js +0 -106
  119. package/lib/esm/view/invoicing/invoicingQboView/epics/fetchInvoicingQboAccountsEpic.js +0 -25
  120. package/lib/esm/view/invoicing/invoicingQboView/epics/fetchInvoicingQboClassesEpic.js +0 -15
  121. package/lib/esm/view/invoicing/settingsView/settingsViewEpics.js +0 -92
  122. package/lib/esm/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryPromoIntroClosedByOutsideClickEpic.js +0 -18
  123. package/lib/esm/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryPromoRemindMeLaterClickedEpic.js +0 -18
  124. package/lib/esm/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryVideoViewedEpic.js +0 -18
  125. package/lib/esm/view/zeniAccountsPromoCard/zeniAccountsPromoCardEpic.js +0 -16
  126. package/lib/esm/view/zeniAccountsPromoCard/zeniAccountsPromoCardPayload.js +0 -1
  127. package/lib/esm/view/zeniAccountsPromoCard/zeniAccountsPromoCardReducer.js +0 -60
  128. package/lib/esm/view/zeniAccountsPromoCard/zeniAccountsPromoCardSelector.js +0 -12
  129. package/lib/esm/view/zeniAccountsPromoCard/zeniAccountsPromoCardState.js +0 -1
  130. package/lib/view/expenseAutomationView/epics/jeSchedule/fetchOneTimeAccrualEpic.d.ts +0 -20
  131. package/lib/view/expenseAutomationView/epics/jeSchedule/fetchOneTimeAccrualEpic.js +0 -49
  132. package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/createOneTimeAccrualEpic.d.ts +0 -8
  133. package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/createOneTimeAccrualEpic.js +0 -103
  134. package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/initializeNewScheduleEpic.d.ts +0 -8
  135. package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/initializeNewScheduleEpic.js +0 -29
  136. package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/saveNewScheduleEpic.d.ts +0 -45
  137. package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/saveNewScheduleEpic.js +0 -114
  138. package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/searchTransactionsForNewScheduleEpic.d.ts +0 -8
  139. package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/searchTransactionsForNewScheduleEpic.js +0 -83
  140. package/lib/view/expenseAutomationView/epics/jeSchedule/oneTimeAccrualActionsEpic.d.ts +0 -12
  141. package/lib/view/expenseAutomationView/epics/jeSchedule/oneTimeAccrualActionsEpic.js +0 -146
  142. package/lib/view/expenseAutomationView/epics/jeSchedule/revertJeScheduleEpic.d.ts +0 -64
  143. package/lib/view/expenseAutomationView/epics/jeSchedule/revertJeScheduleEpic.js +0 -110
  144. package/lib/view/expenseAutomationView/epics/jeSchedule/switchJESchedulesTabEpic.d.ts +0 -6
  145. package/lib/view/expenseAutomationView/epics/jeSchedule/switchJESchedulesTabEpic.js +0 -26
  146. package/lib/view/expenseAutomationView/helpers/newScheduleLocalDataHelper.d.ts +0 -36
  147. package/lib/view/expenseAutomationView/helpers/newScheduleLocalDataHelper.js +0 -145
  148. package/lib/view/expenseAutomationView/selectorTypes/jeNewScheduleViewSelectorTypes.d.ts +0 -42
  149. package/lib/view/expenseAutomationView/selectors/jeNewScheduleViewSelector.d.ts +0 -21
  150. package/lib/view/expenseAutomationView/selectors/jeNewScheduleViewSelector.js +0 -112
  151. package/lib/view/invoicing/invoicingQboView/epics/fetchInvoicingQboAccountsEpic.d.ts +0 -6
  152. package/lib/view/invoicing/invoicingQboView/epics/fetchInvoicingQboAccountsEpic.js +0 -29
  153. package/lib/view/invoicing/invoicingQboView/epics/fetchInvoicingQboClassesEpic.d.ts +0 -6
  154. package/lib/view/invoicing/invoicingQboView/epics/fetchInvoicingQboClassesEpic.js +0 -19
  155. package/lib/view/invoicing/settingsView/settingsViewEpics.d.ts +0 -12
  156. package/lib/view/invoicing/settingsView/settingsViewEpics.js +0 -99
  157. package/lib/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryPromoIntroClosedByOutsideClickEpic.d.ts +0 -8
  158. package/lib/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryPromoIntroClosedByOutsideClickEpic.js +0 -22
  159. package/lib/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryPromoRemindMeLaterClickedEpic.d.ts +0 -8
  160. package/lib/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryPromoRemindMeLaterClickedEpic.js +0 -22
  161. package/lib/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryVideoViewedEpic.d.ts +0 -8
  162. package/lib/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryVideoViewedEpic.js +0 -22
  163. package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardEpic.d.ts +0 -13
  164. package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardEpic.js +0 -20
  165. package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardPayload.d.ts +0 -11
  166. package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardPayload.js +0 -2
  167. package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardReducer.d.ts +0 -7
  168. package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardReducer.js +0 -64
  169. package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardSelector.d.ts +0 -12
  170. package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardSelector.js +0 -15
  171. package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardState.d.ts +0 -9
  172. package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardState.js +0 -2
  173. /package/lib/esm/view/{expenseAutomationView/selectorTypes/jeNewScheduleViewSelectorTypes.js → invoicing/settingsView/epics/settingsViewActionType.js} +0 -0
  174. /package/lib/view/{expenseAutomationView/selectorTypes/jeNewScheduleViewSelectorTypes.js → invoicing/settingsView/epics/settingsViewActionType.js} +0 -0
@@ -1,12 +1,9 @@
1
1
  import { from, of } from 'rxjs';
2
- import { catchError, filter, mergeMap, takeUntil } from 'rxjs/operators';
3
- import { DEFAULT_DATE_FORMAT } from '../../../../commonStateTypes/timePeriod';
4
- import { toAbsoluteDay, toString } from '../../../../commonStateTypes/timePeriod';
5
- import { updateAccruedJESchedules, updateAccruedJESchedulesDetails, updateJEOneTimeAccruals, updateJESchedules, updateJESchedulesDetails, } from '../../../../entity/jeSchedules/jeSchedulesReducer';
2
+ import { catchError, filter, mergeMap } from 'rxjs/operators';
3
+ import { toString } from '../../../../commonStateTypes/timePeriod';
4
+ import { updateJESchedules, updateJESchedulesDetails, } from '../../../../entity/jeSchedules/jeSchedulesReducer';
6
5
  import { getCurrentTenant } from '../../../../entity/tenant/tenantSelector';
7
6
  import { createZeniAPIStatus, isSuccessResponse, } from '../../../../responsePayload';
8
- import { clearAll } from '../../../../rootActions';
9
- import { date } from '../../../../zeniDayJS';
10
7
  import { fetchJeSchedules, fetchJeSchedulesFailure, fetchJeSchedulesSuccess, initializeJeScheduleLocalData, } from '../../reducers/jeSchedulesViewReducer';
11
8
  export const fetchJeSchedulesEpic = (actions$, state$, zeniAPI) => actions$.pipe(filter(fetchJeSchedules.match), mergeMap((action) => {
12
9
  const state = state$.value;
@@ -14,54 +11,27 @@ export const fetchJeSchedulesEpic = (actions$, state$, zeniAPI) => actions$.pipe
14
11
  const { period, refreshViewInBackground } = action.payload;
15
12
  const currentTenant = getCurrentTenant(state);
16
13
  const selectedPeriod = selectedPeriodByTenantId[currentTenant.tenantId];
17
- const { selectedPageTab } = state.expenseAutomationJESchedulesViewState.uiState;
18
- const isClosePeriodTab = selectedPageTab === 'schedules';
19
- const existingEndDate = toAbsoluteDay(date(toString(period.start))
20
- .subtract(1, 'month')
21
- .endOf('month')
22
- .format(DEFAULT_DATE_FORMAT));
23
14
  const queryParam = {
24
15
  start_date: toString(period.start),
25
- end_date: isClosePeriodTab || existingEndDate == null
26
- ? toString(period.end)
27
- : toString(existingEndDate),
28
- include_accrued: true,
29
- ...(isClosePeriodTab
30
- ? { close_period_start_date: toString(period.start) }
31
- : {}),
16
+ end_date: toString(period.end),
32
17
  };
33
18
  return zeniAPI
34
19
  .getJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/expenses_automation/je_schedules?query=${encodeURIComponent(JSON.stringify(queryParam))}`)
35
20
  .pipe(mergeMap((response) => {
36
21
  if (isSuccessResponse(response) && response.data != null) {
37
22
  const updateActions = [];
38
- const accruedJeSchedules = response.data.accrued_je_schedules?.je_schedules ?? [];
39
- const oneTimeAccruals = response.data.one_time_accruals ?? [];
40
23
  updateActions.push(updateJESchedules([
41
24
  ...response.data.je_schedules,
42
25
  ...response.data.failed_je_postings.je_schedules,
43
26
  ]), updateJESchedulesDetails([...response.data.failed_je_postings.je_schedules], response.data.failed_je_postings.scheduled_journal_entries), initializeJeScheduleLocalData([
44
27
  ...response.data.failed_je_postings.je_schedules,
45
28
  ]));
46
- if (accruedJeSchedules.length > 0) {
47
- updateActions.push(updateAccruedJESchedules(accruedJeSchedules), updateAccruedJESchedulesDetails(accruedJeSchedules, response.data.accrued_je_schedules
48
- ?.scheduled_journal_entries));
49
- }
50
- if (oneTimeAccruals.length > 0) {
51
- // Single action, unlike the accrued pair above: this one writes the entity
52
- // directly because an accrual denormalizes its vendor, accounts and classes, so
53
- // there is no fan-out fetch to trigger.
54
- updateActions.push(updateJEOneTimeAccruals(oneTimeAccruals));
55
- }
56
29
  updateActions.push(fetchJeSchedulesSuccess({
57
30
  jeSchedules: [...response.data.je_schedules],
58
31
  failedJeSchedules: [
59
32
  ...response.data.failed_je_postings.je_schedules,
60
33
  ],
61
- accruedJeSchedules: accruedJeSchedules,
62
- oneTimeAccruals: oneTimeAccruals,
63
34
  selectedPeriod: selectedPeriod,
64
- selectedPageTab: selectedPageTab,
65
35
  refreshViewInBackground: refreshViewInBackground,
66
36
  }));
67
37
  return from(updateActions);
@@ -70,17 +40,11 @@ export const fetchJeSchedulesEpic = (actions$, state$, zeniAPI) => actions$.pipe
70
40
  return of(fetchJeSchedulesFailure({
71
41
  status: response.status,
72
42
  selectedPeriod,
73
- selectedPageTab,
74
43
  }));
75
44
  }
76
45
  }), catchError((error) => of(fetchJeSchedulesFailure({
77
46
  status: createZeniAPIStatus('Unexpected Error', 'fetch JE schedules REST API call errored out' +
78
47
  JSON.stringify(error)),
79
48
  selectedPeriod,
80
- selectedPageTab,
81
- }))),
82
- // A tenant switch clears the store while this request is still in flight. Without this
83
- // the old tenant's rows are written back into the freshly cleared store and stay on
84
- // screen under the new tenant until a manual refresh.
85
- takeUntil(actions$.pipe(filter(clearAll.match))));
49
+ }))));
86
50
  }));
@@ -11,25 +11,13 @@ import { ignoreRecommendedJeSchedule, ignoreRecommendedJeScheduleFailure, ignore
11
11
  export const ignoreRecommendedJeScheduleEpic = (actions$, state$, zeniAPI) => actions$.pipe(filter(ignoreRecommendedJeSchedule.match), mergeMap((action) => {
12
12
  const state = state$.value;
13
13
  const { expenseAutomationViewState: { selectedPeriodByTenantId }, } = state;
14
- const { scheduleType, jeScheduleTransactionKey, reason, note } = action.payload;
14
+ const { scheduleType, jeScheduleTransactionKey } = action.payload;
15
15
  const currentTenant = getCurrentTenant(state);
16
16
  const selectedPeriod = selectedPeriodByTenantId[currentTenant.tenantId];
17
17
  const actions = [];
18
18
  const jeScheduleTransactionState = getJEScheduledTransactionByJEScheduleTransactionKey(jeScheduleTransactionKey, state);
19
- const ignorePayload = prepareIgnoreSchedulePayload(scheduleType, jeScheduleTransactionState, state);
20
- // The gateway reads reason/note from je_schedules[0].feedback and nowhere else, and rejects
21
- // anything but those two keys inside it — `action` is stamped server-side.
22
19
  const payload = {
23
- ...ignorePayload,
24
- je_schedules: ignorePayload.je_schedules.map((schedule, index) => index === 0
25
- ? {
26
- ...schedule,
27
- feedback: {
28
- reason,
29
- ...(note != null && note !== '' ? { note } : {}),
30
- },
31
- }
32
- : schedule),
20
+ ...prepareIgnoreSchedulePayload(scheduleType, jeScheduleTransactionState, state),
33
21
  };
34
22
  const queryParam = {
35
23
  je_schedule_type: scheduleType,
@@ -1,60 +1,5 @@
1
1
  import { DEFAULT_DATE_FORMAT } from '../../../commonStateTypes/timePeriod';
2
- import { getClassList } from '../../classList/classListSelector';
3
2
  import { mapScheduleTransactionToBaseScheduleTransactionPayload, mapVendorToVendorPayload, } from '../../scheduleView/scheduleDetailView/scheduleDetailPayload';
4
- const BALANCE_SHEET_CLASS_LABEL = 'balance_sheet';
5
- const SERVICE_MONTH_FORMAT = 'YYYY-MM';
6
- /**
7
- * The credit line is the accrued liability, which always sits on the balance sheet — the
8
- * recurring accrued path resolves the same class the same way (see
9
- * prepareNewScheduleAccruedDetailPayload). Omitted rather than sent empty when the tenant has
10
- * no balance_sheet class, since the API treats the field as optional.
11
- */
12
- export const prepareCreateOneTimeAccrualPayload = (state, localData) => {
13
- const { classListState, classState } = state;
14
- const balanceSheetClass = getClassList(classState, classListState).classes.find((accountingClass) => accountingClass.labels?.includes(BALANCE_SHEET_CLASS_LABEL) === true);
15
- // reverse_next_month alone decides reversal_policy server-side, so reversal_policy is
16
- // deliberately not sent — the API documents it only as an alternate way to say on_bill_match,
17
- // and sending both would be two sources of truth for one toggle.
18
- const reversalFields = localData.reverseNextMonth
19
- ? {
20
- reverse_next_month: true,
21
- expected_reversal_date: getExpectedReversalDate(localData.serviceMonth).format(DEFAULT_DATE_FORMAT),
22
- }
23
- : { reverse_next_month: false };
24
- return {
25
- vendor_id: localData.vendorId,
26
- vendor_name: localData.vendorName,
27
- service_month: localData.serviceMonth.format(SERVICE_MONTH_FORMAT),
28
- amount: localData.amount,
29
- memo: localData.memo,
30
- je_debit_account_id: localData.debitAccountId,
31
- je_credit_account_id: localData.creditAccountId,
32
- ...(localData.debitAccountName != null
33
- ? { je_debit_account_name: localData.debitAccountName }
34
- : {}),
35
- ...(localData.creditAccountName != null
36
- ? { je_credit_account_name: localData.creditAccountName }
37
- : {}),
38
- ...(localData.debitClassId != null
39
- ? { je_debit_accounting_class_id: localData.debitClassId }
40
- : {}),
41
- ...(localData.debitClassName != null
42
- ? { je_debit_accounting_class_name: localData.debitClassName }
43
- : {}),
44
- ...(balanceSheetClass != null
45
- ? {
46
- je_credit_accounting_class_id: balanceSheetClass.classId,
47
- je_credit_accounting_class_name: balanceSheetClass.className,
48
- }
49
- : {}),
50
- ...reversalFields,
51
- };
52
- };
53
- /**
54
- * The API defaults this to the 1st of the month after service_month. We send it explicitly so the
55
- * date the form promised the user is the date that gets stored.
56
- */
57
- export const getExpectedReversalDate = (serviceMonth) => serviceMonth.add(1, 'month').startOf('month');
58
3
  export const prepareIgnoreSchedulePayload = (scheduleType, jeScheduleTransaction, state) => {
59
4
  const { vendorState } = state;
60
5
  const { vendor, currencyCode, currencySymbol, baseTransaction, status, balanceAsOfToday, period, startDate, endDate, jeCredit, jeDebit, } = jeScheduleTransaction;
@@ -2,16 +2,9 @@ import { createSlice } from '@reduxjs/toolkit';
2
2
  import { geNestedAccountIDHierarchyForReport } from '../../../commonStateTypes/accountView/getNestedAccountIDHierarchyForReport';
3
3
  import { toMonthYearPeriodId, } from '../../../commonStateTypes/timePeriod';
4
4
  import { mapAccountBasePayloadToAccountBase, mapAccountMetadataPayloadToAccountMetadata, } from '../../../entity/account/accountPayload';
5
- import { generateJEOneTimeAccrualKey } from '../../../entity/jeSchedules/jeScheduleHelper';
6
- import { getJEScheduleKey, getJEScheduleTransactionDetailKeyPayload, } from '../../../entity/jeSchedules/jeSchedulesPayload';
5
+ import { getJEScheduleTransactionDetailKeyPayload, } from '../../../entity/jeSchedules/jeSchedulesPayload';
7
6
  import { clearAll } from '../../../rootActions';
8
7
  import { mapAccountTypeRecommendationPayloadToAccountRecommendationByType, } from '../../accountMappingView/accountTypeRecommendation/accountTypeRecommendationPayload';
9
- import { MIN_NEW_SCHEDULE_SEARCH_LENGTH, getJESchedulePeriodTabKey, } from '../types/jeSchedulesViewState';
10
- function removeKeyFromEveryTabSlot(keysByPeriodAndTab, keyToRemove) {
11
- for (const periodTabKey of Object.keys(keysByPeriodAndTab)) {
12
- keysByPeriodAndTab[periodTabKey] = keysByPeriodAndTab[periodTabKey].filter((jeScheduleKey) => jeScheduleKey !== keyToRemove);
13
- }
14
- }
15
8
  export const accountSettingsInitialState = {
16
9
  localData: {
17
10
  selectedPrepaidExpensesAccountIds: [],
@@ -43,37 +36,16 @@ export const accountSettingsInitialState = {
43
36
  accruedExpensesNestedAccountListHierarchy: [],
44
37
  accruedExpensesRecommendations: [],
45
38
  };
46
- export const getBaseNewScheduleLocalData = (scheduleType) => ({
47
- scheduleType,
48
- jeScheduleDetails: [],
49
- });
50
- export const newScheduleInitialState = {
51
- fixed_assets: getBaseNewScheduleLocalData('fixed_assets'),
52
- prepaid_expenses: getBaseNewScheduleLocalData('prepaid_expenses'),
53
- };
54
- export const searchTransactionsInitialState = {
55
- searchResults: [],
56
- fetchState: 'Not-Started',
57
- error: undefined,
58
- };
59
39
  export const initialState = {
60
- jeScheduleTransactionKeysByPeriodAndTab: {},
61
- jeScheduleAccruedKeysByPeriodAndTab: {},
62
- jeScheduleOneTimeAccrualKeysByPeriodAndTab: {},
63
- failedJeScheduleTransactionKeysByPeriodAndTab: {},
40
+ jeScheduleTransactionKeysByPeriod: {},
41
+ failedJeScheduleTransactionKeysByPeriod: {},
64
42
  postStatusById: {},
65
43
  ignoreStatusById: {},
66
- revertStatusById: {},
67
44
  jeScheduleLocalDataById: {},
68
- oneTimeAccrualActionStatusById: {},
69
- oneTimeAccrualFetchStatusById: {},
70
45
  uiState: {
71
- createdGroupCollapsed: false,
72
- pendingGroupCollapsed: false,
73
- scrollPosition: { scrollTop: 0, scrollLeft: undefined },
74
46
  searchString: '',
75
- selectedJETypeFilter: null,
76
- selectedPageTab: 'schedules',
47
+ scrollPosition: { scrollTop: 0, scrollLeft: undefined },
48
+ selectedMainTab: 'pending_review',
77
49
  sortKey: 'transactionDate',
78
50
  sortOrder: 'descending',
79
51
  totalCount: 0,
@@ -84,14 +56,6 @@ export const initialState = {
84
56
  error: undefined,
85
57
  },
86
58
  accountSettings: accountSettingsInitialState,
87
- newSchedule: {
88
- createOneTimeAccrualStatus: { fetchState: 'Not-Started', error: undefined },
89
- newScheduleState: newScheduleInitialState,
90
- saveStatus: { fetchState: 'Not-Started', error: undefined },
91
- searchTransactions: searchTransactionsInitialState,
92
- fetchState: 'Not-Started',
93
- error: undefined,
94
- },
95
59
  fetchState: 'Not-Started',
96
60
  error: undefined,
97
61
  hasValidState() {
@@ -136,12 +100,9 @@ const expenseAutomationJESchedulesView = createSlice({
136
100
  },
137
101
  },
138
102
  fetchJeSchedulesSuccess(draft, action) {
139
- const { jeSchedules, selectedPeriod, selectedPageTab, failedJeSchedules, accruedJeSchedules, oneTimeAccruals, refreshViewInBackground, } = action.payload;
140
- const periodTabKey = getJESchedulePeriodTabKey(selectedPageTab, toMonthYearPeriodId(selectedPeriod));
103
+ const { jeSchedules, selectedPeriod, failedJeSchedules, refreshViewInBackground, } = action.payload;
141
104
  const jeScheduleTransactionKeys = jeSchedules.map((schedules) => getJEScheduleTransactionDetailKeyPayload(schedules.base_transaction));
142
105
  const failedJeScheduleTransactionKeys = failedJeSchedules.map((schedules) => getJEScheduleTransactionDetailKeyPayload(schedules.base_transaction));
143
- const jeScheduleAccruedKeys = accruedJeSchedules.map((schedule) => getJEScheduleKey(schedule));
144
- const jeScheduleOneTimeAccrualKeys = oneTimeAccruals.map((accrual) => generateJEOneTimeAccrualKey(accrual._id));
145
106
  if (refreshViewInBackground === true &&
146
107
  draft.refreshStatus.fetchState === 'In-Progress') {
147
108
  draft.refreshStatus = { fetchState: 'Completed', error: undefined };
@@ -150,28 +111,19 @@ const expenseAutomationJESchedulesView = createSlice({
150
111
  draft.fetchState = 'Completed';
151
112
  draft.error = undefined;
152
113
  }
153
- draft.jeScheduleTransactionKeysByPeriodAndTab[periodTabKey] =
154
- jeScheduleTransactionKeys;
155
- draft.jeScheduleAccruedKeysByPeriodAndTab[periodTabKey] =
156
- jeScheduleAccruedKeys;
157
- draft.jeScheduleOneTimeAccrualKeysByPeriodAndTab[periodTabKey] =
158
- jeScheduleOneTimeAccrualKeys;
159
- draft.failedJeScheduleTransactionKeysByPeriodAndTab[periodTabKey] =
160
- failedJeScheduleTransactionKeys;
114
+ draft.jeScheduleTransactionKeysByPeriod[toMonthYearPeriodId(selectedPeriod)] = jeScheduleTransactionKeys;
115
+ draft.failedJeScheduleTransactionKeysByPeriod[toMonthYearPeriodId(selectedPeriod)] = failedJeScheduleTransactionKeys;
161
116
  },
162
117
  fetchJeSchedulesFailure(draft, action) {
163
- const { status, selectedPeriod, selectedPageTab } = action.payload;
164
- const periodTabKey = getJESchedulePeriodTabKey(selectedPageTab, toMonthYearPeriodId(selectedPeriod));
118
+ const { status, selectedPeriod } = action.payload;
165
119
  if (draft.refreshStatus.fetchState === 'In-Progress') {
166
120
  draft.refreshStatus = { fetchState: 'Error', error: status };
167
121
  }
168
122
  else {
169
123
  draft.fetchState = 'Error';
170
124
  draft.error = status;
171
- draft.jeScheduleTransactionKeysByPeriodAndTab[periodTabKey] = [];
172
- draft.jeScheduleAccruedKeysByPeriodAndTab[periodTabKey] = [];
173
- draft.jeScheduleOneTimeAccrualKeysByPeriodAndTab[periodTabKey] = [];
174
125
  }
126
+ draft.jeScheduleTransactionKeysByPeriod[toMonthYearPeriodId(selectedPeriod)] = [];
175
127
  },
176
128
  retryJeSchedule(draft, action) {
177
129
  const { scheduledJournalEntryID } = action.payload;
@@ -207,13 +159,11 @@ const expenseAutomationJESchedulesView = createSlice({
207
159
  };
208
160
  },
209
161
  ignoreRecommendedJeSchedule: {
210
- prepare(jeScheduleTransactionKey, scheduleType, reason, note) {
162
+ prepare(jeScheduleTransactionKey, scheduleType) {
211
163
  return {
212
164
  payload: {
213
165
  jeScheduleTransactionKey,
214
166
  scheduleType,
215
- reason,
216
- note,
217
167
  },
218
168
  };
219
169
  },
@@ -229,41 +179,6 @@ const expenseAutomationJESchedulesView = createSlice({
229
179
  };
230
180
  },
231
181
  },
232
- revertJeSchedule: {
233
- // jeScheduleTransactionKey is a JEScheduleKey for an accrued schedule, which has no base
234
- // transaction to derive a transaction key from. It is only ever used as an opaque row
235
- // identifier here -- for the row's spinner and for dropping the row from the list -- so one
236
- // action serves both shapes rather than two near-identical ones.
237
- prepare(jeScheduleId, jeScheduleTransactionKey, scheduleType, reason, note) {
238
- return {
239
- payload: {
240
- jeScheduleId,
241
- jeScheduleTransactionKey,
242
- scheduleType,
243
- reason,
244
- note,
245
- },
246
- };
247
- },
248
- reducer(draft, action) {
249
- draft.revertStatusById[action.payload.jeScheduleTransactionKey] = {
250
- fetchState: 'In-Progress',
251
- error: undefined,
252
- };
253
- },
254
- },
255
- revertJeScheduleSuccess(draft, action) {
256
- draft.revertStatusById[action.payload.jeScheduleTransactionKey] = {
257
- fetchState: 'Completed',
258
- error: undefined,
259
- };
260
- },
261
- revertJeScheduleFailure(draft, action) {
262
- draft.revertStatusById[action.payload.jeScheduleTransactionKey] = {
263
- fetchState: 'Error',
264
- error: action.payload.status,
265
- };
266
- },
267
182
  ignoreRecommendedJeScheduleSuccess: {
268
183
  reducer(draft, action) {
269
184
  const { jeScheduleTransactionKey } = action.payload;
@@ -296,18 +211,17 @@ const expenseAutomationJESchedulesView = createSlice({
296
211
  };
297
212
  },
298
213
  updateJeScheduleTransactionKeys: {
299
- prepare(jeScheduleKeys, selectedPeriod, selectedPageTab) {
214
+ prepare(jeScheduleKeys, selectedPeriod) {
300
215
  return {
301
216
  payload: {
302
217
  jeScheduleKeys: jeScheduleKeys,
303
218
  selectedPeriod: selectedPeriod,
304
- selectedPageTab: selectedPageTab,
305
219
  },
306
220
  };
307
221
  },
308
222
  reducer(draft, action) {
309
- const { selectedPeriod, selectedPageTab, jeScheduleKeys } = action.payload;
310
- draft.jeScheduleTransactionKeysByPeriodAndTab[getJESchedulePeriodTabKey(selectedPageTab, toMonthYearPeriodId(selectedPeriod))] = jeScheduleKeys;
223
+ const { selectedPeriod, jeScheduleKeys } = action.payload;
224
+ draft.jeScheduleTransactionKeysByPeriod[toMonthYearPeriodId(selectedPeriod)] = jeScheduleKeys;
311
225
  },
312
226
  },
313
227
  removeJeScheduleTransactionKey: {
@@ -320,20 +234,12 @@ const expenseAutomationJESchedulesView = createSlice({
320
234
  };
321
235
  },
322
236
  reducer(draft, action) {
323
- const { jeScheduleKey } = action.payload;
324
- // Dropped from every tab's slot, not just the visible one: once a schedule is ignored or
325
- // resolved it must not reappear when the user switches tabs and hits a cached list.
326
- removeKeyFromEveryTabSlot(draft.jeScheduleTransactionKeysByPeriodAndTab, jeScheduleKey);
327
- },
328
- },
329
- removeJeAccruedScheduleKey: {
330
- prepare(jeAccruedScheduleKey) {
331
- return { payload: { jeAccruedScheduleKey } };
332
- },
333
- reducer(draft, action) {
334
- // Accrued keys live in their own per-tab map, so removeJeScheduleTransactionKey cannot drop
335
- // them -- a reverted accrued schedule stayed on the list until the next fetch.
336
- removeKeyFromEveryTabSlot(draft.jeScheduleAccruedKeysByPeriodAndTab, action.payload.jeAccruedScheduleKey);
237
+ const { selectedPeriod, jeScheduleKey } = action.payload;
238
+ const prevData = [
239
+ ...(draft.jeScheduleTransactionKeysByPeriod[toMonthYearPeriodId(selectedPeriod)] ?? []),
240
+ ];
241
+ const filteredKeys = prevData.filter((jeKey) => jeKey !== jeScheduleKey);
242
+ draft.jeScheduleTransactionKeysByPeriod[toMonthYearPeriodId(selectedPeriod)] = filteredKeys;
337
243
  },
338
244
  },
339
245
  removeFailedJeScheduleTransactionKey: {
@@ -346,8 +252,12 @@ const expenseAutomationJESchedulesView = createSlice({
346
252
  };
347
253
  },
348
254
  reducer(draft, action) {
349
- const { failedJeScheduleKey } = action.payload;
350
- removeKeyFromEveryTabSlot(draft.failedJeScheduleTransactionKeysByPeriodAndTab, failedJeScheduleKey);
255
+ const { selectedPeriod, failedJeScheduleKey } = action.payload;
256
+ const prevData = [
257
+ ...(draft.failedJeScheduleTransactionKeysByPeriod[toMonthYearPeriodId(selectedPeriod)] ?? []),
258
+ ];
259
+ const filteredKeys = prevData.filter((jeKey) => jeKey !== failedJeScheduleKey);
260
+ draft.failedJeScheduleTransactionKeysByPeriod[toMonthYearPeriodId(selectedPeriod)] = filteredKeys;
351
261
  },
352
262
  },
353
263
  initializeJeScheduleLocalData: {
@@ -459,182 +369,6 @@ const expenseAutomationJESchedulesView = createSlice({
459
369
  clearJeAccountSettingsLocalData(draft) {
460
370
  draft.accountSettings.localData = accountSettingsInitialState.localData;
461
371
  },
462
- initializeNewSchedule: {
463
- prepare({ scheduleType, shouldResetEnteredData = true, }) {
464
- return { payload: { scheduleType, shouldResetEnteredData } };
465
- },
466
- reducer() {
467
- // Purely an epic-trigger action — the epic fans out the account/class
468
- // list fetches, and clears entered data only when asked to.
469
- },
470
- },
471
- resetNewScheduleLocalData: {
472
- prepare({ scheduleType, }) {
473
- return { payload: { scheduleType } };
474
- },
475
- reducer(draft, action) {
476
- const { scheduleType } = action.payload;
477
- draft.newSchedule.newScheduleState[scheduleType] =
478
- getBaseNewScheduleLocalData(scheduleType);
479
- },
480
- },
481
- updateNewScheduleLocalData(draft, action) {
482
- const { scheduleType, localData } = action.payload;
483
- draft.newSchedule.newScheduleState[scheduleType] = {
484
- ...draft.newSchedule.newScheduleState[scheduleType],
485
- ...localData,
486
- };
487
- },
488
- searchTransactionsForNewSchedule: {
489
- prepare({ query, scheduleType, }) {
490
- return { payload: { query, scheduleType } };
491
- },
492
- reducer(draft, action) {
493
- const trimmed = action.payload.query.trim();
494
- // Cleared or too-short query: no API (see epic) — reset immediately.
495
- if (trimmed.length < MIN_NEW_SCHEDULE_SEARCH_LENGTH) {
496
- draft.newSchedule.searchTransactions = searchTransactionsInitialState;
497
- return;
498
- }
499
- draft.newSchedule.searchTransactions = {
500
- ...draft.newSchedule.searchTransactions,
501
- searchString: action.payload.query,
502
- fetchState: 'In-Progress',
503
- };
504
- },
505
- },
506
- searchTransactionsForNewScheduleSuccess(draft, action) {
507
- draft.newSchedule.searchTransactions = {
508
- ...draft.newSchedule.searchTransactions,
509
- searchResults: action.payload.searchResults,
510
- fetchState: 'Completed',
511
- error: undefined,
512
- };
513
- },
514
- searchTransactionsForNewScheduleFailure(draft, action) {
515
- draft.newSchedule.searchTransactions = {
516
- ...draft.newSchedule.searchTransactions,
517
- fetchState: 'Error',
518
- error: action.payload.status,
519
- };
520
- },
521
- clearSearchTransactionsForNewSchedule(draft) {
522
- draft.newSchedule.searchTransactions = searchTransactionsInitialState;
523
- },
524
- saveNewSchedule: {
525
- prepare({ scheduleType, }) {
526
- return { payload: { scheduleType } };
527
- },
528
- reducer(draft) {
529
- draft.newSchedule.saveStatus = {
530
- fetchState: 'In-Progress',
531
- error: undefined,
532
- };
533
- },
534
- },
535
- saveNewScheduleSuccess(draft) {
536
- draft.newSchedule.saveStatus = {
537
- fetchState: 'Completed',
538
- error: undefined,
539
- };
540
- },
541
- saveNewScheduleFailure(draft, action) {
542
- draft.newSchedule.saveStatus = {
543
- fetchState: 'Error',
544
- error: action.payload.status,
545
- };
546
- },
547
- createOneTimeAccrual: {
548
- prepare(localData) {
549
- return { payload: { localData } };
550
- },
551
- reducer(draft) {
552
- draft.newSchedule.createOneTimeAccrualStatus = {
553
- fetchState: 'In-Progress',
554
- error: undefined,
555
- };
556
- },
557
- },
558
- createOneTimeAccrualSuccess(draft) {
559
- draft.newSchedule.createOneTimeAccrualStatus = {
560
- fetchState: 'Completed',
561
- error: undefined,
562
- };
563
- },
564
- createOneTimeAccrualFailure(draft, action) {
565
- draft.newSchedule.createOneTimeAccrualStatus = {
566
- fetchState: 'Error',
567
- error: action.payload.status,
568
- };
569
- },
570
- promoteOneTimeAccrual: {
571
- prepare(accrualId, amount) {
572
- return { payload: { accrualId, amount } };
573
- },
574
- reducer(draft, action) {
575
- draft.oneTimeAccrualActionStatusById[action.payload.accrualId] = {
576
- fetchState: 'In-Progress',
577
- error: undefined,
578
- };
579
- },
580
- },
581
- revertOneTimeAccrual: {
582
- prepare(accrualId, reason, note) {
583
- return { payload: { accrualId, reason, note } };
584
- },
585
- reducer(draft, action) {
586
- draft.oneTimeAccrualActionStatusById[action.payload.accrualId] = {
587
- fetchState: 'In-Progress',
588
- error: undefined,
589
- };
590
- },
591
- },
592
- ignoreOneTimeAccrual: {
593
- prepare(accrualId, reason, note) {
594
- return { payload: { accrualId, reason, note } };
595
- },
596
- reducer(draft, action) {
597
- draft.oneTimeAccrualActionStatusById[action.payload.accrualId] = {
598
- fetchState: 'In-Progress',
599
- error: undefined,
600
- };
601
- },
602
- },
603
- fetchOneTimeAccrual: {
604
- prepare(accrualId) {
605
- return { payload: { accrualId } };
606
- },
607
- reducer(draft, action) {
608
- draft.oneTimeAccrualFetchStatusById[action.payload.accrualId] = {
609
- fetchState: 'In-Progress',
610
- error: undefined,
611
- };
612
- },
613
- },
614
- fetchOneTimeAccrualSuccess(draft, action) {
615
- draft.oneTimeAccrualFetchStatusById[action.payload.accrualId] = {
616
- fetchState: 'Completed',
617
- error: undefined,
618
- };
619
- },
620
- fetchOneTimeAccrualFailure(draft, action) {
621
- draft.oneTimeAccrualFetchStatusById[action.payload.accrualId] = {
622
- fetchState: 'Error',
623
- error: action.payload.status,
624
- };
625
- },
626
- oneTimeAccrualActionSuccess(draft, action) {
627
- draft.oneTimeAccrualActionStatusById[action.payload.accrualId] = {
628
- fetchState: 'Completed',
629
- error: undefined,
630
- };
631
- },
632
- oneTimeAccrualActionFailure(draft, action) {
633
- draft.oneTimeAccrualActionStatusById[action.payload.accrualId] = {
634
- fetchState: 'Error',
635
- error: action.payload.status,
636
- };
637
- },
638
372
  updateJESchedulesUIState(draft, action) {
639
373
  if (action.payload.sortKey != null) {
640
374
  draft.uiState.sortKey = action.payload.sortKey;
@@ -648,21 +382,10 @@ const expenseAutomationJESchedulesView = createSlice({
648
382
  if (action.payload.scrollPosition != null) {
649
383
  draft.uiState.scrollPosition = action.payload.scrollPosition;
650
384
  }
651
- if (action.payload.selectedPageTab != null) {
652
- draft.uiState.selectedPageTab = action.payload.selectedPageTab;
385
+ if (action.payload.selectedMainTab != null) {
386
+ draft.uiState.selectedMainTab = action.payload.selectedMainTab;
653
387
  }
654
388
  },
655
- updateJEScheduleTypeFilter(draft, action) {
656
- draft.uiState.selectedJETypeFilter = action.payload;
657
- },
658
- toggleJEPendingGroupCollapsed(draft) {
659
- draft.uiState.pendingGroupCollapsed =
660
- !draft.uiState.pendingGroupCollapsed;
661
- },
662
- toggleJECreatedGroupCollapsed(draft) {
663
- draft.uiState.createdGroupCollapsed =
664
- !draft.uiState.createdGroupCollapsed;
665
- },
666
389
  clearExpenseAutomationJESchedulesView(draft) {
667
390
  Object.assign(draft, initialState);
668
391
  },
@@ -673,7 +396,7 @@ const expenseAutomationJESchedulesView = createSlice({
673
396
  });
674
397
  },
675
398
  });
676
- export const { clearExpenseAutomationJESchedulesView, clearJeAccountSettingsLocalData, clearJeScheduleLocalData, clearSearchTransactionsForNewSchedule, createOneTimeAccrual, createOneTimeAccrualFailure, createOneTimeAccrualSuccess, ignoreOneTimeAccrual, oneTimeAccrualActionFailure, oneTimeAccrualActionSuccess, promoteOneTimeAccrual, revertJeSchedule, revertJeScheduleFailure, revertJeScheduleSuccess, revertOneTimeAccrual, fetchAccountSettingsListForAccountTypes, fetchJeSchedules, fetchJeSchedulesFailure, fetchJeSchedulesPage, fetchJeSchedulesSuccess, fetchOneTimeAccrual, fetchOneTimeAccrualFailure, fetchOneTimeAccrualSuccess, fetchRecommendationForAccountSettings, ignoreRecommendedJeSchedule, ignoreRecommendedJeScheduleFailure, ignoreRecommendedJeScheduleSuccess, initializeAccountSettingsView, initializeJeScheduleLocalData, initializeNewSchedule, removeFailedJeScheduleTransactionKey, removeJeScheduleLocalDataById, removeJeAccruedScheduleKey, removeJeScheduleTransactionKey, resetNewScheduleLocalData, retryJeSchedule, retryJeScheduleFailure, retryJeScheduleSuccess, saveAccountSettings, saveAccountSettingsFailure, saveAccountSettingsLocalData, saveAccountSettingsSuccess, saveNewSchedule, saveNewScheduleFailure, saveNewScheduleSuccess, searchTransactionsForNewSchedule, searchTransactionsForNewScheduleFailure, searchTransactionsForNewScheduleSuccess, toggleJECreatedGroupCollapsed, toggleJEPendingGroupCollapsed, updateAccountSettingsListForAccountTypes, updateAccountSettingsListForAccountTypesFailure, updateJESchedulesUIState, updateJEScheduleTypeFilter, updateJeScheduleLocalDataById, updateJeScheduleTransactionKeys, updateNewScheduleLocalData, updateRecommendationForAccountSettings, updateRecommendationForAccountSettingsFailure, } = expenseAutomationJESchedulesView.actions;
399
+ export const { clearExpenseAutomationJESchedulesView, clearJeAccountSettingsLocalData, clearJeScheduleLocalData, fetchAccountSettingsListForAccountTypes, fetchJeSchedules, fetchJeSchedulesFailure, fetchJeSchedulesPage, fetchJeSchedulesSuccess, fetchRecommendationForAccountSettings, ignoreRecommendedJeSchedule, ignoreRecommendedJeScheduleFailure, ignoreRecommendedJeScheduleSuccess, initializeAccountSettingsView, initializeJeScheduleLocalData, removeFailedJeScheduleTransactionKey, removeJeScheduleLocalDataById, removeJeScheduleTransactionKey, retryJeSchedule, retryJeScheduleFailure, retryJeScheduleSuccess, saveAccountSettings, saveAccountSettingsFailure, saveAccountSettingsLocalData, saveAccountSettingsSuccess, updateAccountSettingsListForAccountTypes, updateAccountSettingsListForAccountTypesFailure, updateJESchedulesUIState, updateJeScheduleLocalDataById, updateJeScheduleTransactionKeys, updateRecommendationForAccountSettings, updateRecommendationForAccountSettingsFailure, } = expenseAutomationJESchedulesView.actions;
677
400
  export default expenseAutomationJESchedulesView.reducer;
678
401
  const doUpdateRecommendationForAccountSettings = (draft, payload) => {
679
402
  const { prepaidExpensesRecommendations, fixedAssetsRecommendations, accruedExpensesRecommendations, } = mapAccountTypeRecommendationPayloadToAccountRecommendationByType(payload);