@zeniai/client-epic-state 5.2.14 → 5.2.16-betaAK0

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 (138) hide show
  1. package/lib/entity/accountRecon/accountReconReducer.d.ts +2 -1
  2. package/lib/entity/accountRecon/accountReconReducer.js +22 -10
  3. package/lib/entity/accountRecon/accountReconSelector.d.ts +1 -0
  4. package/lib/entity/accountRecon/accountReconSelector.js +1 -0
  5. package/lib/entity/approvalRule/approvalRuleConflict.d.ts +13 -0
  6. package/lib/entity/approvalRule/approvalRuleConflict.js +16 -1
  7. package/lib/entity/jeSchedules/jeScheduleHelper.d.ts +1 -0
  8. package/lib/entity/jeSchedules/jeScheduleHelper.js +7 -0
  9. package/lib/entity/jeSchedules/jeSchedulesPayload.d.ts +78 -1
  10. package/lib/entity/jeSchedules/jeSchedulesPayload.js +183 -4
  11. package/lib/entity/jeSchedules/jeSchedulesReducer.d.ts +4 -2
  12. package/lib/entity/jeSchedules/jeSchedulesReducer.js +30 -2
  13. package/lib/entity/jeSchedules/jeSchedulesSelector.d.ts +11 -2
  14. package/lib/entity/jeSchedules/jeSchedulesSelector.js +38 -3
  15. package/lib/entity/jeSchedules/jeSchedulesState.d.ts +123 -1
  16. package/lib/entity/jeSchedules/jeSchedulesTypes.d.ts +24 -1
  17. package/lib/entity/jeSchedules/jeSchedulesTypes.js +96 -1
  18. package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
  19. package/lib/entity/snackbar/snackbarTypes.js +3 -0
  20. package/lib/entity/transaction/payloadTypes/scheduleTransactionPayload.d.ts +2 -0
  21. package/lib/entity/transaction/payloadTypes/scheduleTransactionPayload.js +2 -0
  22. package/lib/entity/transaction/stateTypes/scheduleTransaction.d.ts +2 -0
  23. package/lib/epic.d.ts +10 -1
  24. package/lib/epic.js +18 -0
  25. package/lib/esm/entity/accountRecon/accountReconReducer.js +22 -10
  26. package/lib/esm/entity/accountRecon/accountReconSelector.js +1 -0
  27. package/lib/esm/entity/approvalRule/approvalRuleConflict.js +16 -1
  28. package/lib/esm/entity/jeSchedules/jeScheduleHelper.js +6 -0
  29. package/lib/esm/entity/jeSchedules/jeSchedulesPayload.js +183 -5
  30. package/lib/esm/entity/jeSchedules/jeSchedulesReducer.js +30 -2
  31. package/lib/esm/entity/jeSchedules/jeSchedulesSelector.js +36 -2
  32. package/lib/esm/entity/jeSchedules/jeSchedulesTypes.js +86 -0
  33. package/lib/esm/entity/snackbar/snackbarTypes.js +3 -0
  34. package/lib/esm/entity/transaction/payloadTypes/scheduleTransactionPayload.js +2 -0
  35. package/lib/esm/epic.js +18 -0
  36. package/lib/esm/index.js +16 -10
  37. package/lib/esm/view/expenseAutomationView/epics/accountRecon/confirmStatementMappingEpic.js +2 -2
  38. package/lib/esm/view/expenseAutomationView/epics/accountRecon/deleteCombinedStatementEpic.js +54 -0
  39. package/lib/esm/view/expenseAutomationView/epics/accountRecon/fetchReconciliationViewEpic.js +1 -1
  40. package/lib/esm/view/expenseAutomationView/epics/accountRecon/updateCombinedStatementInfoEpic.js +3 -6
  41. package/lib/esm/view/expenseAutomationView/epics/common/fetchAllExpenseAutomationTabsEpic.js +6 -3
  42. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulePageEpic.js +9 -1
  43. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +41 -5
  44. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/fetchOneTimeAccrualEpic.js +45 -0
  45. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/ignoreRecommendedJeScheduleEpic.js +14 -2
  46. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/newSchedule/createOneTimeAccrualEpic.js +104 -0
  47. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/newSchedule/initializeNewScheduleEpic.js +25 -0
  48. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/newSchedule/saveNewScheduleEpic.js +138 -0
  49. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/newSchedule/searchTransactionsForNewScheduleEpic.js +79 -0
  50. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/oneTimeAccrualActionsEpic.js +180 -0
  51. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/revertJeScheduleEpic.js +111 -0
  52. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/switchJESchedulesTabEpic.js +28 -0
  53. package/lib/esm/view/expenseAutomationView/helpers/newScheduleLocalDataHelper.js +140 -0
  54. package/lib/esm/view/expenseAutomationView/helpers/reconciliationHelpers.js +12 -0
  55. package/lib/esm/view/expenseAutomationView/payload/jeSchedulesPayload.js +55 -0
  56. package/lib/esm/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +319 -29
  57. package/lib/esm/view/expenseAutomationView/reducers/reconciliationViewReducer.js +20 -2
  58. package/lib/esm/view/expenseAutomationView/selectorTypes/jeNewScheduleViewSelectorTypes.js +1 -0
  59. package/lib/esm/view/expenseAutomationView/selectors/jeAccountSettingsViewSelector.js +1 -0
  60. package/lib/esm/view/expenseAutomationView/selectors/jeNewScheduleViewSelector.js +106 -0
  61. package/lib/esm/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +327 -22
  62. package/lib/esm/view/expenseAutomationView/types/jeSchedulesViewState.js +5 -6
  63. package/lib/esm/view/invoicing/dataImportView/dataImportViewSelector.js +2 -0
  64. package/lib/esm/view/invoicing/settingsView/settingsViewSelector.js +5 -1
  65. package/lib/esm/view/scheduleView/scheduleListView/epics/fetchAccruedScheduleListEpic.js +1 -1
  66. package/lib/esm/view/scheduleView/scheduleListView/epics/fetchDownloadSchedulesEpic.js +7 -2
  67. package/lib/esm/view/scheduleView/scheduleListView/scheduleListReducer.js +5 -3
  68. package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/billPaySetupApproverViewSelector.js +20 -1
  69. package/lib/esm/view/spendManagement/reimbursement/remiSetupApproverView/remiSetupApproverViewSelector.js +20 -1
  70. package/lib/index.d.ts +18 -13
  71. package/lib/index.js +92 -47
  72. package/lib/view/expenseAutomationView/epics/accountRecon/confirmStatementMappingEpic.d.ts +10 -2
  73. package/lib/view/expenseAutomationView/epics/accountRecon/confirmStatementMappingEpic.js +1 -1
  74. package/lib/view/expenseAutomationView/epics/accountRecon/deleteCombinedStatementEpic.d.ts +9 -0
  75. package/lib/view/expenseAutomationView/epics/accountRecon/deleteCombinedStatementEpic.js +58 -0
  76. package/lib/view/expenseAutomationView/epics/accountRecon/fetchReconciliationViewEpic.js +1 -1
  77. package/lib/view/expenseAutomationView/epics/accountRecon/updateCombinedStatementInfoEpic.js +3 -6
  78. package/lib/view/expenseAutomationView/epics/common/fetchAllExpenseAutomationTabsEpic.js +6 -3
  79. package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulePageEpic.js +9 -1
  80. package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.d.ts +3 -2
  81. package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +39 -3
  82. package/lib/view/expenseAutomationView/epics/jeSchedule/fetchOneTimeAccrualEpic.d.ts +21 -0
  83. package/lib/view/expenseAutomationView/epics/jeSchedule/fetchOneTimeAccrualEpic.js +49 -0
  84. package/lib/view/expenseAutomationView/epics/jeSchedule/ignoreRecommendedJeScheduleEpic.js +14 -2
  85. package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/createOneTimeAccrualEpic.d.ts +9 -0
  86. package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/createOneTimeAccrualEpic.js +108 -0
  87. package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/initializeNewScheduleEpic.d.ts +8 -0
  88. package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/initializeNewScheduleEpic.js +29 -0
  89. package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/saveNewScheduleEpic.d.ts +9 -0
  90. package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/saveNewScheduleEpic.js +142 -0
  91. package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/searchTransactionsForNewScheduleEpic.d.ts +8 -0
  92. package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/searchTransactionsForNewScheduleEpic.js +83 -0
  93. package/lib/view/expenseAutomationView/epics/jeSchedule/oneTimeAccrualActionsEpic.d.ts +13 -0
  94. package/lib/view/expenseAutomationView/epics/jeSchedule/oneTimeAccrualActionsEpic.js +187 -0
  95. package/lib/view/expenseAutomationView/epics/jeSchedule/revertJeScheduleEpic.d.ts +65 -0
  96. package/lib/view/expenseAutomationView/epics/jeSchedule/revertJeScheduleEpic.js +115 -0
  97. package/lib/view/expenseAutomationView/epics/jeSchedule/switchJESchedulesTabEpic.d.ts +6 -0
  98. package/lib/view/expenseAutomationView/epics/jeSchedule/switchJESchedulesTabEpic.js +32 -0
  99. package/lib/view/expenseAutomationView/helpers/newScheduleLocalDataHelper.d.ts +36 -0
  100. package/lib/view/expenseAutomationView/helpers/newScheduleLocalDataHelper.js +145 -0
  101. package/lib/view/expenseAutomationView/helpers/reconciliationHelpers.d.ts +6 -0
  102. package/lib/view/expenseAutomationView/helpers/reconciliationHelpers.js +13 -0
  103. package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
  104. package/lib/view/expenseAutomationView/payload/jeSchedulesPayload.d.ts +86 -3
  105. package/lib/view/expenseAutomationView/payload/jeSchedulesPayload.js +58 -1
  106. package/lib/view/expenseAutomationView/payload/reconciliationPayload.d.ts +4 -0
  107. package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.d.ts +93 -12
  108. package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +321 -29
  109. package/lib/view/expenseAutomationView/reducers/missingReceiptsViewReducer.d.ts +1 -1
  110. package/lib/view/expenseAutomationView/reducers/reconciliationViewReducer.d.ts +6 -1
  111. package/lib/view/expenseAutomationView/reducers/reconciliationViewReducer.js +22 -4
  112. package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.d.ts +2 -2
  113. package/lib/view/expenseAutomationView/selectorTypes/jeAccountSettingsViewSelectorTypes.d.ts +1 -0
  114. package/lib/view/expenseAutomationView/selectorTypes/jeNewScheduleViewSelectorTypes.d.ts +42 -0
  115. package/lib/view/expenseAutomationView/selectorTypes/jeNewScheduleViewSelectorTypes.js +2 -0
  116. package/lib/view/expenseAutomationView/selectorTypes/jeSchedulesSelectorTypes.d.ts +41 -7
  117. package/lib/view/expenseAutomationView/selectors/jeAccountSettingsViewSelector.js +1 -0
  118. package/lib/view/expenseAutomationView/selectors/jeNewScheduleViewSelector.d.ts +21 -0
  119. package/lib/view/expenseAutomationView/selectors/jeNewScheduleViewSelector.js +112 -0
  120. package/lib/view/expenseAutomationView/selectors/jeSchedulesViewSelector.d.ts +34 -0
  121. package/lib/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +335 -21
  122. package/lib/view/expenseAutomationView/types/completedSubTab.d.ts +1 -1
  123. package/lib/view/expenseAutomationView/types/jeSchedulesViewState.d.ts +83 -8
  124. package/lib/view/expenseAutomationView/types/jeSchedulesViewState.js +8 -8
  125. package/lib/view/expenseAutomationView/types/reconciliationViewState.d.ts +1 -1
  126. package/lib/view/invoicing/dataImportView/dataImportViewSelector.d.ts +2 -0
  127. package/lib/view/invoicing/dataImportView/dataImportViewSelector.js +2 -0
  128. package/lib/view/invoicing/settingsView/settingsViewSelector.d.ts +5 -0
  129. package/lib/view/invoicing/settingsView/settingsViewSelector.js +4 -0
  130. package/lib/view/scheduleView/scheduleListView/epics/fetchAccruedScheduleListEpic.js +1 -1
  131. package/lib/view/scheduleView/scheduleListView/epics/fetchDownloadSchedulesEpic.js +7 -2
  132. package/lib/view/scheduleView/scheduleListView/scheduleListReducer.d.ts +4 -2
  133. package/lib/view/scheduleView/scheduleListView/scheduleListReducer.js +5 -3
  134. package/lib/view/spendManagement/billPay/billPaySetupApproverView/billPaySetupApproverViewSelector.js +20 -1
  135. package/lib/view/spendManagement/billPay/billPaySetupApproverView/billPaySetupApproverViewSelectorTypes.d.ts +3 -0
  136. package/lib/view/spendManagement/reimbursement/remiSetupApproverView/remiSetupApproverViewSelector.js +20 -1
  137. package/lib/view/spendManagement/reimbursement/remiSetupApproverView/remiSetupApproverViewSelectorTypes.d.ts +3 -0
  138. package/package.json +71 -38
