@zeniai/client-epic-state 5.2.50-betaRD1 → 5.2.50

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 (85) hide show
  1. package/lib/entity/jeSchedules/jeSchedulesReducer.d.ts +1 -4
  2. package/lib/entity/jeSchedules/jeSchedulesReducer.js +5 -47
  3. package/lib/epic.d.ts +1 -2
  4. package/lib/epic.js +4 -6
  5. package/lib/esm/entity/jeSchedules/jeSchedulesReducer.js +4 -46
  6. package/lib/esm/epic.js +4 -6
  7. package/lib/esm/index.js +3 -3
  8. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulePageEpic.js +1 -9
  9. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +13 -10
  10. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/initializeJeScheduleLocalDataEpic.js +15 -29
  11. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/retryJeSchedulesEpic.js +1 -12
  12. package/lib/esm/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +1 -60
  13. package/lib/esm/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +11 -11
  14. package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewReducer.js +19 -11
  15. package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewSelector.js +4 -1
  16. package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/saveInvoicingCatalogItemEpic.js +3 -2
  17. package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/seedInvoicingCatalogItemFormDraftEpic.js +26 -7
  18. package/lib/esm/view/invoicing/editInvoicingCouponDetailView/editInvoicingCouponDetailViewReducer.js +19 -11
  19. package/lib/esm/view/invoicing/editInvoicingCouponDetailView/editInvoicingCouponDetailViewSelector.js +3 -1
  20. package/lib/esm/view/invoicing/editInvoicingCouponDetailView/saveInvoicingCouponEpic.js +1 -1
  21. package/lib/esm/view/invoicing/editInvoicingCouponDetailView/seedInvoicingCouponFormDraftEpic.js +25 -6
  22. package/lib/esm/view/invoicing/editInvoicingCustomerDetailView/editInvoicingCustomerDetailViewReducer.js +19 -11
  23. package/lib/esm/view/invoicing/editInvoicingCustomerDetailView/editInvoicingCustomerDetailViewSelector.js +4 -2
  24. package/lib/esm/view/invoicing/editInvoicingCustomerDetailView/saveInvoicingCustomerEpic.js +1 -1
  25. package/lib/esm/view/invoicing/editInvoicingCustomerDetailView/seedInvoicingCustomerFormDraftEpic.js +25 -6
  26. package/lib/esm/view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewReducer.js +21 -13
  27. package/lib/esm/view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewSelector.js +3 -2
  28. package/lib/esm/view/invoicing/editInvoicingSubscriptionDetailView/fetchInvoicingSubscriptionFormPageEpic.js +4 -1
  29. package/lib/esm/view/invoicing/editInvoicingSubscriptionDetailView/saveInvoicingSubscriptionEpic.js +1 -1
  30. package/lib/esm/view/invoicing/editInvoicingSubscriptionDetailView/seedInvoicingSubscriptionFormDraftEpic.js +29 -8
  31. package/lib/esm/view/invoicing/invoicingFormDraft.js +65 -0
  32. package/lib/index.d.ts +3 -3
  33. package/lib/index.js +49 -50
  34. package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulePageEpic.d.ts +2 -2
  35. package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulePageEpic.js +0 -8
  36. package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +11 -8
  37. package/lib/view/expenseAutomationView/epics/jeSchedule/initializeJeScheduleLocalDataEpic.js +15 -29
  38. package/lib/view/expenseAutomationView/epics/jeSchedule/retryJeSchedulesEpic.d.ts +2 -2
  39. package/lib/view/expenseAutomationView/epics/jeSchedule/retryJeSchedulesEpic.js +1 -12
  40. package/lib/view/expenseAutomationView/payload/jeSchedulesPayload.d.ts +0 -18
  41. package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.d.ts +2 -8
  42. package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +3 -62
  43. package/lib/view/expenseAutomationView/selectorTypes/jeSchedulesSelectorTypes.d.ts +0 -2
  44. package/lib/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +11 -11
  45. package/lib/view/expenseAutomationView/types/jeSchedulesViewState.d.ts +0 -15
  46. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewReducer.d.ts +3 -1
  47. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewReducer.js +19 -11
  48. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewSelector.d.ts +10 -0
  49. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewSelector.js +4 -1
  50. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewState.d.ts +2 -1
  51. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/saveInvoicingCatalogItemEpic.js +3 -2
  52. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/seedInvoicingCatalogItemFormDraftEpic.d.ts +10 -6
  53. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/seedInvoicingCatalogItemFormDraftEpic.js +25 -6
  54. package/lib/view/invoicing/editInvoicingCouponDetailView/editInvoicingCouponDetailViewReducer.d.ts +3 -1
  55. package/lib/view/invoicing/editInvoicingCouponDetailView/editInvoicingCouponDetailViewReducer.js +19 -11
  56. package/lib/view/invoicing/editInvoicingCouponDetailView/editInvoicingCouponDetailViewSelector.d.ts +13 -0
  57. package/lib/view/invoicing/editInvoicingCouponDetailView/editInvoicingCouponDetailViewSelector.js +3 -1
  58. package/lib/view/invoicing/editInvoicingCouponDetailView/editInvoicingCouponDetailViewState.d.ts +2 -1
  59. package/lib/view/invoicing/editInvoicingCouponDetailView/saveInvoicingCouponEpic.js +1 -1
  60. package/lib/view/invoicing/editInvoicingCouponDetailView/seedInvoicingCouponFormDraftEpic.d.ts +10 -6
  61. package/lib/view/invoicing/editInvoicingCouponDetailView/seedInvoicingCouponFormDraftEpic.js +24 -5
  62. package/lib/view/invoicing/editInvoicingCustomerDetailView/editInvoicingCustomerDetailViewReducer.d.ts +3 -1
  63. package/lib/view/invoicing/editInvoicingCustomerDetailView/editInvoicingCustomerDetailViewReducer.js +19 -11
  64. package/lib/view/invoicing/editInvoicingCustomerDetailView/editInvoicingCustomerDetailViewSelector.d.ts +9 -0
  65. package/lib/view/invoicing/editInvoicingCustomerDetailView/editInvoicingCustomerDetailViewSelector.js +4 -2
  66. package/lib/view/invoicing/editInvoicingCustomerDetailView/editInvoicingCustomerDetailViewState.d.ts +2 -1
  67. package/lib/view/invoicing/editInvoicingCustomerDetailView/saveInvoicingCustomerEpic.js +1 -1
  68. package/lib/view/invoicing/editInvoicingCustomerDetailView/seedInvoicingCustomerFormDraftEpic.d.ts +10 -6
  69. package/lib/view/invoicing/editInvoicingCustomerDetailView/seedInvoicingCustomerFormDraftEpic.js +24 -5
  70. package/lib/view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewReducer.d.ts +3 -1
  71. package/lib/view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewReducer.js +21 -13
  72. package/lib/view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewSelector.d.ts +9 -0
  73. package/lib/view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewSelector.js +3 -2
  74. package/lib/view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewState.d.ts +2 -1
  75. package/lib/view/invoicing/editInvoicingSubscriptionDetailView/fetchInvoicingSubscriptionFormPageEpic.js +4 -1
  76. package/lib/view/invoicing/editInvoicingSubscriptionDetailView/saveInvoicingSubscriptionEpic.js +1 -1
  77. package/lib/view/invoicing/editInvoicingSubscriptionDetailView/seedInvoicingSubscriptionFormDraftEpic.d.ts +10 -6
  78. package/lib/view/invoicing/editInvoicingSubscriptionDetailView/seedInvoicingSubscriptionFormDraftEpic.js +28 -7
  79. package/lib/view/invoicing/invoicingFormDraft.d.ts +54 -0
  80. package/lib/view/invoicing/invoicingFormDraft.js +72 -0
  81. package/package.json +1 -1
  82. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/fetchFailedJePostingsEpic.js +0 -40
  83. package/lib/tsconfig.mocks.tsbuildinfo +0 -1
  84. package/lib/view/expenseAutomationView/epics/jeSchedule/fetchFailedJePostingsEpic.d.ts +0 -20
  85. package/lib/view/expenseAutomationView/epics/jeSchedule/fetchFailedJePostingsEpic.js +0 -44
@@ -84,9 +84,8 @@ const fetchJeSchedulesEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, op
84
84
  one_time_accrual_service_month_end: parsedEndDate.format(jeSchedulesPayload_1.SERVICE_MONTH_FORMAT),
85
85
  // Existing lists what actually reached the books.
