@zeniai/client-epic-state 5.2.22-betaRD0 → 5.2.23
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.
- package/lib/entity/aiCfo/aiCfoPayload.d.ts +0 -11
- package/lib/entity/aiCfo/aiCfoReducer.js +1 -32
- package/lib/entity/aiCfo/aiCfoState.d.ts +0 -14
- package/lib/epic.d.ts +1 -3
- package/lib/epic.js +0 -4
- package/lib/esm/entity/aiCfo/aiCfoReducer.js +1 -32
- package/lib/esm/epic.js +0 -4
- package/lib/esm/index.js +4 -4
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +7 -45
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/oneTimeAccrualActionsEpic.js +6 -13
- package/lib/esm/view/expenseAutomationView/payload/jeSchedulesPayload.js +1 -1
- package/lib/esm/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +7 -31
- package/lib/esm/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +2 -5
- package/lib/esm/view/invoicing/dataImportView/dataImportViewSelector.js +0 -2
- package/lib/esm/view/invoicing/settingsView/settingsViewSelector.js +1 -5
- package/lib/esm/view/recommendation/recommendationReducer.js +1 -13
- package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/epic/fetchBillPaySetupApproverViewEpic.js +2 -18
- package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/epic/initializeBillPaySetupApproverViewUpdateDataEpic.js +1 -0
- package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/types/commonPayload.js +3 -0
- package/lib/esm/view/spendManagement/reimbursement/remiSetupApproverView/epic/fetchRemiSetupApproverViewEpic.js +2 -18
- package/lib/esm/view/spendManagement/reimbursement/remiSetupApproverView/epic/initializeRemiSetupApproverViewUpdateDataEpic.js +1 -0
- package/lib/index.d.ts +7 -8
- package/lib/index.js +23 -26
- package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.d.ts +1 -1
- package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +7 -45
- package/lib/view/expenseAutomationView/epics/jeSchedule/oneTimeAccrualActionsEpic.d.ts +2 -2
- package/lib/view/expenseAutomationView/epics/jeSchedule/oneTimeAccrualActionsEpic.js +5 -12
- package/lib/view/expenseAutomationView/payload/jeSchedulesPayload.d.ts +1 -54
- package/lib/view/expenseAutomationView/payload/jeSchedulesPayload.js +3 -3
- package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.d.ts +6 -11
- package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +9 -33
- package/lib/view/expenseAutomationView/selectorTypes/jeSchedulesSelectorTypes.d.ts +3 -5
- package/lib/view/expenseAutomationView/selectors/jeSchedulesViewSelector.d.ts +5 -4
- package/lib/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +2 -5
- package/lib/view/expenseAutomationView/types/jeSchedulesViewState.d.ts +0 -2
- package/lib/view/invoicing/dataImportView/dataImportViewSelector.d.ts +0 -2
- package/lib/view/invoicing/dataImportView/dataImportViewSelector.js +0 -2
- package/lib/view/invoicing/settingsView/settingsViewSelector.d.ts +1 -5
- package/lib/view/invoicing/settingsView/settingsViewSelector.js +0 -4
- package/lib/view/recommendation/recommendationPayload.d.ts +0 -34
- package/lib/view/recommendation/recommendationReducer.d.ts +1 -2
- package/lib/view/recommendation/recommendationReducer.js +2 -14
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/epic/fetchBillPaySetupApproverViewEpic.d.ts +1 -2
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/epic/fetchBillPaySetupApproverViewEpic.js +2 -18
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/epic/initializeBillPaySetupApproverViewUpdateDataEpic.js +1 -0
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/types/commonPayload.d.ts +1 -0
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/types/commonPayload.js +3 -0
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/types/commonState.d.ts +1 -0
- package/lib/view/spendManagement/commonHistoryView/commonHistory.d.ts +1 -1
- package/lib/view/spendManagement/reimbursement/remiSetupApproverView/epic/fetchRemiSetupApproverViewEpic.d.ts +1 -2
- package/lib/view/spendManagement/reimbursement/remiSetupApproverView/epic/fetchRemiSetupApproverViewEpic.js +2 -18
- package/lib/view/spendManagement/reimbursement/remiSetupApproverView/epic/initializeRemiSetupApproverViewUpdateDataEpic.js +1 -0
- package/package.json +1 -1
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/prefetchOtherJeSchedulesTabEpic.js +0 -35
- package/lib/esm/view/recommendation/submitRecommendationFeedbackEpic.js +0 -52
- package/lib/view/expenseAutomationView/epics/jeSchedule/prefetchOtherJeSchedulesTabEpic.d.ts +0 -12
- package/lib/view/expenseAutomationView/epics/jeSchedule/prefetchOtherJeSchedulesTabEpic.js +0 -39
- package/lib/view/recommendation/submitRecommendationFeedbackEpic.d.ts +0 -7
- package/lib/view/recommendation/submitRecommendationFeedbackEpic.js +0 -56
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var _a;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
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.
|
|
5
|
-
exports.updateRecommendationForAccountSettingsFailure = exports.updateRecommendationForAccountSettings = exports.updateNewScheduleLocalData = exports.updateJeScheduleTransactionKeys = exports.updateJeScheduleLocalDataById = exports.
|
|
4
|
+
exports.saveNewScheduleSuccess = 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.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.updateJEScheduleTypeFilter = exports.updateJESchedulesUIState = exports.updateAccountSettingsListForAccountTypesFailure = exports.updateAccountSettingsListForAccountTypes = exports.toggleJEPendingGroupCollapsed = exports.toggleJECreatedGroupCollapsed = exports.searchTransactionsForNewScheduleSuccess = exports.searchTransactionsForNewScheduleFailure = exports.searchTransactionsForNewSchedule = 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");
|
|
@@ -72,7 +72,6 @@ exports.initialState = {
|
|
|
72
72
|
ignoreStatusById: {},
|
|
73
73
|
revertStatusById: {},
|
|
74
74
|
jeScheduleLocalDataById: {},
|
|
75
|
-
oneTimeAccrualLocalDataById: {},
|
|
76
75
|
oneTimeAccrualActionStatusById: {},
|
|
77
76
|
oneTimeAccrualFetchStatusById: {},
|
|
78
77
|
uiState: {
|
|
@@ -134,15 +133,11 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
|
|
|
134
133
|
draft.error = undefined;
|
|
135
134
|
}
|
|
136
135
|
},
|
|
137
|
-
|
|
138
|
-
// else omits it and the epic uses the selected tab -- passing the visible tab explicitly
|
|
139
|
-
// would be the same thing.
|
|
140
|
-
prepare(period, refreshViewInBackground = false, selectedPageTab) {
|
|
136
|
+
prepare(period, refreshViewInBackground = false) {
|
|
141
137
|
return {
|
|
142
138
|
payload: {
|
|
143
139
|
period,
|
|
144
140
|
refreshViewInBackground,
|
|
145
|
-
selectedPageTab,
|
|
146
141
|
},
|
|
147
142
|
};
|
|
148
143
|
},
|
|
@@ -410,24 +405,6 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
|
|
|
410
405
|
const { scheduledJournalEntryID } = action.payload;
|
|
411
406
|
delete draft.jeScheduleLocalDataById[scheduledJournalEntryID];
|
|
412
407
|
},
|
|
413
|
-
/**
|
|
414
|
-
* Merge, not replace: the detail form reports one field at a time, so a full overwrite would
|
|
415
|
-
* drop every other edit on each keystroke.
|
|
416
|
-
*/
|
|
417
|
-
updateJeOneTimeAccrualLocalData(draft, action) {
|
|
418
|
-
const { accrualId, localData } = action.payload;
|
|
419
|
-
draft.oneTimeAccrualLocalDataById = {
|
|
420
|
-
...draft.oneTimeAccrualLocalDataById,
|
|
421
|
-
[accrualId]: {
|
|
422
|
-
...draft.oneTimeAccrualLocalDataById[accrualId],
|
|
423
|
-
...localData,
|
|
424
|
-
},
|
|
425
|
-
};
|
|
426
|
-
},
|
|
427
|
-
/** Called when the detail page unmounts and after a successful promote. */
|
|
428
|
-
removeJeOneTimeAccrualLocalData(draft, action) {
|
|
429
|
-
delete draft.oneTimeAccrualLocalDataById[action.payload.accrualId];
|
|
430
|
-
},
|
|
431
408
|
initializeAccountSettingsView(draft) {
|
|
432
409
|
draft.accountSettings.localData = exports.accountSettingsInitialState.localData;
|
|
433
410
|
},
|
|
@@ -604,14 +581,13 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
|
|
|
604
581
|
};
|
|
605
582
|
},
|
|
606
583
|
/**
|
|
607
|
-
* Promote applies the body and posts in one step
|
|
608
|
-
* `
|
|
609
|
-
*
|
|
610
|
-
* action because both callers already have it and `OneTimeAccrualEdits` has no slot for it.
|
|
584
|
+
* Promote applies the body and posts in one step, so it carries whatever the user edited on the
|
|
585
|
+
* detail page. `edits` is absent when nothing was changed -- the epic then falls back to the
|
|
586
|
+
* stored accrual, which is what the list's inline Post does.
|
|
611
587
|
*/
|
|
612
588
|
promoteOneTimeAccrual: {
|
|
613
|
-
prepare(accrualId, amount) {
|
|
614
|
-
return { payload: { accrualId, amount } };
|
|
589
|
+
prepare(accrualId, amount, edits) {
|
|
590
|
+
return { payload: { accrualId, amount, edits } };
|
|
615
591
|
},
|
|
616
592
|
reducer(draft, action) {
|
|
617
593
|
draft.oneTimeAccrualActionStatusById[action.payload.accrualId] = {
|
|
@@ -715,7 +691,7 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
|
|
|
715
691
|
});
|
|
716
692
|
},
|
|
717
693
|
});
|
|
718
|
-
_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.
|
|
694
|
+
_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.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.updateJeScheduleLocalDataById = _a.updateJeScheduleLocalDataById, exports.updateJeScheduleTransactionKeys = _a.updateJeScheduleTransactionKeys, exports.updateNewScheduleLocalData = _a.updateNewScheduleLocalData, exports.updateRecommendationForAccountSettings = _a.updateRecommendationForAccountSettings, exports.updateRecommendationForAccountSettingsFailure = _a.updateRecommendationForAccountSettingsFailure;
|
|
719
695
|
exports.default = expenseAutomationJESchedulesView.reducer;
|
|
720
696
|
const doUpdateRecommendationForAccountSettings = (draft, payload) => {
|
|
721
697
|
const { prepaidExpensesRecommendations, fixedAssetsRecommendations, accruedExpensesRecommendations, } = (0, accountTypeRecommendationPayload_1.mapAccountTypeRecommendationPayloadToAccountRecommendationByType)(payload);
|
|
@@ -1,19 +1,17 @@
|
|
|
1
|
-
import { NestedAccountHierarchyForReport } from '../../../commonStateTypes/accountView/nestedAccountID';
|
|
2
1
|
import { Amount } from '../../../commonStateTypes/amount';
|
|
2
|
+
import { NestedAccountHierarchyForReport } from '../../../commonStateTypes/accountView/nestedAccountID';
|
|
3
3
|
import { NestedClassHierarchyForReport } from '../../../commonStateTypes/classesView/nestedClassID';
|
|
4
4
|
import { CompletionStatusType, FetchStateAndError, ID } from '../../../commonStateTypes/common';
|
|
5
5
|
import { SelectorView } from '../../../commonStateTypes/viewAndReport/viewAndReport';
|
|
6
6
|
import { AccountBase } from '../../../entity/account/accountState';
|
|
7
7
|
import { ClassBase } from '../../../entity/class/classState';
|
|
8
|
-
import { JEAccruedSchedule, JEOneTimeAccrual, JEScheduledTransaction } from '../../../entity/jeSchedules/jeSchedulesSelector';
|
|
9
8
|
import { JEScheduleKey, JEScheduleTransactionKey, ScheduleTypes } from '../../../entity/jeSchedules/jeSchedulesTypes';
|
|
10
9
|
import { UncategorizedAccounts } from '../../accountList/accountListSelector';
|
|
11
10
|
import { JEAccountSettingsView } from '../selectorTypes/jeAccountSettingsViewSelectorTypes';
|
|
12
|
-
import { NewScheduleView } from '../selectorTypes/jeNewScheduleViewSelectorTypes';
|
|
13
11
|
import { JEScheduledTransactionWithFailedEntries } from '../selectors/jeScheduledTransactionWithFailedEntries';
|
|
12
|
+
import { NewScheduleView } from '../selectorTypes/jeNewScheduleViewSelectorTypes';
|
|
13
|
+
import { JEScheduleRow } from '../selectors/jeSchedulesViewSelector';
|
|
14
14
|
import { JEPageTab, JEScheduleLocalData, JESchedulesViewUIState } from '../types/jeSchedulesViewState';
|
|
15
|
-
export type JEScheduleRow = JEAccruedSchedule | JEOneTimeAccrual | JEScheduledTransaction | JEScheduledTransactionWithFailedEntries;
|
|
16
|
-
export type JEScheduleRowWithoutOneTimeAccrual = Exclude<JEScheduleRow, JEOneTimeAccrual>;
|
|
17
15
|
/**
|
|
18
16
|
* Amount rather than a bare number: the KPI strip formats these for display, and a number carries
|
|
19
17
|
* no currency, which is what made the tiles print a hardcoded dollar sign.
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { FetchStateAndError, ID } from '../../../commonStateTypes/common';
|
|
2
|
-
import { JEAccruedSchedule, JEOneTimeAccrual } from '../../../entity/jeSchedules/jeSchedulesSelector';
|
|
3
|
-
import { OneTimeAccrualEdits } from '../../../entity/jeSchedules/jeSchedulesState';
|
|
2
|
+
import { JEAccruedSchedule, JEOneTimeAccrual, JEScheduledTransaction } from '../../../entity/jeSchedules/jeSchedulesSelector';
|
|
4
3
|
import { ScheduleTypes } from '../../../entity/jeSchedules/jeSchedulesTypes';
|
|
5
4
|
import { RootState } from '../../../rootStateTypes';
|
|
6
|
-
import { ExpenseAutomationJESchedulesViewSelector
|
|
5
|
+
import { ExpenseAutomationJESchedulesViewSelector } from '../selectorTypes/jeSchedulesSelectorTypes';
|
|
6
|
+
import { JEScheduledTransactionWithFailedEntries } from './jeScheduledTransactionWithFailedEntries';
|
|
7
7
|
/**
|
|
8
8
|
* `posting_blocked` is written by the posting Cron when a JE fails to post. It is an internal
|
|
9
9
|
* failure state with no human action attached, so it is dropped here rather than hidden at render
|
|
@@ -19,11 +19,12 @@ export declare const isAiAccountantSchedule: (schedule: JEScheduleRow) => boolea
|
|
|
19
19
|
export declare function isAccruedScheduleRow(schedule: JEScheduleRow): schedule is JEAccruedSchedule;
|
|
20
20
|
export declare function isOneTimeAccrualRow(schedule: JEScheduleRow): schedule is JEOneTimeAccrual;
|
|
21
21
|
export declare function getExpenseAutomationJESchedulesView(state: RootState): ExpenseAutomationJESchedulesViewSelector;
|
|
22
|
+
export type JEScheduleRow = JEAccruedSchedule | JEOneTimeAccrual | JEScheduledTransaction | JEScheduledTransactionWithFailedEntries;
|
|
23
|
+
export type JEScheduleRowWithoutOneTimeAccrual = Exclude<JEScheduleRow, JEOneTimeAccrual>;
|
|
22
24
|
export interface ExpenseAutomationJEOneTimeAccrualDetailView {
|
|
23
25
|
actionFetchState: FetchStateAndError;
|
|
24
26
|
detailFetchState: FetchStateAndError;
|
|
25
27
|
accrual?: JEOneTimeAccrual;
|
|
26
|
-
localData?: OneTimeAccrualEdits;
|
|
27
28
|
}
|
|
28
29
|
/**
|
|
29
30
|
* One accrual plus the status of its promote / ignore request, for the detail screen.
|
|
@@ -26,8 +26,8 @@ const classListSelector_1 = require("../../classList/classListSelector");
|
|
|
26
26
|
const scheduleDetailLocalDataHelper_1 = require("../../scheduleView/scheduleDetailView/scheduleDetailLocalDataHelper");
|
|
27
27
|
const scheduleDetailSelector_1 = require("../../scheduleView/scheduleDetailView/scheduleDetailSelector");
|
|
28
28
|
const scheduleListHelper_1 = require("../../scheduleView/scheduleListView/scheduleListHelper");
|
|
29
|
-
const jeSchedulesViewState_1 = require("../types/jeSchedulesViewState");
|
|
30
29
|
const getAllStepsHelper_1 = require("./getAllStepsHelper");
|
|
30
|
+
const jeSchedulesViewState_1 = require("../types/jeSchedulesViewState");
|
|
31
31
|
const jeAccountSettingsViewSelector_1 = require("./jeAccountSettingsViewSelector");
|
|
32
32
|
const jeNewScheduleViewSelector_1 = require("./jeNewScheduleViewSelector");
|
|
33
33
|
// Matches the AI-automation user addresses webc's schedule list row already
|
|
@@ -345,9 +345,7 @@ function getExpenseAutomationJESchedulesView(state) {
|
|
|
345
345
|
*/
|
|
346
346
|
const sumToAmount = (schedules) => {
|
|
347
347
|
const first = schedules[0];
|
|
348
|
-
const currency = first != null
|
|
349
|
-
? getScheduleAmountObject(first)
|
|
350
|
-
: allScheduleAmountFallback;
|
|
348
|
+
const currency = first != null ? getScheduleAmountObject(first) : allScheduleAmountFallback;
|
|
351
349
|
return {
|
|
352
350
|
...currency,
|
|
353
351
|
amount: sumAmount(schedules),
|
|
@@ -489,6 +487,5 @@ function getExpenseAutomationJEOneTimeAccrualDetailView(state, accrualId) {
|
|
|
489
487
|
fetchState: 'Not-Started',
|
|
490
488
|
error: undefined,
|
|
491
489
|
},
|
|
492
|
-
localData: state.expenseAutomationJESchedulesViewState.oneTimeAccrualLocalDataById[accrualId],
|
|
493
490
|
};
|
|
494
491
|
}
|
|
@@ -5,7 +5,6 @@ import { Recommendation } from '../../../commonStateTypes/recommendationBase';
|
|
|
5
5
|
import { SortOrder } from '../../../commonStateTypes/selectorTypes/sortOrderTypes';
|
|
6
6
|
import { MonthYearPeriodId, ScheduleDaysOfMonth } from '../../../commonStateTypes/timePeriod';
|
|
7
7
|
import { AccountBase } from '../../../entity/account/accountState';
|
|
8
|
-
import { OneTimeAccrualEdits } from '../../../entity/jeSchedules/jeSchedulesState';
|
|
9
8
|
import { JEOneTimeAccrualKey, JEScheduleKey, JEScheduleTransactionKey, ScheduleJournalEntryStatusCodeType, ScheduleTransactionID, ScheduleTypes } from '../../../entity/jeSchedules/jeSchedulesTypes';
|
|
10
9
|
import { VendorBase } from '../../../entity/vendor/vendorState';
|
|
11
10
|
import { ZeniDate } from '../../../zeniDayJS';
|
|
@@ -52,7 +51,6 @@ export interface JESchedulesViewState extends FetchedState {
|
|
|
52
51
|
newSchedule: NewJeScheduleState;
|
|
53
52
|
oneTimeAccrualActionStatusById: Record<ID, FetchStateAndError>;
|
|
54
53
|
oneTimeAccrualFetchStatusById: Record<ID, FetchStateAndError>;
|
|
55
|
-
oneTimeAccrualLocalDataById: Record<ID, OneTimeAccrualEdits>;
|
|
56
54
|
postStatusById: Record<ID, FetchStateAndError>;
|
|
57
55
|
refreshStatus: FetchStateAndError;
|
|
58
56
|
revertStatusById: Record<JEScheduleKey | JEScheduleTransactionKey, FetchStateAndError>;
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { FetchStateAndError, ID } from '../../../commonStateTypes/common';
|
|
2
|
-
import { InvoicingFieldHelpByCode } from '../../../entity/invoicing/invoicingCommonPayload';
|
|
3
2
|
import { RootState } from '../../../rootStateTypes';
|
|
4
3
|
import { InvoicingDataImportStatusRow, InvoicingMigrationSession } from './dataImportViewPayload';
|
|
5
4
|
import { InvoicingMigrationDiagnosticsState } from './dataImportViewState';
|
|
6
5
|
export interface InvoicingDataImportView {
|
|
7
6
|
activeMigrationSessionId: ID | null;
|
|
8
7
|
diagnosticsBySession: Record<ID, InvoicingMigrationDiagnosticsState>;
|
|
9
|
-
fieldHelp: InvoicingFieldHelpByCode;
|
|
10
8
|
sessionDetail: Record<ID, InvoicingMigrationSession>;
|
|
11
9
|
sessionDetailFetch: FetchStateAndError;
|
|
12
10
|
sessions: InvoicingMigrationSession[];
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getInvoicingDataImportView = void 0;
|
|
4
|
-
const invoicingConfigViewSelector_1 = require("../invoicingConfigView/invoicingConfigViewSelector");
|
|
5
4
|
/**
|
|
6
5
|
* Single bundled view for the invoicing data-import surfaces — consumers read
|
|
7
6
|
* only this. Carries the migration `sessions` list + `sessionsFetch`, the
|
|
@@ -11,7 +10,6 @@ const invoicingConfigViewSelector_1 = require("../invoicingConfigView/invoicingC
|
|
|
11
10
|
const getInvoicingDataImportView = (state) => {
|
|
12
11
|
const dataImportState = state.invoicingDataImportViewState;
|
|
13
12
|
return {
|
|
14
|
-
fieldHelp: (0, invoicingConfigViewSelector_1.invoicingFieldHelpForGroup)(state, 'data_import'),
|
|
15
13
|
activeMigrationSessionId: dataImportState.activeDetailId,
|
|
16
14
|
sessionDetail: dataImportState.sessionDetail,
|
|
17
15
|
sessionDetailFetch: dataImportState.sessionDetailFetch,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { NestedAccountHierarchyForReport } from '../../../commonStateTypes/accountView/nestedAccountID';
|
|
2
2
|
import { FetchState, FetchStateAndError } from '../../../commonStateTypes/common';
|
|
3
|
-
import { InvoicingDunningActionOption,
|
|
3
|
+
import { InvoicingDunningActionOption, InvoicingNamedOption, InvoicingQboAccountMappingKindOption, InvoicingSettingsPayload } from '../../../entity/invoicing/invoicingCommonPayload';
|
|
4
4
|
import { ZeniAPIStatus } from '../../../responsePayload';
|
|
5
5
|
import { RootState } from '../../../rootStateTypes';
|
|
6
6
|
import { InvoicingQboConnection, InvoicingQboSyncHealth } from '../invoicingQboView/invoicingQboViewPayload';
|
|
@@ -20,7 +20,6 @@ export declare const getInvoicingSettings: (state: RootState) => InvoicingSettin
|
|
|
20
20
|
export declare const getInvoicingSettingsFetchState: (state: RootState) => FetchStateAndError;
|
|
21
21
|
export interface InvoicingSettingsView {
|
|
22
22
|
fetchState: FetchState;
|
|
23
|
-
fieldHelp: InvoicingFieldHelpByCode;
|
|
24
23
|
saveState: FetchStateAndError;
|
|
25
24
|
stripeConnectState: FetchStateAndError;
|
|
26
25
|
error?: ZeniAPIStatus;
|
|
@@ -57,7 +56,6 @@ export interface InvoicingSettingsHubView {
|
|
|
57
56
|
*/
|
|
58
57
|
configFetchState: FetchState;
|
|
59
58
|
dunningScheduleActionOptions: InvoicingDunningActionOption[];
|
|
60
|
-
fieldHelp: InvoicingFieldHelpByCode;
|
|
61
59
|
isEnablingInvoicing: boolean;
|
|
62
60
|
/**
|
|
63
61
|
* Whether the tenant has already enabled invoicing. The enable footer is for
|
|
@@ -97,7 +95,6 @@ export interface InvoicingQboSettingsFormView {
|
|
|
97
95
|
/** So the screen can fetch only what is missing, without reading the slices. */
|
|
98
96
|
configFetchState: FetchState;
|
|
99
97
|
customerMatchingOptions: InvoicingNamedOption[];
|
|
100
|
-
fieldHelp: InvoicingFieldHelpByCode;
|
|
101
98
|
isLoading: boolean;
|
|
102
99
|
/** The persisted sync toggle — the backfill guard checks that, not the draft. */
|
|
103
100
|
isSyncEnabledSaved: boolean;
|
|
@@ -123,7 +120,6 @@ export interface InvoicingQboSettingsFormView {
|
|
|
123
120
|
export declare const getInvoicingQboSettingsFormView: (state: RootState) => InvoicingQboSettingsFormView;
|
|
124
121
|
export interface InvoicingBrandingFormView {
|
|
125
122
|
dateFormatOptions: InvoicingNamedOption[];
|
|
126
|
-
fieldHelp: InvoicingFieldHelpByCode;
|
|
127
123
|
localData: InvoicingBrandingFormLocalData;
|
|
128
124
|
saveState: FetchStateAndError;
|
|
129
125
|
addressLabel?: string;
|
|
@@ -32,7 +32,6 @@ 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'),
|
|
36
35
|
error,
|
|
37
36
|
fetchState,
|
|
38
37
|
saveState: saveFetchState,
|
|
@@ -86,7 +85,6 @@ const getInvoicingSettingsHubView = (state) => {
|
|
|
86
85
|
const { dunningScheduleActionOptions, enableState, error: configError, fetchState: configFetchState, qboAccountMappingKindOptions, qboCustomerMatchingOptions, qboSyncStatusOptions, status, } = (0, invoicingConfigViewSelector_1.getInvoicingConfigView)(state);
|
|
87
86
|
const { canEnable, isQboConfigured, isStripeConnected } = deriveInvoicingEnablePrerequisites(state.invoicingSettingsViewState.settings, state.invoicingQboViewState.connection?.connected === true, qboAccountMappingKindOptions);
|
|
88
87
|
return {
|
|
89
|
-
fieldHelp: (0, invoicingConfigViewSelector_1.invoicingFieldHelpForGroup)(state, 'settings'),
|
|
90
88
|
// Keeps the onboarding step in the gate: a tenant that has not accepted the
|
|
91
89
|
// terms cannot enable invoicing, whatever the integrations say.
|
|
92
90
|
canEnableInvoicing: status === 'settings' && canEnable,
|
|
@@ -118,7 +116,6 @@ const getInvoicingQboSettingsFormView = (state) => {
|
|
|
118
116
|
const { fetchState: configFetchState, qboAccountMappingKindOptions, qboCustomerMatchingOptions, qboSyncStatusOptions, } = (0, invoicingConfigViewSelector_1.getInvoicingConfigView)(state);
|
|
119
117
|
const qboView = (0, invoicingQboViewSelector_1.getInvoicingQboView)(state);
|
|
120
118
|
return {
|
|
121
|
-
fieldHelp: (0, invoicingConfigViewSelector_1.invoicingFieldHelpForGroup)(state, 'settings'),
|
|
122
119
|
accountMappingKindOptions: qboAccountMappingKindOptions,
|
|
123
120
|
accounts: qboView.accounts,
|
|
124
121
|
backfillState: qboView.backfillState,
|
|
@@ -159,7 +156,6 @@ const getInvoicingBrandingFormView = (state) => {
|
|
|
159
156
|
? (0, addressViewSelector_1.getFormattedAddress)(newAddress.addressToCreate)
|
|
160
157
|
: undefined;
|
|
161
158
|
return {
|
|
162
|
-
fieldHelp: (0, invoicingConfigViewSelector_1.invoicingFieldHelpForGroup)(state, 'settings'),
|
|
163
159
|
addressLabel,
|
|
164
160
|
dateFormatOptions: (0, invoicingConfigViewSelector_1.getInvoicingConfigView)(state).dateFormatOptions,
|
|
165
161
|
localData: brandingDraft ?? (0, invoicingBrandingFormConfig_1.entityToInvoicingBrandingFormLocalData)(settings),
|
|
@@ -12,38 +12,4 @@ interface FetchRecommendationPayloadWithCOT {
|
|
|
12
12
|
recommendations: RecommendationPayloadWithCOT[];
|
|
13
13
|
}
|
|
14
14
|
export type FetchRecommendationResponseWithCOT = ZeniAPIResponse<FetchRecommendationPayloadWithCOT>;
|
|
15
|
-
export type RecommendationFeedbackDimension = 'vendor' | 'category' | 'class';
|
|
16
|
-
export type RecommendationFeedbackSource = 'primary' | 'alternate' | 'shadow' | 'qbo';
|
|
17
|
-
export type RecommendationFeedbackOutcome = 'accepted' | 'override_ranked' | 'override_outside' | 'retracted';
|
|
18
|
-
export interface RecommendationFeedbackValue {
|
|
19
|
-
name: string;
|
|
20
|
-
id?: string | null;
|
|
21
|
-
integrationId?: string | null;
|
|
22
|
-
}
|
|
23
|
-
export interface ShownRecommendationForFeedback {
|
|
24
|
-
rank: number;
|
|
25
|
-
source: RecommendationFeedbackSource;
|
|
26
|
-
value: RecommendationFeedbackValue;
|
|
27
|
-
confidence?: number | null;
|
|
28
|
-
cot?: string[];
|
|
29
|
-
reasoning?: string | null;
|
|
30
|
-
}
|
|
31
|
-
export interface SubmitRecommendationFeedbackPayload {
|
|
32
|
-
dimension: RecommendationFeedbackDimension;
|
|
33
|
-
outcome: RecommendationFeedbackOutcome;
|
|
34
|
-
selected: RecommendationFeedbackValue & {
|
|
35
|
-
isNewEntity?: boolean;
|
|
36
|
-
};
|
|
37
|
-
transactionId: string;
|
|
38
|
-
features?: Record<string, unknown> | null;
|
|
39
|
-
lineId?: string | null;
|
|
40
|
-
matchedRank?: number | null;
|
|
41
|
-
matchedSource?: RecommendationFeedbackSource | null;
|
|
42
|
-
reasonText?: string | null;
|
|
43
|
-
recommendationSetId?: string | null;
|
|
44
|
-
retractsFeedbackId?: string | null;
|
|
45
|
-
shownRecommendations?: ShownRecommendationForFeedback[];
|
|
46
|
-
skipped?: boolean;
|
|
47
|
-
topPickSource?: RecommendationFeedbackSource | null;
|
|
48
|
-
}
|
|
49
15
|
export {};
|
|
@@ -5,7 +5,6 @@ import { TransactionID } from '../../entity/transaction/stateTypes/transactionID
|
|
|
5
5
|
import { SupportedTransaction } from '../../entity/transaction/transactionState';
|
|
6
6
|
import { ZeniAPIStatus } from '../../responsePayload';
|
|
7
7
|
import { TransactionsTab } from '../expenseAutomationView/types/transactionsViewState';
|
|
8
|
-
import { SubmitRecommendationFeedbackPayload } from './recommendationPayload';
|
|
9
8
|
import { EntityRecommendationState } from './recommendationState';
|
|
10
9
|
export type RecommendationLineUpdateFlowType = 'categorization' | 'detail';
|
|
11
10
|
type FetchEntityRecommendationsForLineUpdateCommonPayload = {
|
|
@@ -58,6 +57,6 @@ export declare const fetchEntityRecommendationsByTransactionId: import("@reduxjs
|
|
|
58
57
|
}, "recommendation/updateRecommendationForEntityFailure">, indicateReadyToInitializeRecommendation: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[entityIdOrName: string, entityType: EntityType], {
|
|
59
58
|
entityIdOrName: string;
|
|
60
59
|
entityType: EntityType;
|
|
61
|
-
}, "recommendation/indicateReadyToInitializeRecommendation", never, never
|
|
60
|
+
}, "recommendation/indicateReadyToInitializeRecommendation", never, never>;
|
|
62
61
|
declare const _default: import("redux").Reducer<EntityRecommendationState>;
|
|
63
62
|
export default _default;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var _a;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.
|
|
4
|
+
exports.indicateReadyToInitializeRecommendation = exports.updateRecommendationForEntityFailure = exports.updateRecommendationForEntity = exports.fetchRecommendationByEntityId = exports.fetchRecommendationByEntityName = exports.fetchEntityRecommendationsForLineUpdate = exports.fetchEntityRecommendationsByTransactionId = exports.initialState = void 0;
|
|
5
5
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
6
|
const rootActions_1 = require("../../rootActions");
|
|
7
7
|
const recommendationState_1 = require("./recommendationState");
|
|
@@ -135,18 +135,6 @@ const recommendation = (0, toolkit_1.createSlice)({
|
|
|
135
135
|
};
|
|
136
136
|
},
|
|
137
137
|
},
|
|
138
|
-
// Fire-and-forget human feedback on a recommendation (accept, ranked
|
|
139
|
-
// override or outside override). Handled by submitRecommendationFeedbackEpic
|
|
140
|
-
// which POSTs to the accounting recommendation-feedback endpoint. No state
|
|
141
|
-
// mutation: the categorization UX must not depend on the feedback round-trip.
|
|
142
|
-
submitRecommendationFeedback: {
|
|
143
|
-
reducer() {
|
|
144
|
-
// Fire-and-forget: no state mutation; the epic performs the POST.
|
|
145
|
-
},
|
|
146
|
-
prepare(args) {
|
|
147
|
-
return { payload: args };
|
|
148
|
-
},
|
|
149
|
-
},
|
|
150
138
|
},
|
|
151
139
|
extraReducers: (builder) => {
|
|
152
140
|
builder.addCase(rootActions_1.clearAll, (draft) => {
|
|
@@ -154,7 +142,7 @@ const recommendation = (0, toolkit_1.createSlice)({
|
|
|
154
142
|
});
|
|
155
143
|
},
|
|
156
144
|
});
|
|
157
|
-
_a = recommendation.actions, exports.fetchEntityRecommendationsByTransactionId = _a.fetchEntityRecommendationsByTransactionId, exports.fetchEntityRecommendationsForLineUpdate = _a.fetchEntityRecommendationsForLineUpdate, exports.fetchRecommendationByEntityName = _a.fetchRecommendationByEntityName, exports.fetchRecommendationByEntityId = _a.fetchRecommendationByEntityId, exports.updateRecommendationForEntity = _a.updateRecommendationForEntity, exports.updateRecommendationForEntityFailure = _a.updateRecommendationForEntityFailure, exports.indicateReadyToInitializeRecommendation = _a.indicateReadyToInitializeRecommendation
|
|
145
|
+
_a = recommendation.actions, exports.fetchEntityRecommendationsByTransactionId = _a.fetchEntityRecommendationsByTransactionId, exports.fetchEntityRecommendationsForLineUpdate = _a.fetchEntityRecommendationsForLineUpdate, exports.fetchRecommendationByEntityName = _a.fetchRecommendationByEntityName, exports.fetchRecommendationByEntityId = _a.fetchRecommendationByEntityId, exports.updateRecommendationForEntity = _a.updateRecommendationForEntity, exports.updateRecommendationForEntityFailure = _a.updateRecommendationForEntityFailure, exports.indicateReadyToInitializeRecommendation = _a.indicateReadyToInitializeRecommendation;
|
|
158
146
|
exports.default = recommendation.reducer;
|
|
159
147
|
const doUpdateRecommendationForEntity = (draft, entityId, entityType, payload) => {
|
|
160
148
|
const key = (0, recommendationState_1.getEntityRecommendationKey)(entityType, entityId);
|
|
@@ -4,7 +4,6 @@ import { updateApprovalRules } from '../../../../../entity/approvalRule/approval
|
|
|
4
4
|
import { updateAllUsers } from '../../../../../entity/user/userReducer';
|
|
5
5
|
import { RootState } from '../../../../../rootStateTypes';
|
|
6
6
|
import { ZeniAPI } from '../../../../../zeniAPI';
|
|
7
|
-
import { fetchClassList } from '../../../../classList/classListReducer';
|
|
8
7
|
import { fetchBillPaySetupApproverView, fetchBillPaySetupApproverViewFailure, fetchBillPaySetupApproverViewSuccess } from '../billPaySetupApproverViewReducer';
|
|
9
|
-
export type ActionType = ReturnType<typeof fetchBillPaySetupApproverView> | ReturnType<typeof
|
|
8
|
+
export type ActionType = ReturnType<typeof fetchBillPaySetupApproverView> | ReturnType<typeof updateAllUsers> | ReturnType<typeof updateApprovalRules> | ReturnType<typeof fetchBillPaySetupApproverViewSuccess> | ReturnType<typeof fetchBillPaySetupApproverViewFailure>;
|
|
10
9
|
export declare const fetchBillPaySetupApproverViewEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -5,20 +5,13 @@ const rxjs_1 = require("rxjs");
|
|
|
5
5
|
const operators_1 = require("rxjs/operators");
|
|
6
6
|
const approvalRuleReducer_1 = require("../../../../../entity/approvalRule/approvalRuleReducer");
|
|
7
7
|
const approvalRuleSelector_1 = require("../../../../../entity/approvalRule/approvalRuleSelector");
|
|
8
|
-
const tenantSelector_1 = require("../../../../../entity/tenant/tenantSelector");
|
|
9
8
|
const userReducer_1 = require("../../../../../entity/user/userReducer");
|
|
10
9
|
const responsePayload_1 = require("../../../../../responsePayload");
|
|
11
|
-
const classListReducer_1 = require("../../../../classList/classListReducer");
|
|
12
10
|
const billPaySetupApproverViewReducer_1 = require("../billPaySetupApproverViewReducer");
|
|
13
11
|
const fetchBillPaySetupApproverViewEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(billPaySetupApproverViewReducer_1.fetchBillPaySetupApproverView.match), (0, operators_1.switchMap)((action) => {
|
|
14
12
|
const { cacheOverride, useV3 } = action.payload;
|
|
15
|
-
const { billPaySetupApproverViewState, approvalRuleState
|
|
16
|
-
const isAccountingClassesEnabled = (0, tenantSelector_1.getIsAccountingClassesEnabled)(state$.value);
|
|
13
|
+
const { billPaySetupApproverViewState, approvalRuleState } = state$.value;
|
|
17
14
|
const approvalRules = (0, approvalRuleSelector_1.getApprovalRulesByIds)(approvalRuleState, billPaySetupApproverViewState.approvalRuleIds);
|
|
18
|
-
const shouldFetchClassList = isAccountingClassesEnabled &&
|
|
19
|
-
(cacheOverride === true ||
|
|
20
|
-
(classListState.hasValidState() === false &&
|
|
21
|
-
classListState.fetchState !== 'In-Progress'));
|
|
22
15
|
if (cacheOverride === true ||
|
|
23
16
|
approvalRules.length !==
|
|
24
17
|
billPaySetupApproverViewState.approvalRuleIds.length ||
|
|
@@ -38,9 +31,6 @@ const fetchBillPaySetupApproverViewEpic = (actions$, state$, zeniAPI) => actions
|
|
|
38
31
|
(0, approvalRuleReducer_1.updateApprovalRules)(response.data.approval_rules),
|
|
39
32
|
(0, billPaySetupApproverViewReducer_1.fetchBillPaySetupApproverViewSuccess)(approvalRuleIds),
|
|
40
33
|
];
|
|
41
|
-
if (shouldFetchClassList) {
|
|
42
|
-
actions.push((0, classListReducer_1.fetchClassList)());
|
|
43
|
-
}
|
|
44
34
|
return (0, rxjs_1.from)(actions);
|
|
45
35
|
}
|
|
46
36
|
else {
|
|
@@ -50,13 +40,7 @@ const fetchBillPaySetupApproverViewEpic = (actions$, state$, zeniAPI) => actions
|
|
|
50
40
|
}
|
|
51
41
|
else {
|
|
52
42
|
const { approvalRuleIds } = billPaySetupApproverViewState;
|
|
53
|
-
|
|
54
|
-
(0, billPaySetupApproverViewReducer_1.fetchBillPaySetupApproverViewSuccess)(approvalRuleIds),
|
|
55
|
-
];
|
|
56
|
-
if (shouldFetchClassList) {
|
|
57
|
-
actions.push((0, classListReducer_1.fetchClassList)());
|
|
58
|
-
}
|
|
59
|
-
return (0, rxjs_1.from)(actions);
|
|
43
|
+
return (0, rxjs_1.of)((0, billPaySetupApproverViewReducer_1.fetchBillPaySetupApproverViewSuccess)(approvalRuleIds));
|
|
60
44
|
}
|
|
61
45
|
}));
|
|
62
46
|
exports.fetchBillPaySetupApproverViewEpic = fetchBillPaySetupApproverViewEpic;
|
|
@@ -24,6 +24,7 @@ const initializeBillPaySetupApproverViewUpdateDataEpic = (actions$, state$) => a
|
|
|
24
24
|
name: approvalRule.name,
|
|
25
25
|
description: approvalRule.description,
|
|
26
26
|
separationOfDuties: approvalRule.separationOfDuties,
|
|
27
|
+
isFallback: approvalRule.isFallback,
|
|
27
28
|
};
|
|
28
29
|
fetchActions.push((0, billPaySetupApproverViewReducer_1.clearBillPaySetupApproverViewUpdateData)(), (0, billPaySetupApproverViewReducer_1.saveBillPaySetupApproverViewUpdateData)(billPaySetupApproverViewUpdateData));
|
|
29
30
|
}
|
|
@@ -18,6 +18,7 @@ interface ApprovalUpdatableInfoPayload {
|
|
|
18
18
|
is_applicable_on_pending_approval_entity: boolean;
|
|
19
19
|
steps: ApproverViewStepPayload[];
|
|
20
20
|
description?: string;
|
|
21
|
+
is_fallback?: boolean;
|
|
21
22
|
is_separation_of_duty_enabled?: boolean;
|
|
22
23
|
/**
|
|
23
24
|
* Approval Rules 3.0 — rule-level wire fields. The backend accepts these
|
|
@@ -89,6 +89,9 @@ const toApprovalChangableInfoPayload = (approverViewUpdateData) => {
|
|
|
89
89
|
payload.is_separation_of_duty_enabled =
|
|
90
90
|
approverViewUpdateData.separationOfDuties;
|
|
91
91
|
}
|
|
92
|
+
if (approverViewUpdateData.isFallback != null) {
|
|
93
|
+
payload.is_fallback = approverViewUpdateData.isFallback;
|
|
94
|
+
}
|
|
92
95
|
if (isUpdate) {
|
|
93
96
|
payload.approval_rule_id = approverViewUpdateData.approvalRuleId;
|
|
94
97
|
}
|
|
@@ -25,6 +25,6 @@ export interface CommonHistoryState {
|
|
|
25
25
|
}
|
|
26
26
|
export declare const toHistoricEventUpdateType: (v: string) => "deleted" | "created" | "updated";
|
|
27
27
|
type HistoricEventUpdateType = ReturnType<typeof toHistoricEventUpdateType>;
|
|
28
|
-
export declare const toHistoricEventUpdateDisplayType: (v: string) => "
|
|
28
|
+
export declare const toHistoricEventUpdateDisplayType: (v: string) => "list" | "sentence" | "inline";
|
|
29
29
|
type HistoricEventUpdateDisplayType = ReturnType<typeof toHistoricEventUpdateDisplayType>;
|
|
30
30
|
export {};
|
|
@@ -4,7 +4,6 @@ import { updateApprovalRules } from '../../../../../entity/approvalRule/approval
|
|
|
4
4
|
import { updateAllUsers } from '../../../../../entity/user/userReducer';
|
|
5
5
|
import { RootState } from '../../../../../rootStateTypes';
|
|
6
6
|
import { ZeniAPI } from '../../../../../zeniAPI';
|
|
7
|
-
import { fetchClassList } from '../../../../classList/classListReducer';
|
|
8
7
|
import { fetchRemiSetupApproverView, fetchRemiSetupApproverViewFailure, fetchRemiSetupApproverViewSuccess } from '../remiSetupApproverViewReducer';
|
|
9
|
-
export type ActionType = ReturnType<typeof fetchRemiSetupApproverView> | ReturnType<typeof
|
|
8
|
+
export type ActionType = ReturnType<typeof fetchRemiSetupApproverView> | ReturnType<typeof updateAllUsers> | ReturnType<typeof updateApprovalRules> | ReturnType<typeof fetchRemiSetupApproverViewSuccess> | ReturnType<typeof fetchRemiSetupApproverViewFailure>;
|
|
10
9
|
export declare const fetchRemiSetupApproverViewEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -5,20 +5,13 @@ const rxjs_1 = require("rxjs");
|
|
|
5
5
|
const operators_1 = require("rxjs/operators");
|
|
6
6
|
const approvalRuleReducer_1 = require("../../../../../entity/approvalRule/approvalRuleReducer");
|
|
7
7
|
const approvalRuleSelector_1 = require("../../../../../entity/approvalRule/approvalRuleSelector");
|
|
8
|
-
const tenantSelector_1 = require("../../../../../entity/tenant/tenantSelector");
|
|
9
8
|
const userReducer_1 = require("../../../../../entity/user/userReducer");
|
|
10
9
|
const responsePayload_1 = require("../../../../../responsePayload");
|
|
11
|
-
const classListReducer_1 = require("../../../../classList/classListReducer");
|
|
12
10
|
const remiSetupApproverViewReducer_1 = require("../remiSetupApproverViewReducer");
|
|
13
11
|
const fetchRemiSetupApproverViewEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(remiSetupApproverViewReducer_1.fetchRemiSetupApproverView.match), (0, operators_1.switchMap)((action) => {
|
|
14
12
|
const { cacheOverride, resolveAttributeToUser, includeImplicitActors, useV3, } = action.payload;
|
|
15
|
-
const { remiSetupApproverViewState, approvalRuleState
|
|
16
|
-
const isAccountingClassesEnabled = (0, tenantSelector_1.getIsAccountingClassesEnabled)(state$.value);
|
|
13
|
+
const { remiSetupApproverViewState, approvalRuleState } = state$.value;
|
|
17
14
|
const approvalRules = (0, approvalRuleSelector_1.getApprovalRulesByIds)(approvalRuleState, remiSetupApproverViewState.approvalRuleIds);
|
|
18
|
-
const shouldFetchClassList = isAccountingClassesEnabled &&
|
|
19
|
-
(cacheOverride === true ||
|
|
20
|
-
(classListState.hasValidState() === false &&
|
|
21
|
-
classListState.fetchState !== 'In-Progress'));
|
|
22
15
|
if (cacheOverride === true ||
|
|
23
16
|
approvalRules.length !==
|
|
24
17
|
remiSetupApproverViewState.approvalRuleIds.length ||
|
|
@@ -40,9 +33,6 @@ const fetchRemiSetupApproverViewEpic = (actions$, state$, zeniAPI) => actions$.p
|
|
|
40
33
|
(0, approvalRuleReducer_1.updateApprovalRules)(response.data.approval_rules),
|
|
41
34
|
(0, remiSetupApproverViewReducer_1.fetchRemiSetupApproverViewSuccess)(approvalRuleIds),
|
|
42
35
|
];
|
|
43
|
-
if (shouldFetchClassList) {
|
|
44
|
-
actions.push((0, classListReducer_1.fetchClassList)());
|
|
45
|
-
}
|
|
46
36
|
return (0, rxjs_1.from)(actions);
|
|
47
37
|
}
|
|
48
38
|
else {
|
|
@@ -52,13 +42,7 @@ const fetchRemiSetupApproverViewEpic = (actions$, state$, zeniAPI) => actions$.p
|
|
|
52
42
|
}
|
|
53
43
|
else {
|
|
54
44
|
const { approvalRuleIds } = remiSetupApproverViewState;
|
|
55
|
-
|
|
56
|
-
(0, remiSetupApproverViewReducer_1.fetchRemiSetupApproverViewSuccess)(approvalRuleIds),
|
|
57
|
-
];
|
|
58
|
-
if (shouldFetchClassList) {
|
|
59
|
-
actions.push((0, classListReducer_1.fetchClassList)());
|
|
60
|
-
}
|
|
61
|
-
return (0, rxjs_1.from)(actions);
|
|
45
|
+
return (0, rxjs_1.of)((0, remiSetupApproverViewReducer_1.fetchRemiSetupApproverViewSuccess)(approvalRuleIds));
|
|
62
46
|
}
|
|
63
47
|
}));
|
|
64
48
|
exports.fetchRemiSetupApproverViewEpic = fetchRemiSetupApproverViewEpic;
|
|
@@ -24,6 +24,7 @@ const initializeRemiSetupApproverViewUpdateDataEpic = (actions$, state$) => acti
|
|
|
24
24
|
name: approvalRule.name,
|
|
25
25
|
description: approvalRule.description,
|
|
26
26
|
separationOfDuties: approvalRule.separationOfDuties,
|
|
27
|
+
isFallback: approvalRule.isFallback,
|
|
27
28
|
};
|
|
28
29
|
fetchActions.push((0, remiSetupApproverViewReducer_1.clearRemiSetupApproverViewUpdateData)(), (0, remiSetupApproverViewReducer_1.saveRemiSetupApproverViewUpdateData)(remiSetupApproverViewUpdateData));
|
|
29
30
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "5.2.
|
|
3
|
+
"version": "5.2.23",
|
|
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",
|