@zeniai/client-epic-state 5.2.29 → 5.2.30-betaRD0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/entity/aiCfo/aiCfoPayload.d.ts +21 -0
- package/lib/entity/aiCfo/aiCfoReducer.js +73 -1
- package/lib/entity/aiCfo/aiCfoState.d.ts +24 -0
- package/lib/entity/file/fileState.d.ts +3 -3
- package/lib/entity/file/fileState.js +2 -0
- package/lib/entity/invoicing/creditNote/creditNotePayload.d.ts +0 -1
- package/lib/entity/invoicing/creditNote/creditNotePayload.js +0 -1
- package/lib/entity/invoicing/creditNote/creditNoteState.d.ts +0 -1
- package/lib/entity/invoicing/invoice/invoicePayload.d.ts +0 -1
- package/lib/entity/invoicing/invoice/invoicePayload.js +0 -1
- package/lib/entity/invoicing/invoice/invoiceState.d.ts +0 -1
- package/lib/entity/invoicing/invoicingCommonPayload.d.ts +2 -0
- package/lib/entity/invoicing/invoicingCustomer/invoicingCustomerPayload.d.ts +0 -1
- package/lib/entity/invoicing/invoicingCustomer/invoicingCustomerPayload.js +0 -1
- package/lib/entity/invoicing/invoicingCustomer/invoicingCustomerState.d.ts +0 -1
- package/lib/entity/invoicing/invoicingSubscription/invoicingSubscriptionPayload.d.ts +1 -2
- package/lib/entity/invoicing/invoicingSubscription/invoicingSubscriptionPayload.js +1 -2
- package/lib/entity/invoicing/invoicingSubscription/invoicingSubscriptionState.d.ts +1 -2
- package/lib/epic.d.ts +2 -1
- package/lib/epic.js +2 -0
- package/lib/esm/entity/aiCfo/aiCfoReducer.js +73 -1
- package/lib/esm/entity/file/fileState.js +2 -0
- package/lib/esm/entity/invoicing/creditNote/creditNotePayload.js +0 -1
- package/lib/esm/entity/invoicing/invoice/invoicePayload.js +0 -1
- package/lib/esm/entity/invoicing/invoicingCustomer/invoicingCustomerPayload.js +0 -1
- package/lib/esm/entity/invoicing/invoicingSubscription/invoicingSubscriptionPayload.js +1 -2
- package/lib/esm/epic.js +2 -0
- package/lib/esm/index.js +2 -2
- package/lib/esm/view/aiCfoView/aiCfoViewReducer.js +5 -0
- package/lib/esm/view/aiCfoView/aiCfoViewSelector.js +1 -0
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +29 -11
- package/lib/esm/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +4 -2
- package/lib/esm/view/invoicing/couponView/couponViewState.js +4 -4
- package/lib/esm/view/invoicing/dataImportView/dataImportViewSelector.js +2 -0
- package/lib/esm/view/invoicing/invoicingCatalogListView/invoicingCatalogListViewSelector.js +1 -0
- package/lib/esm/view/invoicing/invoicingConfigView/invoicingConfigViewReducer.js +2 -0
- package/lib/esm/view/invoicing/invoicingCustomerListView/invoicingCustomerListViewState.js +3 -3
- package/lib/esm/view/invoicing/invoicingDunningCaseListView/invoicingDunningCaseListViewState.js +4 -4
- package/lib/esm/view/invoicing/invoicingOverview/invoicingOverviewPayload.js +0 -1
- package/lib/esm/view/invoicing/invoicingSubscriptionDetailView/invoicingSubscriptionDetailViewSelector.js +2 -1
- package/lib/esm/view/invoicing/invoicingSubscriptionListView/invoicingSubscriptionListViewSelector.js +1 -0
- package/lib/esm/view/invoicing/invoicingSubscriptionListView/invoicingSubscriptionListViewState.js +0 -2
- package/lib/esm/view/invoicing/settingsView/invoicingBrandingFormConfig.js +5 -0
- package/lib/esm/view/invoicing/settingsView/settingsViewSelector.js +5 -1
- package/lib/esm/view/recommendation/recommendationReducer.js +13 -1
- package/lib/esm/view/recommendation/submitRecommendationFeedbackEpic.js +52 -0
- package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/epic/fetchBillPaySetupApproverViewEpic.js +18 -2
- package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/epic/initializeBillPaySetupApproverViewUpdateDataEpic.js +0 -1
- package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/types/commonPayload.js +0 -3
- package/lib/esm/view/spendManagement/reimbursement/remiSetupApproverView/epic/fetchRemiSetupApproverViewEpic.js +18 -2
- package/lib/esm/view/spendManagement/reimbursement/remiSetupApproverView/epic/initializeRemiSetupApproverViewUpdateDataEpic.js +0 -1
- package/lib/index.d.ts +7 -5
- package/lib/index.js +24 -23
- package/lib/view/aiCfoView/aiCfoViewReducer.js +5 -0
- package/lib/view/aiCfoView/aiCfoViewSelector.js +1 -0
- package/lib/view/aiCfoView/aiCfoViewState.d.ts +7 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +29 -11
- package/lib/view/expenseAutomationView/selectorTypes/jeSchedulesSelectorTypes.d.ts +5 -3
- package/lib/view/expenseAutomationView/selectors/jeSchedulesViewSelector.d.ts +2 -5
- package/lib/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +4 -2
- package/lib/view/invoicing/couponView/couponViewState.d.ts +2 -2
- package/lib/view/invoicing/couponView/couponViewState.js +4 -4
- package/lib/view/invoicing/dataImportView/dataImportViewSelector.d.ts +2 -0
- package/lib/view/invoicing/dataImportView/dataImportViewSelector.js +2 -0
- package/lib/view/invoicing/invoicingCatalogListView/invoicingCatalogListViewSelector.d.ts +1 -0
- package/lib/view/invoicing/invoicingCatalogListView/invoicingCatalogListViewSelector.js +1 -0
- package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewPayload.d.ts +1 -0
- package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewReducer.d.ts +1 -1
- package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewReducer.js +2 -0
- package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewState.d.ts +1 -0
- package/lib/view/invoicing/invoicingCustomerListView/invoicingCustomerListViewState.d.ts +2 -2
- package/lib/view/invoicing/invoicingCustomerListView/invoicingCustomerListViewState.js +3 -3
- package/lib/view/invoicing/invoicingDunningCaseListView/invoicingDunningCaseListViewState.d.ts +2 -2
- package/lib/view/invoicing/invoicingDunningCaseListView/invoicingDunningCaseListViewState.js +4 -4
- package/lib/view/invoicing/invoicingOverview/invoicingOverviewPayload.d.ts +0 -1
- package/lib/view/invoicing/invoicingOverview/invoicingOverviewPayload.js +0 -1
- package/lib/view/invoicing/invoicingOverview/invoicingOverviewState.d.ts +0 -1
- package/lib/view/invoicing/invoicingSubscriptionDetailView/invoicingSubscriptionDetailViewSelector.d.ts +3 -1
- package/lib/view/invoicing/invoicingSubscriptionDetailView/invoicingSubscriptionDetailViewSelector.js +1 -0
- package/lib/view/invoicing/invoicingSubscriptionListView/invoicingSubscriptionListViewSelector.d.ts +2 -0
- package/lib/view/invoicing/invoicingSubscriptionListView/invoicingSubscriptionListViewSelector.js +1 -0
- package/lib/view/invoicing/invoicingSubscriptionListView/invoicingSubscriptionListViewState.d.ts +2 -2
- package/lib/view/invoicing/invoicingSubscriptionListView/invoicingSubscriptionListViewState.js +0 -2
- package/lib/view/invoicing/issueCreditNote/issueCreditNotePayload.d.ts +0 -1
- package/lib/view/invoicing/settingsView/invoicingBrandingFormConfig.d.ts +1 -0
- package/lib/view/invoicing/settingsView/invoicingBrandingFormConfig.js +5 -0
- package/lib/view/invoicing/settingsView/settingsViewSelector.d.ts +5 -1
- package/lib/view/invoicing/settingsView/settingsViewSelector.js +4 -0
- package/lib/view/invoicing/subscriptionAction/subscriptionActionRequestPayload.d.ts +8 -0
- package/lib/view/recommendation/recommendationPayload.d.ts +34 -0
- package/lib/view/recommendation/recommendationReducer.d.ts +2 -1
- package/lib/view/recommendation/recommendationReducer.js +14 -2
- package/lib/view/recommendation/submitRecommendationFeedbackEpic.d.ts +7 -0
- package/lib/view/recommendation/submitRecommendationFeedbackEpic.js +56 -0
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/epic/fetchBillPaySetupApproverViewEpic.d.ts +2 -1
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/epic/fetchBillPaySetupApproverViewEpic.js +18 -2
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/epic/initializeBillPaySetupApproverViewUpdateDataEpic.js +0 -1
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/types/commonPayload.d.ts +0 -1
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/types/commonPayload.js +0 -3
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/types/commonState.d.ts +0 -1
- package/lib/view/spendManagement/commonHistoryView/commonHistory.d.ts +1 -1
- package/lib/view/spendManagement/reimbursement/remiSetupApproverView/epic/fetchRemiSetupApproverViewEpic.d.ts +2 -1
- package/lib/view/spendManagement/reimbursement/remiSetupApproverView/epic/fetchRemiSetupApproverViewEpic.js +18 -2
- package/lib/view/spendManagement/reimbursement/remiSetupApproverView/epic/initializeRemiSetupApproverViewUpdateDataEpic.js +0 -1
- package/package.json +1 -1
|
@@ -5,6 +5,7 @@ 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';
|
|
8
9
|
import { EntityRecommendationState } from './recommendationState';
|
|
9
10
|
export type RecommendationLineUpdateFlowType = 'categorization' | 'detail';
|
|
10
11
|
type FetchEntityRecommendationsForLineUpdateCommonPayload = {
|
|
@@ -57,6 +58,6 @@ export declare const fetchEntityRecommendationsByTransactionId: import("@reduxjs
|
|
|
57
58
|
}, "recommendation/updateRecommendationForEntityFailure">, indicateReadyToInitializeRecommendation: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[entityIdOrName: string, entityType: EntityType], {
|
|
58
59
|
entityIdOrName: string;
|
|
59
60
|
entityType: EntityType;
|
|
60
|
-
}, "recommendation/indicateReadyToInitializeRecommendation", never, never>;
|
|
61
|
+
}, "recommendation/indicateReadyToInitializeRecommendation", never, never>, submitRecommendationFeedback: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[args: SubmitRecommendationFeedbackPayload], SubmitRecommendationFeedbackPayload, "recommendation/submitRecommendationFeedback", never, never>;
|
|
61
62
|
declare const _default: import("redux").Reducer<EntityRecommendationState>;
|
|
62
63
|
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.indicateReadyToInitializeRecommendation = exports.updateRecommendationForEntityFailure = exports.updateRecommendationForEntity = exports.fetchRecommendationByEntityId = exports.fetchRecommendationByEntityName = exports.fetchEntityRecommendationsForLineUpdate = exports.fetchEntityRecommendationsByTransactionId = exports.initialState = void 0;
|
|
4
|
+
exports.submitRecommendationFeedback = 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,6 +135,18 @@ 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
|
+
},
|
|
138
150
|
},
|
|
139
151
|
extraReducers: (builder) => {
|
|
140
152
|
builder.addCase(rootActions_1.clearAll, (draft) => {
|
|
@@ -142,7 +154,7 @@ const recommendation = (0, toolkit_1.createSlice)({
|
|
|
142
154
|
});
|
|
143
155
|
},
|
|
144
156
|
});
|
|
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;
|
|
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, exports.submitRecommendationFeedback = _a.submitRecommendationFeedback;
|
|
146
158
|
exports.default = recommendation.reducer;
|
|
147
159
|
const doUpdateRecommendationForEntity = (draft, entityId, entityType, payload) => {
|
|
148
160
|
const key = (0, recommendationState_1.getEntityRecommendationKey)(entityType, entityId);
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { RootState } from '../../reducer';
|
|
4
|
+
import { ZeniAPI } from '../../zeniAPI';
|
|
5
|
+
import { submitRecommendationFeedback } from './recommendationReducer';
|
|
6
|
+
export type ActionType = ReturnType<typeof submitRecommendationFeedback>;
|
|
7
|
+
export declare const submitRecommendationFeedbackEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.submitRecommendationFeedbackEpic = void 0;
|
|
4
|
+
const rxjs_1 = require("rxjs");
|
|
5
|
+
const operators_1 = require("rxjs/operators");
|
|
6
|
+
const responsePayload_1 = require("../../responsePayload");
|
|
7
|
+
const recommendationReducer_1 = require("./recommendationReducer");
|
|
8
|
+
const toRequestBody = (payload) => ({
|
|
9
|
+
line_id: payload.lineId ?? null,
|
|
10
|
+
dimension: payload.dimension,
|
|
11
|
+
recommendation_set_id: payload.recommendationSetId ?? null,
|
|
12
|
+
top_pick_source: payload.topPickSource ?? null,
|
|
13
|
+
shown_recommendations: (payload.shownRecommendations ?? []).map((recommendation) => ({
|
|
14
|
+
source: recommendation.source,
|
|
15
|
+
rank: recommendation.rank,
|
|
16
|
+
value: {
|
|
17
|
+
name: recommendation.value.name,
|
|
18
|
+
id: recommendation.value.id ?? null,
|
|
19
|
+
integration_id: recommendation.value.integrationId ?? null,
|
|
20
|
+
},
|
|
21
|
+
confidence: recommendation.confidence ?? null,
|
|
22
|
+
reasoning: recommendation.reasoning ?? null,
|
|
23
|
+
cot: recommendation.cot ?? [],
|
|
24
|
+
})),
|
|
25
|
+
selected: {
|
|
26
|
+
name: payload.selected.name,
|
|
27
|
+
id: payload.selected.id ?? null,
|
|
28
|
+
integration_id: payload.selected.integrationId ?? null,
|
|
29
|
+
is_new_entity: payload.selected.isNewEntity ?? false,
|
|
30
|
+
},
|
|
31
|
+
matched_source: payload.matchedSource ?? null,
|
|
32
|
+
matched_rank: payload.matchedRank ?? null,
|
|
33
|
+
outcome: payload.outcome,
|
|
34
|
+
reason_text: payload.reasonText ?? null,
|
|
35
|
+
skipped: payload.skipped ?? false,
|
|
36
|
+
retracts_feedback_id: payload.retractsFeedbackId ?? null,
|
|
37
|
+
features: payload.features ?? null,
|
|
38
|
+
});
|
|
39
|
+
// Fire-and-forget: the epic never re-emits an action. Feedback delivery is a
|
|
40
|
+
// side-effect that must not disrupt the categorization UX, so both the
|
|
41
|
+
// success and error paths complete silently (errors are logged for debugging).
|
|
42
|
+
const submitRecommendationFeedbackEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(recommendationReducer_1.submitRecommendationFeedback.match), (0, operators_1.mergeMap)((action) => {
|
|
43
|
+
const { transactionId } = action.payload;
|
|
44
|
+
return zeniAPI
|
|
45
|
+
.postAndGetJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/transactions/${transactionId}/recommendation-feedback`, toRequestBody(action.payload))
|
|
46
|
+
.pipe((0, operators_1.mergeMap)((response) => {
|
|
47
|
+
if (!(0, responsePayload_1.isSuccessStatus)(response)) {
|
|
48
|
+
console.error('submitRecommendationFeedbackEpic: recommendation feedback was not recorded', response.status);
|
|
49
|
+
}
|
|
50
|
+
return rxjs_1.EMPTY;
|
|
51
|
+
}), (0, operators_1.catchError)((error) => {
|
|
52
|
+
console.error('submitRecommendationFeedbackEpic: failed to submit recommendation feedback', error);
|
|
53
|
+
return rxjs_1.EMPTY;
|
|
54
|
+
}));
|
|
55
|
+
}));
|
|
56
|
+
exports.submitRecommendationFeedbackEpic = submitRecommendationFeedbackEpic;
|
|
@@ -4,6 +4,7 @@ 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';
|
|
7
8
|
import { fetchBillPaySetupApproverView, fetchBillPaySetupApproverViewFailure, fetchBillPaySetupApproverViewSuccess } from '../billPaySetupApproverViewReducer';
|
|
8
|
-
export type ActionType = ReturnType<typeof fetchBillPaySetupApproverView> | ReturnType<typeof updateAllUsers> | ReturnType<typeof updateApprovalRules> | ReturnType<typeof fetchBillPaySetupApproverViewSuccess> | ReturnType<typeof fetchBillPaySetupApproverViewFailure>;
|
|
9
|
+
export type ActionType = ReturnType<typeof fetchBillPaySetupApproverView> | ReturnType<typeof fetchClassList> | ReturnType<typeof updateAllUsers> | ReturnType<typeof updateApprovalRules> | ReturnType<typeof fetchBillPaySetupApproverViewSuccess> | ReturnType<typeof fetchBillPaySetupApproverViewFailure>;
|
|
9
10
|
export declare const fetchBillPaySetupApproverViewEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -5,13 +5,20 @@ 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");
|
|
8
9
|
const userReducer_1 = require("../../../../../entity/user/userReducer");
|
|
9
10
|
const responsePayload_1 = require("../../../../../responsePayload");
|
|
11
|
+
const classListReducer_1 = require("../../../../classList/classListReducer");
|
|
10
12
|
const billPaySetupApproverViewReducer_1 = require("../billPaySetupApproverViewReducer");
|
|
11
13
|
const fetchBillPaySetupApproverViewEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(billPaySetupApproverViewReducer_1.fetchBillPaySetupApproverView.match), (0, operators_1.switchMap)((action) => {
|
|
12
14
|
const { cacheOverride, useV3 } = action.payload;
|
|
13
|
-
const { billPaySetupApproverViewState, approvalRuleState } = state$.value;
|
|
15
|
+
const { billPaySetupApproverViewState, approvalRuleState, classListState } = state$.value;
|
|
16
|
+
const isAccountingClassesEnabled = (0, tenantSelector_1.getIsAccountingClassesEnabled)(state$.value);
|
|
14
17
|
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'));
|
|
15
22
|
if (cacheOverride === true ||
|
|
16
23
|
approvalRules.length !==
|
|
17
24
|
billPaySetupApproverViewState.approvalRuleIds.length ||
|
|
@@ -31,6 +38,9 @@ const fetchBillPaySetupApproverViewEpic = (actions$, state$, zeniAPI) => actions
|
|
|
31
38
|
(0, approvalRuleReducer_1.updateApprovalRules)(response.data.approval_rules),
|
|
32
39
|
(0, billPaySetupApproverViewReducer_1.fetchBillPaySetupApproverViewSuccess)(approvalRuleIds),
|
|
33
40
|
];
|
|
41
|
+
if (shouldFetchClassList) {
|
|
42
|
+
actions.push((0, classListReducer_1.fetchClassList)());
|
|
43
|
+
}
|
|
34
44
|
return (0, rxjs_1.from)(actions);
|
|
35
45
|
}
|
|
36
46
|
else {
|
|
@@ -40,7 +50,13 @@ const fetchBillPaySetupApproverViewEpic = (actions$, state$, zeniAPI) => actions
|
|
|
40
50
|
}
|
|
41
51
|
else {
|
|
42
52
|
const { approvalRuleIds } = billPaySetupApproverViewState;
|
|
43
|
-
|
|
53
|
+
const actions = [
|
|
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);
|
|
44
60
|
}
|
|
45
61
|
}));
|
|
46
62
|
exports.fetchBillPaySetupApproverViewEpic = fetchBillPaySetupApproverViewEpic;
|
|
@@ -24,7 +24,6 @@ const initializeBillPaySetupApproverViewUpdateDataEpic = (actions$, state$) => a
|
|
|
24
24
|
name: approvalRule.name,
|
|
25
25
|
description: approvalRule.description,
|
|
26
26
|
separationOfDuties: approvalRule.separationOfDuties,
|
|
27
|
-
isFallback: approvalRule.isFallback,
|
|
28
27
|
};
|
|
29
28
|
fetchActions.push((0, billPaySetupApproverViewReducer_1.clearBillPaySetupApproverViewUpdateData)(), (0, billPaySetupApproverViewReducer_1.saveBillPaySetupApproverViewUpdateData)(billPaySetupApproverViewUpdateData));
|
|
30
29
|
}
|
|
@@ -18,7 +18,6 @@ interface ApprovalUpdatableInfoPayload {
|
|
|
18
18
|
is_applicable_on_pending_approval_entity: boolean;
|
|
19
19
|
steps: ApproverViewStepPayload[];
|
|
20
20
|
description?: string;
|
|
21
|
-
is_fallback?: boolean;
|
|
22
21
|
is_separation_of_duty_enabled?: boolean;
|
|
23
22
|
/**
|
|
24
23
|
* Approval Rules 3.0 — rule-level wire fields. The backend accepts these
|
|
@@ -89,9 +89,6 @@ 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
|
-
}
|
|
95
92
|
if (isUpdate) {
|
|
96
93
|
payload.approval_rule_id = approverViewUpdateData.approvalRuleId;
|
|
97
94
|
}
|
|
@@ -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) => "inline" | "list" | "sentence";
|
|
29
29
|
type HistoricEventUpdateDisplayType = ReturnType<typeof toHistoricEventUpdateDisplayType>;
|
|
30
30
|
export {};
|
|
@@ -4,6 +4,7 @@ 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';
|
|
7
8
|
import { fetchRemiSetupApproverView, fetchRemiSetupApproverViewFailure, fetchRemiSetupApproverViewSuccess } from '../remiSetupApproverViewReducer';
|
|
8
|
-
export type ActionType = ReturnType<typeof fetchRemiSetupApproverView> | ReturnType<typeof updateAllUsers> | ReturnType<typeof updateApprovalRules> | ReturnType<typeof fetchRemiSetupApproverViewSuccess> | ReturnType<typeof fetchRemiSetupApproverViewFailure>;
|
|
9
|
+
export type ActionType = ReturnType<typeof fetchRemiSetupApproverView> | ReturnType<typeof fetchClassList> | ReturnType<typeof updateAllUsers> | ReturnType<typeof updateApprovalRules> | ReturnType<typeof fetchRemiSetupApproverViewSuccess> | ReturnType<typeof fetchRemiSetupApproverViewFailure>;
|
|
9
10
|
export declare const fetchRemiSetupApproverViewEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -5,13 +5,20 @@ 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");
|
|
8
9
|
const userReducer_1 = require("../../../../../entity/user/userReducer");
|
|
9
10
|
const responsePayload_1 = require("../../../../../responsePayload");
|
|
11
|
+
const classListReducer_1 = require("../../../../classList/classListReducer");
|
|
10
12
|
const remiSetupApproverViewReducer_1 = require("../remiSetupApproverViewReducer");
|
|
11
13
|
const fetchRemiSetupApproverViewEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(remiSetupApproverViewReducer_1.fetchRemiSetupApproverView.match), (0, operators_1.switchMap)((action) => {
|
|
12
14
|
const { cacheOverride, resolveAttributeToUser, includeImplicitActors, useV3, } = action.payload;
|
|
13
|
-
const { remiSetupApproverViewState, approvalRuleState } = state$.value;
|
|
15
|
+
const { remiSetupApproverViewState, approvalRuleState, classListState } = state$.value;
|
|
16
|
+
const isAccountingClassesEnabled = (0, tenantSelector_1.getIsAccountingClassesEnabled)(state$.value);
|
|
14
17
|
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'));
|
|
15
22
|
if (cacheOverride === true ||
|
|
16
23
|
approvalRules.length !==
|
|
17
24
|
remiSetupApproverViewState.approvalRuleIds.length ||
|
|
@@ -33,6 +40,9 @@ const fetchRemiSetupApproverViewEpic = (actions$, state$, zeniAPI) => actions$.p
|
|
|
33
40
|
(0, approvalRuleReducer_1.updateApprovalRules)(response.data.approval_rules),
|
|
34
41
|
(0, remiSetupApproverViewReducer_1.fetchRemiSetupApproverViewSuccess)(approvalRuleIds),
|
|
35
42
|
];
|
|
43
|
+
if (shouldFetchClassList) {
|
|
44
|
+
actions.push((0, classListReducer_1.fetchClassList)());
|
|
45
|
+
}
|
|
36
46
|
return (0, rxjs_1.from)(actions);
|
|
37
47
|
}
|
|
38
48
|
else {
|
|
@@ -42,7 +52,13 @@ const fetchRemiSetupApproverViewEpic = (actions$, state$, zeniAPI) => actions$.p
|
|
|
42
52
|
}
|
|
43
53
|
else {
|
|
44
54
|
const { approvalRuleIds } = remiSetupApproverViewState;
|
|
45
|
-
|
|
55
|
+
const actions = [
|
|
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);
|
|
46
62
|
}
|
|
47
63
|
}));
|
|
48
64
|
exports.fetchRemiSetupApproverViewEpic = fetchRemiSetupApproverViewEpic;
|
|
@@ -24,7 +24,6 @@ const initializeRemiSetupApproverViewUpdateDataEpic = (actions$, state$) => acti
|
|
|
24
24
|
name: approvalRule.name,
|
|
25
25
|
description: approvalRule.description,
|
|
26
26
|
separationOfDuties: approvalRule.separationOfDuties,
|
|
27
|
-
isFallback: approvalRule.isFallback,
|
|
28
27
|
};
|
|
29
28
|
fetchActions.push((0, remiSetupApproverViewReducer_1.clearRemiSetupApproverViewUpdateData)(), (0, remiSetupApproverViewReducer_1.saveRemiSetupApproverViewUpdateData)(remiSetupApproverViewUpdateData));
|
|
30
29
|
}
|
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.30-betaRD0",
|
|
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",
|