86
86
  one_time_accrual_statuses: ['posted'],
87
- // Kept only so this tab's response shape is unchanged. Nothing reads the failed
88
- // postings it returns any more -- they have their own endpoint and their own group
89
- // on Review. Dropping the key from the response is a server-side follow-up.
87
+ // A failed posting from an earlier month still needs to surface here, so this list
88
+ // is deliberately not windowed.
90
89
  filter_failed_je_postings_by_date: false,
91
90
  }),
92
91
  };
@@ -97,10 +96,12 @@ const fetchJeSchedulesEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, op
97
96
  const updateActions = [];
98
97
  const accruedJeSchedules = response.data.accrued_je_schedules?.je_schedules ?? [];
99
98
  const oneTimeAccruals = response.data.one_time_accruals ?? [];
100
- // failed_je_postings is deliberately ignored. This endpoint windows it to the close
101
- // month, which is what hid older failures; fetchFailedJePostingsEpic owns that list
102
- // now and fetches it unwindowed.
103
- updateActions.push((0, jeSchedulesReducer_1.updateJESchedules)([...response.data.je_schedules]));
99
+ updateActions.push((0, jeSchedulesReducer_1.updateJESchedules)([
100
+ ...response.data.je_schedules,
101
+ ...response.data.failed_je_postings.je_schedules,
102
+ ]), (0, jeSchedulesReducer_1.updateJESchedulesDetails)([...response.data.failed_je_postings.je_schedules], response.data.failed_je_postings.scheduled_journal_entries), (0, jeSchedulesViewReducer_1.initializeJeScheduleLocalData)([
103
+ ...response.data.failed_je_postings.je_schedules,
104
+ ]));
104
105
  if (accruedJeSchedules.length > 0) {
105
106
  updateActions.push((0, jeSchedulesReducer_1.updateAccruedJESchedules)(accruedJeSchedules), (0, jeSchedulesReducer_1.updateAccruedJESchedulesDetails)(accruedJeSchedules, response.data.accrued_je_schedules
106
107
  ?.scheduled_journal_entries));
@@ -113,7 +114,9 @@ const fetchJeSchedulesEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, op
113
114
  }
