@zeniai/client-epic-state 5.2.22-betaAM1 → 5.2.22-betaRD0

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 (78) hide show
  1. package/lib/entity/jeSchedules/jeSchedulesPayload.d.ts +0 -24
  2. package/lib/entity/jeSchedules/jeSchedulesPayload.js +0 -40
  3. package/lib/entity/jeSchedules/jeSchedulesState.d.ts +0 -26
  4. package/lib/epic.d.ts +2 -6
  5. package/lib/epic.js +2 -10
  6. package/lib/esm/entity/jeSchedules/jeSchedulesPayload.js +0 -40
  7. package/lib/esm/epic.js +2 -10
  8. package/lib/esm/index.js +4 -8
  9. package/lib/esm/reducer.js +0 -3
  10. package/lib/esm/view/expenseAutomationView/epics/common/fetchAllExpenseAutomationTabsEpic.js +11 -28
  11. package/lib/esm/view/expenseAutomationView/epics/common/refreshExpenseAutomationCurrentTabEpic.js +1 -9
  12. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +45 -7
  13. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/oneTimeAccrualActionsEpic.js +13 -6
  14. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/prefetchOtherJeSchedulesTabEpic.js +35 -0
  15. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/switchJESchedulesTabEpic.js +0 -5
  16. package/lib/esm/view/expenseAutomationView/expenseAutomationViewSelector.js +7 -22
  17. package/lib/esm/view/expenseAutomationView/payload/jeSchedulesPayload.js +1 -1
  18. package/lib/esm/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +31 -7
  19. package/lib/esm/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +1 -3
  20. package/lib/esm/view/expenseAutomationView/types/jeSchedulesViewState.js +1 -5
  21. package/lib/index.d.ts +6 -11
  22. package/lib/index.js +49 -73
  23. package/lib/reducer.d.ts +0 -1
  24. package/lib/reducer.js +0 -3
  25. package/lib/rootStateTypes.d.ts +0 -2
  26. package/lib/view/expenseAutomationView/epics/common/fetchAllExpenseAutomationTabsEpic.d.ts +1 -2
  27. package/lib/view/expenseAutomationView/epics/common/fetchAllExpenseAutomationTabsEpic.js +11 -28
  28. package/lib/view/expenseAutomationView/epics/common/refreshExpenseAutomationCurrentTabEpic.d.ts +1 -2
  29. package/lib/view/expenseAutomationView/epics/common/refreshExpenseAutomationCurrentTabEpic.js +1 -9
  30. package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.d.ts +1 -1
  31. package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +45 -7
  32. package/lib/view/expenseAutomationView/epics/jeSchedule/oneTimeAccrualActionsEpic.d.ts +2 -2
  33. package/lib/view/expenseAutomationView/epics/jeSchedule/oneTimeAccrualActionsEpic.js +12 -5
  34. package/lib/view/expenseAutomationView/epics/jeSchedule/prefetchOtherJeSchedulesTabEpic.d.ts +12 -0
  35. package/lib/view/expenseAutomationView/epics/jeSchedule/prefetchOtherJeSchedulesTabEpic.js +39 -0
  36. package/lib/view/expenseAutomationView/epics/jeSchedule/switchJESchedulesTabEpic.d.ts +1 -2
  37. package/lib/view/expenseAutomationView/epics/jeSchedule/switchJESchedulesTabEpic.js +0 -5
  38. package/lib/view/expenseAutomationView/expenseAutomationViewSelector.js +7 -22
  39. package/lib/view/expenseAutomationView/payload/jeSchedulesPayload.d.ts +54 -1
  40. package/lib/view/expenseAutomationView/payload/jeSchedulesPayload.js +3 -3
  41. package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.d.ts +13 -8
  42. package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +33 -9
  43. package/lib/view/expenseAutomationView/selectorTypes/expenseAutomationViewSelectorTypes.d.ts +0 -2
  44. package/lib/view/expenseAutomationView/selectors/jeSchedulesViewSelector.d.ts +2 -0
  45. package/lib/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +1 -3
  46. package/lib/view/expenseAutomationView/types/jeSchedulesViewState.d.ts +3 -1
  47. package/lib/view/expenseAutomationView/types/jeSchedulesViewState.js +1 -5
  48. package/package.json +1 -1
  49. package/lib/esm/view/expenseAutomationView/epics/actualMatching/fetchActualMatchingEpic.js +0 -46
  50. package/lib/esm/view/expenseAutomationView/epics/actualMatching/fetchActualMatchingPageEpic.js +0 -7
  51. package/lib/esm/view/expenseAutomationView/epics/actualMatching/matchAndReverseAccrualsEpic.js +0 -50
  52. package/lib/esm/view/expenseAutomationView/epics/actualMatching/searchMatchAccrualsEpic.js +0 -44
  53. package/lib/esm/view/expenseAutomationView/epics/actualMatching/searchMatchTransactionsEpic.js +0 -44
  54. package/lib/esm/view/expenseAutomationView/payload/actualMatchingPayload.js +0 -60
  55. package/lib/esm/view/expenseAutomationView/reducers/actualMatchingViewReducer.js +0 -260
  56. package/lib/esm/view/expenseAutomationView/selectorTypes/actualMatchingViewSelectorTypes.js +0 -1
  57. package/lib/esm/view/expenseAutomationView/selectors/actualMatchingViewSelector.js +0 -200
  58. package/lib/esm/view/expenseAutomationView/types/actualMatchingViewState.js +0 -22
  59. package/lib/view/expenseAutomationView/epics/actualMatching/fetchActualMatchingEpic.d.ts +0 -9
  60. package/lib/view/expenseAutomationView/epics/actualMatching/fetchActualMatchingEpic.js +0 -50
  61. package/lib/view/expenseAutomationView/epics/actualMatching/fetchActualMatchingPageEpic.d.ts +0 -5
  62. package/lib/view/expenseAutomationView/epics/actualMatching/fetchActualMatchingPageEpic.js +0 -11
  63. package/lib/view/expenseAutomationView/epics/actualMatching/matchAndReverseAccrualsEpic.d.ts +0 -8
  64. package/lib/view/expenseAutomationView/epics/actualMatching/matchAndReverseAccrualsEpic.js +0 -54
  65. package/lib/view/expenseAutomationView/epics/actualMatching/searchMatchAccrualsEpic.d.ts +0 -8
  66. package/lib/view/expenseAutomationView/epics/actualMatching/searchMatchAccrualsEpic.js +0 -48
  67. package/lib/view/expenseAutomationView/epics/actualMatching/searchMatchTransactionsEpic.d.ts +0 -8
  68. package/lib/view/expenseAutomationView/epics/actualMatching/searchMatchTransactionsEpic.js +0 -48
  69. package/lib/view/expenseAutomationView/payload/actualMatchingPayload.d.ts +0 -72
  70. package/lib/view/expenseAutomationView/payload/actualMatchingPayload.js +0 -65
  71. package/lib/view/expenseAutomationView/reducers/actualMatchingViewReducer.d.ts +0 -53
  72. package/lib/view/expenseAutomationView/reducers/actualMatchingViewReducer.js +0 -264
  73. package/lib/view/expenseAutomationView/selectorTypes/actualMatchingViewSelectorTypes.d.ts +0 -59
  74. package/lib/view/expenseAutomationView/selectorTypes/actualMatchingViewSelectorTypes.js +0 -2
  75. package/lib/view/expenseAutomationView/selectors/actualMatchingViewSelector.d.ts +0 -11
  76. package/lib/view/expenseAutomationView/selectors/actualMatchingViewSelector.js +0 -212
  77. package/lib/view/expenseAutomationView/types/actualMatchingViewState.d.ts +0 -81
  78. package/lib/view/expenseAutomationView/types/actualMatchingViewState.js +0 -27
