@zeniai/client-epic-state 5.2.22 → 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 -2
- package/lib/epic.js +0 -2
- package/lib/esm/entity/aiCfo/aiCfoReducer.js +1 -32
- package/lib/esm/epic.js +0 -2
- package/lib/esm/index.js +2 -2
- package/lib/esm/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +2 -4
- 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 +5 -6
- package/lib/index.js +23 -24
- package/lib/view/expenseAutomationView/selectorTypes/jeSchedulesSelectorTypes.d.ts +3 -5
- package/lib/view/expenseAutomationView/selectors/jeSchedulesViewSelector.d.ts +5 -2
- package/lib/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +2 -4
- 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/recommendation/submitRecommendationFeedbackEpic.js +0 -52
- package/lib/view/recommendation/submitRecommendationFeedbackEpic.d.ts +0 -7
- package/lib/view/recommendation/submitRecommendationFeedbackEpic.js +0 -56
|
@@ -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",
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { EMPTY } from 'rxjs';
|
|
2
|
-
import { catchError, filter, mergeMap } from 'rxjs/operators';
|
|
3
|
-
import { isSuccessStatus } from '../../responsePayload';
|
|
4
|
-
import { submitRecommendationFeedback } from './recommendationReducer';
|
|
5
|
-
const toRequestBody = (payload) => ({
|
|
6
|
-
line_id: payload.lineId ?? null,
|
|
7
|
-
dimension: payload.dimension,
|
|
8
|
-
recommendation_set_id: payload.recommendationSetId ?? null,
|
|
9
|
-
top_pick_source: payload.topPickSource ?? null,
|
|
10
|
-
shown_recommendations: (payload.shownRecommendations ?? []).map((recommendation) => ({
|
|
11
|
-
source: recommendation.source,
|
|
12
|
-
rank: recommendation.rank,
|
|
13
|
-
value: {
|
|
14
|
-
name: recommendation.value.name,
|
|
15
|
-
id: recommendation.value.id ?? null,
|
|
16
|
-
integration_id: recommendation.value.integrationId ?? null,
|
|
17
|
-
},
|
|
18
|
-
confidence: recommendation.confidence ?? null,
|
|
19
|
-
reasoning: recommendation.reasoning ?? null,
|
|
20
|
-
cot: recommendation.cot ?? [],
|
|
21
|
-
})),
|
|
22
|
-
selected: {
|
|
23
|
-
name: payload.selected.name,
|
|
24
|
-
id: payload.selected.id ?? null,
|
|
25
|
-
integration_id: payload.selected.integrationId ?? null,
|
|
26
|
-
is_new_entity: payload.selected.isNewEntity ?? false,
|
|
27
|
-
},
|
|
28
|
-
matched_source: payload.matchedSource ?? null,
|
|
29
|
-
matched_rank: payload.matchedRank ?? null,
|
|
30
|
-
outcome: payload.outcome,
|
|
31
|
-
reason_text: payload.reasonText ?? null,
|
|
32
|
-
skipped: payload.skipped ?? false,
|
|
33
|
-
retracts_feedback_id: payload.retractsFeedbackId ?? null,
|
|
34
|
-
features: payload.features ?? null,
|
|
35
|
-
});
|
|
36
|
-
// Fire-and-forget: the epic never re-emits an action. Feedback delivery is a
|
|
37
|
-
// side-effect that must not disrupt the categorization UX, so both the
|
|
38
|
-
// success and error paths complete silently (errors are logged for debugging).
|
|
39
|
-
export const submitRecommendationFeedbackEpic = (actions$, _state$, zeniAPI) => actions$.pipe(filter(submitRecommendationFeedback.match), mergeMap((action) => {
|
|
40
|
-
const { transactionId } = action.payload;
|
|
41
|
-
return zeniAPI
|
|
42
|
-
.postAndGetJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/transactions/${transactionId}/recommendation-feedback`, toRequestBody(action.payload))
|
|
43
|
-
.pipe(mergeMap((response) => {
|
|
44
|
-
if (!isSuccessStatus(response)) {
|
|
45
|
-
console.error('submitRecommendationFeedbackEpic: recommendation feedback was not recorded', response.status);
|
|
46
|
-
}
|
|
47
|
-
return EMPTY;
|
|
48
|
-
}), catchError((error) => {
|
|
49
|
-
console.error('submitRecommendationFeedbackEpic: failed to submit recommendation feedback', error);
|
|
50
|
-
return EMPTY;
|
|
51
|
-
}));
|
|
52
|
-
}));
|
|
@@ -1,7 +0,0 @@
|
|
|
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>;
|
|
@@ -1,56 +0,0 @@
|
|
|
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;
|