114
115
  updateActions.push((0, jeSchedulesViewReducer_1.fetchJeSchedulesSuccess)({
115
116
  jeSchedules: [...response.data.je_schedules],
116
- failedJeSchedules: [],
117
+ failedJeSchedules: [
118
+ ...response.data.failed_je_postings.je_schedules,
119
+ ],
117
120
  accruedJeSchedules: accruedJeSchedules,
118
121
  oneTimeAccruals: oneTimeAccruals,
119
122
  selectedPeriod: selectedPeriod,
@@ -10,36 +10,22 @@ const initializeJeScheduleLocalDataEpic = (actions$, state$) => actions$.pipe((0
10
10
  const actions = [];
11
11
  const { jeScheduleTransactionKeys } = action.payload;
12
12
  jeScheduleTransactionKeys.forEach((jeScheduleTransactionKey) => {
13
- // Checked before the selector runs, not after: the selector destructures the record it
14
- // looks up, so a key that is not in the store throws a TypeError rather than returning
15
- // undefined. This epic is a mergeMap with no catchError, so that throw would take its
16
- // subscription down for the rest of the session and silently stop local-data
17
- // initialisation everywhere -- not just for this row.
18
- if (state.jeSchedulesState.schedulesByTransactionKey[jeScheduleTransactionKey] == null) {
19
- return;
20
- }
21
13
  const jeScheduledTransaction = (0, jeSchedulesSelector_1.getJEScheduledTransactionByJEScheduleTransactionKey)(jeScheduleTransactionKey, state);
22
- // One record per journal entry, not per schedule. A schedule that failed in two months is
23
- // two rows and each needs its own vendor / category edits -- keying only the first left
24
- // every later row without local data, which the list renders read-only and without a
25
- // Retry button. An empty array is possible when details have not landed yet; it must not
26
- // throw, because this runs in a mergeMap with no catchError and the throw would take the
27
- // epic's subscription down for the rest of the session.
28
- jeScheduledTransaction.scheduledJournalEntry.forEach((journalEntry) => {
29
- const { scheduledJournalEntryID } = journalEntry;
30
- actions.push((0, jeSchedulesViewReducer_1.updateJeScheduleLocalDataById)({
31
- localData: {
32
- jeScheduleType: jeScheduledTransaction.jeScheduleType,
33
- jeScheduleID: jeScheduledTransaction.jeScheduleId,
34
- scheduledJournalEntryID,
35
- updatedVendor: undefined,
36
- updatedCategoryId: undefined,
37
- updatedAccumulatedDepreciationCategoryID: undefined,
38
- updatedClassId: undefined,
39
- },
40
- scheduledJournalEntryID,
41
- }));
42
- });
14
+ const initLocalData = {
15
+ jeScheduleType: jeScheduledTransaction.jeScheduleType,
16
+ jeScheduleID: jeScheduledTransaction.jeScheduleId,
17
+ scheduledJournalEntryID: jeScheduledTransaction.scheduledJournalEntry[0]
18
+ .scheduledJournalEntryID,
19
+ updatedVendor: undefined,
20
+ updatedCategoryId: undefined,
21
+ updatedAccumulatedDepreciationCategoryID: undefined,
22
+ updatedClassId: undefined,
23
+ };
24
+ actions.push((0, jeSchedulesViewReducer_1.updateJeScheduleLocalDataById)({
25
+ localData: initLocalData,
26
+ scheduledJournalEntryID: jeScheduledTransaction.scheduledJournalEntry[0]
27
+ .scheduledJournalEntryID,
28
+ }));
43
29
  });
44
30
  return (0, rxjs_1.from)(actions);
45
31
  }));
@@ -1,10 +1,10 @@
1
1
  import { ActionsObservable, StateObservable } from 'redux-observable';
2
2
  import { Observable } from 'rxjs';
3
- import { removeScheduledJournalEntryFromJESchedule, updateJESchedules, updateJESchedulesDetails } from '../../../../entity/jeSchedules/jeSchedulesReducer';
3
+ import { updateJESchedules, updateJESchedulesDetails } from '../../../../entity/jeSchedules/jeSchedulesReducer';
4
4
  import { openSnackbar } from '../../../../entity/snackbar/snackbarReducer';
5
5
  import { RootState } from '../../../../rootStateTypes';
6
6
  import { ZeniAPI } from '../../../../zeniAPI';
7
7
  import { fetchMonthEndCloseChecks } from '../../../monthEndCloseChecksView/monthEndCloseChecksViewReducer';
8
8
  import { removeFailedJeScheduleTransactionKey, removeJeScheduleLocalDataById, retryJeSchedule, retryJeScheduleFailure, retryJeScheduleSuccess, updateJeScheduleTransactionKeys } from '../../reducers/jeSchedulesViewReducer';
9
- export type ActionType = ReturnType<typeof fetchMonthEndCloseChecks> | ReturnType<typeof openSnackbar> | ReturnType<typeof removeFailedJeScheduleTransactionKey> | ReturnType<typeof removeJeScheduleLocalDataById> | ReturnType<typeof removeScheduledJournalEntryFromJESchedule> | ReturnType<typeof retryJeSchedule> | ReturnType<typeof retryJeScheduleFailure> | ReturnType<typeof retryJeScheduleSuccess> | ReturnType<typeof updateJESchedules> | ReturnType<typeof updateJESchedulesDetails> | ReturnType<typeof updateJeScheduleTransactionKeys>;
9
+ export type ActionType = ReturnType<typeof fetchMonthEndCloseChecks> | ReturnType<typeof openSnackbar> | ReturnType<typeof removeFailedJeScheduleTransactionKey> | ReturnType<typeof removeJeScheduleLocalDataById> | ReturnType<typeof retryJeSchedule> | ReturnType<typeof retryJeScheduleFailure> | ReturnType<typeof retryJeScheduleSuccess> | ReturnType<typeof updateJESchedules> | ReturnType<typeof updateJESchedulesDetails> | ReturnType<typeof updateJeScheduleTransactionKeys>;
10
10
  export declare const retryJeScheduleEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.retryJeScheduleEpic = void 0;
4
4
  const rxjs_1 = require("rxjs");
5
5
  const operators_1 = require("rxjs/operators");
6
- const jeSchedulesReducer_1 = require("../../../../entity/jeSchedules/jeSchedulesReducer");
7
6
  const snackbarReducer_1 = require("../../../../entity/snackbar/snackbarReducer");
8
7
  const tenantSelector_1 = require("../../../../entity/tenant/tenantSelector");
9
8
  const responsePayload_1 = require("../../../../responsePayload");
@@ -26,16 +25,9 @@ const retryJeScheduleEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, ope
26
25
  .pipe((0, operators_1.mergeMap)((response) => {
27
26
  if ((0, responsePayload_1.isSuccessStatus)(response)) {
28
27
  const updateActions = [];
29
- // Retire this entry, and the schedule itself only when this was its last failed
30
- // one. A schedule that failed in several months is several rows sharing one
31
- // schedule key, so dropping the key outright took the still-failing months off the
32
- // list with it and nothing would have surfaced them again.
33
- const failedEntriesForSchedule = state.jeSchedulesState.schedulesByTransactionKey[jeScheduleTransactionKey]?.scheduledJournalEntry ?? [];
34
- const wasLastFailedEntryForSchedule = failedEntriesForSchedule.filter((journalEntry) => journalEntry.scheduledJournalEntryID !==
35
- scheduledJournalEntryID).length === 0;
36
28
  updateActions.push((0, jeSchedulesViewReducer_1.retryJeScheduleSuccess)({
37
29
  scheduledJournalEntryID,
38
- }), (0, jeSchedulesReducer_1.removeScheduledJournalEntryFromJESchedule)(jeScheduleTransactionKey, scheduledJournalEntryID), (0, jeSchedulesViewReducer_1.removeJeScheduleLocalDataById)({ scheduledJournalEntryID }), // Important to remove localdata after success.
30
+ }), (0, jeSchedulesViewReducer_1.removeFailedJeScheduleTransactionKey)(jeScheduleTransactionKey, selectedPeriod), (0, jeSchedulesViewReducer_1.removeJeScheduleLocalDataById)({ scheduledJournalEntryID }), // Important to remove localdata after success.
39
31
  (0, monthEndCloseChecksViewReducer_1.fetchMonthEndCloseChecks)({
40
32
  tenantId: currentTenant.tenantId,
41
33
  period: selectedPeriod,
@@ -45,9 +37,6 @@ const retryJeScheduleEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, ope
45
37
  messageText: 'success',
46
38
  type: 'success',
47
39
  }));
48
- if (wasLastFailedEntryForSchedule) {
49
- updateActions.push((0, jeSchedulesViewReducer_1.removeFailedJeScheduleTransactionKey)(jeScheduleTransactionKey, selectedPeriod));
50
- }
51
40
  return (0, rxjs_1.from)(updateActions);
52
41
  }
53
42
  else {
@@ -78,24 +78,6 @@ interface ExpenseAutomationJESchedulesPayload {
78
78
  };
79
79
  }
80
80
  export type ExpenseAutomationJESchedulesResponse = ZeniAPIResponse<ExpenseAutomationJESchedulesPayload>;
81
- /**
82
- * `GET /1.0/expenses_automation/failed_je_postings`.
83
- *
84
- * Deliberately the same `failed_je_postings` shape the schedules endpoint sends under that key, so
85
- * both responses feed the same mappers. The difference is what the server does before answering:
86
- * this endpoint applies no date window, so a posting that failed months ago still comes back.
87
- */
88
- export interface FailedJePostingsPayload {
89
- je_schedules: JEScheduledTransactionPayload[];
90
- scheduled_journal_entries: ScheduledJournalEntryPayload[];
91
- }
92
- interface ExpenseAutomationFailedJePostingsPayload {
93
- failed_je_postings: FailedJePostingsPayload;
94
- query?: {
95
- expected_post_start_date: string | null;
96
- };
97
- }
98
- export type ExpenseAutomationFailedJePostingsResponse = ZeniAPIResponse<ExpenseAutomationFailedJePostingsPayload>;
99
81
  export declare const SERVICE_MONTH_FORMAT = "YYYY-MM";
100
82
  export interface CreateOneTimeAccrualPayload {
101
83
  amount: number;
@@ -47,13 +47,7 @@ export declare const clearExpenseAutomationJESchedulesView: import("@reduxjs/too
47
47
  period: TimePeriod;
48
48
  refreshViewInBackground: any;
49
49
  selectedPageTab: "schedules" | "actual_matching" | "existing_schedules" | undefined;
50
- }, "expenseAutomationJESchedulesView/fetchJeSchedules", never, never>, fetchFailedJePostings: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[refreshInBackground?: any], {
51
- refreshInBackground: any;
52
- }, "expenseAutomationJESchedulesView/fetchFailedJePostings", never, never>, fetchFailedJePostingsFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[status: ZeniAPIStatus<Record<string, unknown>>], {
53
- status: ZeniAPIStatus<Record<string, unknown>>;
54
- }, "expenseAutomationJESchedulesView/fetchFailedJePostingsFailure", never, never>, fetchFailedJePostingsSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[failedJeSchedules: JEScheduledTransactionPayload[]], {
55
- failedJeSchedules: JEScheduledTransactionPayload[];
56
- }, "expenseAutomationJESchedulesView/fetchFailedJePostingsSuccess", never, never>, fetchJeSchedulesFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
50
+ }, "expenseAutomationJESchedulesView/fetchJeSchedules", never, never>, fetchJeSchedulesFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
57
51
  selectedPageTab: JEPageTab;
58
52
  selectedPeriod: MonthYearPeriod;
59
53
  status: ZeniAPIStatus;
@@ -138,7 +132,7 @@ export declare const clearExpenseAutomationJESchedulesView: import("@reduxjs/too
138
132
  status: ZeniAPIStatus;
139
133
  }, "expenseAutomationJESchedulesView/searchTransactionsForNewScheduleFailure">, searchTransactionsForNewScheduleSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
140
134
  searchResults: JEScheduleTransactionKey[];
141
- }, "expenseAutomationJESchedulesView/searchTransactionsForNewScheduleSuccess">, toggleJECreatedGroupCollapsed: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationJESchedulesView/toggleJECreatedGroupCollapsed">, toggleJEFailedGroupCollapsed: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationJESchedulesView/toggleJEFailedGroupCollapsed">, toggleJEPendingGroupCollapsed: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationJESchedulesView/toggleJEPendingGroupCollapsed">, updateAccountSettingsListForAccountTypes: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
135
+ }, "expenseAutomationJESchedulesView/searchTransactionsForNewScheduleSuccess">, toggleJECreatedGroupCollapsed: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationJESchedulesView/toggleJECreatedGroupCollapsed">, toggleJEPendingGroupCollapsed: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationJESchedulesView/toggleJEPendingGroupCollapsed">, updateAccountSettingsListForAccountTypes: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
142
136
  accountPayload: AccountMetadataPayload[];
143
137
  }, "expenseAutomationJESchedulesView/updateAccountSettingsListForAccountTypes">, updateAccountSettingsListForAccountTypesFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
