@zeniai/client-epic-state 5.2.26-betaAK0 → 5.2.26
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/entity/file/fileState.d.ts +3 -3
- package/lib/entity/file/fileState.js +0 -2
- package/lib/entity/invoicing/creditNote/creditNotePayload.d.ts +1 -0
- package/lib/entity/invoicing/creditNote/creditNotePayload.js +1 -0
- package/lib/entity/invoicing/creditNote/creditNoteState.d.ts +1 -0
- package/lib/entity/invoicing/invoice/invoicePayload.d.ts +1 -0
- package/lib/entity/invoicing/invoice/invoicePayload.js +1 -0
- package/lib/entity/invoicing/invoice/invoiceState.d.ts +1 -0
- package/lib/entity/invoicing/invoicingCommonPayload.d.ts +0 -2
- package/lib/entity/invoicing/invoicingCustomer/invoicingCustomerPayload.d.ts +1 -0
- package/lib/entity/invoicing/invoicingCustomer/invoicingCustomerPayload.js +1 -0
- package/lib/entity/invoicing/invoicingCustomer/invoicingCustomerState.d.ts +1 -0
- package/lib/entity/invoicing/invoicingSubscription/invoicingSubscriptionPayload.d.ts +2 -1
- package/lib/entity/invoicing/invoicingSubscription/invoicingSubscriptionPayload.js +2 -1
- package/lib/entity/invoicing/invoicingSubscription/invoicingSubscriptionState.d.ts +2 -1
- 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/entity/file/fileState.js +0 -2
- package/lib/esm/entity/invoicing/creditNote/creditNotePayload.js +1 -0
- package/lib/esm/entity/invoicing/invoice/invoicePayload.js +1 -0
- package/lib/esm/entity/invoicing/invoicingCustomer/invoicingCustomerPayload.js +1 -0
- package/lib/esm/entity/invoicing/invoicingSubscription/invoicingSubscriptionPayload.js +2 -1
- 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/couponView/couponViewState.js +4 -4
- package/lib/esm/view/invoicing/dataImportView/dataImportViewSelector.js +0 -2
- package/lib/esm/view/invoicing/invoicingCatalogListView/invoicingCatalogListViewSelector.js +0 -1
- package/lib/esm/view/invoicing/invoicingConfigView/invoicingConfigViewReducer.js +0 -2
- 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 +1 -0
- package/lib/esm/view/invoicing/invoicingSubscriptionDetailView/invoicingSubscriptionDetailViewSelector.js +1 -2
- package/lib/esm/view/invoicing/invoicingSubscriptionListView/invoicingSubscriptionListViewSelector.js +0 -1
- package/lib/esm/view/invoicing/invoicingSubscriptionListView/invoicingSubscriptionListViewState.js +2 -0
- package/lib/esm/view/invoicing/settingsView/invoicingBrandingFormConfig.js +0 -5
- 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 -7
- 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/couponView/couponViewState.d.ts +2 -2
- package/lib/view/invoicing/couponView/couponViewState.js +4 -4
- package/lib/view/invoicing/dataImportView/dataImportViewSelector.d.ts +0 -2
- package/lib/view/invoicing/dataImportView/dataImportViewSelector.js +0 -2
- package/lib/view/invoicing/invoicingCatalogListView/invoicingCatalogListViewSelector.d.ts +0 -1
- package/lib/view/invoicing/invoicingCatalogListView/invoicingCatalogListViewSelector.js +0 -1
- package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewPayload.d.ts +0 -1
- package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewReducer.d.ts +1 -1
- package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewReducer.js +0 -2
- package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewState.d.ts +0 -1
- 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 +1 -0
- package/lib/view/invoicing/invoicingOverview/invoicingOverviewPayload.js +1 -0
- package/lib/view/invoicing/invoicingOverview/invoicingOverviewState.d.ts +1 -0
- package/lib/view/invoicing/invoicingSubscriptionDetailView/invoicingSubscriptionDetailViewSelector.d.ts +1 -3
- package/lib/view/invoicing/invoicingSubscriptionDetailView/invoicingSubscriptionDetailViewSelector.js +0 -1
- package/lib/view/invoicing/invoicingSubscriptionListView/invoicingSubscriptionListViewSelector.d.ts +0 -2
- package/lib/view/invoicing/invoicingSubscriptionListView/invoicingSubscriptionListViewSelector.js +0 -1
- package/lib/view/invoicing/invoicingSubscriptionListView/invoicingSubscriptionListViewState.d.ts +2 -2
- package/lib/view/invoicing/invoicingSubscriptionListView/invoicingSubscriptionListViewState.js +2 -0
- package/lib/view/invoicing/issueCreditNote/issueCreditNotePayload.d.ts +1 -0
- package/lib/view/invoicing/settingsView/invoicingBrandingFormConfig.d.ts +0 -1
- package/lib/view/invoicing/settingsView/invoicingBrandingFormConfig.js +0 -5
- package/lib/view/invoicing/settingsView/settingsViewSelector.d.ts +1 -5
- package/lib/view/invoicing/settingsView/settingsViewSelector.js +0 -4
- package/lib/view/invoicing/subscriptionAction/subscriptionActionRequestPayload.d.ts +0 -8
- 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
package/lib/view/invoicing/invoicingSubscriptionListView/invoicingSubscriptionListViewSelector.d.ts
CHANGED
|
@@ -7,8 +7,6 @@ import { InvoicingListSort } from '../invoicingApiHelper';
|
|
|
7
7
|
import { InvoicingSubscriptionColumnConfig, InvoicingSubscriptionFilters, InvoicingSubscriptionTabId } from './invoicingSubscriptionListViewState';
|
|
8
8
|
export interface InvoicingSubscriptionListView extends SelectorView {
|
|
9
9
|
activeTab: InvoicingSubscriptionTabId;
|
|
10
|
-
/** Cancel reasons from `/1.0/config`, so the dialog hardcodes nothing. */
|
|
11
|
-
cancelReasonCodeOptions: InvoicingNamedOption[];
|
|
12
10
|
columns: InvoicingSubscriptionColumnConfig[];
|
|
13
11
|
count: InvoicingListCounts;
|
|
14
12
|
countsFetchState: FetchStateAndError;
|
package/lib/view/invoicing/invoicingSubscriptionListView/invoicingSubscriptionListViewSelector.js
CHANGED
|
@@ -31,7 +31,6 @@ exports.getInvoicingSubscriptionListView = (0, toolkit_1.createSelector)((state)
|
|
|
31
31
|
count: listViewState.counts,
|
|
32
32
|
countsFetchState: listViewState.countsFetchState,
|
|
33
33
|
subscriptionCommercialEditAllowedFromStatuses: configState.subscriptionCommercialEditAllowedFromStatuses,
|
|
34
|
-
cancelReasonCodeOptions: configState.subscriptionCancelReasonCodeOptions,
|
|
35
34
|
subscriptionLifecycleActionOptions: configState.subscriptionLifecycleActionOptions,
|
|
36
35
|
subscriptionMetadataEditAllowedFromStatuses: configState.subscriptionMetadataEditAllowedFromStatuses,
|
|
37
36
|
statusOptions,
|
package/lib/view/invoicing/invoicingSubscriptionListView/invoicingSubscriptionListViewState.d.ts
CHANGED
|
@@ -7,8 +7,8 @@ export interface InvoicingSubscriptionFilters {
|
|
|
7
7
|
startedFrom?: string;
|
|
8
8
|
startedTo?: string;
|
|
9
9
|
}
|
|
10
|
-
export declare const ALL_INVOICING_SUBSCRIPTION_SORT_KEYS: readonly ["subscription", "customer", "plan", "term_end", "next_billing", "auto_collect", "status", "mrr"];
|
|
11
|
-
export declare const toInvoicingSubscriptionSortKey: (v: string) => "status" | "customer" | "subscription" | "plan" | "term_end" | "next_billing" | "auto_collect" | "mrr";
|
|
10
|
+
export declare const ALL_INVOICING_SUBSCRIPTION_SORT_KEYS: readonly ["subscription", "customer", "plan", "product_code", "term_end", "next_billing", "auto_collect", "status", "mrr"];
|
|
11
|
+
export declare const toInvoicingSubscriptionSortKey: (v: string) => "status" | "customer" | "subscription" | "plan" | "product_code" | "term_end" | "next_billing" | "auto_collect" | "mrr";
|
|
12
12
|
export type InvoicingSubscriptionSortKey = ReturnType<typeof toInvoicingSubscriptionSortKey>;
|
|
13
13
|
/**
|
|
14
14
|
* Structural column descriptor owned by CES so the subscription-list column set,
|
package/lib/view/invoicing/invoicingSubscriptionListView/invoicingSubscriptionListViewState.js
CHANGED
|
@@ -6,6 +6,7 @@ exports.ALL_INVOICING_SUBSCRIPTION_SORT_KEYS = [
|
|
|
6
6
|
'subscription',
|
|
7
7
|
'customer',
|
|
8
8
|
'plan',
|
|
9
|
+
'product_code',
|
|
9
10
|
'term_end',
|
|
10
11
|
'next_billing',
|
|
11
12
|
'auto_collect',
|
|
@@ -18,6 +19,7 @@ exports.INVOICING_SUBSCRIPTION_COLUMNS = [
|
|
|
18
19
|
{ key: 'subscription', sortable: true },
|
|
19
20
|
{ key: 'customer', sortable: false },
|
|
20
21
|
{ key: 'plan', sortable: true },
|
|
22
|
+
{ key: 'product_code', sortable: true },
|
|
21
23
|
{ key: 'term_end', sortable: true },
|
|
22
24
|
{ key: 'next_billing', sortable: true },
|
|
23
25
|
{ key: 'auto_collect', sortable: true },
|
|
@@ -10,7 +10,6 @@ exports.initialInvoicingBrandingFormLocalData = {
|
|
|
10
10
|
dateFormat: '',
|
|
11
11
|
defaultMemo: '',
|
|
12
12
|
email: '',
|
|
13
|
-
invoiceFooterText: '',
|
|
14
13
|
invoicePrefix: '',
|
|
15
14
|
logoFileId: '',
|
|
16
15
|
phone: '',
|
|
@@ -23,7 +22,6 @@ const entityToInvoicingBrandingFormLocalData = (settings) => ({
|
|
|
23
22
|
dateFormat: settings?.date_format ?? '',
|
|
24
23
|
defaultMemo: settings?.default_memo ?? '',
|
|
25
24
|
email: settings?.email ?? '',
|
|
26
|
-
invoiceFooterText: settings?.invoice_footer_text ?? '',
|
|
27
25
|
invoicePrefix: settings?.invoice_prefix ?? '',
|
|
28
26
|
logoFileId: settings?.logo_file_id ?? '',
|
|
29
27
|
phone: settings?.phone ?? '',
|
|
@@ -45,9 +43,6 @@ const brandingLocalDataToSettingsPayload = (localData, address) => ({
|
|
|
45
43
|
date_format: trimOrUndefined(localData.dateFormat),
|
|
46
44
|
default_memo: trimOrUndefined(localData.defaultMemo),
|
|
47
45
|
email: trimOrUndefined(localData.email),
|
|
48
|
-
// Sent even when blank: "" is how the API is told to hide the footer line,
|
|
49
|
-
// so this one must not collapse to `undefined` like the fields above.
|
|
50
|
-
invoice_footer_text: localData.invoiceFooterText.trim(),
|
|
51
46
|
invoice_prefix: trimOrUndefined(localData.invoicePrefix),
|
|
52
47
|
logo_file_id: localData.logoFileId,
|
|
53
48
|
phone: trimOrUndefined(localData.phone),
|
|
@@ -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),
|
|
@@ -18,14 +18,6 @@ export type PauseSubscriptionBody = {
|
|
|
18
18
|
pause_reason?: string;
|
|
19
19
|
resume_date?: string;
|
|
20
20
|
};
|
|
21
|
-
/**
|
|
22
|
-
* What the cancel dialog collects. Form values, not the request body: the screen
|
|
23
|
-
* turns these into {@link CancelSubscriptionBody}.
|
|
24
|
-
*/
|
|
25
|
-
export type InvoicingCancelSubscriptionValues = {
|
|
26
|
-
cancelReasonCode: string;
|
|
27
|
-
cancelReason?: string;
|
|
28
|
-
};
|
|
29
21
|
export type CancelSubscriptionBody = {
|
|
30
22
|
cancel_reason?: string;
|
|
31
23
|
cancel_reason_code?: string;
|
|
@@ -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.26
|
|
3
|
+
"version": "5.2.26",
|
|
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;
|