@@ -3,6 +3,7 @@ import { FetchState, FetchStateAndError } from '../../../commonStateTypes/common
3
3
  import { InvoicingDunningActionOption, InvoicingNamedOption, InvoicingQboAccountMappingKindOption, InvoicingSettingsPayload } from '../../../entity/invoicing/invoicingCommonPayload';
4
4
  import { ZeniAPIStatus } from '../../../responsePayload';
5
5
  import { RootState } from '../../../rootStateTypes';
6
+ import { InvoicingFieldHelpByCode } from '../../../entity/invoicing/invoicingCommonPayload';
6
7
  import { InvoicingQboConnection, InvoicingQboSyncHealth } from '../invoicingQboView/invoicingQboViewPayload';
7
8
  import { InvoicingAccountingOption } from '../invoicingQboView/invoicingQboViewSelector';
8
9
  import { InvoicingBrandingFormLocalData } from './invoicingBrandingFormConfig';
@@ -20,6 +21,7 @@ export declare const getInvoicingSettings: (state: RootState) => InvoicingSettin
20
21
  export declare const getInvoicingSettingsFetchState: (state: RootState) => FetchStateAndError;
21
22
  export interface InvoicingSettingsView {
22
23
  fetchState: FetchState;
24
+ fieldHelp: InvoicingFieldHelpByCode;
23
25
  saveState: FetchStateAndError;
24
26
  stripeConnectState: FetchStateAndError;
25
27
  error?: ZeniAPIStatus;
@@ -56,6 +58,7 @@ export interface InvoicingSettingsHubView {
56
58
  */
57
59
  configFetchState: FetchState;
58
60
  dunningScheduleActionOptions: InvoicingDunningActionOption[];
61
+ fieldHelp: InvoicingFieldHelpByCode;
59
62
  isEnablingInvoicing: boolean;
60
63
  /**
61
64
  * Whether the tenant has already enabled invoicing. The enable footer is for
@@ -95,6 +98,7 @@ export interface InvoicingQboSettingsFormView {
95
98
  /** So the screen can fetch only what is missing, without reading the slices. */
96
99
  configFetchState: FetchState;
97
100
  customerMatchingOptions: InvoicingNamedOption[];
101
+ fieldHelp: InvoicingFieldHelpByCode;
98
102
  isLoading: boolean;
99
103
  /** The persisted sync toggle — the backfill guard checks that, not the draft. */
100
104
  isSyncEnabledSaved: boolean;
@@ -120,6 +124,7 @@ export interface InvoicingQboSettingsFormView {
120
124
  export declare const getInvoicingQboSettingsFormView: (state: RootState) => InvoicingQboSettingsFormView;
121
125
  export interface InvoicingBrandingFormView {
122
126
  dateFormatOptions: InvoicingNamedOption[];
127
+ fieldHelp: InvoicingFieldHelpByCode;
123
128
  localData: InvoicingBrandingFormLocalData;
124
129
  saveState: FetchStateAndError;
125
130
  addressLabel?: string;
@@ -32,6 +32,7 @@ exports.getInvoicingSettingsFetchState = getInvoicingSettingsFetchState;
32
32
  const getInvoicingSettingsView = (state) => {
33
33
  const { error, fetchState, saveFetchState, settings, stripeFetchState } = state.invoicingSettingsViewState;
34
34
  return {
35
+ fieldHelp: (0, invoicingConfigViewSelector_1.invoicingFieldHelpForGroup)(state, 'settings'),
35
36
  error,
36
37
  fetchState,
37
38
  saveState: saveFetchState,
@@ -85,6 +86,7 @@ const getInvoicingSettingsHubView = (state) => {
85
86
  const { dunningScheduleActionOptions, enableState, error: configError, fetchState: configFetchState, qboAccountMappingKindOptions, qboCustomerMatchingOptions, qboSyncStatusOptions, status, } = (0, invoicingConfigViewSelector_1.getInvoicingConfigView)(state);
86
87
  const { canEnable, isQboConfigured, isStripeConnected } = deriveInvoicingEnablePrerequisites(state.invoicingSettingsViewState.settings, state.invoicingQboViewState.connection?.connected === true, qboAccountMappingKindOptions);
87
88
  return {
89
+ fieldHelp: (0, invoicingConfigViewSelector_1.invoicingFieldHelpForGroup)(state, 'settings'),
88
90
  // Keeps the onboarding step in the gate: a tenant that has not accepted the
89
91
  // terms cannot enable invoicing, whatever the integrations say.
90
92
  canEnableInvoicing: status === 'settings' && canEnable,
@@ -116,6 +118,7 @@ const getInvoicingQboSettingsFormView = (state) => {
116
118
  const { fetchState: configFetchState, qboAccountMappingKindOptions, qboCustomerMatchingOptions, qboSyncStatusOptions, } = (0, invoicingConfigViewSelector_1.getInvoicingConfigView)(state);
117
119
  const qboView = (0, invoicingQboViewSelector_1.getInvoicingQboView)(state);
118
120
  return {
121
+ fieldHelp: (0, invoicingConfigViewSelector_1.invoicingFieldHelpForGroup)(state, 'settings'),
119
122
  accountMappingKindOptions: qboAccountMappingKindOptions,
120
123
  accounts: qboView.accounts,
121
124
  backfillState: qboView.backfillState,
@@ -156,6 +159,7 @@ const getInvoicingBrandingFormView = (state) => {
156
159
  ? (0, addressViewSelector_1.getFormattedAddress)(newAddress.addressToCreate)
157
160
  : undefined;
158
161
  return {
162
+ fieldHelp: (0, invoicingConfigViewSelector_1.invoicingFieldHelpForGroup)(state, 'settings'),
159
163
  addressLabel,
160
164
  dateFormatOptions: (0, invoicingConfigViewSelector_1.getInvoicingConfigView)(state).dateFormatOptions,
161
165
  localData: brandingDraft ?? (0, invoicingBrandingFormConfig_1.entityToInvoicingBrandingFormLocalData)(settings),
@@ -33,7 +33,7 @@ const fetchAccruedScheduleListEpic = (actions$, state$, zeniAPI) => actions$.pip
33
33
  je_schedule_type: scheduleType,
34
34
  sort_by: 'transaction_date',
35
35
  sort_order: 'desc',
36
- filter: 'all',
36
+ filter: action.payload.statusFilter,
37
37
  };
38
38
  return zeniAPI
39
39
  .getJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/schedules?query=${encodeURIComponent(JSON.stringify(queryParam))}`)
@@ -10,9 +10,14 @@ const responsePayload_1 = require("../../../../responsePayload");
10
10
  const scheduleListReducer_1 = require("../scheduleListReducer");
11
11
  const scheduleListTypes_1 = require("../scheduleListTypes");
12
12
  const fetchDownloadSchedulesEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(scheduleListReducer_1.fetchDownloadSchedules.match), (0, operators_1.mergeMap)((action) => {
13
- const { scheduleType, downloadCategories } = action.payload;
13
+ const { scheduleType, downloadCategories, statusFilter } = action.payload;
14
14
  const scheduleListState = state$.value.scheduleListState;
15
15
  // if parameters are provided, use those. else go to localdata
16
+ // Accrued is deliberately not served here. Its rows come back in a different shape, this
17
+ // epic writes them through updateJESchedules (the prepaid / fixed mapper), and
18
+ // doUpdateScheduleList never flips downloadState for accrued -- so a request would store the
19
+ // wrong data and then never report completion. Accrued downloads go through
20
+ // fetchAccruedScheduleList, which owns that shape end to end.
16
21
  let scheduleState;
17
22
  if (scheduleType !== 'accrued_expenses') {
18
23
  scheduleState = (0, scheduleListReducer_1.getState)(scheduleListState, scheduleType);
@@ -37,7 +42,7 @@ const fetchDownloadSchedulesEpic = (actions$, state$, zeniAPI) => actions$.pipe(
37
42
  base_txn_account_ids: downloadCategories,
38
43
  sort_by: 'transaction_date',
39
44
  sort_order: 'desc',
40
- filter: 'all',
45
+ filter: statusFilter,
41
46
  };
42
47
  return zeniAPI
43
48
  .getJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/schedules/download?query=${encodeURIComponent(JSON.stringify(queryParam))}`)
@@ -16,7 +16,7 @@ export declare const initialState: ScheduleListViewState;
16
16
  export declare const fetchDownloadSchedules: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[scheduleType: "prepaid_expenses" | "fixed_assets" | "accrued_expenses" | "deferred_revenue", timeframeAndCategory: {
17
17
  selectedCategoryId: ID;
18
18
  selectedTimeframe: TimeframeTick;
19
- }, downloadCategories: string[], cacheOverride?: any], {
19
+ }, downloadCategories: string[], statusFilter?: "completed" | "new" | "ongoing" | "all" | undefined, cacheOverride?: any], {
20
20
  timeframeAndCategory: {
21
21
  selectedCategoryId: ID;
22
22
  selectedTimeframe: TimeframeTick;
@@ -24,16 +24,18 @@ export declare const fetchDownloadSchedules: import("@reduxjs/toolkit").ActionCr
24
24
  scheduleType: "prepaid_expenses" | "fixed_assets" | "accrued_expenses" | "deferred_revenue";
25
25
  cacheOverride: any;
26
26
  downloadCategories: string[];
27
+ statusFilter: "completed" | "new" | "ongoing" | "all";
27
28
  }, "scheduleListView/fetchDownloadSchedules", never, never>, fetchAccruedScheduleList: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[scheduleType: "prepaid_expenses" | "fixed_assets" | "accrued_expenses" | "deferred_revenue", timeframeAndCategory?: {
28
29
  selectedCategoryId: ID;
29
30
  selectedTimeframe: TimeframeTick;
30
- } | undefined, cacheOverride?: any], {
31
+ } | undefined, cacheOverride?: any, statusFilter?: "completed" | "new" | "ongoing" | "all" | undefined], {
31
32
  timeframeAndCategory: {
32
33
  selectedCategoryId: ID;
33
34
  selectedTimeframe: TimeframeTick;
34
35
  } | undefined;
35
36
  scheduleType: "prepaid_expenses" | "fixed_assets" | "accrued_expenses" | "deferred_revenue";
36
37
  cacheOverride: any;
38
+ statusFilter: "completed" | "new" | "ongoing" | "all";
37
39
  }, "scheduleListView/fetchAccruedScheduleList", never, never>, fetchScheduleList: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[scheduleType: "prepaid_expenses" | "fixed_assets" | "accrued_expenses" | "deferred_revenue", timeframeAndCategory?: {
38
40
  selectedCategoryId: ID;
39
41
  selectedTimeframe: TimeframeTick;
@@ -90,8 +90,8 @@ const scheduleListView = (0, toolkit_1.createSlice)({
90
90
  reducers: {
91
91
  fetchDownloadSchedules: {
92
92
  reducer(draft, action) {
93
+ // Accrued is not downloaded through this action -- see fetchDownloadSchedulesEpic for why.
93
94
  if (action.payload.scheduleType !== 'accrued_expenses') {
94
- //if condition added for type narrowing
95
95
  const state = getState(draft, action.payload.scheduleType);
96
96
  const selectedTimeframe = action.payload.timeframeAndCategory.selectedTimeframe;
97
97
  const selectedCategoryId = action.payload.timeframeAndCategory.selectedCategoryId;
@@ -115,13 +115,14 @@ const scheduleListView = (0, toolkit_1.createSlice)({
115
115
  updateState(draft, action.payload.scheduleType, state);
116
116
  }
117
117
  },
118
- prepare(scheduleType, timeframeAndCategory, downloadCategories, cacheOverride = false) {
118
+ prepare(scheduleType, timeframeAndCategory, downloadCategories, statusFilter = 'all', cacheOverride = false) {
119
119
  return {
120
120
  payload: {
121
121
  timeframeAndCategory,
122
122
  scheduleType,
123
123
  cacheOverride,
124
124
  downloadCategories,
125
+ statusFilter,
125
126
  },
126
127
  };
127
128
  },
@@ -157,12 +158,13 @@ const scheduleListView = (0, toolkit_1.createSlice)({
157
158
  updateState(draft, action.payload.scheduleType, state);
158
159
  }
159
160
  },
160
- prepare(scheduleType, timeframeAndCategory, cacheOverride = false) {
161
+ prepare(scheduleType, timeframeAndCategory, cacheOverride = false, statusFilter = 'all') {
161
162
  return {
162
163
  payload: {
163
164
  timeframeAndCategory,
164
165
  scheduleType,
165
166
  cacheOverride,
167
+ statusFilter,
166
168
  },
167
169
  };
168
170
  },
@@ -13,7 +13,7 @@ const tenantSelector_1 = require("../../../../entity/tenant/tenantSelector");
13
13
  const userSelector_1 = require("../../../../entity/user/userSelector");
14
14
  const userRoleSelector_1 = require("../../../../entity/userRole/userRoleSelector");
15
15
  exports.getBillPaySetupApproverView = (0, toolkit_1.createSelector)((state) => state.billPaySetupApproverViewState, (state) => state.approvalRuleState, (state) => state.userState, (billPaySetupApproverViewState, approvalRuleState, userState) => {
16
- const { approvalRulesDeleteStatusById, approvalRuleIds, fetchState, error, listeningToPusherEvent, newApprovalRuleId, } = billPaySetupApproverViewState;
16
+ const { approvalRulesDeleteStatusById, approvalRuleIds, approverListState, fetchState, error, listeningToPusherEvent, newApprovalRuleId, } = billPaySetupApproverViewState;
17
17
  const deleteStateList = Object.values(approvalRulesDeleteStatusById);
18
18
  const approvalRules = (0, approvalRuleSelector_1.getApprovalRulesByIds)(approvalRuleState, approvalRuleIds);
19
19
  const allApprovalRules = approvalRules.map((approvalRule) => {
@@ -41,10 +41,15 @@ exports.getBillPaySetupApproverView = (0, toolkit_1.createSelector)((state) => s
41
41
  name: 'Require Info',
42
42
  code: 'require_info',
43
43
  };
44
+ const activeApproverIds = new Set(approverListState.approverIds);
45
+ const referencedApproverIds = new Set(allApprovalRules.flatMap((approvalRule) => approvalRule.steps.flatMap((step) => step.actors.map((actor) => actor.userId))));
46
+ const inactiveApproverIds = Array.from(referencedApproverIds).filter((userId) => !activeApproverIds.has(userId));
44
47
  return {
45
48
  allApprovalRules,
46
49
  deleteStatus: (0, reduceFetchState_1.reduceAnyFetchState)(deleteStateList),
47
50
  approvalRulesStatus,
51
+ approverListFetchStatus: approverListState.fetchStatus,
52
+ inactiveApproverIds,
48
53
  fetchState,
49
54
  error,
50
55
  listeningToPusherEvent,
@@ -63,6 +68,19 @@ exports.getBillPaySetupApproverUpdateDataView = (0, toolkit_1.createSelector)((s
63
68
  };
64
69
  })
65
70
  .filter((approver) => approver.user != null);
71
+ const activeApproverIds = new Set(approverIds);
72
+ const currentRuleSteps = billPaySetupApproverViewUpdateData?.data?.steps ?? [];
73
+ const inactiveActorUserIds = new Set(currentRuleSteps
74
+ .flatMap((step) => step.actors.map((actor) => actor.userId))
75
+ .filter((userId) => userId != null && !activeApproverIds.has(userId)));
76
+ const inactiveActorApprovers = Array.from(inactiveActorUserIds)
77
+ .map((userId) => {
78
+ return {
79
+ user: (0, userSelector_1.getUserByUserId)(userState, userId),
80
+ role: (0, userRoleSelector_1.getUserRoleByUserId)(userRoleState, userId),
81
+ };
82
+ })
83
+ .filter((approver) => approver.user != null);
66
84
  const allAttributes = attributes;
67
85
  const filteredApprovers = (0, cloneDeep_1.default)(allApprovers);
68
86
  const filteredAttributes = (0, cloneDeep_1.default)(attributes);
@@ -96,6 +114,7 @@ exports.getBillPaySetupApproverUpdateDataView = (0, toolkit_1.createSelector)((s
96
114
  allApprovalRules,
97
115
  allApprovers,
98
116
  filteredApprovers,
117
+ inactiveActorApprovers,
99
118
  allAttributes,
100
119
  filteredAttributes,
101
120
  billPaySetupApproverViewUpdateData,
@@ -49,7 +49,9 @@ export interface ApprovalRuleWithUser extends Omit<ApprovalRule, 'steps'> {
49
49
  export interface BillPaySetupApproverView extends SelectorView {
50
50
  allApprovalRules: ApprovalRuleWithUser[];
51
51
  approvalRulesStatus: AllowedValueWithCode;
52
+ approverListFetchStatus: FetchStateAndError;
52
53
  deleteStatus: FetchStateAndError;
54
+ inactiveApproverIds: ID[];
53
55
  listeningToPusherEvent?: boolean;
54
56
  newApprovalRuleId?: ID;
55
57
  }
@@ -61,6 +63,7 @@ export interface BillPaySetupApproverUpdateDataView extends SelectorView {
61
63
  approverListFetchStatus: FetchStateAndError;
62
64
  filteredApprovers: UserAndRole[];
63
65
  filteredAttributes: AttributeType[];
66
+ inactiveActorApprovers: UserAndRole[];
64
67
  affectedEntityIds?: ID[];
65
68
  billPaySetupApproverViewUpdateData?: ApproverViewUpdateData;
66
69
  listeningToPusherEvent?: boolean;
@@ -13,7 +13,7 @@ const userSelector_1 = require("../../../../entity/user/userSelector");
13
13
  const userRoleSelector_1 = require("../../../../entity/userRole/userRoleSelector");
14
14
  const getRemiSetupApproverView = (state, filterAdmins = true) => {
15
15
  const { remiSetupApproverViewState, approvalRuleState, userState } = state;
16
- const { approvalRulesDeleteStatusById, approvalRuleIds, fetchState, error, listeningToPusherEvent, newApprovalRuleId, } = remiSetupApproverViewState;
16
+ const { approvalRulesDeleteStatusById, approvalRuleIds, approverListState, fetchState, error, listeningToPusherEvent, newApprovalRuleId, } = remiSetupApproverViewState;
17
17
  const deleteStateList = Object.values(approvalRulesDeleteStatusById);
18
18
  const approvalRules = (0, approvalRuleSelector_1.getApprovalRulesByIds)(approvalRuleState, approvalRuleIds);
19
19
  const allApprovalRules = approvalRules.map((approvalRule) => {
@@ -42,10 +42,15 @@ const getRemiSetupApproverView = (state, filterAdmins = true) => {
42
42
  name: 'Require Info',
43
43
  code: 'require_info',
44
44
  };
45
+ const activeApproverIds = new Set(approverListState.approverIds);
46
+ const referencedApproverIds = new Set(allApprovalRules.flatMap((approvalRule) => approvalRule.steps.flatMap((step) => step.actors.map((actor) => actor.userId))));
47
+ const inactiveApproverIds = Array.from(referencedApproverIds).filter((userId) => !activeApproverIds.has(userId));
45
48
  return {
46
49
  allApprovalRules,
47
50
  deleteStatus: (0, reduceFetchState_1.reduceAnyFetchState)(deleteStateList),
48
51
  approvalRulesStatus,
52
+ approverListFetchStatus: approverListState.fetchStatus,
53
+ inactiveApproverIds,
49
54
  fetchState,
50
55
  error,
51
56
  listeningToPusherEvent,
@@ -81,6 +86,19 @@ exports.getRemiSetupApproverUpdateDataView = (0, toolkit_1.createSelector)((stat
81
86
  };
82
87
  })
83
88
  .filter((approver) => approver.user != null);
89
+ const activeApproverIds = new Set(approverIds);
90
+ const currentRuleSteps = remiSetupApproverViewUpdateData?.data?.steps ?? [];
91
+ const inactiveActorUserIds = new Set(currentRuleSteps
92
+ .flatMap((step) => step.actors.map((actor) => actor.userId))
93
+ .filter((userId) => userId != null && !activeApproverIds.has(userId)));
94
+ const inactiveActorApprovers = Array.from(inactiveActorUserIds)
95
+ .map((userId) => {
96
+ return {
97
+ user: (0, userSelector_1.getUserByUserId)(userState, userId),
98
+ role: (0, userRoleSelector_1.getUserRoleByUserId)(userRoleState, userId),
99
+ };
100
+ })
101
+ .filter((approver) => approver.user != null);
84
102
  const allAttributes = attributes;
85
103
  const filteredApprovers = (0, cloneDeep_1.default)(allApprovers);
86
104
  const filteredAttributes = (0, cloneDeep_1.default)(attributes);
@@ -115,6 +133,7 @@ exports.getRemiSetupApproverUpdateDataView = (0, toolkit_1.createSelector)((stat
115
133
  allAttributes,
116
134
  filteredApprovers,
117
135
  filteredAttributes,
136
+ inactiveActorApprovers,
118
137
  allAccountingClasses,
119
138
  remiSetupApproverViewUpdateData,
120
139
  approversDetailsFetchStatus: (0, reduceFetchState_1.reduceAllFetchState)([
@@ -48,7 +48,9 @@ export interface ApprovalRuleWithUser extends Omit<ApprovalRule, 'steps'> {
48
48
  export interface RemiSetupApproverView extends SelectorView {
49
49
  allApprovalRules: ApprovalRuleWithUser[];
50
50
  approvalRulesStatus: AllowedValueWithCode;
51
+ approverListFetchStatus: FetchStateAndError;
51
52
  deleteStatus: FetchStateAndError;
53
+ inactiveApproverIds: ID[];
52
54
  listeningToPusherEvent?: boolean;
53
55
  newApprovalRuleId?: ID;
54
56
  }
@@ -60,6 +62,7 @@ export interface RemiSetupApproverUpdateDataView extends SelectorView {
60
62
  approversDetailsFetchStatus: FetchStateAndError;
61
63
  filteredApprovers: UserAndRole[];
62
64
  filteredAttributes: AttributeType[];
65
+ inactiveActorApprovers: UserAndRole[];
63
66
  affectedEntityIds?: ID[];
64
67
  listeningToPusherEvent?: boolean;
65
68
  remiSetupApproverViewUpdateData?: ApproverViewUpdateData;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeniai/client-epic-state",
3
- "version": "5.2.14",
3
+ "version": "5.2.16-betaAK0",
4
4
  "description": "Shared module between Web & Mobile containing required abstractions for state management, async network communication. ",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib/esm/index.js",
@@ -33,6 +33,44 @@
33
33
  "require": "./lib/view/*.js"
34
34
  }
35
35
  },
36
+ "scripts": {
37
+ "clean": "rimraf lib",
38
+ "test:typecheck": "echo 'Typechecking test files...' && NODE_OPTIONS=--max-old-space-size=4096 time tsc -p tsconfig.typecheck.json",
39
+ "test:typecheck-modified-files": "chmod +x ./scripts/tsc-modified-files.sh && SINCE_DAYS=30 ./scripts/tsc-modified-files.sh master tsconfig.typecheck.json",
40
+ "test:typecheck-mocks": "echo 'Typechecking mock files...' && NODE_OPTIONS=--max-old-space-size=4096 time tsc -p tsconfig.mocks.json",
41
+ "test:typecheck-mocks-modified-files": "chmod +x ./scripts/tsc-modified-files.sh && SINCE_DAYS=30 ./scripts/tsc-modified-files.sh master tsconfig.mocks.json",
42
+ "test": "pnpm lint-modified-files && pnpm test:typecheck-modified-files && pnpm test:typecheck-mocks-modified-files && vitest run --typecheck",
43
+ "test:full": "pnpm test:typecheck-modified-files && pnpm test:typecheck-mocks-modified-files && vitest run --typecheck",
44
+ "lint": "eslint . --ext .js,.jsx,.ts,.tsx --max-warnings 0 --fix",
45
+ "lint-modified-files": "chmod +x ./scripts/lint-modified-files.sh && ./scripts/lint-modified-files.sh",
46
+ "lint:fix-modified-files": "chmod +x ./scripts/lint-modified-files.sh && LINT_FIX=true ./scripts/lint-modified-files.sh",
47
+ "tsc-modified-files": "chmod +x ./scripts/tsc-modified-files.sh && ./scripts/tsc-modified-files.sh",
48
+ "typecheck": "tsc --noEmit",
49
+ "circular-dependency": "madge --circular --extensions ts ./src",
50
+ "circular-dependency-modified-files": "chmod +x ./scripts/circular-dependency-modified-files.sh && ./scripts/circular-dependency-modified-files.sh",
51
+ "build": "chmod +x ./scripts/run_build.sh && ./scripts/run_build.sh && rimraf \"lib/**/__mocks__\" \"lib/**/__testHelpers__\"",
52
+ "only-build": "eslint . --ext .js,.jsx,.ts,.tsx && time tsc && tsc -p tsconfig.esm.json && rimraf \"lib/**/__mocks__\" \"lib/**/__testHelpers__\"",
53
+ "only-build-dev": "eslint . --ext .js,.jsx,.ts,.tsx && time tsc -p tsconfig.dev.json && tsc -p tsconfig.esm.dev.json && rimraf \"lib/**/__mocks__\" \"lib/**/__testHelpers__\"",
54
+ "format": "prettier --write --ignore-unknown \"src/**/*\" && pnpm lint",
55
+ "format-watch": "bash ./scripts/run-format-watch.sh",
56
+ "check-version": "node ./scripts/check_version.js",
57
+ "prepublishOnly": "chmod +x ./scripts/branch_validation.sh && ./scripts/branch_validation.sh && pnpm update-slack-group-topic && pnpm run check-version && pnpm clean && pnpm build",
58
+ "version": "git add -A src",
59
+ "postversion": "git push && git push --tags",
60
+ "check-dependencies": "node ./scripts/check_dependencies.js",
61
+ "clean-overrides": "node ./scripts/clean_overrides.js",
62
+ "create-or-update-release-branch": "chmod +x ./scripts/create_or_update_release_branch.sh && ./scripts/create_or_update_release_branch.sh",
63
+ "bump-versions-master": "chmod +x ./scripts/bump_versions_master.sh && ./scripts/bump_versions_master.sh",
64
+ "bump-versions-beta": "chmod +x ./scripts/bump_versions_beta.sh && ./scripts/bump_versions_beta.sh",
65
+ "bump-update-web-app-cockpit-beta": "chmod +x ./scripts/bump_and_update_web_app_ui_beta.sh && ./scripts/bump_and_update_web_app_ui_beta.sh",
66
+ "send-release-notes": "chmod +x ./scripts/send_release_notes.sh && ./scripts/send_release_notes.sh",
67
+ "update-slack-group-topic": "chmod +x ./scripts/update-slack-group-topic.sh && ./scripts/update-slack-group-topic.sh",
68
+ "build-beta-and-copy": "chmod +x ./scripts/build_and_copy.sh && ./scripts/build_and_copy.sh",
69
+ "pr-approvals-update": "chmod +x ./scripts/pr_approvals.sh && ./scripts/pr_approvals.sh",
70
+ "raise-pr-automation": "chmod +x ./scripts/raise_pr_automation.sh && ./scripts/raise_pr_automation.sh",
71
+ "test:file": "bash ./scripts/test-file.sh",
72
+ "find-unused-code": "knip"
73
+ },
36
74
  "files": [
37
75
  "lib/**/*"
38
76
  ],
@@ -100,41 +138,36 @@
100
138
  "dayjs": "^1.10.7",
101
139
  "url-parse": "^1.5.10"
102
140
  },
103
- "scripts": {
104
- "clean": "rimraf lib",
105
- "test:typecheck": "echo 'Typechecking test files...' && NODE_OPTIONS=--max-old-space-size=4096 time tsc -p tsconfig.typecheck.json",
106
- "test:typecheck-modified-files": "chmod +x ./scripts/tsc-modified-files.sh && SINCE_DAYS=30 ./scripts/tsc-modified-files.sh master tsconfig.typecheck.json",
107
- "test:typecheck-mocks": "echo 'Typechecking mock files...' && NODE_OPTIONS=--max-old-space-size=4096 time tsc -p tsconfig.mocks.json",
108
- "test:typecheck-mocks-modified-files": "chmod +x ./scripts/tsc-modified-files.sh && SINCE_DAYS=30 ./scripts/tsc-modified-files.sh master tsconfig.mocks.json",
109
- "test": "pnpm lint-modified-files && pnpm test:typecheck-modified-files && pnpm test:typecheck-mocks-modified-files && vitest run --typecheck",
110
- "test:full": "pnpm test:typecheck-modified-files && pnpm test:typecheck-mocks-modified-files && vitest run --typecheck",
111
- "lint": "eslint . --ext .js,.jsx,.ts,.tsx --max-warnings 0 --fix",
112
- "lint-modified-files": "chmod +x ./scripts/lint-modified-files.sh && ./scripts/lint-modified-files.sh",
113
- "lint:fix-modified-files": "chmod +x ./scripts/lint-modified-files.sh && LINT_FIX=true ./scripts/lint-modified-files.sh",
114
- "tsc-modified-files": "chmod +x ./scripts/tsc-modified-files.sh && ./scripts/tsc-modified-files.sh",
115
- "typecheck": "tsc --noEmit",
116
- "circular-dependency": "madge --circular --extensions ts ./src",
117
- "circular-dependency-modified-files": "chmod +x ./scripts/circular-dependency-modified-files.sh && ./scripts/circular-dependency-modified-files.sh",
118
- "build": "chmod +x ./scripts/run_build.sh && ./scripts/run_build.sh && rimraf \"lib/**/__mocks__\" \"lib/**/__testHelpers__\"",
119
- "only-build": "eslint . --ext .js,.jsx,.ts,.tsx && time tsc && tsc -p tsconfig.esm.json && rimraf \"lib/**/__mocks__\" \"lib/**/__testHelpers__\"",
120
- "only-build-dev": "eslint . --ext .js,.jsx,.ts,.tsx && time tsc -p tsconfig.dev.json && tsc -p tsconfig.esm.dev.json && rimraf \"lib/**/__mocks__\" \"lib/**/__testHelpers__\"",
121
- "format": "prettier --write --ignore-unknown \"src/**/*\" && pnpm lint",
122
- "format-watch": "bash ./scripts/run-format-watch.sh",
123
- "check-version": "node ./scripts/check_version.js",
124
- "version": "git add -A src",
125
- "postversion": "git push && git push --tags",
126
- "check-dependencies": "node ./scripts/check_dependencies.js",
127
- "clean-overrides": "node ./scripts/clean_overrides.js",
128
- "create-or-update-release-branch": "chmod +x ./scripts/create_or_update_release_branch.sh && ./scripts/create_or_update_release_branch.sh",
129
- "bump-versions-master": "chmod +x ./scripts/bump_versions_master.sh && ./scripts/bump_versions_master.sh",
130
- "bump-versions-beta": "chmod +x ./scripts/bump_versions_beta.sh && ./scripts/bump_versions_beta.sh",
131
- "bump-update-web-app-cockpit-beta": "chmod +x ./scripts/bump_and_update_web_app_ui_beta.sh && ./scripts/bump_and_update_web_app_ui_beta.sh",
132
- "send-release-notes": "chmod +x ./scripts/send_release_notes.sh && ./scripts/send_release_notes.sh",
133
- "update-slack-group-topic": "chmod +x ./scripts/update-slack-group-topic.sh && ./scripts/update-slack-group-topic.sh",
134
- "build-beta-and-copy": "chmod +x ./scripts/build_and_copy.sh && ./scripts/build_and_copy.sh",
135
- "pr-approvals-update": "chmod +x ./scripts/pr_approvals.sh && ./scripts/pr_approvals.sh",
136
- "raise-pr-automation": "chmod +x ./scripts/raise_pr_automation.sh && ./scripts/raise_pr_automation.sh",
137
- "test:file": "bash ./scripts/test-file.sh",
138
- "find-unused-code": "knip"
141
+ "pnpm": {
142
+ "overrides": {
143
+ "@babel/core": ">=7.29.6",
144
+ "@babel/helpers": ">=7.26.10",
145
+ "@babel/runtime": ">=7.26.10",
146
+ "@babel/traverse": ">=7.23.2",
147
+ "@eslint/eslintrc>ajv": ">=6.14.0 <7",
148
+ "@eslint/plugin-kit": ">=0.3.4",
149
+ "@modelcontextprotocol/sdk": ">=1.25.2",
150
+ "ajv": ">=8.18.0",
151
+ "body-parser": ">=2.2.1",
152
+ "brace-expansion": ">=5.0.9",
153
+ "cross-spawn": ">=7.0.5",
154
+ "esbuild": ">=0.28.1",
155
+ "eslint>ajv": ">=6.14.0 <7",
156
+ "flatted": ">=3.4.2",
157
+ "glob": ">=11.1.0",
158
+ "hono": ">=4.11.4",
159
+ "immutable": ">=4.3.9 <5",
160
+ "js-yaml": ">=4.3.1 <5",
161
+ "minimatch": ">=10.2.3",
162
+ "nanoid": ">=3.3.17 <4",
163
+ "picomatch": ">=4.0.4",
164
+ "postcss": ">=8.5.18",
165
+ "qs": "^6.14.1",
166
+ "rollup": ">=4.59.0",
167
+ "shell-quote": ">=1.9.0",
168
+ "tough-cookie": "=4.1.3",
169
+ "vite": ">=7.3.5 <8",
170
+ "yaml": ">=2.9.0"
171
+ }
139
172
  }
140
- }
173
+ }