144
138
  status: ZeniAPIStatus;
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  var _a;
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.saveAccountSettingsLocalData = exports.saveAccountSettingsFailure = exports.saveAccountSettings = exports.retryJeScheduleSuccess = exports.retryJeScheduleFailure = exports.retryJeSchedule = exports.resetNewScheduleLocalData = exports.removeJeScheduleTransactionKey = exports.removeJeAccruedScheduleKey = exports.removeJeScheduleLocalDataById = exports.removeJeOneTimeAccrualLocalData = exports.removeFailedJeScheduleTransactionKey = exports.initializeNewSchedule = exports.initializeJeScheduleLocalData = exports.initializeAccountSettingsView = exports.ignoreRecommendedJeScheduleSuccess = exports.ignoreRecommendedJeScheduleFailure = exports.ignoreRecommendedJeSchedule = exports.fetchRecommendationForAccountSettings = exports.fetchOneTimeAccrualSuccess = exports.fetchOneTimeAccrualFailure = exports.fetchOneTimeAccrual = exports.fetchJeSchedulesSuccess = exports.fetchJeSchedulesPage = exports.fetchJeSchedulesFailure = exports.fetchFailedJePostingsSuccess = exports.fetchFailedJePostingsFailure = exports.fetchFailedJePostings = exports.fetchJeSchedules = exports.fetchAccountSettingsListForAccountTypes = exports.revertOneTimeAccrual = exports.revertJeScheduleSuccess = exports.revertJeScheduleFailure = exports.revertJeSchedule = exports.promoteOneTimeAccrual = exports.oneTimeAccrualActionSuccess = exports.oneTimeAccrualActionFailure = exports.ignoreOneTimeAccrual = exports.createOneTimeAccrualSuccess = exports.createOneTimeAccrualFailure = exports.createOneTimeAccrual = exports.clearSearchTransactionsForNewSchedule = exports.clearJeScheduleLocalData = exports.clearJeAccountSettingsLocalData = exports.clearExpenseAutomationJESchedulesView = exports.initialState = exports.searchTransactionsInitialState = exports.newScheduleInitialState = exports.getBaseNewScheduleLocalData = exports.accountSettingsInitialState = void 0;
5
- exports.updateRecommendationForAccountSettingsFailure = exports.updateRecommendationForAccountSettings = exports.updateNewScheduleLocalData = exports.updateJeScheduleTransactionKeys = exports.updateJeScheduleLocalDataById = exports.updateJeOneTimeAccrualLocalData = exports.updateJEScheduleTypeFilter = exports.updateJESchedulesUIState = exports.updateAccountSettingsListForAccountTypesFailure = exports.updateAccountSettingsListForAccountTypes = exports.toggleJEPendingGroupCollapsed = exports.toggleJEFailedGroupCollapsed = exports.toggleJECreatedGroupCollapsed = exports.searchTransactionsForNewScheduleSuccess = exports.searchTransactionsForNewScheduleFailure = exports.searchTransactionsForNewSchedule = exports.saveNewScheduleSuccess = exports.saveNewScheduleFailure = exports.saveNewSchedule = exports.saveAccountSettingsSuccess = void 0;
4
+ exports.saveNewScheduleFailure = exports.saveNewSchedule = exports.saveAccountSettingsSuccess = exports.saveAccountSettingsLocalData = exports.saveAccountSettingsFailure = exports.saveAccountSettings = exports.retryJeScheduleSuccess = exports.retryJeScheduleFailure = exports.retryJeSchedule = exports.resetNewScheduleLocalData = exports.removeJeScheduleTransactionKey = exports.removeJeAccruedScheduleKey = exports.removeJeScheduleLocalDataById = exports.removeJeOneTimeAccrualLocalData = exports.removeFailedJeScheduleTransactionKey = exports.initializeNewSchedule = exports.initializeJeScheduleLocalData = exports.initializeAccountSettingsView = exports.ignoreRecommendedJeScheduleSuccess = exports.ignoreRecommendedJeScheduleFailure = exports.ignoreRecommendedJeSchedule = exports.fetchRecommendationForAccountSettings = exports.fetchOneTimeAccrualSuccess = exports.fetchOneTimeAccrualFailure = exports.fetchOneTimeAccrual = exports.fetchJeSchedulesSuccess = exports.fetchJeSchedulesPage = exports.fetchJeSchedulesFailure = exports.fetchJeSchedules = exports.fetchAccountSettingsListForAccountTypes = exports.revertOneTimeAccrual = exports.revertJeScheduleSuccess = exports.revertJeScheduleFailure = exports.revertJeSchedule = exports.promoteOneTimeAccrual = exports.oneTimeAccrualActionSuccess = exports.oneTimeAccrualActionFailure = exports.ignoreOneTimeAccrual = exports.createOneTimeAccrualSuccess = exports.createOneTimeAccrualFailure = exports.createOneTimeAccrual = exports.clearSearchTransactionsForNewSchedule = exports.clearJeScheduleLocalData = exports.clearJeAccountSettingsLocalData = exports.clearExpenseAutomationJESchedulesView = exports.initialState = exports.searchTransactionsInitialState = exports.newScheduleInitialState = exports.getBaseNewScheduleLocalData = exports.accountSettingsInitialState = void 0;
5
+ exports.updateRecommendationForAccountSettingsFailure = exports.updateRecommendationForAccountSettings = exports.updateNewScheduleLocalData = exports.updateJeScheduleTransactionKeys = exports.updateJeScheduleLocalDataById = exports.updateJeOneTimeAccrualLocalData = exports.updateJEScheduleTypeFilter = exports.updateJESchedulesUIState = exports.updateAccountSettingsListForAccountTypesFailure = exports.updateAccountSettingsListForAccountTypes = exports.toggleJEPendingGroupCollapsed = exports.toggleJECreatedGroupCollapsed = exports.searchTransactionsForNewScheduleSuccess = exports.searchTransactionsForNewScheduleFailure = exports.searchTransactionsForNewSchedule = exports.saveNewScheduleSuccess = void 0;
6
6
  const toolkit_1 = require("@reduxjs/toolkit");
7
7
  const getNestedAccountIDHierarchyForReport_1 = require("../../../commonStateTypes/accountView/getNestedAccountIDHierarchyForReport");
8
8
  const timePeriod_1 = require("../../../commonStateTypes/timePeriod");
@@ -68,10 +68,6 @@ exports.initialState = {
68
68
  jeScheduleAccruedKeysByPeriodAndTab: {},
69
69
  jeScheduleOneTimeAccrualKeysByPeriodAndTab: {},
70
70
  failedJeScheduleTransactionKeysByPeriodAndTab: {},
71
- failedJePostings: {
72
- fetchState: { fetchState: 'Not-Started', error: undefined },
73
- jeScheduleTransactionKeys: [],
74
- },
75
71
  postStatusById: {},
76
72
  ignoreStatusById: {},
77
73
  revertStatusById: {},
@@ -81,9 +77,6 @@ exports.initialState = {
81
77
  oneTimeAccrualFetchStatusById: {},
82
78
  uiState: {
83
79
  createdGroupCollapsed: false,
84
- // Expanded, like the other two. A failed posting is the only thing on this page that is
85
- // actively wrong, so folding it away by default would hide the reason to open the tab.
86
- failedGroupCollapsed: false,
87
80
  pendingGroupCollapsed: false,
88
81
  scrollPosition: { scrollTop: 0, scrollLeft: undefined },
89
82
  searchString: '',
@@ -155,53 +148,6 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
155
148
  };
156
149
  },
157
150
  },
158
- /**
159
- * The Failed Postings list, fetched separately from the schedules it belongs to.
160
- *
161
- * No period and no tab in any of these three: the endpoint applies no date window, so there is
162
- * one list per tenant and one slot to hold it. `refreshInBackground` keeps a silent refetch
163
- * from dropping a skeleton over rows already on screen, the same way refreshStatus does for
164
- * the schedules list.
165
- */
166
- fetchFailedJePostings: {
167
- reducer(draft, action) {
168
- if (!action.payload.refreshInBackground) {
169
- draft.failedJePostings.fetchState = {
170
- fetchState: 'In-Progress',
171
- error: undefined,
172
- };
173
- }
174
- },
175
- prepare(refreshInBackground = false) {
176
- return { payload: { refreshInBackground } };
177
- },
178
- },
179
- fetchFailedJePostingsSuccess: {
180
- reducer(draft, action) {
181
- draft.failedJePostings = {
182
- fetchState: { fetchState: 'Completed', error: undefined },
183
- jeScheduleTransactionKeys: action.payload.failedJeSchedules.map((schedule) => (0, jeSchedulesPayload_1.getJEScheduleTransactionDetailKeyPayload)(schedule.base_transaction)),
184
- };
185
- },
186
- prepare(failedJeSchedules) {
187
- return { payload: { failedJeSchedules } };
188
- },
189
- },
190
- fetchFailedJePostingsFailure: {
191
- reducer(draft, action) {
192
- // Keys are deliberately left alone. The schedules list clears its buckets on failure so an
193
- // errored tab cannot read as "these are all the schedules there are", but this list is a
194
- // set of outstanding problems -- showing the last known ones beside an error beats
195
- // implying there are none.
196
- draft.failedJePostings.fetchState = {
197
- fetchState: 'Error',
198
- error: action.payload.status,
199
- };
200
- },
201
- prepare(status) {
202
- return { payload: { status } };
203
- },
204
- },
205
151
  fetchJeSchedulesSuccess(draft, action) {
206
152
  const { jeSchedules, selectedPeriod, selectedPageTab, failedJeSchedules, accruedJeSchedules, oneTimeAccruals, refreshViewInBackground, } = action.payload;
207
153
  const periodTabKey = (0, jeSchedulesViewState_1.getJESchedulePeriodTabKey)(selectedPageTab, (0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod));
@@ -418,8 +364,6 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
418
364
  reducer(draft, action) {
419
365
  const { failedJeScheduleKey } = action.payload;
420
366
  removeKeyFromEveryTabSlot(draft.failedJeScheduleTransactionKeysByPeriodAndTab, failedJeScheduleKey);
421
- draft.failedJePostings.jeScheduleTransactionKeys =
422
- draft.failedJePostings.jeScheduleTransactionKeys.filter((jeScheduleKey) => jeScheduleKey !== failedJeScheduleKey);
423
367
  },
424
368
  },
