@zeniai/client-epic-state 5.1.85 → 5.1.86
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/customerSatisfaction/customerSatisfactionReducer.d.ts +1 -1
- package/lib/entity/customerSatisfaction/customerSatisfactionReducer.js +2 -6
- package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.js +0 -29
- package/lib/esm/entity/customerSatisfaction/customerSatisfactionReducer.js +1 -4
- package/lib/esm/entity/snackbar/snackbarTypes.js +0 -29
- package/lib/esm/index.js +1 -1
- package/lib/esm/view/companyHealthMetricView/companyHealthMetricConfigReducer.js +1 -4
- package/lib/esm/view/invoicing/createCreditNote/createCreditNoteEpic.js +4 -24
- package/lib/esm/view/invoicing/createInvoice/createInvoiceEpic.js +4 -24
- package/lib/esm/view/invoicing/createInvoice/createInvoiceSelector.js +10 -37
- package/lib/esm/view/invoicing/discountAction/discountActionEpic.js +9 -33
- package/lib/esm/view/invoicing/dunningAction/dunningActionEpic.js +9 -35
- package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/catalogDetailEditPayload.js +1 -5
- package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/saveInvoicingCatalogItemEpic.js +5 -32
- package/lib/esm/view/invoicing/editInvoicingCouponDetailView/saveInvoicingCouponEpic.js +3 -23
- package/lib/esm/view/invoicing/editInvoicingCustomerDetailView/saveInvoicingCustomerEpic.js +4 -24
- package/lib/esm/view/invoicing/editInvoicingSubscriptionDetailView/saveInvoicingSubscriptionEpic.js +4 -24
- package/lib/esm/view/invoicing/editInvoicingSubscriptionDetailView/syncInvoicingSubscriptionCouponsEpic.js +3 -20
- package/lib/esm/view/invoicing/invoiceAction/invoiceActionEpic.js +17 -60
- package/lib/esm/view/invoicing/invoicingConfigView/invoicingConfigViewReducer.js +0 -30
- package/lib/esm/view/invoicing/invoicingConfigView/invoicingConfigViewSelector.js +29 -4
- package/lib/esm/view/invoicing/invoicingQboView/epics/retryInvoicingQboSyncTaskEpic.js +10 -29
- package/lib/esm/view/invoicing/invoicingQboView/epics/startInvoicingQboBackfillEpic.js +5 -28
- package/lib/esm/view/invoicing/issueCreditNote/issueCreditNoteEpic.js +4 -24
- package/lib/esm/view/invoicing/issueCreditNote/issueCreditNoteSelector.js +14 -22
- package/lib/esm/view/invoicing/recordPayment/recordPaymentEpic.js +7 -46
- package/lib/esm/view/invoicing/settingsView/settingsViewEpics.js +8 -26
- package/lib/esm/view/invoicing/settingsView/settingsViewReducer.js +1 -1
- package/lib/esm/view/invoicing/settingsView/settingsViewSelector.js +1 -4
- package/lib/esm/view/invoicing/subscriptionAction/subscriptionActionEpic.js +9 -41
- package/lib/esm/view/vendorFiling1099/vendorFiling1099UploadDetails/vendorFiling1099UploadDetailsReducer.js +1 -4
- package/lib/esm/view/vendorTabView/vendorTabViewReducer.js +1 -4
- package/lib/index.d.ts +3 -4
- package/lib/index.js +8 -7
- package/lib/view/companyHealthMetricView/companyHealthMetricConfigReducer.d.ts +1 -1
- package/lib/view/companyHealthMetricView/companyHealthMetricConfigReducer.js +2 -5
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
- package/lib/view/invoicing/createCreditNote/createCreditNoteEpic.d.ts +1 -2
- package/lib/view/invoicing/createCreditNote/createCreditNoteEpic.js +3 -23
- package/lib/view/invoicing/createInvoice/createInvoiceEpic.d.ts +1 -2
- package/lib/view/invoicing/createInvoice/createInvoiceEpic.js +3 -23
- package/lib/view/invoicing/createInvoice/createInvoiceSelector.d.ts +8 -22
- package/lib/view/invoicing/createInvoice/createInvoiceSelector.js +10 -37
- package/lib/view/invoicing/discountAction/discountActionEpic.d.ts +1 -2
- package/lib/view/invoicing/discountAction/discountActionEpic.js +8 -32
- package/lib/view/invoicing/dunningAction/dunningActionEpic.d.ts +1 -2
- package/lib/view/invoicing/dunningAction/dunningActionEpic.js +8 -34
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/catalogDetailEditPayload.d.ts +1 -3
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/catalogDetailEditPayload.js +1 -5
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/saveInvoicingCatalogItemEpic.d.ts +1 -2
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/saveInvoicingCatalogItemEpic.js +4 -31
- package/lib/view/invoicing/editInvoicingCouponDetailView/saveInvoicingCouponEpic.d.ts +1 -2
- package/lib/view/invoicing/editInvoicingCouponDetailView/saveInvoicingCouponEpic.js +2 -22
- package/lib/view/invoicing/editInvoicingCustomerDetailView/saveInvoicingCustomerEpic.d.ts +1 -2
- package/lib/view/invoicing/editInvoicingCustomerDetailView/saveInvoicingCustomerEpic.js +3 -23
- package/lib/view/invoicing/editInvoicingSubscriptionDetailView/saveInvoicingSubscriptionEpic.d.ts +1 -2
- package/lib/view/invoicing/editInvoicingSubscriptionDetailView/saveInvoicingSubscriptionEpic.js +3 -23
- package/lib/view/invoicing/editInvoicingSubscriptionDetailView/syncInvoicingSubscriptionCouponsEpic.d.ts +1 -2
- package/lib/view/invoicing/editInvoicingSubscriptionDetailView/syncInvoicingSubscriptionCouponsEpic.js +2 -19
- package/lib/view/invoicing/invoiceAction/invoiceActionEpic.d.ts +1 -2
- package/lib/view/invoicing/invoiceAction/invoiceActionEpic.js +16 -59
- package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewPayload.d.ts +0 -13
- package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewReducer.d.ts +1 -1
- package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewReducer.js +0 -30
- package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewSelector.d.ts +31 -11
- package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewSelector.js +29 -4
- package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewState.d.ts +0 -15
- package/lib/view/invoicing/invoicingQboView/epics/invoicingQboViewActionType.d.ts +1 -2
- package/lib/view/invoicing/invoicingQboView/epics/retryInvoicingQboSyncTaskEpic.js +9 -28
- package/lib/view/invoicing/invoicingQboView/epics/startInvoicingQboBackfillEpic.js +4 -27
- package/lib/view/invoicing/issueCreditNote/issueCreditNoteEpic.d.ts +1 -2
- package/lib/view/invoicing/issueCreditNote/issueCreditNoteEpic.js +3 -23
- package/lib/view/invoicing/issueCreditNote/issueCreditNoteSelector.d.ts +7 -24
- package/lib/view/invoicing/issueCreditNote/issueCreditNoteSelector.js +16 -23
- package/lib/view/invoicing/recordPayment/recordPaymentEpic.d.ts +1 -2
- package/lib/view/invoicing/recordPayment/recordPaymentEpic.js +6 -45
- package/lib/view/invoicing/settingsView/settingsViewEpics.d.ts +1 -2
- package/lib/view/invoicing/settingsView/settingsViewEpics.js +7 -25
- package/lib/view/invoicing/settingsView/settingsViewReducer.d.ts +1 -10
- package/lib/view/invoicing/settingsView/settingsViewReducer.js +1 -1
- package/lib/view/invoicing/settingsView/settingsViewSelector.d.ts +2 -4
- package/lib/view/invoicing/settingsView/settingsViewSelector.js +1 -4
- package/lib/view/invoicing/subscriptionAction/subscriptionActionEpic.d.ts +1 -2
- package/lib/view/invoicing/subscriptionAction/subscriptionActionEpic.js +8 -40
- package/lib/view/vendorFiling1099/vendorFiling1099UploadDetails/vendorFiling1099UploadDetailsReducer.d.ts +1 -1
- package/lib/view/vendorFiling1099/vendorFiling1099UploadDetails/vendorFiling1099UploadDetailsReducer.js +2 -5
- package/lib/view/vendorTabView/vendorTabViewReducer.d.ts +1 -1
- package/lib/view/vendorTabView/vendorTabViewReducer.js +2 -5
- package/package.json +1 -1
|
@@ -21,28 +21,15 @@ export interface InvoicingConfigPayload {
|
|
|
21
21
|
subscription_edit_field_options: InvoicingSubscriptionEditFieldOptionWire[];
|
|
22
22
|
subscription_lifecycle_action_options: InvoicingSubscriptionLifecycleActionOptionWire[];
|
|
23
23
|
subscription_metadata_edit_allowed_from_statuses: string[];
|
|
24
|
-
auto_collection_options?: InvoicingNamedOptionWire[];
|
|
25
|
-
billing_period_unit_options?: InvoicingNamedOptionWire[];
|
|
26
|
-
catalog_trial_end_action_options?: InvoicingNamedOptionWire[];
|
|
27
|
-
catalog_trial_unit_options?: InvoicingNamedOptionWire[];
|
|
28
24
|
created_at?: string | null;
|
|
29
|
-
customer_type_options?: InvoicingNamedOptionWire[];
|
|
30
|
-
date_format_options?: InvoicingNamedOptionWire[];
|
|
31
|
-
discount_apply_on_options?: InvoicingNamedOptionWire[];
|
|
32
|
-
discount_duration_type_options?: InvoicingNamedOptionWire[];
|
|
33
|
-
discount_type_options?: InvoicingNamedOptionWire[];
|
|
34
25
|
invoicing_tos_acceptance_ip?: string | null;
|
|
35
26
|
invoicing_tos_acceptance_time?: string | null;
|
|
36
27
|
invoicing_tos_acceptance_user_agent?: string | null;
|
|
37
28
|
invoicing_tos_acceptance_user_id?: string | null;
|
|
38
29
|
is_invoicing_settings_seeded?: boolean;
|
|
39
|
-
manual_payment_method_options?: InvoicingNamedOptionWire[];
|
|
40
|
-
net_term_day_options?: InvoicingNamedOptionWire[];
|
|
41
|
-
payment_gateway_options?: InvoicingNamedOptionWire[];
|
|
42
30
|
qbo_account_mapping_kind_options?: InvoicingQboAccountMappingKindOptionWire[];
|
|
43
31
|
qbo_customer_matching_options?: InvoicingNamedOptionWire[];
|
|
44
32
|
qbo_sync_status_options?: InvoicingNamedOptionWire[];
|
|
45
|
-
taxability_options?: InvoicingNamedOptionWire[];
|
|
46
33
|
updated_at?: string | null;
|
|
47
34
|
}
|
|
48
35
|
export type InvoicingConfigResponse = ZeniAPIResponse<InvoicingConfigPayload>;
|
|
@@ -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' | '
|
|
5
|
+
export declare function mapInvoicingConfigPayloadToState(payload: InvoicingConfigPayload): Pick<InvoicingConfigViewState, 'auditLogEntityRouteOptions' | 'auditLogListSortFieldOptions' | 'auditLogSourceLabels' | '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], {
|
|
@@ -13,20 +13,7 @@ exports.initialState = {
|
|
|
13
13
|
auditLogEntityRouteOptions: [],
|
|
14
14
|
auditLogListSortFieldOptions: [],
|
|
15
15
|
auditLogSourceLabels: [],
|
|
16
|
-
autoCollectionOptions: [],
|
|
17
|
-
billingPeriodUnitOptions: [],
|
|
18
|
-
catalogTrialEndActionOptions: [],
|
|
19
|
-
catalogTrialUnitOptions: [],
|
|
20
|
-
customerTypeOptions: [],
|
|
21
|
-
dateFormatOptions: [],
|
|
22
|
-
discountApplyOnOptions: [],
|
|
23
|
-
discountDurationTypeOptions: [],
|
|
24
|
-
discountTypeOptions: [],
|
|
25
16
|
dunningScheduleActionOptions: [],
|
|
26
|
-
manualPaymentMethodOptions: [],
|
|
27
|
-
netTermDayOptions: [],
|
|
28
|
-
paymentGatewayOptions: [],
|
|
29
|
-
taxabilityOptions: [],
|
|
30
17
|
enableFetchState: { fetchState: 'Not-Started', error: undefined },
|
|
31
18
|
subscriptionLifecycleActionOptions: [],
|
|
32
19
|
subscriptionCommercialEditAllowedFromStatuses: [],
|
|
@@ -47,8 +34,6 @@ exports.initialState = {
|
|
|
47
34
|
invoicingTosAcceptanceUserAgent: undefined,
|
|
48
35
|
invoicingTosAcceptanceUserId: undefined,
|
|
49
36
|
isInvoicingSettingsSeeded: undefined,
|
|
50
|
-
createdAt: undefined,
|
|
51
|
-
updatedAt: undefined,
|
|
52
37
|
hasValidState() {
|
|
53
38
|
return (this.fetchState === 'Completed' && this.isInvoicingTosAccepted != null);
|
|
54
39
|
},
|
|
@@ -64,21 +49,6 @@ function mapInvoicingConfigPayloadToState(payload) {
|
|
|
64
49
|
code: option.code,
|
|
65
50
|
name: option.name,
|
|
66
51
|
})),
|
|
67
|
-
autoCollectionOptions: (payload.auto_collection_options ?? []).map(invoicingCommonPayload_1.toInvoicingNamedOption),
|
|
68
|
-
billingPeriodUnitOptions: (payload.billing_period_unit_options ?? []).map(invoicingCommonPayload_1.toInvoicingNamedOption),
|
|
69
|
-
catalogTrialEndActionOptions: (payload.catalog_trial_end_action_options ?? []).map(invoicingCommonPayload_1.toInvoicingNamedOption),
|
|
70
|
-
catalogTrialUnitOptions: (payload.catalog_trial_unit_options ?? []).map(invoicingCommonPayload_1.toInvoicingNamedOption),
|
|
71
|
-
customerTypeOptions: (payload.customer_type_options ?? []).map(invoicingCommonPayload_1.toInvoicingNamedOption),
|
|
72
|
-
dateFormatOptions: (payload.date_format_options ?? []).map(invoicingCommonPayload_1.toInvoicingNamedOption),
|
|
73
|
-
discountApplyOnOptions: (payload.discount_apply_on_options ?? []).map(invoicingCommonPayload_1.toInvoicingNamedOption),
|
|
74
|
-
discountDurationTypeOptions: (payload.discount_duration_type_options ?? []).map(invoicingCommonPayload_1.toInvoicingNamedOption),
|
|
75
|
-
discountTypeOptions: (payload.discount_type_options ?? []).map(invoicingCommonPayload_1.toInvoicingNamedOption),
|
|
76
|
-
manualPaymentMethodOptions: (payload.manual_payment_method_options ?? []).map(invoicingCommonPayload_1.toInvoicingNamedOption),
|
|
77
|
-
netTermDayOptions: (payload.net_term_day_options ?? []).map(invoicingCommonPayload_1.toInvoicingNamedOption),
|
|
78
|
-
paymentGatewayOptions: (payload.payment_gateway_options ?? []).map(invoicingCommonPayload_1.toInvoicingNamedOption),
|
|
79
|
-
taxabilityOptions: (payload.taxability_options ?? []).map(invoicingCommonPayload_1.toInvoicingNamedOption),
|
|
80
|
-
createdAt: payload.created_at ?? undefined,
|
|
81
|
-
updatedAt: payload.updated_at ?? undefined,
|
|
82
52
|
dunningScheduleActionOptions: payload.dunning_schedule_action_options.map((option) => ({
|
|
83
53
|
code: (0, invoicingCommonPayload_1.toInvoicingDunningAction)(option.code),
|
|
84
54
|
name: option.name,
|
|
@@ -1,18 +1,38 @@
|
|
|
1
|
-
import { FetchStateAndError } from '../../../commonStateTypes/common';
|
|
1
|
+
import { FetchState, FetchStateAndError } from '../../../commonStateTypes/common';
|
|
2
|
+
import { InvoicingDunningActionOption } from '../../../entity/invoicing/invoicingCommonPayload';
|
|
3
|
+
import type { AuditLogEntityRouteOption, AuditLogListSortFieldOption, AuditLogSourceLabelOption, InvoicingCatalogItemLifecycleAction, InvoicingCatalogLifecycleActionOption, InvoicingCatalogProductLifecycleAction, InvoicingDiscountLifecycleActionOption, InvoicingNamedOption, InvoicingQboAccountMappingKindOption, InvoicingSubscriptionEditFieldOption, InvoicingSubscriptionLifecycleActionOption } from '../../../entity/invoicing/invoicingCommonPayload';
|
|
2
4
|
import { RootState } from '../../../reducer';
|
|
5
|
+
import { ZeniAPIStatus } from '../../../responsePayload';
|
|
3
6
|
import { InvoicingOnboardingStatus } from './invoicingConfigViewPayload';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* The whole config state plus what only the view layer needs: the derived
|
|
7
|
-
* onboarding `status` and the shorter names consumers use for the two action
|
|
8
|
-
* fetch states. Extending the state means every field the config API grows
|
|
9
|
-
* reaches consumers without touching this selector; the two internal
|
|
10
|
-
* `*FetchState` fields and the state's own validity predicate are omitted so
|
|
11
|
-
* each piece of data has exactly one public name.
|
|
12
|
-
*/
|
|
13
|
-
export interface InvoicingConfigView extends Omit<InvoicingConfigViewState, 'acceptTermsFetchState' | 'enableFetchState' | 'hasValidState'> {
|
|
7
|
+
export interface InvoicingConfigView {
|
|
14
8
|
acceptTermsState: FetchStateAndError;
|
|
9
|
+
auditLogEntityRouteOptions: AuditLogEntityRouteOption[];
|
|
10
|
+
auditLogListSortFieldOptions: AuditLogListSortFieldOption[];
|
|
11
|
+
auditLogSourceLabels: AuditLogSourceLabelOption[];
|
|
12
|
+
catalogItemLifecycleActionOptions: InvoicingCatalogLifecycleActionOption<InvoicingCatalogItemLifecycleAction>[];
|
|
13
|
+
catalogProductLifecycleActionOptions: InvoicingCatalogLifecycleActionOption<InvoicingCatalogProductLifecycleAction>[];
|
|
14
|
+
discountLifecycleActionOptions: InvoicingDiscountLifecycleActionOption[];
|
|
15
|
+
dunningScheduleActionOptions: InvoicingDunningActionOption[];
|
|
15
16
|
enableState: FetchStateAndError;
|
|
17
|
+
fetchState: FetchState;
|
|
18
|
+
qboAccountMappingKindOptions: InvoicingQboAccountMappingKindOption[];
|
|
19
|
+
qboCustomerMatchingOptions: InvoicingNamedOption[];
|
|
20
|
+
qboSyncStatusOptions: InvoicingNamedOption[];
|
|
21
|
+
subscriptionCancelTimingOptions: InvoicingNamedOption[];
|
|
22
|
+
subscriptionChangeOptionOptions: InvoicingNamedOption[];
|
|
23
|
+
subscriptionCommercialEditAllowedFromStatuses: string[];
|
|
24
|
+
subscriptionEditFieldOptions: InvoicingSubscriptionEditFieldOption[];
|
|
25
|
+
subscriptionLifecycleActionOptions: InvoicingSubscriptionLifecycleActionOption[];
|
|
26
|
+
subscriptionMetadataEditAllowedFromStatuses: string[];
|
|
27
|
+
error?: ZeniAPIStatus;
|
|
28
|
+
isInvoicingEnabled?: boolean;
|
|
29
|
+
isInvoicingTosAccepted?: boolean;
|
|
16
30
|
status?: InvoicingOnboardingStatus;
|
|
17
31
|
}
|
|
32
|
+
/**
|
|
33
|
+
* Single bundled view for the invoicing config — consumers read only this.
|
|
34
|
+
* Carries the config flags, the derived onboarding `status` used for route
|
|
35
|
+
* gating, the config fetch (`fetchState`/`error`), and the accept-terms /
|
|
36
|
+
* enable action fetch states.
|
|
37
|
+
*/
|
|
18
38
|
export declare const getInvoicingConfigView: (state: RootState) => InvoicingConfigView;
|
|
@@ -2,12 +2,37 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getInvoicingConfigView = void 0;
|
|
4
4
|
const invoicingConfigViewPayload_1 = require("./invoicingConfigViewPayload");
|
|
5
|
+
/**
|
|
6
|
+
* Single bundled view for the invoicing config — consumers read only this.
|
|
7
|
+
* Carries the config flags, the derived onboarding `status` used for route
|
|
8
|
+
* gating, the config fetch (`fetchState`/`error`), and the accept-terms /
|
|
9
|
+
* enable action fetch states.
|
|
10
|
+
*/
|
|
5
11
|
const getInvoicingConfigView = (state) => {
|
|
6
|
-
const
|
|
12
|
+
const configState = state.invoicingConfigViewState;
|
|
7
13
|
return {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
14
|
+
acceptTermsState: configState.acceptTermsFetchState,
|
|
15
|
+
auditLogEntityRouteOptions: configState.auditLogEntityRouteOptions,
|
|
16
|
+
auditLogListSortFieldOptions: configState.auditLogListSortFieldOptions,
|
|
17
|
+
auditLogSourceLabels: configState.auditLogSourceLabels,
|
|
18
|
+
dunningScheduleActionOptions: configState.dunningScheduleActionOptions,
|
|
19
|
+
enableState: configState.enableFetchState,
|
|
20
|
+
subscriptionLifecycleActionOptions: configState.subscriptionLifecycleActionOptions,
|
|
21
|
+
subscriptionCommercialEditAllowedFromStatuses: configState.subscriptionCommercialEditAllowedFromStatuses,
|
|
22
|
+
subscriptionMetadataEditAllowedFromStatuses: configState.subscriptionMetadataEditAllowedFromStatuses,
|
|
23
|
+
subscriptionEditFieldOptions: configState.subscriptionEditFieldOptions,
|
|
24
|
+
subscriptionCancelTimingOptions: configState.subscriptionCancelTimingOptions,
|
|
25
|
+
subscriptionChangeOptionOptions: configState.subscriptionChangeOptionOptions,
|
|
26
|
+
catalogItemLifecycleActionOptions: configState.catalogItemLifecycleActionOptions,
|
|
27
|
+
catalogProductLifecycleActionOptions: configState.catalogProductLifecycleActionOptions,
|
|
28
|
+
discountLifecycleActionOptions: configState.discountLifecycleActionOptions,
|
|
29
|
+
qboAccountMappingKindOptions: configState.qboAccountMappingKindOptions,
|
|
30
|
+
qboCustomerMatchingOptions: configState.qboCustomerMatchingOptions,
|
|
31
|
+
qboSyncStatusOptions: configState.qboSyncStatusOptions,
|
|
32
|
+
error: configState.error,
|
|
33
|
+
fetchState: configState.fetchState,
|
|
34
|
+
isInvoicingEnabled: configState.isInvoicingEnabled,
|
|
35
|
+
isInvoicingTosAccepted: configState.isInvoicingTosAccepted,
|
|
11
36
|
status: (0, invoicingConfigViewPayload_1.deriveInvoicingOnboardingStatus)(configState.isInvoicingTosAccepted, configState.isInvoicingEnabled),
|
|
12
37
|
};
|
|
13
38
|
};
|
|
@@ -6,23 +6,11 @@ export interface InvoicingConfigViewState extends FetchedState {
|
|
|
6
6
|
auditLogEntityRouteOptions: AuditLogEntityRouteOption[];
|
|
7
7
|
auditLogListSortFieldOptions: AuditLogListSortFieldOption[];
|
|
8
8
|
auditLogSourceLabels: AuditLogSourceLabelOption[];
|
|
9
|
-
autoCollectionOptions: InvoicingNamedOption[];
|
|
10
|
-
billingPeriodUnitOptions: InvoicingNamedOption[];
|
|
11
9
|
catalogItemLifecycleActionOptions: InvoicingCatalogLifecycleActionOption<InvoicingCatalogItemLifecycleAction>[];
|
|
12
10
|
catalogProductLifecycleActionOptions: InvoicingCatalogLifecycleActionOption<InvoicingCatalogProductLifecycleAction>[];
|
|
13
|
-
catalogTrialEndActionOptions: InvoicingNamedOption[];
|
|
14
|
-
catalogTrialUnitOptions: InvoicingNamedOption[];
|
|
15
|
-
customerTypeOptions: InvoicingNamedOption[];
|
|
16
|
-
dateFormatOptions: InvoicingNamedOption[];
|
|
17
|
-
discountApplyOnOptions: InvoicingNamedOption[];
|
|
18
|
-
discountDurationTypeOptions: InvoicingNamedOption[];
|
|
19
11
|
discountLifecycleActionOptions: InvoicingDiscountLifecycleActionOption[];
|
|
20
|
-
discountTypeOptions: InvoicingNamedOption[];
|
|
21
12
|
dunningScheduleActionOptions: InvoicingDunningActionOption[];
|
|
22
13
|
enableFetchState: FetchStateAndError;
|
|
23
|
-
manualPaymentMethodOptions: InvoicingNamedOption[];
|
|
24
|
-
netTermDayOptions: InvoicingNamedOption[];
|
|
25
|
-
paymentGatewayOptions: InvoicingNamedOption[];
|
|
26
14
|
qboAccountMappingKindOptions: InvoicingQboAccountMappingKindOption[];
|
|
27
15
|
qboCustomerMatchingOptions: InvoicingNamedOption[];
|
|
28
16
|
qboSyncStatusOptions: InvoicingNamedOption[];
|
|
@@ -32,8 +20,6 @@ export interface InvoicingConfigViewState extends FetchedState {
|
|
|
32
20
|
subscriptionEditFieldOptions: InvoicingSubscriptionEditFieldOption[];
|
|
33
21
|
subscriptionLifecycleActionOptions: InvoicingSubscriptionLifecycleActionOption[];
|
|
34
22
|
subscriptionMetadataEditAllowedFromStatuses: string[];
|
|
35
|
-
taxabilityOptions: InvoicingNamedOption[];
|
|
36
|
-
createdAt?: string;
|
|
37
23
|
invoicingTosAcceptanceIp?: string;
|
|
38
24
|
invoicingTosAcceptanceTime?: string;
|
|
39
25
|
invoicingTosAcceptanceUserAgent?: string;
|
|
@@ -42,5 +28,4 @@ export interface InvoicingConfigViewState extends FetchedState {
|
|
|
42
28
|
isInvoicingEnabled?: boolean;
|
|
43
29
|
isInvoicingSettingsSeeded?: boolean;
|
|
44
30
|
isInvoicingTosAccepted?: boolean;
|
|
45
|
-
updatedAt?: string;
|
|
46
31
|
}
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import { openSnackbar } from '../../../../entity/snackbar/snackbarReducer';
|
|
2
1
|
import { fetchInvoicingQboAccounts, fetchInvoicingQboClasses, fetchInvoicingQboConnection, fetchInvoicingQboSyncHealth, retryInvoicingQboSyncTask, retryInvoicingQboSyncTaskFailure, retryInvoicingQboSyncTaskSuccess, startInvoicingQboBackfill, startInvoicingQboBackfillFailure, startInvoicingQboBackfillSuccess, updateInvoicingQboAccounts, updateInvoicingQboAccountsFailure, updateInvoicingQboClasses, updateInvoicingQboClassesFailure, updateInvoicingQboConnection, updateInvoicingQboConnectionFailure, updateInvoicingQboSyncHealth, updateInvoicingQboSyncHealthFailure } from '../invoicingQboViewReducer';
|
|
3
|
-
export type InvoicingQboViewActionType = ReturnType<typeof
|
|
2
|
+
export type InvoicingQboViewActionType = ReturnType<typeof fetchInvoicingQboConnection> | ReturnType<typeof updateInvoicingQboConnection> | ReturnType<typeof updateInvoicingQboConnectionFailure> | ReturnType<typeof fetchInvoicingQboAccounts> | ReturnType<typeof updateInvoicingQboAccounts> | ReturnType<typeof updateInvoicingQboAccountsFailure> | ReturnType<typeof fetchInvoicingQboClasses> | ReturnType<typeof updateInvoicingQboClasses> | ReturnType<typeof updateInvoicingQboClassesFailure> | ReturnType<typeof fetchInvoicingQboSyncHealth> | ReturnType<typeof updateInvoicingQboSyncHealth> | ReturnType<typeof updateInvoicingQboSyncHealthFailure> | ReturnType<typeof retryInvoicingQboSyncTask> | ReturnType<typeof retryInvoicingQboSyncTaskSuccess> | ReturnType<typeof retryInvoicingQboSyncTaskFailure> | ReturnType<typeof startInvoicingQboBackfill> | ReturnType<typeof startInvoicingQboBackfillSuccess> | ReturnType<typeof startInvoicingQboBackfillFailure>;
|
|
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.retryInvoicingQboSyncTaskEpic = void 0;
|
|
4
4
|
const rxjs_1 = require("rxjs");
|
|
5
5
|
const operators_1 = require("rxjs/operators");
|
|
6
|
-
const snackbarReducer_1 = require("../../../../entity/snackbar/snackbarReducer");
|
|
7
6
|
const responsePayload_1 = require("../../../../responsePayload");
|
|
8
7
|
const invoicingQboViewReducer_1 = require("../invoicingQboViewReducer");
|
|
9
8
|
const retryInvoicingQboSyncTaskEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(invoicingQboViewReducer_1.retryInvoicingQboSyncTask.match), (0, operators_1.mergeMap)((action) => {
|
|
@@ -16,34 +15,16 @@ const retryInvoicingQboSyncTaskEpic = (actions$, _state$, zeniAPI) => actions$.p
|
|
|
16
15
|
return (0, rxjs_1.of)((0, invoicingQboViewReducer_1.retryInvoicingQboSyncTaskSuccess)({
|
|
17
16
|
status: response.data?.status ?? '',
|
|
18
17
|
taskId: response.data?.task_id ?? taskId,
|
|
19
|
-
}), (0, invoicingQboViewReducer_1.fetchInvoicingQboSyncHealth)()
|
|
20
|
-
messageSection: 'invoicing_qbo_sync_health_retry',
|
|
21
|
-
messageText: 'success',
|
|
22
|
-
type: 'success',
|
|
23
|
-
}));
|
|
18
|
+
}), (0, invoicingQboViewReducer_1.fetchInvoicingQboSyncHealth)());
|
|
24
19
|
}
|
|
25
|
-
return (0, rxjs_1.
|
|
26
|
-
|
|
27
|
-
status: response.status,
|
|
28
|
-
taskId,
|
|
29
|
-
}),
|
|
30
|
-
(0, snackbarReducer_1.openSnackbar)({
|
|
31
|
-
messageSection: 'invoicing_qbo_sync_health_retry',
|
|
32
|
-
messageText: 'failed',
|
|
33
|
-
type: 'error',
|
|
34
|
-
}),
|
|
35
|
-
]);
|
|
36
|
-
}), (0, operators_1.catchError)((error) => (0, rxjs_1.from)([
|
|
37
|
-
(0, invoicingQboViewReducer_1.retryInvoicingQboSyncTaskFailure)({
|
|
38
|
-
status: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Retry QBO sync task REST API call errored out ' +
|
|
39
|
-
JSON.stringify(error)),
|
|
20
|
+
return (0, rxjs_1.of)((0, invoicingQboViewReducer_1.retryInvoicingQboSyncTaskFailure)({
|
|
21
|
+
status: response.status,
|
|
40
22
|
taskId,
|
|
41
|
-
})
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
])));
|
|
23
|
+
}));
|
|
24
|
+
}), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, invoicingQboViewReducer_1.retryInvoicingQboSyncTaskFailure)({
|
|
25
|
+
status: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Retry QBO sync task REST API call errored out ' +
|
|
26
|
+
JSON.stringify(error)),
|
|
27
|
+
taskId,
|
|
28
|
+
}))));
|
|
48
29
|
}));
|
|
49
30
|
exports.retryInvoicingQboSyncTaskEpic = retryInvoicingQboSyncTaskEpic;
|
|
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.startInvoicingQboBackfillEpic = void 0;
|
|
4
4
|
const rxjs_1 = require("rxjs");
|
|
5
5
|
const operators_1 = require("rxjs/operators");
|
|
6
|
-
const snackbarReducer_1 = require("../../../../entity/snackbar/snackbarReducer");
|
|
7
6
|
const responsePayload_1 = require("../../../../responsePayload");
|
|
8
7
|
const invoicingQboViewReducer_1 = require("../invoicingQboViewReducer");
|
|
9
8
|
const startInvoicingQboBackfillEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(invoicingQboViewReducer_1.startInvoicingQboBackfill.match), (0, operators_1.switchMap)((action) => {
|
|
@@ -14,32 +13,10 @@ const startInvoicingQboBackfillEpic = (actions$, _state$, zeniAPI) => actions$.p
|
|
|
14
13
|
})
|
|
15
14
|
.pipe((0, operators_1.mergeMap)((response) => {
|
|
16
15
|
if ((0, responsePayload_1.isSuccessResponse)(response)) {
|
|
17
|
-
return (0, rxjs_1.
|
|
18
|
-
(0, invoicingQboViewReducer_1.startInvoicingQboBackfillSuccess)(),
|
|
19
|
-
(0, invoicingQboViewReducer_1.fetchInvoicingQboSyncHealth)(),
|
|
20
|
-
(0, snackbarReducer_1.openSnackbar)({
|
|
21
|
-
messageSection: 'invoicing_qbo_backfill',
|
|
22
|
-
messageText: 'success',
|
|
23
|
-
type: 'success',
|
|
24
|
-
}),
|
|
25
|
-
]);
|
|
16
|
+
return (0, rxjs_1.of)((0, invoicingQboViewReducer_1.startInvoicingQboBackfillSuccess)(), (0, invoicingQboViewReducer_1.fetchInvoicingQboSyncHealth)());
|
|
26
17
|
}
|
|
27
|
-
return (0, rxjs_1.
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
messageSection: 'invoicing_qbo_backfill',
|
|
31
|
-
messageText: 'failed',
|
|
32
|
-
type: 'error',
|
|
33
|
-
}),
|
|
34
|
-
]);
|
|
35
|
-
}), (0, operators_1.catchError)((error) => (0, rxjs_1.from)([
|
|
36
|
-
(0, invoicingQboViewReducer_1.startInvoicingQboBackfillFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Start QBO backfill REST API call errored out ' +
|
|
37
|
-
JSON.stringify(error))),
|
|
38
|
-
(0, snackbarReducer_1.openSnackbar)({
|
|
39
|
-
messageSection: 'invoicing_qbo_backfill',
|
|
40
|
-
messageText: 'failed',
|
|
41
|
-
type: 'error',
|
|
42
|
-
}),
|
|
43
|
-
])));
|
|
18
|
+
return (0, rxjs_1.of)((0, invoicingQboViewReducer_1.startInvoicingQboBackfillFailure)(response.status));
|
|
19
|
+
}), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, invoicingQboViewReducer_1.startInvoicingQboBackfillFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Start QBO backfill REST API call errored out ' +
|
|
20
|
+
JSON.stringify(error))))));
|
|
44
21
|
}));
|
|
45
22
|
exports.startInvoicingQboBackfillEpic = startInvoicingQboBackfillEpic;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
3
|
import { updateInvoicingCreditNotes } from '../../../entity/invoicing/creditNote/creditNoteReducer';
|
|
4
|
-
import { openSnackbar } from '../../../entity/snackbar/snackbarReducer';
|
|
5
4
|
import { RootState } from '../../../reducer';
|
|
6
5
|
import { ZeniAPI } from '../../../zeniAPI';
|
|
7
6
|
import { fetchInvoiceDetail } from '../invoiceDetail/invoiceDetailReducer';
|
|
8
7
|
import { issueCreditNoteFailure, issueCreditNoteSuccess, submitIssueCreditNote } from './issueCreditNoteReducer';
|
|
9
|
-
export type ActionType = ReturnType<typeof submitIssueCreditNote> | ReturnType<typeof issueCreditNoteSuccess> | ReturnType<typeof issueCreditNoteFailure> | ReturnType<typeof updateInvoicingCreditNotes> | ReturnType<typeof fetchInvoiceDetail
|
|
8
|
+
export type ActionType = ReturnType<typeof submitIssueCreditNote> | ReturnType<typeof issueCreditNoteSuccess> | ReturnType<typeof issueCreditNoteFailure> | ReturnType<typeof updateInvoicingCreditNotes> | ReturnType<typeof fetchInvoiceDetail>;
|
|
10
9
|
export declare const issueCreditNoteEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -4,7 +4,6 @@ exports.issueCreditNoteEpic = void 0;
|
|
|
4
4
|
const rxjs_1 = require("rxjs");
|
|
5
5
|
const operators_1 = require("rxjs/operators");
|
|
6
6
|
const creditNoteReducer_1 = require("../../../entity/invoicing/creditNote/creditNoteReducer");
|
|
7
|
-
const snackbarReducer_1 = require("../../../entity/snackbar/snackbarReducer");
|
|
8
7
|
const responsePayload_1 = require("../../../responsePayload");
|
|
9
8
|
const invoiceDetailReducer_1 = require("../invoiceDetail/invoiceDetailReducer");
|
|
10
9
|
const issueCreditNotePayload_1 = require("./issueCreditNotePayload");
|
|
@@ -22,29 +21,10 @@ const issueCreditNoteEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, ope
|
|
|
22
21
|
(0, creditNoteReducer_1.updateInvoicingCreditNotes)([response.data], 'merge'),
|
|
23
22
|
(0, invoiceDetailReducer_1.fetchInvoiceDetail)({ invoiceId }),
|
|
24
23
|
(0, issueCreditNoteReducer_1.issueCreditNoteSuccess)({ creditNoteId: response.data.id }),
|
|
25
|
-
(0, snackbarReducer_1.openSnackbar)({
|
|
26
|
-
messageSection: 'invoicing_credit_note_saved',
|
|
27
|
-
messageText: 'success',
|
|
28
|
-
type: 'success',
|
|
29
|
-
}),
|
|
30
24
|
];
|
|
31
25
|
}
|
|
32
|
-
return (0, rxjs_1.
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
messageSection: 'invoicing_credit_note_saved',
|
|
36
|
-
messageText: 'failed',
|
|
37
|
-
type: 'error',
|
|
38
|
-
}),
|
|
39
|
-
]);
|
|
40
|
-
}), (0, operators_1.catchError)((error) => (0, rxjs_1.from)([
|
|
41
|
-
(0, issueCreditNoteReducer_1.issueCreditNoteFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Issue credit note REST API call errored out ' +
|
|
42
|
-
JSON.stringify(error))),
|
|
43
|
-
(0, snackbarReducer_1.openSnackbar)({
|
|
44
|
-
messageSection: 'invoicing_credit_note_saved',
|
|
45
|
-
messageText: 'failed',
|
|
46
|
-
type: 'error',
|
|
47
|
-
}),
|
|
48
|
-
])));
|
|
26
|
+
return (0, rxjs_1.of)((0, issueCreditNoteReducer_1.issueCreditNoteFailure)(response.status));
|
|
27
|
+
}), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, issueCreditNoteReducer_1.issueCreditNoteFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Issue credit note REST API call errored out ' +
|
|
28
|
+
JSON.stringify(error))))));
|
|
49
29
|
}));
|
|
50
30
|
exports.issueCreditNoteEpic = issueCreditNoteEpic;
|
|
@@ -1,30 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ID } from '../../../commonStateTypes/common';
|
|
2
2
|
import { SelectorView } from '../../../commonStateTypes/viewAndReport/viewAndReport';
|
|
3
|
-
import { InvoicingInvoice } from '../../../entity/invoicing/invoice/invoiceState';
|
|
4
3
|
import { RootState } from '../../../reducer';
|
|
5
4
|
import { IssueCreditNoteFormLocalData } from './issueCreditNoteState';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
*/
|
|
12
|
-
export interface IssueCreditNoteView extends SelectorView {
|
|
13
|
-
/**
|
|
14
|
-
* True once the invoice has loaded and the draft for *this* invoice has line
|
|
15
|
-
* items to credit.
|
|
16
|
-
*/
|
|
17
|
-
isPageReady: boolean;
|
|
5
|
+
export interface InvoicingIssueCreditNoteView extends SelectorView {
|
|
6
|
+
issuedCreditNoteId?: ID;
|
|
7
|
+
}
|
|
8
|
+
export declare const getIssueCreditNoteView: (state: RootState) => InvoicingIssueCreditNoteView;
|
|
9
|
+
export interface IssueCreditNoteFormView extends SelectorView {
|
|
18
10
|
localData: IssueCreditNoteFormLocalData;
|
|
19
11
|
reasonCodeValues: string[];
|
|
20
|
-
submitState: FetchStateAndError;
|
|
21
|
-
invoice?: InvoicingInvoice;
|
|
22
|
-
issuedCreditNoteId?: ID;
|
|
23
12
|
}
|
|
24
|
-
|
|
25
|
-
* The draft is a single global slice, so a draft seeded for a previously opened
|
|
26
|
-
* invoice can still be in state when another invoice's screen mounts. Anything
|
|
27
|
-
* that would render that stale draft next to this invoice is dropped until the
|
|
28
|
-
* screen re-seeds it for `invoiceId`.
|
|
29
|
-
*/
|
|
30
|
-
export declare const getIssueCreditNoteView: (state: RootState, invoiceId: ID) => IssueCreditNoteView;
|
|
13
|
+
export declare const getIssueCreditNoteFormView: (state: RootState) => IssueCreditNoteFormView;
|
|
@@ -1,32 +1,25 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getIssueCreditNoteView = void 0;
|
|
4
|
-
const invoiceDetailSelector_1 = require("../invoiceDetail/invoiceDetailSelector");
|
|
3
|
+
exports.getIssueCreditNoteFormView = exports.getIssueCreditNoteView = void 0;
|
|
5
4
|
const issueCreditNoteFormConfig_1 = require("./issueCreditNoteFormConfig");
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
* invoice can still be in state when another invoice's screen mounts. Anything
|
|
9
|
-
* that would render that stale draft next to this invoice is dropped until the
|
|
10
|
-
* screen re-seeds it for `invoiceId`.
|
|
11
|
-
*/
|
|
12
|
-
const getIssueCreditNoteView = (state, invoiceId) => {
|
|
13
|
-
const invoiceView = (0, invoiceDetailSelector_1.getInvoiceDetail)(state, invoiceId);
|
|
14
|
-
const { draft, error, fetchState, issuedCreditNoteId } = state.invoicingIssueCreditNoteState;
|
|
15
|
-
const isDraftForInvoice = draft.invoiceId === invoiceId;
|
|
5
|
+
const getIssueCreditNoteView = (state) => {
|
|
6
|
+
const { error, fetchState, issuedCreditNoteId } = state.invoicingIssueCreditNoteState;
|
|
16
7
|
return {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
isDraftForInvoice &&
|
|
20
|
-
draft.lineItems.length > 0,
|
|
8
|
+
error,
|
|
9
|
+
fetchState,
|
|
21
10
|
issuedCreditNoteId,
|
|
22
|
-
localData: isDraftForInvoice
|
|
23
|
-
? draft
|
|
24
|
-
: (0, issueCreditNoteFormConfig_1.initialIssueCreditNoteFormLocalData)(invoiceId),
|
|
25
|
-
reasonCodeValues: [...issueCreditNoteFormConfig_1.INVOICING_CREDIT_NOTE_REASON_CODES],
|
|
26
|
-
submitState: { error, fetchState },
|
|
27
|
-
error: invoiceView.error,
|
|
28
|
-
fetchState: invoiceView.fetchState,
|
|
29
11
|
version: 1.0,
|
|
30
12
|
};
|
|
31
13
|
};
|
|
32
14
|
exports.getIssueCreditNoteView = getIssueCreditNoteView;
|
|
15
|
+
const getIssueCreditNoteFormView = (state) => {
|
|
16
|
+
const { draft, error, fetchState } = state.invoicingIssueCreditNoteState;
|
|
17
|
+
return {
|
|
18
|
+
localData: draft,
|
|
19
|
+
reasonCodeValues: [...issueCreditNoteFormConfig_1.INVOICING_CREDIT_NOTE_REASON_CODES],
|
|
20
|
+
error,
|
|
21
|
+
fetchState,
|
|
22
|
+
version: 1.0,
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
exports.getIssueCreditNoteFormView = getIssueCreditNoteFormView;
|
|
@@ -2,11 +2,10 @@ import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
3
|
import { updateInvoices } from '../../../entity/invoicing/invoice/invoiceReducer';
|
|
4
4
|
import { updateInvoicingTransactions } from '../../../entity/invoicing/invoicingTransaction/invoicingTransactionReducer';
|
|
5
|
-
import { openSnackbar } from '../../../entity/snackbar/snackbarReducer';
|
|
6
5
|
import { RootState } from '../../../reducer';
|
|
7
6
|
import { ZeniAPI } from '../../../zeniAPI';
|
|
8
7
|
import { fetchInvoiceDetail } from '../invoiceDetail/invoiceDetailReducer';
|
|
9
8
|
import { addInvoicingTransactionToList } from '../invoicingTransactionListView/invoicingTransactionListViewReducer';
|
|
10
9
|
import { recordPaymentFailure, recordPaymentSuccess, submitRecordPayment } from './recordPaymentReducer';
|
|
11
|
-
export type ActionType = ReturnType<typeof submitRecordPayment> | ReturnType<typeof recordPaymentSuccess> | ReturnType<typeof recordPaymentFailure> | ReturnType<typeof updateInvoicingTransactions> | ReturnType<typeof addInvoicingTransactionToList> | ReturnType<typeof updateInvoices> | ReturnType<typeof fetchInvoiceDetail
|
|
10
|
+
export type ActionType = ReturnType<typeof submitRecordPayment> | ReturnType<typeof recordPaymentSuccess> | ReturnType<typeof recordPaymentFailure> | ReturnType<typeof updateInvoicingTransactions> | ReturnType<typeof addInvoicingTransactionToList> | ReturnType<typeof updateInvoices> | ReturnType<typeof fetchInvoiceDetail>;
|
|
12
11
|
export declare const recordPaymentEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -5,7 +5,6 @@ const rxjs_1 = require("rxjs");
|
|
|
5
5
|
const operators_1 = require("rxjs/operators");
|
|
6
6
|
const invoiceReducer_1 = require("../../../entity/invoicing/invoice/invoiceReducer");
|
|
7
7
|
const invoicingTransactionReducer_1 = require("../../../entity/invoicing/invoicingTransaction/invoicingTransactionReducer");
|
|
8
|
-
const snackbarReducer_1 = require("../../../entity/snackbar/snackbarReducer");
|
|
9
8
|
const responsePayload_1 = require("../../../responsePayload");
|
|
10
9
|
const invoiceDetailReducer_1 = require("../invoiceDetail/invoiceDetailReducer");
|
|
11
10
|
const invoicingTransactionListViewReducer_1 = require("../invoicingTransactionListView/invoicingTransactionListViewReducer");
|
|
@@ -30,30 +29,11 @@ const recordPaymentEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, opera
|
|
|
30
29
|
(0, invoiceReducer_1.updateInvoices)([response.data], 'merge'),
|
|
31
30
|
(0, invoiceDetailReducer_1.fetchInvoiceDetail)({ invoiceId }),
|
|
32
31
|
(0, recordPaymentReducer_1.recordPaymentSuccess)({ invoiceId }),
|
|
33
|
-
(0, snackbarReducer_1.openSnackbar)({
|
|
34
|
-
messageSection: 'invoicing_payment_recorded',
|
|
35
|
-
messageText: 'success',
|
|
36
|
-
type: 'success',
|
|
37
|
-
}),
|
|
38
32
|
];
|
|
39
33
|
}
|
|
40
|
-
return (0, rxjs_1.
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
messageSection: 'invoicing_payment_recorded',
|
|
44
|
-
messageText: 'failed',
|
|
45
|
-
type: 'error',
|
|
46
|
-
}),
|
|
47
|
-
]);
|
|
48
|
-
}), (0, operators_1.catchError)((error) => (0, rxjs_1.from)([
|
|
49
|
-
(0, recordPaymentReducer_1.recordPaymentFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Record payment REST API call errored out ' +
|
|
50
|
-
JSON.stringify(error))),
|
|
51
|
-
(0, snackbarReducer_1.openSnackbar)({
|
|
52
|
-
messageSection: 'invoicing_payment_recorded',
|
|
53
|
-
messageText: 'failed',
|
|
54
|
-
type: 'error',
|
|
55
|
-
}),
|
|
56
|
-
])));
|
|
34
|
+
return (0, rxjs_1.of)((0, recordPaymentReducer_1.recordPaymentFailure)(response.status));
|
|
35
|
+
}), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, recordPaymentReducer_1.recordPaymentFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Record payment REST API call errored out ' +
|
|
36
|
+
JSON.stringify(error))))));
|
|
57
37
|
}
|
|
58
38
|
const apiUrl = `${zeniAPI.apiEndPoints.invoicingMicroServiceBaseUrl}/1.0/payments`;
|
|
59
39
|
const data = (0, recordPaymentPayload_1.localDataToRecordPaymentPayload)(draft);
|
|
@@ -72,29 +52,10 @@ const recordPaymentEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, opera
|
|
|
72
52
|
if (linkedInvoiceId != null) {
|
|
73
53
|
successActions.push((0, invoiceDetailReducer_1.fetchInvoiceDetail)({ invoiceId: linkedInvoiceId }));
|
|
74
54
|
}
|
|
75
|
-
successActions.push((0, snackbarReducer_1.openSnackbar)({
|
|
76
|
-
messageSection: 'invoicing_payment_recorded',
|
|
77
|
-
messageText: 'success',
|
|
78
|
-
type: 'success',
|
|
79
|
-
}));
|
|
80
55
|
return successActions;
|
|
81
56
|
}
|
|
82
|
-
return (0, rxjs_1.
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
messageSection: 'invoicing_payment_recorded',
|
|
86
|
-
messageText: 'failed',
|
|
87
|
-
type: 'error',
|
|
88
|
-
}),
|
|
89
|
-
]);
|
|
90
|
-
}), (0, operators_1.catchError)((error) => (0, rxjs_1.from)([
|
|
91
|
-
(0, recordPaymentReducer_1.recordPaymentFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Record payment REST API call errored out ' +
|
|
92
|
-
JSON.stringify(error))),
|
|
93
|
-
(0, snackbarReducer_1.openSnackbar)({
|
|
94
|
-
messageSection: 'invoicing_payment_recorded',
|
|
95
|
-
messageText: 'failed',
|
|
96
|
-
type: 'error',
|
|
97
|
-
}),
|
|
98
|
-
])));
|
|
57
|
+
return (0, rxjs_1.of)((0, recordPaymentReducer_1.recordPaymentFailure)(response.status));
|
|
58
|
+
}), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, recordPaymentReducer_1.recordPaymentFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Record payment REST API call errored out ' +
|
|
59
|
+
JSON.stringify(error))))));
|
|
99
60
|
}));
|
|
100
61
|
exports.recordPaymentEpic = recordPaymentEpic;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
3
|
import { updateAddresses } from '../../../entity/address/addressReducer';
|
|
4
|
-
import { openSnackbar } from '../../../entity/snackbar/snackbarReducer';
|
|
5
4
|
import { RootState } from '../../../reducer';
|
|
6
5
|
import { ZeniAPI } from '../../../zeniAPI';
|
|
7
6
|
import { connectInvoicingStripe, disconnectInvoicingStripe, fetchInvoicingSettings, invoicingStripeConnectionFailure, saveInvoicingSettings, saveInvoicingSettingsFailure, saveInvoicingSettingsSuccess, updateInvoicingSettings, updateInvoicingSettingsFailure, updateInvoicingStripeConnection } from './settingsViewReducer';
|
|
8
|
-
export type ActionType = ReturnType<typeof fetchInvoicingSettings> | ReturnType<typeof updateInvoicingSettings> | ReturnType<typeof updateInvoicingSettingsFailure> | ReturnType<typeof saveInvoicingSettings> | ReturnType<typeof saveInvoicingSettingsSuccess> | ReturnType<typeof saveInvoicingSettingsFailure> | ReturnType<typeof connectInvoicingStripe> | ReturnType<typeof disconnectInvoicingStripe> | ReturnType<typeof updateInvoicingStripeConnection> | ReturnType<typeof invoicingStripeConnectionFailure> | ReturnType<typeof updateAddresses
|
|
7
|
+
export type ActionType = ReturnType<typeof fetchInvoicingSettings> | ReturnType<typeof updateInvoicingSettings> | ReturnType<typeof updateInvoicingSettingsFailure> | ReturnType<typeof saveInvoicingSettings> | ReturnType<typeof saveInvoicingSettingsSuccess> | ReturnType<typeof saveInvoicingSettingsFailure> | ReturnType<typeof connectInvoicingStripe> | ReturnType<typeof disconnectInvoicingStripe> | ReturnType<typeof updateInvoicingStripeConnection> | ReturnType<typeof invoicingStripeConnectionFailure> | ReturnType<typeof updateAddresses>;
|
|
9
8
|
export declare const fetchInvoicingSettingsEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
10
9
|
export declare const connectInvoicingStripeEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
11
10
|
export declare const disconnectInvoicingStripeEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|