@zeniai/client-epic-state 5.2.26 → 5.2.27-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/entity/jeSchedules/jeSchedulesState.d.ts +7 -0
- 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/oneTimeAccrualActionsEpic.js +22 -0
- package/lib/esm/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +4 -2
- package/lib/esm/view/invoicing/dataImportView/dataImportViewSelector.js +2 -0
- package/lib/esm/view/invoicing/invoicingConfigView/invoicingConfigViewReducer.js +2 -0
- 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/oneTimeAccrualActionsEpic.js +22 -0
- package/lib/view/expenseAutomationView/payload/jeSchedulesPayload.d.ts +2 -0
- 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/dataImportView/dataImportViewSelector.d.ts +2 -0
- package/lib/view/invoicing/dataImportView/dataImportViewSelector.js +2 -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/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
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getInvoicingDataImportView = void 0;
|
|
4
|
+
const invoicingConfigViewSelector_1 = require("../invoicingConfigView/invoicingConfigViewSelector");
|
|
4
5
|
/**
|
|
5
6
|
* Single bundled view for the invoicing data-import surfaces — consumers read
|
|
6
7
|
* only this. Carries the migration `sessions` list + `sessionsFetch`, the
|
|
@@ -10,6 +11,7 @@ exports.getInvoicingDataImportView = void 0;
|
|
|
10
11
|
const getInvoicingDataImportView = (state) => {
|
|
11
12
|
const dataImportState = state.invoicingDataImportViewState;
|
|
12
13
|
return {
|
|
14
|
+
fieldHelp: (0, invoicingConfigViewSelector_1.invoicingFieldHelpForGroup)(state, 'data_import'),
|
|
13
15
|
activeMigrationSessionId: dataImportState.activeDetailId,
|
|
14
16
|
sessionDetail: dataImportState.sessionDetail,
|
|
15
17
|
sessionDetailFetch: dataImportState.sessionDetailFetch,
|
|
@@ -54,6 +54,7 @@ export interface InvoicingConfigPayload {
|
|
|
54
54
|
qbo_account_mapping_kind_options?: InvoicingQboAccountMappingKindOptionWire[];
|
|
55
55
|
qbo_customer_matching_options?: InvoicingNamedOptionWire[];
|
|
56
56
|
qbo_sync_status_options?: InvoicingNamedOptionWire[];
|
|
57
|
+
subscription_cancel_reason_code_options?: InvoicingNamedOptionWire[];
|
|
57
58
|
subscription_status_options?: InvoicingNamedOptionWire[];
|
|
58
59
|
taxability_options?: InvoicingNamedOptionWire[];
|
|
59
60
|
transaction_status_options?: InvoicingNamedOptionWire[];
|
|
@@ -2,7 +2,7 @@ import { ZeniAPIStatus } from '../../../responsePayload';
|
|
|
2
2
|
import { InvoicingConfigPayload } from './invoicingConfigViewPayload';
|
|
3
3
|
import { InvoicingConfigViewState } from './invoicingConfigViewState';
|
|
4
4
|
export declare const initialState: InvoicingConfigViewState;
|
|
5
|
-
export declare function mapInvoicingConfigPayloadToState(payload: InvoicingConfigPayload): Pick<InvoicingConfigViewState, 'auditLogEntityRouteOptions' | 'auditLogListSortFieldOptions' | 'auditLogSourceLabels' | 'autoCollectionOptions' | 'billingPeriodUnitOptions' | 'catalogTierTypeOptionsByPricingModel' | 'catalogTrialEndActionOptions' | 'catalogTrialUnitOptions' | 'customerTypeOptions' | 'dateFormatOptions' | 'fieldHelp' | 'discountApplyOnOptions' | 'discountDurationTypeOptions' | 'discountTypeOptions' | 'manualPaymentMethodOptions' | 'netTermDayOptions' | 'paymentGatewayOptions' | 'taxabilityOptions' | 'cardStatusOptions' | 'catalogItemStatusOptions' | 'catalogItemTypeOptions' | 'creditNoteReasonCodeOptions' | 'creditNoteStatusOptions' | 'creditNoteTypeOptions' | 'customerStatusOptions' | 'discountStatusOptions' | 'dunningCaseStatusOptions' | 'invoiceStatusOptions' | 'subscriptionStatusOptions' | 'transactionStatusOptions' | 'transactionTypeOptions' | 'createdAt' | 'updatedAt' | 'dunningScheduleActionOptions' | 'subscriptionLifecycleActionOptions' | 'subscriptionCommercialEditAllowedFromStatuses' | 'subscriptionMetadataEditAllowedFromStatuses' | 'subscriptionEditFieldOptions' | 'subscriptionCancelTimingOptions' | 'subscriptionChangeOptionOptions' | 'catalogItemLifecycleActionOptions' | 'catalogProductLifecycleActionOptions' | 'discountLifecycleActionOptions' | 'qboAccountMappingKindOptions' | 'qboCustomerMatchingOptions' | 'qboSyncStatusOptions' | 'isInvoicingEnabled' | 'isInvoicingTosAccepted' | 'invoicingTosAcceptanceIp' | 'invoicingTosAcceptanceTime' | 'invoicingTosAcceptanceUserAgent' | 'invoicingTosAcceptanceUserId' | 'isInvoicingSettingsSeeded'>;
|
|
5
|
+
export declare function mapInvoicingConfigPayloadToState(payload: InvoicingConfigPayload): Pick<InvoicingConfigViewState, 'auditLogEntityRouteOptions' | 'auditLogListSortFieldOptions' | 'auditLogSourceLabels' | 'autoCollectionOptions' | 'billingPeriodUnitOptions' | 'catalogTierTypeOptionsByPricingModel' | 'catalogTrialEndActionOptions' | 'catalogTrialUnitOptions' | 'customerTypeOptions' | 'dateFormatOptions' | 'fieldHelp' | 'discountApplyOnOptions' | 'discountDurationTypeOptions' | 'discountTypeOptions' | 'manualPaymentMethodOptions' | 'netTermDayOptions' | 'paymentGatewayOptions' | 'taxabilityOptions' | 'cardStatusOptions' | 'catalogItemStatusOptions' | 'catalogItemTypeOptions' | 'creditNoteReasonCodeOptions' | 'creditNoteStatusOptions' | 'creditNoteTypeOptions' | 'customerStatusOptions' | 'discountStatusOptions' | 'dunningCaseStatusOptions' | 'invoiceStatusOptions' | 'subscriptionCancelReasonCodeOptions' | 'subscriptionStatusOptions' | 'transactionStatusOptions' | 'transactionTypeOptions' | 'createdAt' | 'updatedAt' | 'dunningScheduleActionOptions' | 'subscriptionLifecycleActionOptions' | 'subscriptionCommercialEditAllowedFromStatuses' | 'subscriptionMetadataEditAllowedFromStatuses' | 'subscriptionEditFieldOptions' | 'subscriptionCancelTimingOptions' | 'subscriptionChangeOptionOptions' | 'catalogItemLifecycleActionOptions' | 'catalogProductLifecycleActionOptions' | 'discountLifecycleActionOptions' | 'qboAccountMappingKindOptions' | 'qboCustomerMatchingOptions' | 'qboSyncStatusOptions' | 'isInvoicingEnabled' | 'isInvoicingTosAccepted' | 'invoicingTosAcceptanceIp' | 'invoicingTosAcceptanceTime' | 'invoicingTosAcceptanceUserAgent' | 'invoicingTosAcceptanceUserId' | 'isInvoicingSettingsSeeded'>;
|
|
6
6
|
export declare const fetchInvoicingConfig: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[payload?: {
|
|
7
7
|
cacheOverride?: boolean;
|
|
8
8
|
} | undefined], {
|
|
@@ -39,6 +39,7 @@ exports.initialState = {
|
|
|
39
39
|
discountStatusOptions: [],
|
|
40
40
|
dunningCaseStatusOptions: [],
|
|
41
41
|
invoiceStatusOptions: [],
|
|
42
|
+
subscriptionCancelReasonCodeOptions: [],
|
|
42
43
|
subscriptionStatusOptions: [],
|
|
43
44
|
transactionStatusOptions: [],
|
|
44
45
|
transactionTypeOptions: [],
|
|
@@ -108,6 +109,7 @@ function mapInvoicingConfigPayloadToState(payload) {
|
|
|
108
109
|
discountStatusOptions: (payload.discount_status_options ?? []).map(invoicingCommonPayload_1.toInvoicingNamedOption),
|
|
109
110
|
dunningCaseStatusOptions: (payload.dunning_case_status_options ?? []).map(invoicingCommonPayload_1.toInvoicingNamedOption),
|
|
110
111
|
invoiceStatusOptions: (payload.invoice_status_options ?? []).map(invoicingCommonPayload_1.toInvoicingNamedOption),
|
|
112
|
+
subscriptionCancelReasonCodeOptions: (payload.subscription_cancel_reason_code_options ?? []).map(invoicingCommonPayload_1.toInvoicingNamedOption),
|
|
111
113
|
subscriptionStatusOptions: (payload.subscription_status_options ?? []).map(invoicingCommonPayload_1.toInvoicingNamedOption),
|
|
112
114
|
transactionStatusOptions: (payload.transaction_status_options ?? []).map(invoicingCommonPayload_1.toInvoicingNamedOption),
|
|
113
115
|
transactionTypeOptions: (payload.transaction_type_options ?? []).map(invoicingCommonPayload_1.toInvoicingNamedOption),
|
|
@@ -38,6 +38,7 @@ export interface InvoicingConfigViewState extends FetchedState {
|
|
|
38
38
|
qboAccountMappingKindOptions: InvoicingQboAccountMappingKindOption[];
|
|
39
39
|
qboCustomerMatchingOptions: InvoicingNamedOption[];
|
|
40
40
|
qboSyncStatusOptions: InvoicingNamedOption[];
|
|
41
|
+
subscriptionCancelReasonCodeOptions: InvoicingNamedOption[];
|
|
41
42
|
subscriptionCancelTimingOptions: InvoicingNamedOption[];
|
|
42
43
|
subscriptionChangeOptionOptions: InvoicingNamedOption[];
|
|
43
44
|
subscriptionCommercialEditAllowedFromStatuses: string[];
|
|
@@ -44,7 +44,6 @@ const mapInvoicingPlanRevenuePointPayloadToState = (payload) => ({
|
|
|
44
44
|
mrr: (0, amount_1.toAmount)(payload.mrr, 'USD', '$'),
|
|
45
45
|
pct: payload.pct,
|
|
46
46
|
planID: payload.plan,
|
|
47
|
-
productCode: payload.product_code,
|
|
48
47
|
});
|
|
49
48
|
exports.mapInvoicingPlanRevenuePointPayloadToState = mapInvoicingPlanRevenuePointPayloadToState;
|
|
50
49
|
const mapInvoicingDashboardSummaryPayloadToState = (payload) => ({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FetchStateAndError, ID } from '../../../commonStateTypes/common';
|
|
2
2
|
import { SelectorView } from '../../../commonStateTypes/viewAndReport/viewAndReport';
|
|
3
|
-
import type { InvoicingFieldHelpByCode } from '../../../entity/invoicing/invoicingCommonPayload';
|
|
3
|
+
import type { InvoicingFieldHelpByCode, InvoicingNamedOption } from '../../../entity/invoicing/invoicingCommonPayload';
|
|
4
4
|
import { InvoicingSubscription } from '../../../entity/invoicing/invoicingSubscription/invoicingSubscriptionState';
|
|
5
5
|
import { RootState } from '../../../rootStateTypes';
|
|
6
6
|
/**
|
|
@@ -10,6 +10,8 @@ import { RootState } from '../../../rootStateTypes';
|
|
|
10
10
|
*/
|
|
11
11
|
export interface InvoicingSubscriptionDetailView extends SelectorView {
|
|
12
12
|
actionState: FetchStateAndError;
|
|
13
|
+
/** Cancel reasons from `/1.0/config`, so the dialog hardcodes nothing. */
|
|
14
|
+
cancelReasonCodeOptions: InvoicingNamedOption[];
|
|
13
15
|
/**
|
|
14
16
|
* Backend help copy for this screen's field group, keyed by field code.
|
|
15
17
|
* Folded in here so the screen never reaches for the config view itself.
|
|
@@ -10,6 +10,7 @@ const getInvoicingSubscriptionDetail = (state, invoicingSubscriptionID) => {
|
|
|
10
10
|
const { error, fetchState } = state.invoicingSubscriptionDetailViewState;
|
|
11
11
|
return {
|
|
12
12
|
fieldHelp: (0, invoicingConfigViewSelector_1.invoicingFieldHelpForGroup)(state, 'subscription'),
|
|
13
|
+
cancelReasonCodeOptions: (0, invoicingConfigViewSelector_1.getInvoicingConfigView)(state).subscriptionCancelReasonCodeOptions,
|
|
13
14
|
actionState: (0, subscriptionActionSelector_1.getInvoicingSubscriptionActionState)(invoicingSubscriptionID)(state),
|
|
14
15
|
subscription: (0, exports.getInvoicingSubscriptionById)(state, invoicingSubscriptionID),
|
|
15
16
|
fetchState,
|
package/lib/view/invoicing/invoicingSubscriptionListView/invoicingSubscriptionListViewSelector.d.ts
CHANGED
|
@@ -7,6 +7,8 @@ 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[];
|
|
10
12
|
columns: InvoicingSubscriptionColumnConfig[];
|
|
11
13
|
count: InvoicingListCounts;
|
|
12
14
|
countsFetchState: FetchStateAndError;
|
package/lib/view/invoicing/invoicingSubscriptionListView/invoicingSubscriptionListViewSelector.js
CHANGED
|
@@ -31,6 +31,7 @@ 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,
|
|
34
35
|
subscriptionLifecycleActionOptions: configState.subscriptionLifecycleActionOptions,
|
|
35
36
|
subscriptionMetadataEditAllowedFromStatuses: configState.subscriptionMetadataEditAllowedFromStatuses,
|
|
36
37
|
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", "
|
|
11
|
-
export declare const toInvoicingSubscriptionSortKey: (v: string) => "status" | "customer" | "subscription" | "plan" | "
|
|
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";
|
|
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,7 +6,6 @@ exports.ALL_INVOICING_SUBSCRIPTION_SORT_KEYS = [
|
|
|
6
6
|
'subscription',
|
|
7
7
|
'customer',
|
|
8
8
|
'plan',
|
|
9
|
-
'product_code',
|
|
10
9
|
'term_end',
|
|
11
10
|
'next_billing',
|
|
12
11
|
'auto_collect',
|
|
@@ -19,7 +18,6 @@ exports.INVOICING_SUBSCRIPTION_COLUMNS = [
|
|
|
19
18
|
{ key: 'subscription', sortable: true },
|
|
20
19
|
{ key: 'customer', sortable: false },
|
|
21
20
|
{ key: 'plan', sortable: true },
|
|
22
|
-
{ key: 'product_code', sortable: true },
|
|
23
21
|
{ key: 'term_end', sortable: true },
|
|
24
22
|
{ key: 'next_billing', sortable: true },
|
|
25
23
|
{ key: 'auto_collect', sortable: true },
|
|
@@ -10,6 +10,7 @@ exports.initialInvoicingBrandingFormLocalData = {
|
|
|
10
10
|
dateFormat: '',
|
|
11
11
|
defaultMemo: '',
|
|
12
12
|
email: '',
|
|
13
|
+
invoiceFooterText: '',
|
|
13
14
|
invoicePrefix: '',
|
|
14
15
|
logoFileId: '',
|
|
15
16
|
phone: '',
|
|
@@ -22,6 +23,7 @@ const entityToInvoicingBrandingFormLocalData = (settings) => ({
|
|
|
22
23
|
dateFormat: settings?.date_format ?? '',
|
|
23
24
|
defaultMemo: settings?.default_memo ?? '',
|
|
24
25
|
email: settings?.email ?? '',
|
|
26
|
+
invoiceFooterText: settings?.invoice_footer_text ?? '',
|
|
25
27
|
invoicePrefix: settings?.invoice_prefix ?? '',
|
|
26
28
|
logoFileId: settings?.logo_file_id ?? '',
|
|
27
29
|
phone: settings?.phone ?? '',
|
|
@@ -43,6 +45,9 @@ const brandingLocalDataToSettingsPayload = (localData, address) => ({
|
|
|
43
45
|
date_format: trimOrUndefined(localData.dateFormat),
|
|
44
46
|
default_memo: trimOrUndefined(localData.defaultMemo),
|
|
45
47
|
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(),
|
|
46
51
|
invoice_prefix: trimOrUndefined(localData.invoicePrefix),
|
|
47
52
|
logo_file_id: localData.logoFileId,
|
|
48
53
|
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, InvoicingNamedOption, InvoicingQboAccountMappingKindOption, InvoicingSettingsPayload } from '../../../entity/invoicing/invoicingCommonPayload';
|
|
3
|
+
import { InvoicingDunningActionOption, InvoicingFieldHelpByCode, 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,6 +20,7 @@ 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;
|
|
23
24
|
saveState: FetchStateAndError;
|
|
24
25
|
stripeConnectState: FetchStateAndError;
|
|
25
26
|
error?: ZeniAPIStatus;
|
|
@@ -56,6 +57,7 @@ export interface InvoicingSettingsHubView {
|
|
|
56
57
|
*/
|
|
57
58
|
configFetchState: FetchState;
|
|
58
59
|
dunningScheduleActionOptions: InvoicingDunningActionOption[];
|
|
60
|
+
fieldHelp: InvoicingFieldHelpByCode;
|
|
59
61
|
isEnablingInvoicing: boolean;
|
|
60
62
|
/**
|
|
61
63
|
* Whether the tenant has already enabled invoicing. The enable footer is for
|
|
@@ -95,6 +97,7 @@ export interface InvoicingQboSettingsFormView {
|
|
|
95
97
|
/** So the screen can fetch only what is missing, without reading the slices. */
|
|
96
98
|
configFetchState: FetchState;
|
|
97
99
|
customerMatchingOptions: InvoicingNamedOption[];
|
|
100
|
+
fieldHelp: InvoicingFieldHelpByCode;
|
|
98
101
|
isLoading: boolean;
|
|
99
102
|
/** The persisted sync toggle — the backfill guard checks that, not the draft. */
|
|
100
103
|
isSyncEnabledSaved: boolean;
|
|
@@ -120,6 +123,7 @@ export interface InvoicingQboSettingsFormView {
|
|
|
120
123
|
export declare const getInvoicingQboSettingsFormView: (state: RootState) => InvoicingQboSettingsFormView;
|
|
121
124
|
export interface InvoicingBrandingFormView {
|
|
122
125
|
dateFormatOptions: InvoicingNamedOption[];
|
|
126
|
+
fieldHelp: InvoicingFieldHelpByCode;
|
|
123
127
|
localData: InvoicingBrandingFormLocalData;
|
|
124
128
|
saveState: FetchStateAndError;
|
|
125
129
|
addressLabel?: string;
|
|
@@ -32,6 +32,7 @@ exports.getInvoicingSettingsFetchState = getInvoicingSettingsFetchState;
|
|
|
32
32
|
const getInvoicingSettingsView = (state) => {
|
|
33
33
|
const { error, fetchState, saveFetchState, settings, stripeFetchState } = state.invoicingSettingsViewState;
|
|
34
34
|
return {
|
|
35
|
+
fieldHelp: (0, invoicingConfigViewSelector_1.invoicingFieldHelpForGroup)(state, 'settings'),
|
|
35
36
|
error,
|
|
36
37
|
fetchState,
|
|
37
38
|
saveState: saveFetchState,
|
|
@@ -85,6 +86,7 @@ const getInvoicingSettingsHubView = (state) => {
|
|
|
85
86
|
const { dunningScheduleActionOptions, enableState, error: configError, fetchState: configFetchState, qboAccountMappingKindOptions, qboCustomerMatchingOptions, qboSyncStatusOptions, status, } = (0, invoicingConfigViewSelector_1.getInvoicingConfigView)(state);
|
|
86
87
|
const { canEnable, isQboConfigured, isStripeConnected } = deriveInvoicingEnablePrerequisites(state.invoicingSettingsViewState.settings, state.invoicingQboViewState.connection?.connected === true, qboAccountMappingKindOptions);
|
|
87
88
|
return {
|
|
89
|
+
fieldHelp: (0, invoicingConfigViewSelector_1.invoicingFieldHelpForGroup)(state, 'settings'),
|
|
88
90
|
// Keeps the onboarding step in the gate: a tenant that has not accepted the
|
|
89
91
|
// terms cannot enable invoicing, whatever the integrations say.
|
|
90
92
|
canEnableInvoicing: status === 'settings' && canEnable,
|
|
@@ -116,6 +118,7 @@ const getInvoicingQboSettingsFormView = (state) => {
|
|
|
116
118
|
const { fetchState: configFetchState, qboAccountMappingKindOptions, qboCustomerMatchingOptions, qboSyncStatusOptions, } = (0, invoicingConfigViewSelector_1.getInvoicingConfigView)(state);
|
|
117
119
|
const qboView = (0, invoicingQboViewSelector_1.getInvoicingQboView)(state);
|
|
118
120
|
return {
|
|
121
|
+
fieldHelp: (0, invoicingConfigViewSelector_1.invoicingFieldHelpForGroup)(state, 'settings'),
|
|
119
122
|
accountMappingKindOptions: qboAccountMappingKindOptions,
|
|
120
123
|
accounts: qboView.accounts,
|
|
121
124
|
backfillState: qboView.backfillState,
|
|
@@ -156,6 +159,7 @@ const getInvoicingBrandingFormView = (state) => {
|
|
|
156
159
|
? (0, addressViewSelector_1.getFormattedAddress)(newAddress.addressToCreate)
|
|
157
160
|
: undefined;
|
|
158
161
|
return {
|
|
162
|
+
fieldHelp: (0, invoicingConfigViewSelector_1.invoicingFieldHelpForGroup)(state, 'settings'),
|
|
159
163
|
addressLabel,
|
|
160
164
|
dateFormatOptions: (0, invoicingConfigViewSelector_1.getInvoicingConfigView)(state).dateFormatOptions,
|
|
161
165
|
localData: brandingDraft ?? (0, invoicingBrandingFormConfig_1.entityToInvoicingBrandingFormLocalData)(settings),
|
|
@@ -18,6 +18,14 @@ 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
|
+
};
|
|
21
29
|
export type CancelSubscriptionBody = {
|
|
22
30
|
cancel_reason?: string;
|
|
23
31
|
cancel_reason_code?: string;
|
|
@@ -12,4 +12,38 @@ 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
|
+
}
|
|
15
49
|
export {};
|
|
@@ -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>;
|