425
369
  initializeJeScheduleLocalData: {
@@ -762,9 +706,6 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
762
706
  draft.uiState.createdGroupCollapsed =
763
707
  !draft.uiState.createdGroupCollapsed;
764
708
  },
765
- toggleJEFailedGroupCollapsed(draft) {
766
- draft.uiState.failedGroupCollapsed = !draft.uiState.failedGroupCollapsed;
767
- },
768
709
  clearExpenseAutomationJESchedulesView(draft) {
769
710
  Object.assign(draft, exports.initialState);
770
711
  },
@@ -775,7 +716,7 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
775
716
  });
776
717
  },
777
718
  });
778
- _a = expenseAutomationJESchedulesView.actions, exports.clearExpenseAutomationJESchedulesView = _a.clearExpenseAutomationJESchedulesView, exports.clearJeAccountSettingsLocalData = _a.clearJeAccountSettingsLocalData, exports.clearJeScheduleLocalData = _a.clearJeScheduleLocalData, exports.clearSearchTransactionsForNewSchedule = _a.clearSearchTransactionsForNewSchedule, exports.createOneTimeAccrual = _a.createOneTimeAccrual, exports.createOneTimeAccrualFailure = _a.createOneTimeAccrualFailure, exports.createOneTimeAccrualSuccess = _a.createOneTimeAccrualSuccess, exports.ignoreOneTimeAccrual = _a.ignoreOneTimeAccrual, exports.oneTimeAccrualActionFailure = _a.oneTimeAccrualActionFailure, exports.oneTimeAccrualActionSuccess = _a.oneTimeAccrualActionSuccess, exports.promoteOneTimeAccrual = _a.promoteOneTimeAccrual, exports.revertJeSchedule = _a.revertJeSchedule, exports.revertJeScheduleFailure = _a.revertJeScheduleFailure, exports.revertJeScheduleSuccess = _a.revertJeScheduleSuccess, exports.revertOneTimeAccrual = _a.revertOneTimeAccrual, exports.fetchAccountSettingsListForAccountTypes = _a.fetchAccountSettingsListForAccountTypes, exports.fetchJeSchedules = _a.fetchJeSchedules, exports.fetchFailedJePostings = _a.fetchFailedJePostings, exports.fetchFailedJePostingsFailure = _a.fetchFailedJePostingsFailure, exports.fetchFailedJePostingsSuccess = _a.fetchFailedJePostingsSuccess, exports.fetchJeSchedulesFailure = _a.fetchJeSchedulesFailure, exports.fetchJeSchedulesPage = _a.fetchJeSchedulesPage, exports.fetchJeSchedulesSuccess = _a.fetchJeSchedulesSuccess, exports.fetchOneTimeAccrual = _a.fetchOneTimeAccrual, exports.fetchOneTimeAccrualFailure = _a.fetchOneTimeAccrualFailure, exports.fetchOneTimeAccrualSuccess = _a.fetchOneTimeAccrualSuccess, exports.fetchRecommendationForAccountSettings = _a.fetchRecommendationForAccountSettings, exports.ignoreRecommendedJeSchedule = _a.ignoreRecommendedJeSchedule, exports.ignoreRecommendedJeScheduleFailure = _a.ignoreRecommendedJeScheduleFailure, exports.ignoreRecommendedJeScheduleSuccess = _a.ignoreRecommendedJeScheduleSuccess, exports.initializeAccountSettingsView = _a.initializeAccountSettingsView, exports.initializeJeScheduleLocalData = _a.initializeJeScheduleLocalData, exports.initializeNewSchedule = _a.initializeNewSchedule, exports.removeFailedJeScheduleTransactionKey = _a.removeFailedJeScheduleTransactionKey, exports.removeJeOneTimeAccrualLocalData = _a.removeJeOneTimeAccrualLocalData, exports.removeJeScheduleLocalDataById = _a.removeJeScheduleLocalDataById, exports.removeJeAccruedScheduleKey = _a.removeJeAccruedScheduleKey, exports.removeJeScheduleTransactionKey = _a.removeJeScheduleTransactionKey, exports.resetNewScheduleLocalData = _a.resetNewScheduleLocalData, exports.retryJeSchedule = _a.retryJeSchedule, exports.retryJeScheduleFailure = _a.retryJeScheduleFailure, exports.retryJeScheduleSuccess = _a.retryJeScheduleSuccess, exports.saveAccountSettings = _a.saveAccountSettings, exports.saveAccountSettingsFailure = _a.saveAccountSettingsFailure, exports.saveAccountSettingsLocalData = _a.saveAccountSettingsLocalData, exports.saveAccountSettingsSuccess = _a.saveAccountSettingsSuccess, exports.saveNewSchedule = _a.saveNewSchedule, exports.saveNewScheduleFailure = _a.saveNewScheduleFailure, exports.saveNewScheduleSuccess = _a.saveNewScheduleSuccess, exports.searchTransactionsForNewSchedule = _a.searchTransactionsForNewSchedule, exports.searchTransactionsForNewScheduleFailure = _a.searchTransactionsForNewScheduleFailure, exports.searchTransactionsForNewScheduleSuccess = _a.searchTransactionsForNewScheduleSuccess, exports.toggleJECreatedGroupCollapsed = _a.toggleJECreatedGroupCollapsed, exports.toggleJEFailedGroupCollapsed = _a.toggleJEFailedGroupCollapsed, exports.toggleJEPendingGroupCollapsed = _a.toggleJEPendingGroupCollapsed, exports.updateAccountSettingsListForAccountTypes = _a.updateAccountSettingsListForAccountTypes, exports.updateAccountSettingsListForAccountTypesFailure = _a.updateAccountSettingsListForAccountTypesFailure, exports.updateJESchedulesUIState = _a.updateJESchedulesUIState, exports.updateJEScheduleTypeFilter = _a.updateJEScheduleTypeFilter, exports.updateJeOneTimeAccrualLocalData = _a.updateJeOneTimeAccrualLocalData, exports.updateJeScheduleLocalDataById = _a.updateJeScheduleLocalDataById, exports.updateJeScheduleTransactionKeys = _a.updateJeScheduleTransactionKeys, exports.updateNewScheduleLocalData = _a.updateNewScheduleLocalData, exports.updateRecommendationForAccountSettings = _a.updateRecommendationForAccountSettings, exports.updateRecommendationForAccountSettingsFailure = _a.updateRecommendationForAccountSettingsFailure;
719
+ _a = expenseAutomationJESchedulesView.actions, exports.clearExpenseAutomationJESchedulesView = _a.clearExpenseAutomationJESchedulesView, exports.clearJeAccountSettingsLocalData = _a.clearJeAccountSettingsLocalData, exports.clearJeScheduleLocalData = _a.clearJeScheduleLocalData, exports.clearSearchTransactionsForNewSchedule = _a.clearSearchTransactionsForNewSchedule, exports.createOneTimeAccrual = _a.createOneTimeAccrual, exports.createOneTimeAccrualFailure = _a.createOneTimeAccrualFailure, exports.createOneTimeAccrualSuccess = _a.createOneTimeAccrualSuccess, exports.ignoreOneTimeAccrual = _a.ignoreOneTimeAccrual, exports.oneTimeAccrualActionFailure = _a.oneTimeAccrualActionFailure, exports.oneTimeAccrualActionSuccess = _a.oneTimeAccrualActionSuccess, exports.promoteOneTimeAccrual = _a.promoteOneTimeAccrual, exports.revertJeSchedule = _a.revertJeSchedule, exports.revertJeScheduleFailure = _a.revertJeScheduleFailure, exports.revertJeScheduleSuccess = _a.revertJeScheduleSuccess, exports.revertOneTimeAccrual = _a.revertOneTimeAccrual, exports.fetchAccountSettingsListForAccountTypes = _a.fetchAccountSettingsListForAccountTypes, exports.fetchJeSchedules = _a.fetchJeSchedules, exports.fetchJeSchedulesFailure = _a.fetchJeSchedulesFailure, exports.fetchJeSchedulesPage = _a.fetchJeSchedulesPage, exports.fetchJeSchedulesSuccess = _a.fetchJeSchedulesSuccess, exports.fetchOneTimeAccrual = _a.fetchOneTimeAccrual, exports.fetchOneTimeAccrualFailure = _a.fetchOneTimeAccrualFailure, exports.fetchOneTimeAccrualSuccess = _a.fetchOneTimeAccrualSuccess, exports.fetchRecommendationForAccountSettings = _a.fetchRecommendationForAccountSettings, exports.ignoreRecommendedJeSchedule = _a.ignoreRecommendedJeSchedule, exports.ignoreRecommendedJeScheduleFailure = _a.ignoreRecommendedJeScheduleFailure, exports.ignoreRecommendedJeScheduleSuccess = _a.ignoreRecommendedJeScheduleSuccess, exports.initializeAccountSettingsView = _a.initializeAccountSettingsView, exports.initializeJeScheduleLocalData = _a.initializeJeScheduleLocalData, exports.initializeNewSchedule = _a.initializeNewSchedule, exports.removeFailedJeScheduleTransactionKey = _a.removeFailedJeScheduleTransactionKey, exports.removeJeOneTimeAccrualLocalData = _a.removeJeOneTimeAccrualLocalData, exports.removeJeScheduleLocalDataById = _a.removeJeScheduleLocalDataById, exports.removeJeAccruedScheduleKey = _a.removeJeAccruedScheduleKey, exports.removeJeScheduleTransactionKey = _a.removeJeScheduleTransactionKey, exports.resetNewScheduleLocalData = _a.resetNewScheduleLocalData, exports.retryJeSchedule = _a.retryJeSchedule, exports.retryJeScheduleFailure = _a.retryJeScheduleFailure, exports.retryJeScheduleSuccess = _a.retryJeScheduleSuccess, exports.saveAccountSettings = _a.saveAccountSettings, exports.saveAccountSettingsFailure = _a.saveAccountSettingsFailure, exports.saveAccountSettingsLocalData = _a.saveAccountSettingsLocalData, exports.saveAccountSettingsSuccess = _a.saveAccountSettingsSuccess, exports.saveNewSchedule = _a.saveNewSchedule, exports.saveNewScheduleFailure = _a.saveNewScheduleFailure, exports.saveNewScheduleSuccess = _a.saveNewScheduleSuccess, exports.searchTransactionsForNewSchedule = _a.searchTransactionsForNewSchedule, exports.searchTransactionsForNewScheduleFailure = _a.searchTransactionsForNewScheduleFailure, exports.searchTransactionsForNewScheduleSuccess = _a.searchTransactionsForNewScheduleSuccess, exports.toggleJECreatedGroupCollapsed = _a.toggleJECreatedGroupCollapsed, exports.toggleJEPendingGroupCollapsed = _a.toggleJEPendingGroupCollapsed, exports.updateAccountSettingsListForAccountTypes = _a.updateAccountSettingsListForAccountTypes, exports.updateAccountSettingsListForAccountTypesFailure = _a.updateAccountSettingsListForAccountTypesFailure, exports.updateJESchedulesUIState = _a.updateJESchedulesUIState, exports.updateJEScheduleTypeFilter = _a.updateJEScheduleTypeFilter, exports.updateJeOneTimeAccrualLocalData = _a.updateJeOneTimeAccrualLocalData, exports.updateJeScheduleLocalDataById = _a.updateJeScheduleLocalDataById, exports.updateJeScheduleTransactionKeys = _a.updateJeScheduleTransactionKeys, exports.updateNewScheduleLocalData = _a.updateNewScheduleLocalData, exports.updateRecommendationForAccountSettings = _a.updateRecommendationForAccountSettings, exports.updateRecommendationForAccountSettingsFailure = _a.updateRecommendationForAccountSettingsFailure;
779
720
  exports.default = expenseAutomationJESchedulesView.reducer;