package/lib/reducer.d.ts CHANGED
@@ -65,7 +65,6 @@ declare const reducers: import("redux").Reducer<import("redux").CombinedState<{
65
65
  entityAutoCompleteState: import("./view/autoComplete/entityAutoCompleteState").EntityAutoCompleteState;
66
66
  entityRecommendationState: import("./view/recommendation/recommendationState").EntityRecommendationState;
67
67
  expenseAutomationFluxAnalysisViewState: import("./view/expenseAutomationView/types/fluxAnalysisViewState").FluxAnalysisViewState;
68
- expenseAutomationActualMatchingViewState: import("./view/expenseAutomationView/types/actualMatchingViewState").ActualMatchingViewState;
69
68
  expenseAutomationJESchedulesViewState: import("./view/expenseAutomationView/types/jeSchedulesViewState").JESchedulesViewState;
70
69
  expenseAutomationMissingReceiptsViewState: import(".").ExpenseAutomationMissingReceiptsViewState;
71
70
  expenseAutomationReconciliationViewState: import("./view/expenseAutomationView/types/reconciliationViewState").ReconciliationViewState;
package/lib/reducer.js CHANGED
@@ -155,7 +155,6 @@ const creditAgentViewReducer_1 = __importStar(require("./view/creditAgentView/cr
155
155
  const dashboardReducer_1 = __importStar(require("./view/dashboard/dashboardReducer"));
156
156
  const dashboardLayoutReducer_1 = __importStar(require("./view/dashboardLayout/dashboardLayoutReducer"));
157
157
  const expenseAutomationViewReducer_1 = __importStar(require("./view/expenseAutomationView/expenseAutomationViewReducer"));
158
- const actualMatchingViewReducer_1 = __importStar(require("./view/expenseAutomationView/reducers/actualMatchingViewReducer"));
159
158
  const fluxAnalysisViewReducer_1 = __importStar(require("./view/expenseAutomationView/reducers/fluxAnalysisViewReducer"));
160
159
  const jeSchedulesViewReducer_1 = __importStar(require("./view/expenseAutomationView/reducers/jeSchedulesViewReducer"));
161
160
  const missingReceiptsViewReducer_1 = __importStar(require("./view/expenseAutomationView/reducers/missingReceiptsViewReducer"));
@@ -469,7 +468,6 @@ const initialViewsState = {
469
468
  entityAutoCompleteState: entityAutoCompleteReducer_1.initialState,
470
469
  entityRecommendationState: recommendationReducer_1.initialState,
471
470
  expenseAutomationFluxAnalysisViewState: fluxAnalysisViewReducer_1.initialState,
472
- expenseAutomationActualMatchingViewState: actualMatchingViewReducer_1.initialState,
473
471
  expenseAutomationJESchedulesViewState: jeSchedulesViewReducer_1.initialState,
474
472
  expenseAutomationMissingReceiptsViewState: missingReceiptsViewReducer_1.initialState,
475
473
  expenseAutomationReconciliationViewState: reconciliationViewReducer_1.initialState,
@@ -764,7 +762,6 @@ const viewReducers = {
764
762
  entityAutoCompleteState: entityAutoCompleteReducer_1.default,
765
763
  entityRecommendationState: recommendationReducer_1.default,
766
764
  expenseAutomationFluxAnalysisViewState: fluxAnalysisViewReducer_1.default,
767
- expenseAutomationActualMatchingViewState: actualMatchingViewReducer_1.default,
768
765
  expenseAutomationJESchedulesViewState: jeSchedulesViewReducer_1.default,
769
766
  expenseAutomationMissingReceiptsViewState: missingReceiptsViewReducer_1.default,
770
767
  expenseAutomationReconciliationViewState: reconciliationViewReducer_1.default,
@@ -114,7 +114,6 @@ import { CreditAgentViewState } from './view/creditAgentView/creditAgentViewStat
114
114
  import { DashboardState } from './view/dashboard/dashboardState';
115
115
  import { DashboardLayoutState } from './view/dashboardLayout/dashboardLayoutState';
116
116
  import { ExpenseAutomationViewState } from './view/expenseAutomationView/expenseAutomationViewState';
117
- import { ActualMatchingViewState as ExpenseAutomationActualMatchingViewState } from './view/expenseAutomationView/types/actualMatchingViewState';
118
117
  import { FluxAnalysisViewState as ExpenseAutomationFluxAnalysisViewState } from './view/expenseAutomationView/types/fluxAnalysisViewState';
119
118
  import { JESchedulesViewState as ExpenseAutomationJESchedulesViewState } from './view/expenseAutomationView/types/jeSchedulesViewState';
120
119
  import { MissingReceiptsViewState as ExpenseAutomationMissingReceiptsViewState } from './view/expenseAutomationView/types/missingReceiptsViewState';
@@ -430,7 +429,6 @@ export type ViewsState = {
430
429
  editRemiDetailViewState: EditRemiDetailViewState;
431
430
  entityAutoCompleteState: EntityAutoCompleteState;
432
431
  entityRecommendationState: EntityRecommendationState;
433
- expenseAutomationActualMatchingViewState: ExpenseAutomationActualMatchingViewState;
434
432
  expenseAutomationFluxAnalysisViewState: ExpenseAutomationFluxAnalysisViewState;
435
433
  expenseAutomationJESchedulesViewState: ExpenseAutomationJESchedulesViewState;
436
434
  expenseAutomationMissingReceiptsViewState: ExpenseAutomationMissingReceiptsViewState;
@@ -3,11 +3,10 @@ import { Observable } from 'rxjs';
3
3
  import { RootState } from '../../../../rootStateTypes';
4
4
  import { fetchMonthEndCloseChecks } from '../../../monthEndCloseChecksView/monthEndCloseChecksViewReducer';
5
5
  import { fetchAllExpenseAutomationTabs } from '../../expenseAutomationViewReducer';
6
- import { fetchActualMatchingPage } from '../../reducers/actualMatchingViewReducer';
7
6
  import { fetchFluxAnalysisView } from '../../reducers/fluxAnalysisViewReducer';
8
7
  import { fetchJeSchedulesPage } from '../../reducers/jeSchedulesViewReducer';
9
8
  import { fetchMissingReceipts } from '../../reducers/missingReceiptsViewReducer';
10
9
  import { fetchReconciliation } from '../../reducers/reconciliationViewReducer';
11
10
  import { fetchTransactionCategorizationView } from '../../reducers/transactionsViewReducer';
12
- export type ActionType = ReturnType<typeof fetchAllExpenseAutomationTabs> | ReturnType<typeof fetchActualMatchingPage> | ReturnType<typeof fetchMissingReceipts> | ReturnType<typeof fetchMonthEndCloseChecks> | ReturnType<typeof fetchFluxAnalysisView> | ReturnType<typeof fetchJeSchedulesPage> | ReturnType<typeof fetchReconciliation> | ReturnType<typeof fetchTransactionCategorizationView>;
11
+ export type ActionType = ReturnType<typeof fetchAllExpenseAutomationTabs> | ReturnType<typeof fetchMissingReceipts> | ReturnType<typeof fetchMonthEndCloseChecks> | ReturnType<typeof fetchFluxAnalysisView> | ReturnType<typeof fetchJeSchedulesPage> | ReturnType<typeof fetchReconciliation> | ReturnType<typeof fetchTransactionCategorizationView>;
13
12
  export declare const fetchAllExpenseAutomationTabsEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>) => Observable<ActionType>;
@@ -6,7 +6,6 @@ const operators_1 = require("rxjs/operators");
6
6
  const timePeriod_1 = require("../../../../commonStateTypes/timePeriod");
7
7
  const tenantSelector_1 = require("../../../../entity/tenant/tenantSelector");
8
8
  const expenseAutomationViewReducer_1 = require("../../expenseAutomationViewReducer");
9
- const actualMatchingViewReducer_1 = require("../../reducers/actualMatchingViewReducer");
10
9
  const fluxAnalysisViewReducer_1 = require("../../reducers/fluxAnalysisViewReducer");
11
10
  const jeSchedulesViewReducer_1 = require("../../reducers/jeSchedulesViewReducer");
12
11
  const missingReceiptsViewReducer_1 = require("../../reducers/missingReceiptsViewReducer");
@@ -35,14 +34,11 @@ const fetchAllExpenseAutomationTabsEpic = (actions$, state$) => actions$.pipe((0
35
34
  }
36
35
  if (cacheOverride === true) {
37
36
  const actions = [];
38
- const selectedPageTab = state.expenseAutomationJESchedulesViewState.uiState.selectedPageTab;
39
37
  actions.push((0, transactionsViewReducer_1.fetchTransactionCategorizationView)(selectedTransactionCategorizationTab, { start: timePeriodStart, end: timePeriodEnd }, cacheOverride, false, undefined, undefined, refreshViewInBackground, false), (0, missingReceiptsViewReducer_1.fetchMissingReceipts)({ start: timePeriodStart, end: timePeriodEnd }, {
40
38
  amount: 75.0,
41
39
  currencyCode: 'USD',
42
40
  currencySymbol: '$',
43
- }, cacheOverride, refreshViewInBackground), (0, fluxAnalysisViewReducer_1.fetchFluxAnalysisView)(selectedPeriod, cacheOverride, refreshViewInBackground, null), selectedPageTab === 'actual_matching'
44
- ? (0, actualMatchingViewReducer_1.fetchActualMatchingPage)({ start: timePeriodStart, end: timePeriodEnd }, cacheOverride)
45
- : (0, jeSchedulesViewReducer_1.fetchJeSchedulesPage)({ start: timePeriodStart, end: timePeriodEnd }, cacheOverride));
41
+ }, cacheOverride, refreshViewInBackground), (0, fluxAnalysisViewReducer_1.fetchFluxAnalysisView)(selectedPeriod, cacheOverride, refreshViewInBackground, null), (0, jeSchedulesViewReducer_1.fetchJeSchedulesPage)({ start: timePeriodStart, end: timePeriodEnd }, cacheOverride));
46
42
  if (reconciliationEnabled) {
47
43
  actions.push((0, reconciliationViewReducer_1.fetchReconciliation)(selectedPeriod, undefined, cacheOverride, refreshViewInBackground));
48
44
  }
@@ -68,29 +64,16 @@ const fetchAllExpenseAutomationTabsEpic = (actions$, state$) => actions$.pipe((0
68
64
  fetchActions.push((0, fluxAnalysisViewReducer_1.fetchFluxAnalysisView)(selectedPeriod, cacheOverride, refreshViewInBackground, null));
69
65
  }
70
66
  // The two JE tabs cache separately, so only the tab actually being shown decides whether a
71
- // fetch is still needed. Actual Matching is a third tab on the same page with its own
72
- // endpoint and cache slot.
73
- const selectedPageTab = state.expenseAutomationJESchedulesViewState.uiState.selectedPageTab;
74
- if (selectedPageTab === 'actual_matching') {
75
- const actualMatchingPeriodKeys = state.expenseAutomationActualMatchingViewState.accrualKeysByPeriod[monthYearPeriodId];
76
- if (state.expenseAutomationActualMatchingViewState.fetchState !==
77
- 'In-Progress' &&
78
- (!state.expenseAutomationActualMatchingViewState.hasValidState() ||
79
- actualMatchingPeriodKeys == null)) {
80
- fetchActions.push((0, actualMatchingViewReducer_1.fetchActualMatchingPage)({ start: timePeriodStart, end: timePeriodEnd }, cacheOverride));
81
- }
82
- }
83
- else {
84
- const jeSchedulesPeriodTabKey = (0, jeSchedulesViewState_1.getJESchedulePeriodTabKey)(selectedPageTab, monthYearPeriodId);
85
- if (state.expenseAutomationJESchedulesViewState.fetchState !==
86
- 'In-Progress' &&
87
- (!state.expenseAutomationJESchedulesViewState.hasValidState() ||
88
- state.expenseAutomationJESchedulesViewState
89
- .jeScheduleTransactionKeysByPeriodAndTab[jeSchedulesPeriodTabKey] == null ||
90
- state.expenseAutomationJESchedulesViewState
91
- .failedJeScheduleTransactionKeysByPeriodAndTab[jeSchedulesPeriodTabKey] == null)) {
92
- fetchActions.push((0, jeSchedulesViewReducer_1.fetchJeSchedulesPage)({ start: timePeriodStart, end: timePeriodEnd }, cacheOverride));
93
- }
67
+ // fetch is still needed.
68
+ const jeSchedulesPeriodTabKey = (0, jeSchedulesViewState_1.getJESchedulePeriodTabKey)(state.expenseAutomationJESchedulesViewState.uiState.selectedPageTab, monthYearPeriodId);
69
+ if (state.expenseAutomationJESchedulesViewState.fetchState !==
70
+ 'In-Progress' &&
71
+ (!state.expenseAutomationJESchedulesViewState.hasValidState() ||
72
+ state.expenseAutomationJESchedulesViewState
73
+ .jeScheduleTransactionKeysByPeriodAndTab[jeSchedulesPeriodTabKey] == null ||
74
+ state.expenseAutomationJESchedulesViewState
75
+ .failedJeScheduleTransactionKeysByPeriodAndTab[jeSchedulesPeriodTabKey] == null)) {
76
+ fetchActions.push((0, jeSchedulesViewReducer_1.fetchJeSchedulesPage)({ start: timePeriodStart, end: timePeriodEnd }, cacheOverride));
94
77
  }
95
78
  if (state.expenseAutomationReconciliationViewState.fetchState !==
96
79
  'In-Progress' &&
@@ -4,11 +4,10 @@ import { RootState } from '../../../../rootStateTypes';
4
4
  import { fetchCompanyMonthEndReportTemplates, fetchCompanyMonthEndReportView } from '../../../companyMonthEndReportView/companyMonthEndReportViewReducer';
5
5
  import { fetchMonthEndCloseChecks } from '../../../monthEndCloseChecksView/monthEndCloseChecksViewReducer';
6
6
  import { refreshExpenseAutomationCurrentTab } from '../../expenseAutomationViewReducer';
7
- import { fetchActualMatchingPage } from '../../reducers/actualMatchingViewReducer';
8
7
  import { fetchFluxAnalysisView } from '../../reducers/fluxAnalysisViewReducer';
9
8
  import { fetchJeSchedulesPage } from '../../reducers/jeSchedulesViewReducer';
10
9
  import { fetchMissingReceipts } from '../../reducers/missingReceiptsViewReducer';
11
10
  import { fetchReconciliation } from '../../reducers/reconciliationViewReducer';
12
11
  import { fetchTransactionCategorizationView } from '../../reducers/transactionsViewReducer';
13
- export type ActionType = ReturnType<typeof refreshExpenseAutomationCurrentTab> | ReturnType<typeof fetchActualMatchingPage> | ReturnType<typeof fetchCompanyMonthEndReportView> | ReturnType<typeof fetchCompanyMonthEndReportTemplates> | ReturnType<typeof fetchMissingReceipts> | ReturnType<typeof fetchMonthEndCloseChecks> | ReturnType<typeof fetchFluxAnalysisView> | ReturnType<typeof fetchReconciliation> | ReturnType<typeof fetchJeSchedulesPage> | ReturnType<typeof fetchTransactionCategorizationView>;
12
+ export type ActionType = ReturnType<typeof refreshExpenseAutomationCurrentTab> | ReturnType<typeof fetchCompanyMonthEndReportView> | ReturnType<typeof fetchCompanyMonthEndReportTemplates> | ReturnType<typeof fetchMissingReceipts> | ReturnType<typeof fetchMonthEndCloseChecks> | ReturnType<typeof fetchFluxAnalysisView> | ReturnType<typeof fetchReconciliation> | ReturnType<typeof fetchJeSchedulesPage> | ReturnType<typeof fetchTransactionCategorizationView>;
14
13
  export declare const refreshExpenseAutomationCurrentTabEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>) => Observable<ActionType>;
@@ -7,7 +7,6 @@ const timePeriod_1 = require("../../../../commonStateTypes/timePeriod");
7
7
  const tenantSelector_1 = require("../../../../entity/tenant/tenantSelector");
8
8
  const companyMonthEndReportViewReducer_1 = require("../../../companyMonthEndReportView/companyMonthEndReportViewReducer");
9
9
  const expenseAutomationViewReducer_1 = require("../../expenseAutomationViewReducer");
10
- const actualMatchingViewReducer_1 = require("../../reducers/actualMatchingViewReducer");
11
10
  const fluxAnalysisViewReducer_1 = require("../../reducers/fluxAnalysisViewReducer");
12
11
  const jeSchedulesViewReducer_1 = require("../../reducers/jeSchedulesViewReducer");
13
12
  const missingReceiptsViewReducer_1 = require("../../reducers/missingReceiptsViewReducer");
@@ -42,17 +41,10 @@ const refreshExpenseAutomationCurrentTabEpic = (actions$, state$) => actions$.pi
42
41
  return (0, rxjs_1.from)([
43
42
  (0, fluxAnalysisViewReducer_1.fetchFluxAnalysisView)(selectedPeriod, true, true, null),
44
43
  ]);
45
- case 'je_schedules': {
46
- const selectedPageTab = state.expenseAutomationJESchedulesViewState.uiState.selectedPageTab;
47
- if (selectedPageTab === 'actual_matching') {
48
- return (0, rxjs_1.from)([
49
- (0, actualMatchingViewReducer_1.fetchActualMatchingPage)({ start: timePeriodStart, end: timePeriodEnd }, true),
50
- ]);
51
- }
44
+ case 'je_schedules':
52
45
  return (0, rxjs_1.from)([
53
46
  (0, jeSchedulesViewReducer_1.fetchJeSchedulesPage)({ start: timePeriodStart, end: timePeriodEnd }, true),
54
47
  ]);
55
- }
56
48
  case 'month_end_insights':
57
49
  return (0, rxjs_1.from)([
58
50
  (0, companyMonthEndReportViewReducer_1.fetchCompanyMonthEndReportView)(true, companyId, currentTenant.tenantId, period.end, true),
@@ -1,8 +1,8 @@
1
1
  import { ActionsObservable, StateObservable } from 'redux-observable';
2
2
  import { Observable } from 'rxjs';
3
3
  import { updateAccruedJESchedules, updateAccruedJESchedulesDetails, updateJEOneTimeAccruals, updateJESchedules, updateJESchedulesDetails } from '../../../../entity/jeSchedules/jeSchedulesReducer';
4
- import { RootState } from '../../../../rootStateTypes';
5
4
  import { clearAll } from '../../../../rootActions';
5
+ import { RootState } from '../../../../rootStateTypes';
6
6
  import { ZeniAPI } from '../../../../zeniAPI';
7
7
  import { fetchJeSchedules, fetchJeSchedulesFailure, fetchJeSchedulesSuccess, initializeJeScheduleLocalData } from '../../reducers/jeSchedulesViewReducer';
8
8
  export type ActionType = ReturnType<typeof clearAll> | ReturnType<typeof fetchJeSchedules> | ReturnType<typeof fetchJeSchedulesFailure> | ReturnType<typeof fetchJeSchedulesSuccess> | ReturnType<typeof initializeJeScheduleLocalData> | ReturnType<typeof updateAccruedJESchedules> | ReturnType<typeof updateAccruedJESchedulesDetails> | ReturnType<typeof updateJEOneTimeAccruals> | ReturnType<typeof updateJESchedules> | ReturnType<typeof updateJESchedulesDetails>;
@@ -10,6 +10,7 @@ const tenantSelector_1 = require("../../../../entity/tenant/tenantSelector");
10
10
  const responsePayload_1 = require("../../../../responsePayload");
11
11
  const rootActions_1 = require("../../../../rootActions");
12
12
  const zeniDayJS_1 = require("../../../../zeniDayJS");
13
+ const jeSchedulesPayload_1 = require("../../payload/jeSchedulesPayload");
13
14
  const jeSchedulesViewReducer_1 = require("../../reducers/jeSchedulesViewReducer");
14
15
  const fetchJeSchedulesEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(jeSchedulesViewReducer_1.fetchJeSchedules.match), (0, operators_1.mergeMap)((action) => {
15
16
  const state = state$.value;
@@ -17,21 +18,58 @@ const fetchJeSchedulesEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, op
17
18
  const { period, refreshViewInBackground } = action.payload;
18
19
  const currentTenant = (0, tenantSelector_1.getCurrentTenant)(state);
19
20
  const selectedPeriod = selectedPeriodByTenantId[currentTenant.tenantId];
20
- const { selectedPageTab } = state.expenseAutomationJESchedulesViewState.uiState;
21
+ // The prefetch names the tab it is warming; everything else means the visible one. Reading
22
+ // this from state unconditionally would make the prefetch fetch the visible tab's window and
23
+ // then overwrite its cache with the result.
24
+ const selectedPageTab = action.payload.selectedPageTab ??
25
+ state.expenseAutomationJESchedulesViewState.uiState.selectedPageTab;
21
26
  const isClosePeriodTab = selectedPageTab === 'schedules';
22
27
  const existingEndDate = (0, timePeriod_2.toAbsoluteDay)((0, zeniDayJS_1.date)((0, timePeriod_2.toString)(period.start))
23
28
  .subtract(1, 'month')
24
29
  .endOf('month')
25
30
  .format(timePeriod_1.DEFAULT_DATE_FORMAT));
31
+ // Existing Schedules looks at months already closed, so it stops at the previous month end;
32
+ // Review Schedules is closing the selected month and runs to its end.
33
+ const endDate = isClosePeriodTab || existingEndDate == null
34
+ ? (0, timePeriod_2.toString)(period.end)
35
+ : (0, timePeriod_2.toString)(existingEndDate);
36
+ // Accrued rows are windowed on the schedule's own start_date rather than a transaction date,
37
+ // so they get their own bounds. Review wants the month being closed; Existing wants the year
38
+ // up to endDate, snapped to the 1st — the same window the server used to compute for itself.
39
+ const accruedStartDate = isClosePeriodTab
40
+ ? (0, timePeriod_2.toString)(period.start)
41
+ : (0, zeniDayJS_1.date)(endDate)
42
+ .subtract(1, 'year')
43
+ .startOf('month')
44
+ .format(timePeriod_1.DEFAULT_DATE_FORMAT);
26
45
  const queryParam = {
27
- start_date: (0, timePeriod_2.toString)(period.start),
28
- end_date: isClosePeriodTab || existingEndDate == null
29
- ? (0, timePeriod_2.toString)(period.end)
30
- : (0, timePeriod_2.toString)(existingEndDate),
46
+ base_transaction_end_date: endDate,
47
+ end_date: endDate,
48
+ accrued_start_date: accruedStartDate,
49
+ accrued_end_date: endDate,
31
50
  include_accrued: true,
32
51
  ...(isClosePeriodTab
33
- ? { close_period_start_date: (0, timePeriod_2.toString)(period.start) }
34
- : {}),
52
+ ? {
53
+ // Both types share the close month, so one bound covers them. Existing sends none,
54
+ // which is what keeps the differing server defaults — a year back for prepaid, five
55
+ // for fixed assets.
56
+ base_transaction_start_date: (0, timePeriod_2.toString)(period.start),
57
+ close_period_start_date: (0, timePeriod_2.toString)(period.start),
58
+ one_time_accrual_service_month: (0, zeniDayJS_1.date)((0, timePeriod_2.toString)(period.start)).format(jeSchedulesPayload_1.SERVICE_MONTH_FORMAT),
59
+ // Empty means no status filter: the month being closed is reviewed whatever state
60
+ // each accrual is in.
61
+ one_time_accrual_statuses: [],
62
+ filter_failed_je_postings_by_date: true,
63
+ }
64
+ : {
65
+ one_time_accrual_service_month_start: (0, zeniDayJS_1.date)(accruedStartDate).format(jeSchedulesPayload_1.SERVICE_MONTH_FORMAT),
66
+ one_time_accrual_service_month_end: (0, zeniDayJS_1.date)(endDate).format(jeSchedulesPayload_1.SERVICE_MONTH_FORMAT),
67
+ // Existing lists what actually reached the books.
68
+ one_time_accrual_statuses: ['posted'],
69
+ // A failed posting from an earlier month still needs to surface here, so this list
70
+ // is deliberately not windowed.
71
+ filter_failed_je_postings_by_date: false,
72
+ }),
35
73
  };
36
74
  return zeniAPI
37
75
  .getJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/expenses_automation/je_schedules?query=${encodeURIComponent(JSON.stringify(queryParam))}`)
@@ -5,8 +5,8 @@ import { openSnackbar } from '../../../../entity/snackbar/snackbarReducer';
5
5
  import { RootState } from '../../../../reducer';
6
6
  import { clearAll } from '../../../../rootActions';
7
7
  import { ZeniAPI } from '../../../../zeniAPI';
8
- import { fetchJeSchedules, ignoreOneTimeAccrual, oneTimeAccrualActionFailure, oneTimeAccrualActionSuccess, promoteOneTimeAccrual, revertOneTimeAccrual } from '../../reducers/jeSchedulesViewReducer';
9
- export type ActionType = ReturnType<typeof clearAll> | ReturnType<typeof promoteOneTimeAccrual> | ReturnType<typeof revertOneTimeAccrual> | ReturnType<typeof ignoreOneTimeAccrual> | ReturnType<typeof oneTimeAccrualActionSuccess> | ReturnType<typeof oneTimeAccrualActionFailure> | ReturnType<typeof updateJEOneTimeAccruals> | ReturnType<typeof fetchJeSchedules> | ReturnType<typeof openSnackbar>;
8
+ import { fetchJeSchedules, ignoreOneTimeAccrual, oneTimeAccrualActionFailure, oneTimeAccrualActionSuccess, promoteOneTimeAccrual, removeJeOneTimeAccrualLocalData, revertOneTimeAccrual } from '../../reducers/jeSchedulesViewReducer';
9
+ export type ActionType = ReturnType<typeof clearAll> | ReturnType<typeof promoteOneTimeAccrual> | ReturnType<typeof removeJeOneTimeAccrualLocalData> | ReturnType<typeof revertOneTimeAccrual> | ReturnType<typeof ignoreOneTimeAccrual> | ReturnType<typeof oneTimeAccrualActionSuccess> | ReturnType<typeof oneTimeAccrualActionFailure> | ReturnType<typeof updateJEOneTimeAccruals> | ReturnType<typeof fetchJeSchedules> | ReturnType<typeof openSnackbar>;
10
10
  export declare const promoteOneTimeAccrualEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
11
11
  export declare const ignoreOneTimeAccrualEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
12
12
  export declare const revertOneTimeAccrualEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
@@ -9,8 +9,8 @@ const jeSchedulesReducer_1 = require("../../../../entity/jeSchedules/jeSchedules
9
9
  const jeSchedulesSelector_1 = require("../../../../entity/jeSchedules/jeSchedulesSelector");
10
10
  const snackbarReducer_1 = require("../../../../entity/snackbar/snackbarReducer");
11
11
  const tenantSelector_1 = require("../../../../entity/tenant/tenantSelector");
12
- const rootActions_1 = require("../../../../rootActions");
13
12
  const responsePayload_1 = require("../../../../responsePayload");
13
+ const rootActions_1 = require("../../../../rootActions");
14
14
  const jeSchedulesViewReducer_1 = require("../../reducers/jeSchedulesViewReducer");
15
15
  /**
16
16
  * The page the accrual came from, so a promoted or ignored row lands in the right bucket. Guarded
@@ -53,8 +53,11 @@ messageSection, accrualId, message, status) {
53
53
  }
54
54
  const promoteOneTimeAccrualEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(jeSchedulesViewReducer_1.promoteOneTimeAccrual.match), (0, operators_1.mergeMap)((action) => {
55
55
  const state = state$.value;
56
- const { accrualId, amount, edits } = action.payload;
56
+ const { accrualId, amount } = action.payload;
57
57
  const accrual = (0, jeSchedulesSelector_1.getJEOneTimeAccrualByKey)((0, jeScheduleHelper_1.generateJEOneTimeAccrualKey)(accrualId), state.jeSchedulesState);
58
+ // The detail form writes what the user changed here as they change it. The list's inline
59
+ // Post has no form, so it finds nothing and every value below falls back to the stored draft.
60
+ const edits = state.expenseAutomationJESchedulesViewState.oneTimeAccrualLocalDataById[accrualId];
58
61
  // An edited value wins; anything untouched falls back to the stored draft, which is what the
59
62
  // list's inline Post sends.
60
63
  const debitAccountId = edits?.jeDebitAccountId ?? accrual?.jeDebitAccountId;
@@ -68,8 +71,7 @@ const promoteOneTimeAccrualEpic = (actions$, state$, zeniAPI) => actions$.pipe((
68
71
  // that never happens.
69
72
  // Untouched falls back to the stored policy, so posting without editing cannot silently
70
73
  // flip a scheduled reversal to on-bill-match.
71
- const reverseNextMonth = edits?.reverseNextMonth ??
72
- accrual?.reversalPolicy === 'scheduled_date';
74
+ const reverseNextMonth = edits?.reverseNextMonth ?? accrual?.reversalPolicy === 'scheduled_date';
73
75
  const expectedReversalDate = edits?.expectedReversalDate ?? accrual?.expectedReversalDate;
74
76
  const debitClassId = edits?.jeDebitAccountingClassId ?? accrual?.jeDebitAccountingClassId;
75
77
  const debitClassName = edits?.jeDebitAccountingClassName ??
@@ -79,7 +81,9 @@ const promoteOneTimeAccrualEpic = (actions$, state$, zeniAPI) => actions$.pipe((
79
81
  memo: edits?.memo ?? accrual?.memo ?? '',
80
82
  je_debit_account_id: debitAccountId,
81
83
  je_credit_account_id: creditAccountId,
82
- ...(debitClassId != null ? { je_debit_accounting_class_id: debitClassId } : {}),
84
+ ...(debitClassId != null
85
+ ? { je_debit_accounting_class_id: debitClassId }
86
+ : {}),
83
87
  ...(debitClassName != null
84
88
  ? { je_debit_accounting_class_name: debitClassName }
85
89
  : {}),
@@ -99,6 +103,9 @@ const promoteOneTimeAccrualEpic = (actions$, state$, zeniAPI) => actions$.pipe((
99
103
  return (0, rxjs_1.from)([
100
104
  (0, jeSchedulesReducer_1.updateJEOneTimeAccruals)([response.data.accrual]),
101
105
  (0, jeSchedulesViewReducer_1.oneTimeAccrualActionSuccess)({ accrualId }),
106
+ // The edits are now on the server copy; leaving them would re-apply them to a
107
+ // later promote of the same accrual.
108
+ (0, jeSchedulesViewReducer_1.removeJeOneTimeAccrualLocalData)({ accrualId }),
102
109
  (0, snackbarReducer_1.openSnackbar)({
103
110
  messageSection: 'save_schedule',
104
111
  messageText: 'success',
@@ -0,0 +1,12 @@
1
+ import { ActionsObservable, StateObservable } from 'redux-observable';
2
+ import { Observable } from 'rxjs';
3
+ import { RootState } from '../../../../rootStateTypes';
4
+ import { fetchJeSchedules, fetchJeSchedulesPage } from '../../reducers/jeSchedulesViewReducer';
5
+ export type ActionType = ReturnType<typeof fetchJeSchedules> | ReturnType<typeof fetchJeSchedulesPage>;
6
+ /**
7
+ * Warms the tab the user is not looking at, so switching to it renders rows instead of a skeleton.
8
+ *
9
+ * Listens for `fetchJeSchedulesPage` rather than `fetchJeSchedules` on purpose: the prefetch emits
10
+ * `fetchJeSchedules`, so listening for that would make this epic feed itself.
11
+ */
12
+ export declare const prefetchOtherJeSchedulesTabEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>) => Observable<ActionType>;
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.prefetchOtherJeSchedulesTabEpic = void 0;
4
+ const rxjs_1 = require("rxjs");
5
+ const operators_1 = require("rxjs/operators");
6
+ const timePeriod_1 = require("../../../../commonStateTypes/timePeriod");
7
+ const tenantSelector_1 = require("../../../../entity/tenant/tenantSelector");
8
+ const jeSchedulesViewReducer_1 = require("../../reducers/jeSchedulesViewReducer");
9
+ const jeSchedulesViewState_1 = require("../../types/jeSchedulesViewState");
10
+ /**
11
+ * Warms the tab the user is not looking at, so switching to it renders rows instead of a skeleton.
12
+ *
13
+ * Listens for `fetchJeSchedulesPage` rather than `fetchJeSchedules` on purpose: the prefetch emits
14
+ * `fetchJeSchedules`, so listening for that would make this epic feed itself.
15
+ */
16
+ const prefetchOtherJeSchedulesTabEpic = (actions$, state$) => actions$.pipe((0, operators_1.filter)(jeSchedulesViewReducer_1.fetchJeSchedulesPage.match), (0, operators_1.mergeMap)((action) => {
17
+ const state = state$.value;
18
+ const { period } = action.payload;
19
+ const { selectedPageTab } = state.expenseAutomationJESchedulesViewState.uiState;
20
+ const otherPageTab = jeSchedulesViewState_1.ALL_JE_PAGE_TABS.find((pageTab) => pageTab !== selectedPageTab);
21
+ if (otherPageTab == null) {
22
+ return rxjs_1.EMPTY;
23
+ }
24
+ const currentTenant = (0, tenantSelector_1.getCurrentTenant)(state);
25
+ const selectedPeriod = state.expenseAutomationViewState.selectedPeriodByTenantId[currentTenant.tenantId];
26
+ if (selectedPeriod == null) {
27
+ return rxjs_1.EMPTY;
28
+ }
29
+ // Already warm for this period: without this check every tab switch would refetch the tab
30
+ // just left, since a switch also fires fetchJeSchedulesPage.
31
+ const otherPeriodTabKey = (0, jeSchedulesViewState_1.getJESchedulePeriodTabKey)(otherPageTab, (0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod));
32
+ const isOtherTabAlreadyLoaded = state.expenseAutomationJESchedulesViewState
33
+ .jeScheduleTransactionKeysByPeriodAndTab[otherPeriodTabKey] != null;
34
+ if (isOtherTabAlreadyLoaded) {
35
+ return rxjs_1.EMPTY;
36
+ }
37
+ return (0, rxjs_1.of)((0, jeSchedulesViewReducer_1.fetchJeSchedules)(period, true, otherPageTab));
38
+ }));
39
+ exports.prefetchOtherJeSchedulesTabEpic = prefetchOtherJeSchedulesTabEpic;
@@ -1,7 +1,6 @@
1
1
  import { ActionsObservable, StateObservable } from 'redux-observable';
2
2
  import { Observable } from 'rxjs';
3
3
  import { RootState } from '../../../../reducer';
4
- import { fetchActualMatchingPage } from '../../reducers/actualMatchingViewReducer';
5
4
  import { fetchJeSchedulesPage, updateJESchedulesUIState } from '../../reducers/jeSchedulesViewReducer';
6
- export type ActionType = ReturnType<typeof fetchActualMatchingPage> | ReturnType<typeof fetchJeSchedulesPage> | ReturnType<typeof updateJESchedulesUIState>;
5
+ export type ActionType = ReturnType<typeof fetchJeSchedulesPage> | ReturnType<typeof updateJESchedulesUIState>;
7
6
  export declare const switchJESchedulesTabEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>) => Observable<ActionType>;
@@ -5,7 +5,6 @@ const rxjs_1 = require("rxjs");
5
5
  const operators_1 = require("rxjs/operators");
6
6
  const timePeriod_1 = require("../../../../commonStateTypes/timePeriod");
7
7
  const tenantSelector_1 = require("../../../../entity/tenant/tenantSelector");
8
- const actualMatchingViewReducer_1 = require("../../reducers/actualMatchingViewReducer");
9
8
  const jeSchedulesViewReducer_1 = require("../../reducers/jeSchedulesViewReducer");
10
9
  const switchJESchedulesTabEpic = (actions$, state$) => actions$.pipe((0, operators_1.filter)(jeSchedulesViewReducer_1.updateJESchedulesUIState.match), (0, operators_1.filter)((action) => action.payload.selectedPageTab != null), (0, operators_1.mergeMap)(() => {
11
10
  const state = state$.value;
@@ -28,10 +27,6 @@ const switchJESchedulesTabEpic = (actions$, state$) => actions$.pipe((0, operato
28
27
  if (timePeriodStart == null || timePeriodEnd == null) {
29
28
  return rxjs_1.EMPTY;
30
29
  }
31
- const { selectedPageTab } = state.expenseAutomationJESchedulesViewState.uiState;
32
- if (selectedPageTab === 'actual_matching') {
33
- return (0, rxjs_1.of)((0, actualMatchingViewReducer_1.fetchActualMatchingPage)({ start: timePeriodStart, end: timePeriodEnd }, true));
34
- }
35
30
  return (0, rxjs_1.of)((0, jeSchedulesViewReducer_1.fetchJeSchedulesPage)({ start: timePeriodStart, end: timePeriodEnd }, true));
36
31
  }));
37
32
  exports.switchJESchedulesTabEpic = switchJESchedulesTabEpic;
@@ -7,7 +7,6 @@ const monthEndCloseChecksSelector_1 = require("../../entity/monthEndCloseChecks/
7
7
  const tenantSelector_1 = require("../../entity/tenant/tenantSelector");
8
8
  const companyMonthEndReportViewSelector_1 = require("../companyMonthEndReportView/companyMonthEndReportViewSelector");
9
9
  const monthEndCloseChecksViewSelector_1 = require("../monthEndCloseChecksView/monthEndCloseChecksViewSelector");
10
- const actualMatchingViewSelector_1 = require("./selectors/actualMatchingViewSelector");
11
10
  const fluxAnalysisViewSelector_1 = require("./selectors/fluxAnalysisViewSelector");
12
11
  const getAllStepsHelper_1 = require("./selectors/getAllStepsHelper");
13
12
  const jeSchedulesViewSelector_1 = require("./selectors/jeSchedulesViewSelector");
@@ -25,7 +24,7 @@ const isPreviousStepDisabled = (selectedTransactionCategorizationTab, allSteps,
25
24
  return allSteps[stepIndex - 1].isDisabled;
26
25
  };
27
26
  function getExpenseAutomationView(state) {
28
- const { expenseAutomationViewState, tenantState, expenseAutomationMissingReceiptsViewState, expenseAutomationJESchedulesViewState, expenseAutomationActualMatchingViewState, expenseAutomationTransactionsViewState, expenseAutomationReconciliationViewState, monthEndCloseChecksState, companyState, } = state;
27
+ const { expenseAutomationViewState, tenantState, expenseAutomationMissingReceiptsViewState, expenseAutomationJESchedulesViewState, expenseAutomationTransactionsViewState, expenseAutomationReconciliationViewState, monthEndCloseChecksState, companyState, } = state;
29
28
  const { loggedInUser, currentTenantId } = tenantState;
30
29
  const currentTenant = (0, tenantSelector_1.getCurrentTenant)(state);
31
30
  const { currentSelectedView, selectedPeriodByTenantId } = expenseAutomationViewState;
@@ -46,7 +45,6 @@ function getExpenseAutomationView(state) {
46
45
  const reconciliation = (0, reconciliationViewSelector_1.getExpenseAutomationReconciliationView)(state);
47
46
  const expenseAutomationTransactionsView = (0, transactionCategorizationSelector_1.getExpenseAutomationTransactionView)(state);
48
47
  const jeSchedules = (0, jeSchedulesViewSelector_1.getExpenseAutomationJESchedulesView)(state);
49
- const actualMatching = (0, actualMatchingViewSelector_1.getExpenseAutomationActualMatchingView)(state);
50
48
  switch (currentSelectedView) {
51
49
  case 'reconciliation':
52
50
  currentSelectedViewFetchState = reconciliation.fetchStatus;
@@ -59,23 +57,12 @@ function getExpenseAutomationView(state) {
59
57
  fluxAnalysis.refreshStatus;
60
58
  break;
61
59
  case 'je_schedules':
62
- if (expenseAutomationJESchedulesViewState.uiState.selectedPageTab ===
63
- 'actual_matching') {
64
- currentSelectedViewFetchState = {
65
- fetchState: actualMatching.fetchState,
66
- error: actualMatching.error,
67
- };
68
- currentSelectedViewBackgroundRefreshFetchState =
69
- actualMatching.refreshStatus;
70
- }
71
- else {
72
- currentSelectedViewFetchState = {
73
- fetchState: jeSchedules.fetchState,
74
- error: jeSchedules.error,
75
- };
76
- currentSelectedViewBackgroundRefreshFetchState =
77
- jeSchedules.refreshStatus;
78
- }
60
+ currentSelectedViewFetchState = {
61
+ fetchState: jeSchedules.fetchState,
62
+ error: jeSchedules.error,
63
+ };
64
+ currentSelectedViewBackgroundRefreshFetchState =
65
+ jeSchedules.refreshStatus;
79
66
  break;
80
67
  case 'missing_receipts':
81
68
  currentSelectedViewFetchState = {
@@ -107,7 +94,6 @@ function getExpenseAutomationView(state) {
107
94
  const fetchStateVariables = [
108
95
  expenseAutomationMissingReceiptsViewState,
109
96
  expenseAutomationJESchedulesViewState,
110
- expenseAutomationActualMatchingViewState,
111
97
  expenseAutomationTransactionsView,
112
98
  expenseAutomationReconciliationViewState,
113
99
  ];
@@ -193,7 +179,6 @@ function getExpenseAutomationView(state) {
193
179
  ]);
194
180
  return {
195
181
  jeSchedules,
196
- actualMatching,
197
182
  transactionView: expenseAutomationTransactionsView,
198
183
  missingReceipts,
199
184
  reconciliation,
@@ -7,11 +7,51 @@ import { RootState } from '../../../rootStateTypes';
7
7
  import { ZeniDate } from '../../../zeniDayJS';
8
8
  import { JESchedulePayload, SaveJESchedulePayload } from '../../scheduleView/scheduleDetailView/scheduleDetailPayload';
9
9
  import { JEScheduleLocalData, NewOneTimeAccrualLocalData } from '../types/jeSchedulesViewState';
10
+ /**
11
+ * The query this endpoint accepts. Every field names the thing it filters, because three
12
+ * different fields are involved and which one applies depends on the row type:
13
+ *
14
+ * - prepaid / fixed assets -> the base transaction's date
15
+ * - accrued schedules -> the schedule's own start_date, i.e. its first posting date
16
+ * - one-time accruals -> service_month, a 'YYYY-MM' string
17
+ *
18
+ * Omitting a bound means "use the server default", and the defaults differ per type -- which is
19
+ * why the Existing tab omits `base_transaction_start_date` rather than sending one value for both.
20
+ */
10
21
  export interface ExpenseAutomationJESchedulesQueryPayload {
22
+ accrued_end_date: string;
23
+ accrued_start_date: string;
24
+ base_transaction_end_date: string;
25
+ /**
26
+ * The same value as `base_transaction_end_date`, sent for the rollout window.
27
+ *
28
+ * An older server reads only `end_date` and has never heard of
29
+ * `base_transaction_end_date`; without this it falls back to `date.today()`, which silently
30
+ * widens the Existing tab and breaks any month other than the current one. Remove alongside
31
+ * `include_accrued`.
32
+ */
11
33
  end_date: string;
34
+ /**
35
+ * Sent while the backend rollout completes.
36
+ *
37
+ * The server ignores it now and always returns accrued rows. An older server does not: it reads
38
+ * this flag and omits `accrued_je_schedules` and `one_time_accruals` without it. Dropping it here
39
+ * would mean a new bundle against a not-yet-deployed (or rolled-back) backend silently loses
40
+ * every accrued row. Remove once the backend change is released everywhere.
41
+ */
12
42
  include_accrued: boolean;
13
- start_date: string;
43
+ base_transaction_start_date?: string;
44
+ /**
45
+ * Deprecated, sent for the same rollout reason as `include_accrued`. On an older server its
46
+ * presence is what selects the close-period behaviour; on the current one the explicit fields
47
+ * above take precedence and this is only a fallback.
48
+ */
14
49
  close_period_start_date?: string;
50
+ filter_failed_je_postings_by_date?: boolean;
51
+ one_time_accrual_service_month?: string;
52
+ one_time_accrual_service_month_end?: string;
53
+ one_time_accrual_service_month_start?: string;
54
+ one_time_accrual_statuses?: string[];
15
55
  }
16
56
  interface ExpenseAutomationJESchedulesPayload {
17
57
  failed_je_postings: {
@@ -24,8 +64,21 @@ interface ExpenseAutomationJESchedulesPayload {
24
64
  scheduled_journal_entries?: ScheduledJournalEntryPayload[];
25
65
  };
26
66
  one_time_accruals?: JEOneTimeAccrualPayload[];
67
+ query?: {
68
+ accrued_end_date: string;
69
+ accrued_start_date: string;
70
+ base_transaction_end_date: string;
71
+ filter_failed_je_postings_by_date: boolean;
72
+ fixed_assets_start_date: string;
73
+ prepaid_start_date: string;
74
+ one_time_accrual_service_month?: string;
75
+ one_time_accrual_service_month_end?: string;
76
+ one_time_accrual_service_month_start?: string;
77
+ one_time_accrual_statuses?: string[];
78
+ };
27
79
  }
28
80
  export type ExpenseAutomationJESchedulesResponse = ZeniAPIResponse<ExpenseAutomationJESchedulesPayload>;
81
+ export declare const SERVICE_MONTH_FORMAT = "YYYY-MM";
29
82
  export interface CreateOneTimeAccrualPayload {
30
83
  amount: number;
31
84
  je_credit_account_id: ID;
@@ -1,11 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.preparePayloadForRetryPosting = exports.prepareIgnoreSchedulePayload = exports.getExpectedReversalDate = exports.prepareCreateOneTimeAccrualPayload = void 0;
3
+ exports.preparePayloadForRetryPosting = exports.prepareIgnoreSchedulePayload = exports.getExpectedReversalDate = exports.prepareCreateOneTimeAccrualPayload = exports.SERVICE_MONTH_FORMAT = void 0;
4
4
  const timePeriod_1 = require("../../../commonStateTypes/timePeriod");
5
5
  const classListSelector_1 = require("../../classList/classListSelector");
6
6
  const scheduleDetailPayload_1 = require("../../scheduleView/scheduleDetailView/scheduleDetailPayload");
7
7
  const BALANCE_SHEET_CLASS_LABEL = 'balance_sheet';
8
- const SERVICE_MONTH_FORMAT = 'YYYY-MM';
8
+ exports.SERVICE_MONTH_FORMAT = 'YYYY-MM';
9
9
  /**
10
10
  * The credit line is the accrued liability, which always sits on the balance sheet — the
11
11
  * recurring accrued path resolves the same class the same way (see
@@ -27,7 +27,7 @@ const prepareCreateOneTimeAccrualPayload = (state, localData) => {
27
27
  return {
28
28
  vendor_id: localData.vendorId,
29
29
  vendor_name: localData.vendorName,
30
- service_month: localData.serviceMonth.format(SERVICE_MONTH_FORMAT),
30
+ service_month: localData.serviceMonth.format(exports.SERVICE_MONTH_FORMAT),
31
31
  amount: localData.amount,
32
32
  memo: localData.memo,
33
33
  je_debit_account_id: localData.debitAccountId,