780
721
  const doUpdateRecommendationForAccountSettings = (draft, payload) => {
781
722
  const { prepaidExpensesRecommendations, fixedAssetsRecommendations, accruedExpensesRecommendations, } = (0, accountTypeRecommendationPayload_1.mapAccountTypeRecommendationPayloadToAccountRecommendationByType)(payload);
@@ -47,7 +47,6 @@ export interface ExpenseAutomationJESchedulesViewSelector extends SelectorView {
47
47
  completionStatus: CompletionStatusType;
48
48
  createdSchedules: JEScheduleRow[];
49
49
  createdTotal: number;
50
- failedPostings: JEScheduledTransactionWithFailedEntries[];
51
50
  hasLoadedForSelectedTab: boolean;
52
51
  ignoreStatusById: Record<JEScheduleTransactionKey, FetchStateAndError>;
53
52
  jeScheduleLocalDataById: Record<ID, JEScheduleLocalData>;
@@ -62,7 +61,6 @@ export interface ExpenseAutomationJESchedulesViewSelector extends SelectorView {
62
61
  pendingReviewTotal: number;
63
62
  postStatusById: Record<ID, FetchStateAndError>;
64
63
  refreshStatus: FetchStateAndError;
65
- /** @deprecated Alias of `failedPostings`. Remove once webc and app-ui are repointed. */
66
64
  resolveSchedules: JEScheduledTransactionWithFailedEntries[];
67
65
  revertStatusById: Record<JEScheduleKey | JEScheduleTransactionKey, FetchStateAndError>;
68
66
  scheduleCountsByTab: Partial<Record<JEPageTab, number>>;
@@ -225,7 +225,7 @@ function getExpenseAutomationJESchedulesView(state) {
225
225
  const accruedSchedules = [];
226
226
  const oneTimeAccruals = [];
227
227
  const { accountState, accountListState, classState, classListState, expenseAutomationJESchedulesViewState, expenseAutomationViewState, monthEndCloseChecksState, } = state;
228
- const { jeScheduleTransactionKeysByPeriodAndTab, jeScheduleAccruedKeysByPeriodAndTab, jeScheduleOneTimeAccrualKeysByPeriodAndTab, failedJePostings, jeScheduleLocalDataById, postStatusById, ignoreStatusById, revertStatusById, oneTimeAccrualActionStatusById, uiState, error, fetchState, refreshStatus, newSchedule, } = expenseAutomationJESchedulesViewState;
228
+ const { jeScheduleTransactionKeysByPeriodAndTab, jeScheduleAccruedKeysByPeriodAndTab, jeScheduleOneTimeAccrualKeysByPeriodAndTab, failedJeScheduleTransactionKeysByPeriodAndTab, jeScheduleLocalDataById, postStatusById, ignoreStatusById, revertStatusById, oneTimeAccrualActionStatusById, uiState, error, fetchState, refreshStatus, newSchedule, } = expenseAutomationJESchedulesViewState;
229
229
  const accountSettingsView = (0, jeAccountSettingsViewSelector_1.getJEAccountSettingsView)(state);
230
230
  const newScheduleView = newSchedule.selectedDetailScheduleType === 'fixed_assets' ||
231
231
  newSchedule.selectedDetailScheduleType === 'prepaid_expenses'
@@ -264,11 +264,15 @@ function getExpenseAutomationJESchedulesView(state) {
264
264
  const jeScheduleTransactionKeysForSelectedTab = selectedPeriodTabKey != null
265
265
  ? jeScheduleTransactionKeysByPeriodAndTab[selectedPeriodTabKey]
266
266
  : undefined;
267
+ const failedJeScheduleTransactionKeysForSelectedTab = selectedPeriodTabKey != null
268
+ ? failedJeScheduleTransactionKeysByPeriodAndTab[selectedPeriodTabKey]
269
+ : undefined;
267
270
  // Distinguishes "this tab has never been fetched for this period" from "fetched and genuinely
268
271
  // empty". Without it the page cannot tell a first visit from a real empty state, and renders an
269
272
  // empty table where it should render a skeleton.
270
273
  const hasLoadedForSelectedTab = jeScheduleTransactionKeysForSelectedTab != null;
271
274
  const jeScheduleTransactionKeys = jeScheduleTransactionKeysForSelectedTab ?? [];
275
+ const failedJeScheduleTransactionKeys = failedJeScheduleTransactionKeysForSelectedTab ?? [];
272
276
  const jeScheduleAccruedKeys = (selectedPeriodTabKey != null
273
277
  ? jeScheduleAccruedKeysByPeriodAndTab[selectedPeriodTabKey]
274
278
  : undefined) ?? [];
@@ -291,16 +295,11 @@ function getExpenseAutomationJESchedulesView(state) {
291
295
  accruedSchedules.push(accruedScheduleDetails);
292
296
  }
293
297
  });
294
- // Sourced from the tenant-wide bucket, not the per-period one: a failed posting belongs to no
295
- // close month, and windowing it is what kept older failures off the only tab that can resolve
296
- // them.
297
- failedJePostings.jeScheduleTransactionKeys.forEach((jeScheduleKey) => {
298
+ failedJeScheduleTransactionKeys.forEach((jeScheduleKey) => {
298
299
  const jeScheduleDetails = (0, jeSchedulesSelector_1.getJEScheduledTransactionByJEScheduleTransactionKey)(jeScheduleKey, state);
299
300
  failedJeScheduledTransaction.push(jeScheduleDetails);
300
301
  });
301
302
  const { sortKey, sortOrder, selectedJETypeFilter } = uiState;
302
- const matchesTypeFilter = (schedule) => selectedJETypeFilter == null ||
303
- getJEScheduleRowType(schedule) === selectedJETypeFilter;
304
303
  const unsortedResolveSchedules = [];
305
304
  failedJeScheduledTransaction.forEach((schedule) => {
306
305
  schedule.scheduledJournalEntry.forEach((journalEntry) => {
@@ -310,7 +309,10 @@ function getExpenseAutomationJESchedulesView(state) {
310
309
  });
311
310
  });
312
311
  });
313
- const resolveSchedules = sortJEScheduledTransactions(unsortedResolveSchedules.filter(matchesTypeFilter), sortKey, sortOrder);
312
+ const resolveSchedules = sortJEScheduledTransactions(unsortedResolveSchedules, sortKey, sortOrder);
313
+ const validResolveForPending = unsortedResolveSchedules.filter((r) => jeScheduleLocalDataById[r.scheduledJournalEntry.scheduledJournalEntryID] != null);
314
+ const matchesTypeFilter = (schedule) => selectedJETypeFilter == null ||
315
+ getJEScheduleRowType(schedule) === selectedJETypeFilter;
314
316
  const isCreatedStatus = (schedule) => {
315
317
  // An accrual is "created" once it is not review work: posted, reversing, reversed, or in a
316
318
  // transient posting claim.
@@ -328,6 +330,7 @@ function getExpenseAutomationJESchedulesView(state) {
328
330
  ];
329
331
  const pendingReviewSchedules = sortJEScheduledTransactions([
330
332
  ...allScheduleRows.filter((schedule) => isPendingReviewRow(schedule) && matchesTypeFilter(schedule)),
333
+ ...validResolveForPending,
331
334
  ], sortKey, sortOrder);
332
335
  const createdSchedules = sortJEScheduledTransactions(allScheduleRows.filter((schedule) => isCreatedStatus(schedule) && matchesTypeFilter(schedule)), sortKey, sortOrder);
333
336
  // KPI summary — derived from unfiltered schedules so counts are always accurate
@@ -446,9 +449,6 @@ function getExpenseAutomationJESchedulesView(state) {
446
449
  kpiSummary,
447
450
  pendingReviewSchedules,
448
451
  pendingReviewTotal,
449
- failedPostings: resolveSchedules,
450
- // Deprecated alias of failedPostings. Still read by the section's footer-form effect and by
451
- // app-ui analytics; remove once both are repointed.
452
452
  resolveSchedules: resolveSchedules,
453
453
  accountSettingsView,
454
454
  newScheduleView,
@@ -19,7 +19,6 @@ export type JESchedulePeriodTabKey = `${JEPageTab}_${MonthYearPeriodId}`;
19
19
  export declare const getJESchedulePeriodTabKey: (selectedPageTab: JEPageTab, monthYearPeriodId: MonthYearPeriodId) => JESchedulePeriodTabKey;
20
20
  export interface JESchedulesViewUIState {
21
21
  createdGroupCollapsed: boolean;
22
- failedGroupCollapsed: boolean;
23
22
  pendingGroupCollapsed: boolean;
24
23
  scrollPosition: {
25
24
  scrollTop: number;
@@ -42,22 +41,8 @@ export interface JEScheduleLocalData {
42
41
  updatedClassId?: ID;
43
42
  updatedVendor?: VendorBase;
44
43
  }
45
- /**
46
- * The Failed Postings bucket, and the only list on this page that is not scoped to a period.
47
- *
48
- * A failed posting is broken until someone resolves it, whatever month it belongs to, so windowing
49
- * it the way the schedule lists are windowed is what hid a March failure from the September close.
50
- * It therefore has no period-tab key, and its own fetch state rather than the slice's: the list is
51
- * fetched separately from `/1.0/expenses_automation/failed_je_postings`, so a slow or failing
52
- * lookup here must not blank the schedules table, or vice versa.
53
- */
54
- export interface FailedJePostingsState {
55
- fetchState: FetchStateAndError;
56
- jeScheduleTransactionKeys: JEScheduleTransactionKey[];
57
- }
58
44
  export interface JESchedulesViewState extends FetchedState {
59
45
  accountSettings: AccountSettingsState;
60
- failedJePostings: FailedJePostingsState;
61
46
  failedJeScheduleTransactionKeysByPeriodAndTab: Record<JESchedulePeriodTabKey, JEScheduleTransactionKey[]>;
62
47
  ignoreStatusById: Record<JEScheduleTransactionKey, FetchStateAndError>;
63
48
  jeScheduleAccruedKeysByPeriodAndTab: Record<JESchedulePeriodTabKey, JEScheduleKey[]>;
@@ -74,6 +74,8 @@ export declare const updateInvoicingCatalogItemFormDraft: import("@reduxjs/toolk
74
74
  }, "editInvoicingCatalogItemDetailView/runInvoicingCatalogProductActionFailure">, submitInvoicingCatalogItemForm: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[payload: SubmitInvoicingCatalogItemFormPayload], SubmitInvoicingCatalogItemFormPayload, "editInvoicingCatalogItemDetailView/submitInvoicingCatalogItemForm", never, never>, submitInvoicingCatalogItemFormSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
75
75
  itemId: ID;
76
76
  kind: InvoicingCatalogItemKind;
77
- }, "editInvoicingCatalogItemDetailView/submitInvoicingCatalogItemFormSuccess">, submitInvoicingCatalogItemFormFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "editInvoicingCatalogItemDetailView/submitInvoicingCatalogItemFormFailure">, resetEditInvoicingCatalogItemDetailView: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"editInvoicingCatalogItemDetailView/resetEditInvoicingCatalogItemDetailView">;
77
+ }, "editInvoicingCatalogItemDetailView/submitInvoicingCatalogItemFormSuccess">, submitInvoicingCatalogItemFormFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "editInvoicingCatalogItemDetailView/submitInvoicingCatalogItemFormFailure">, resetEditInvoicingCatalogItemDetailView: import("@reduxjs/toolkit").ActionCreatorWithOptionalPayload<{
78
+ id?: ID;
79
+ } | undefined, "editInvoicingCatalogItemDetailView/resetEditInvoicingCatalogItemDetailView">;
78
80
  declare const _default: import("redux").Reducer<EditInvoicingCatalogItemDetailViewState>;
79
81
  export default _default;
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.resetEditInvoicingCatalogItemDetailView = exports.submitInvoicingCatalogItemFormFailure = exports.submitInvoicingCatalogItemFormSuccess = exports.submitInvoicingCatalogItemForm = exports.runInvoicingCatalogProductActionFailure = exports.runInvoicingCatalogProductActionSuccess = exports.runInvoicingCatalogProductAction = exports.runInvoicingCatalogPlanActionFailure = exports.runInvoicingCatalogPlanActionSuccess = exports.runInvoicingCatalogPlanAction = exports.seedInvoicingCatalogItemFormDraft = exports.updateInvoicingCatalogItemDetailFailure = exports.updateInvoicingCatalogItemDetail = exports.fetchInvoicingCatalogItemDetailPage = exports.fetchInvoicingCatalogItemDetail = exports.updateInvoicingCatalogItemFormDraft = exports.initialState = void 0;
5
5
  const toolkit_1 = require("@reduxjs/toolkit");
6
6
  const rootActions_1 = require("../../../rootActions");
7
+ const invoicingFormDraft_1 = require("../invoicingFormDraft");
7
8
  const invoicingCatalogItemFormHelper_1 = require("./invoicingCatalogItemFormHelper");
8
9
  exports.initialState = {
9
10
  fetchState: 'Not-Started',
@@ -25,7 +26,7 @@ const editInvoicingCatalogItemDetailView = (0, toolkit_1.createSlice)({
25
26
  updateInvoicingCatalogItemFormDraft(draft, action) {
26
27
  const { id, localData } = action.payload;
27
28
  if (id != null) {
28
- draft.editDraftById[id] = localData;
29
+ (0, invoicingFormDraft_1.applyInvoicingFormDraftEdit)(draft.editDraftById, id, localData);
29
30
  }
30
31
  else {
31
32
  draft.newItemDraft = localData;
@@ -68,6 +69,7 @@ const editInvoicingCatalogItemDetailView = (0, toolkit_1.createSlice)({
68
69
  fetchState: 'Error',
69
70
  error: action.payload.error,
70
71
  };
72
+ (0, invoicingFormDraft_1.applyInvoicingFormDraftFailure)(draft.editDraftById, action.payload.id, invoicingCatalogItemFormHelper_1.initialInvoicingCatalogItemFormLocalData);
71
73
  },
72
74
  fetchInvoicingCatalogItemDetailPage: {
73
75
  reducer() {
@@ -83,14 +85,10 @@ const editInvoicingCatalogItemDetailView = (0, toolkit_1.createSlice)({
83
85
  };
84
86
  },
85
87
  },
86
- /**
87
- * Seed the draft from the loaded record, once. Skipped when a draft already
88
- * exists so a late-arriving refetch cannot overwrite in-progress edits.
89
- */
88
+ /** Fill the draft from the loaded record — see `applyInvoicingFormDraftSeed`. */
90
89
  seedInvoicingCatalogItemFormDraft(draft, action) {
91
- if (draft.editDraftById[action.payload.id] == null) {
92
- draft.editDraftById[action.payload.id] = action.payload.localData;
93
- }
90
+ const { id, localData } = action.payload;
91
+ (0, invoicingFormDraft_1.applyInvoicingFormDraftSeed)(draft.editDraftById, id, localData);
94
92
  },
95
93
  runInvoicingCatalogPlanAction(draft, action) {
96
94
  draft.actionStateById[action.payload.id] = {
@@ -129,13 +127,23 @@ const editInvoicingCatalogItemDetailView = (0, toolkit_1.createSlice)({
129
127
  error: action.payload.error,
130
128
  };
131
129
  },
132
- resetEditInvoicingCatalogItemDetailView(draft) {
130
+ /**
131
+ * Discard a form's draft — the catalog item's own when `id` is given,
132
+ * the create draft otherwise. Scoped to the one form on purpose: another
133
+ * catalog item's half-finished edit is not this form's to throw away.
134
+ * Clearing every draft at once is what `clearAll` is for.
135
+ */
136
+ resetEditInvoicingCatalogItemDetailView(draft, action) {
133
137
  draft.fetchState = 'Not-Started';
134
138
  draft.error = undefined;
135
139
  draft.savedItemId = undefined;
136
140
  draft.savedKind = undefined;
137
- draft.editDraftById = {};
138
- draft.newItemDraft = { ...invoicingCatalogItemFormHelper_1.initialInvoicingCatalogItemFormLocalData };
141
+ const id = action.payload?.id;
142
+ if (id == null) {
143
+ draft.newItemDraft = { ...invoicingCatalogItemFormHelper_1.initialInvoicingCatalogItemFormLocalData };
144
+ return;
145
+ }
146
+ delete draft.editDraftById[id];
139
147
  },
140
148
  },
141
149
  extraReducers: (builder) => {
@@ -44,6 +44,16 @@ export interface InvoicingCatalogItemFormView extends SelectorView {
44
44
  * Folded in here so the screen never reaches for the config view itself.
45
45
  */
46
46
  fieldHelp: InvoicingFieldHelpByCode;
47
+ /**
48
+ * True while anything the form's fields mount against is still loading: the
49
+ * accounting lists, and — until it has reached the draft — the item being
50
+ * edited. The form holds a skeleton on this rather than mount, because both
51
+ * arrive too late to be picked up: it seeds react-hook-form once, at first
52
+ * render, and the accounting fields choose between a picker and a text input
53
+ * from the lists. A later refetch does not raise this again, so a refresh
54
+ * leaves the form on screen instead of blanking it mid-edit.
55
+ */
56
+ isFormLoading: boolean;
47
57
  /**
48
58
  * True while the accounting lists are still loading, so the form can wait
49
59
  * instead of mounting pickers whose options are not there yet.
@@ -5,6 +5,7 @@ const toolkit_1 = require("@reduxjs/toolkit");
5
5
  const reduceFetchState_1 = require("../../../commonStateTypes/reduceFetchState");
6
6
  const planSelector_1 = require("../../../entity/invoicing/plan/planSelector");
7
7
  const invoicingConfigViewSelector_1 = require("../invoicingConfigView/invoicingConfigViewSelector");
8
+ const invoicingFormDraft_1 = require("../invoicingFormDraft");
8
9
  const invoicingQboViewSelector_1 = require("../invoicingQboView/invoicingQboViewSelector");
9
10
  const invoicingCatalogItemFormHelper_1 = require("./invoicingCatalogItemFormHelper");
10
11
  const getEditInvoicingCatalogItemDetailViewState = (state) => ({
@@ -58,7 +59,7 @@ const getInvoicingCatalogItemFormView = (state, id) => {
58
59
  // lands. Until then the page is showing its skeleton, so the blank shape here
59
60
  // is never rendered.
60
61
  const localData = id != null
61
- ? (editDraftById[id] ?? invoicingCatalogItemFormHelper_1.initialInvoicingCatalogItemFormLocalData)
62
+ ? (0, invoicingFormDraft_1.getInvoicingFormDraftLocalData)(editDraftById, id, invoicingCatalogItemFormHelper_1.initialInvoicingCatalogItemFormLocalData)
62
63
  : newItemDraft;
63
64
  const allApplicableItemOptions = (0, exports.getInvoicingApplicableCatalogItemOptions)(state);
64
65
  const applicableItemOptions = id != null
@@ -96,6 +97,8 @@ const getInvoicingCatalogItemFormView = (state, id) => {
96
97
  catalogProductLifecycleActionOptions,
97
98
  recordState,
98
99
  fieldHelp: (0, invoicingConfigViewSelector_1.invoicingFieldHelpForGroup)(state, 'catalog'),
100
+ isFormLoading: (0, invoicingQboViewSelector_1.isInvoicingAccountingPickerDataLoading)(state) ||
101
+ (0, invoicingFormDraft_1.isInvoicingFormDraftPending)(editDraftById, id),
99
102
  isQboPickerDataLoading: (0, invoicingQboViewSelector_1.isInvoicingAccountingPickerDataLoading)(state),
100
103
  qboAccountHierarchy: qboView?.nestedAccountHierarchy ?? [],
101
104
  qboClassHierarchy: qboView?.nestedClassHierarchy ?? [],
@@ -1,5 +1,6 @@
1
1
  import { Amount } from '../../../commonStateTypes/amount';
2
2
  import { FetchStateAndError, FetchedState, ID } from '../../../commonStateTypes/common';
3
+ import { InvoicingFormDraftById } from '../invoicingFormDraft';
3
4
  /** A single pricing tier within a price point (values kept as raw strings). */
4
5
  export interface InvoicingCatalogItemFormTier {
5
6
  endingUnit: string;
@@ -63,7 +64,7 @@ export interface EditInvoicingCatalogItemDetailViewState extends FetchedState {
63
64
  */
64
65
  actionStateById: Record<ID, FetchStateAndError>;
65
66
  /** Inline-edit drafts, keyed by catalog item id. */
66
- editDraftById: Record<ID, InvoicingCatalogItemFormLocalData>;
67
+ editDraftById: InvoicingFormDraftById<InvoicingCatalogItemFormLocalData>;
67
68
  newItemDraft: InvoicingCatalogItemFormLocalData;
68
69
  /**
69
70
  * Detail-load state per catalog item id. Keyed rather than a single slot, so
@@ -20,8 +20,9 @@ const saveInvoicingCatalogItemEpic = (actions$, state$, zeniAPI) => actions$.pip
20
20
  // class become the records the service stores. Price points ride along
21
21
  // nested, so the detail page and the create/edit form share one request.
22
22
  const viewState = state.editInvoicingCatalogItemDetailViewState;
23
- const localData = (id != null ? viewState.editDraftById[id] : viewState.newItemDraft) ??
24
- viewState.newItemDraft;
23
+ const localData = (id != null
24
+ ? viewState.editDraftById[id]?.localData
25
+ : viewState.newItemDraft) ?? viewState.newItemDraft;
25
26
  const data = (0, editInvoicingCatalogItemDetailViewPayload_1.localDataToSaveInvoicingCatalogItemPayload)(localData, id == null, accountingLookup);
26
27
  const baseUrl = `${zeniAPI.apiEndPoints.invoicingMicroServiceBaseUrl}/1.0`;
27
28
  const path = id != null