@zeniai/client-epic-state 5.1.81-betaAK2 → 5.1.81-betaAK3
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/esm/view/invoicing/editInvoicingCatalogItemDetailView/saveInvoicingCatalogItemEpic.js +32 -5
- package/lib/esm/view/invoicing/editInvoicingCouponDetailView/saveInvoicingCouponEpic.js +23 -3
- package/lib/esm/view/invoicing/editInvoicingCustomerDetailView/saveInvoicingCustomerEpic.js +24 -4
- package/lib/esm/view/invoicing/editInvoicingSubscriptionDetailView/saveInvoicingSubscriptionEpic.js +24 -4
- package/lib/esm/view/invoicing/editInvoicingSubscriptionDetailView/syncInvoicingSubscriptionCouponsEpic.js +20 -3
- package/lib/esm/view/invoicing/recordPayment/recordPaymentEpic.js +46 -7
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/saveInvoicingCatalogItemEpic.d.ts +2 -1
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/saveInvoicingCatalogItemEpic.js +31 -4
- package/lib/view/invoicing/editInvoicingCouponDetailView/saveInvoicingCouponEpic.d.ts +2 -1
- package/lib/view/invoicing/editInvoicingCouponDetailView/saveInvoicingCouponEpic.js +22 -2
- package/lib/view/invoicing/editInvoicingCustomerDetailView/saveInvoicingCustomerEpic.d.ts +2 -1
- package/lib/view/invoicing/editInvoicingCustomerDetailView/saveInvoicingCustomerEpic.js +23 -3
- package/lib/view/invoicing/editInvoicingSubscriptionDetailView/saveInvoicingSubscriptionEpic.d.ts +2 -1
- package/lib/view/invoicing/editInvoicingSubscriptionDetailView/saveInvoicingSubscriptionEpic.js +23 -3
- package/lib/view/invoicing/editInvoicingSubscriptionDetailView/syncInvoicingSubscriptionCouponsEpic.d.ts +2 -1
- package/lib/view/invoicing/editInvoicingSubscriptionDetailView/syncInvoicingSubscriptionCouponsEpic.js +19 -2
- package/lib/view/invoicing/recordPayment/recordPaymentEpic.d.ts +2 -1
- package/lib/view/invoicing/recordPayment/recordPaymentEpic.js +45 -6
- package/package.json +1 -1
- package/lib/tsconfig.mocks.tsbuildinfo +0 -1
package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/saveInvoicingCatalogItemEpic.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { forkJoin,
|
|
1
|
+
import { forkJoin, from } from 'rxjs';
|
|
2
2
|
import { catchError, filter, mergeMap } from 'rxjs/operators';
|
|
3
3
|
import { mergeInvoicingPlanSubFamily, updateInvoicingPlans, } from '../../../entity/invoicing/plan/planReducer';
|
|
4
4
|
import { updateInvoicingProducts } from '../../../entity/invoicing/product/productReducer';
|
|
5
|
+
import { openSnackbar } from '../../../entity/snackbar/snackbarReducer';
|
|
5
6
|
import { createZeniAPIStatus, isSuccessResponse } from '../../../responsePayload';
|
|
6
7
|
import { addInvoicingCatalogItem } from '../invoicingCatalogListView/invoicingCatalogListViewReducer';
|
|
7
8
|
import { localDataToSaveInvoicingCatalogItemPayload, } from './editInvoicingCatalogItemDetailViewPayload';
|
|
@@ -38,7 +39,14 @@ export const saveInvoicingCatalogItemEpic = (actions$, state$, zeniAPI) => actio
|
|
|
38
39
|
const failedProductResponse = productResponses.find((productResponse) => !isSuccessResponse(productResponse) ||
|
|
39
40
|
productResponse.data == null);
|
|
40
41
|
if (failedProductResponse != null) {
|
|
41
|
-
return
|
|
42
|
+
return from([
|
|
43
|
+
submitInvoicingCatalogItemFormFailure(failedProductResponse.status),
|
|
44
|
+
openSnackbar({
|
|
45
|
+
messageSection: 'invoicing_catalog_item_saved',
|
|
46
|
+
messageText: 'failed',
|
|
47
|
+
type: 'error',
|
|
48
|
+
}),
|
|
49
|
+
]);
|
|
42
50
|
}
|
|
43
51
|
const savedProducts = productResponses.flatMap((productResponse) => productResponse.data != null ? [productResponse.data] : []);
|
|
44
52
|
const resultActions = [
|
|
@@ -65,6 +73,11 @@ export const saveInvoicingCatalogItemEpic = (actions$, state$, zeniAPI) => actio
|
|
|
65
73
|
: 'plan';
|
|
66
74
|
resultActions.push(addInvoicingCatalogItem({ id: savedItem.id, type: itemType }));
|
|
67
75
|
}
|
|
76
|
+
resultActions.push(openSnackbar({
|
|
77
|
+
messageSection: 'invoicing_catalog_item_saved',
|
|
78
|
+
messageText: 'success',
|
|
79
|
+
type: 'success',
|
|
80
|
+
}));
|
|
68
81
|
return resultActions;
|
|
69
82
|
};
|
|
70
83
|
const productUpdates = saveInvoicingCatalogItem.match(action)
|
|
@@ -75,7 +88,21 @@ export const saveInvoicingCatalogItemEpic = (actions$, state$, zeniAPI) => actio
|
|
|
75
88
|
}
|
|
76
89
|
return forkJoin(productUpdates.map((productUpdate) => zeniAPI.putAndGetJSON(`${baseUrl}/catalog/products/${encodeURIComponent(productUpdate.id)}`, productUpdate.data))).pipe(mergeMap(completeSave));
|
|
77
90
|
}
|
|
78
|
-
return
|
|
79
|
-
|
|
80
|
-
|
|
91
|
+
return from([
|
|
92
|
+
submitInvoicingCatalogItemFormFailure(response.status),
|
|
93
|
+
openSnackbar({
|
|
94
|
+
messageSection: 'invoicing_catalog_item_saved',
|
|
95
|
+
messageText: 'failed',
|
|
96
|
+
type: 'error',
|
|
97
|
+
}),
|
|
98
|
+
]);
|
|
99
|
+
}), catchError((error) => from([
|
|
100
|
+
submitInvoicingCatalogItemFormFailure(createZeniAPIStatus('Unexpected Error', 'Save catalog item REST API call errored out ' +
|
|
101
|
+
JSON.stringify(error))),
|
|
102
|
+
openSnackbar({
|
|
103
|
+
messageSection: 'invoicing_catalog_item_saved',
|
|
104
|
+
messageText: 'failed',
|
|
105
|
+
type: 'error',
|
|
106
|
+
}),
|
|
107
|
+
])));
|
|
81
108
|
}));
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { from } from 'rxjs';
|
|
2
2
|
import { catchError, filter, mergeMap } from 'rxjs/operators';
|
|
3
3
|
import { updateInvoicingCoupons } from '../../../entity/invoicing/coupon/couponReducer';
|
|
4
|
+
import { openSnackbar } from '../../../entity/snackbar/snackbarReducer';
|
|
4
5
|
import { createZeniAPIStatus, isSuccessResponse } from '../../../responsePayload';
|
|
5
6
|
import { addInvoicingCouponToList } from '../couponView/couponViewReducer';
|
|
6
7
|
import { localDataToSaveInvoicingCouponPayload, } from './editInvoicingCouponDetailViewPayload';
|
|
@@ -43,8 +44,27 @@ export const saveInvoicingCouponEpic = (actions$, state$, zeniAPI) => actions$.p
|
|
|
43
44
|
status: couponPayload.status,
|
|
44
45
|
}));
|
|
45
46
|
}
|
|
47
|
+
resultActions.push(openSnackbar({
|
|
48
|
+
messageSection: 'invoicing_coupon_saved',
|
|
49
|
+
messageText: 'success',
|
|
50
|
+
type: 'success',
|
|
51
|
+
}));
|
|
46
52
|
return resultActions;
|
|
47
53
|
}
|
|
48
|
-
return
|
|
49
|
-
|
|
54
|
+
return from([
|
|
55
|
+
submitInvoicingCouponFormFailure(response.status),
|
|
56
|
+
openSnackbar({
|
|
57
|
+
messageSection: 'invoicing_coupon_saved',
|
|
58
|
+
messageText: 'failed',
|
|
59
|
+
type: 'error',
|
|
60
|
+
}),
|
|
61
|
+
]);
|
|
62
|
+
}), catchError((error) => from([
|
|
63
|
+
submitInvoicingCouponFormFailure(createZeniAPIStatus('Unexpected Error', 'Save coupon REST API call errored out ' + JSON.stringify(error))),
|
|
64
|
+
openSnackbar({
|
|
65
|
+
messageSection: 'invoicing_coupon_saved',
|
|
66
|
+
messageText: 'failed',
|
|
67
|
+
type: 'error',
|
|
68
|
+
}),
|
|
69
|
+
])));
|
|
50
70
|
}));
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { from } from 'rxjs';
|
|
2
2
|
import { catchError, filter, mergeMap } from 'rxjs/operators';
|
|
3
3
|
import { updateAddresses } from '../../../entity/address/addressReducer';
|
|
4
4
|
import { extractInvoicingCustomerAddresses } from '../../../entity/invoicing/invoicingCustomer/invoicingCustomerPayload';
|
|
5
5
|
import { updateInvoicingCustomers } from '../../../entity/invoicing/invoicingCustomer/invoicingCustomerReducer';
|
|
6
|
+
import { openSnackbar } from '../../../entity/snackbar/snackbarReducer';
|
|
6
7
|
import { createZeniAPIStatus, isSuccessResponse } from '../../../responsePayload';
|
|
7
8
|
import { resetNewAddressDataInLocalStore } from '../../addressView/addressViewReducer';
|
|
8
9
|
import { addInvoicingCustomerToList } from '../invoicingCustomerListView/invoicingCustomerListViewReducer';
|
|
@@ -45,9 +46,28 @@ export const saveInvoicingCustomerEpic = (actions$, state$, zeniAPI) => actions$
|
|
|
45
46
|
status: response.data.status,
|
|
46
47
|
}));
|
|
47
48
|
}
|
|
49
|
+
resultActions.push(openSnackbar({
|
|
50
|
+
messageSection: 'invoicing_customer_saved',
|
|
51
|
+
messageText: 'success',
|
|
52
|
+
type: 'success',
|
|
53
|
+
}));
|
|
48
54
|
return resultActions;
|
|
49
55
|
}
|
|
50
|
-
return
|
|
51
|
-
|
|
52
|
-
|
|
56
|
+
return from([
|
|
57
|
+
submitInvoicingCustomerFormFailure(response.status),
|
|
58
|
+
openSnackbar({
|
|
59
|
+
messageSection: 'invoicing_customer_saved',
|
|
60
|
+
messageText: 'failed',
|
|
61
|
+
type: 'error',
|
|
62
|
+
}),
|
|
63
|
+
]);
|
|
64
|
+
}), catchError((error) => from([
|
|
65
|
+
submitInvoicingCustomerFormFailure(createZeniAPIStatus('Unexpected Error', 'Save customer REST API call errored out ' +
|
|
66
|
+
JSON.stringify(error))),
|
|
67
|
+
openSnackbar({
|
|
68
|
+
messageSection: 'invoicing_customer_saved',
|
|
69
|
+
messageText: 'failed',
|
|
70
|
+
type: 'error',
|
|
71
|
+
}),
|
|
72
|
+
])));
|
|
53
73
|
}));
|
package/lib/esm/view/invoicing/editInvoicingSubscriptionDetailView/saveInvoicingSubscriptionEpic.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { from } from 'rxjs';
|
|
2
2
|
import { catchError, filter, mergeMap } from 'rxjs/operators';
|
|
3
3
|
import { updateAddresses } from '../../../entity/address/addressReducer';
|
|
4
4
|
import { extractInvoicingSubscriptionAddresses } from '../../../entity/invoicing/invoicingSubscription/invoicingSubscriptionPayload';
|
|
5
5
|
import { updateInvoicingSubscriptions } from '../../../entity/invoicing/invoicingSubscription/invoicingSubscriptionReducer';
|
|
6
|
+
import { openSnackbar } from '../../../entity/snackbar/snackbarReducer';
|
|
6
7
|
import { createZeniAPIStatus, isSuccessResponse } from '../../../responsePayload';
|
|
7
8
|
import { resetNewAddressDataInLocalStore } from '../../addressView/addressViewReducer';
|
|
8
9
|
import { addInvoicingSubscriptionToList } from '../invoicingSubscriptionListView/invoicingSubscriptionListViewReducer';
|
|
@@ -38,7 +39,14 @@ export const saveInvoicingSubscriptionEpic = (actions$, state$, zeniAPI) => acti
|
|
|
38
39
|
: zeniAPI.postAndGetJSON(`${baseUrl}/subscriptions`, { ...data });
|
|
39
40
|
return request$.pipe(mergeMap((response) => {
|
|
40
41
|
if (!isSuccessResponse(response) || response.data == null) {
|
|
41
|
-
return [
|
|
42
|
+
return [
|
|
43
|
+
submitInvoicingSubscriptionFormFailure(response.status),
|
|
44
|
+
openSnackbar({
|
|
45
|
+
messageSection: 'invoicing_subscription_saved',
|
|
46
|
+
messageText: 'failed',
|
|
47
|
+
type: 'error',
|
|
48
|
+
}),
|
|
49
|
+
];
|
|
42
50
|
}
|
|
43
51
|
const saved = response.data;
|
|
44
52
|
const couponChanged = id != null &&
|
|
@@ -78,7 +86,19 @@ export const saveInvoicingSubscriptionEpic = (actions$, state$, zeniAPI) => acti
|
|
|
78
86
|
status: saved.status,
|
|
79
87
|
}));
|
|
80
88
|
}
|
|
89
|
+
resultActions.push(openSnackbar({
|
|
90
|
+
messageSection: 'invoicing_subscription_saved',
|
|
91
|
+
messageText: 'success',
|
|
92
|
+
type: 'success',
|
|
93
|
+
}));
|
|
81
94
|
return resultActions;
|
|
82
|
-
}), catchError((error) =>
|
|
83
|
-
|
|
95
|
+
}), catchError((error) => from([
|
|
96
|
+
submitInvoicingSubscriptionFormFailure(createZeniAPIStatus('Unexpected Error', 'Save subscription REST API call errored out ' +
|
|
97
|
+
JSON.stringify(error))),
|
|
98
|
+
openSnackbar({
|
|
99
|
+
messageSection: 'invoicing_subscription_saved',
|
|
100
|
+
messageText: 'failed',
|
|
101
|
+
type: 'error',
|
|
102
|
+
}),
|
|
103
|
+
])));
|
|
84
104
|
}));
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { EMPTY, of } from 'rxjs';
|
|
1
|
+
import { EMPTY, from, of } from 'rxjs';
|
|
2
2
|
import { catchError, filter, map, mergeMap } from 'rxjs/operators';
|
|
3
3
|
import { updateAddresses } from '../../../entity/address/addressReducer';
|
|
4
4
|
import { extractInvoicingSubscriptionAddresses, } from '../../../entity/invoicing/invoicingSubscription/invoicingSubscriptionPayload';
|
|
5
5
|
import { updateInvoicingSubscriptions } from '../../../entity/invoicing/invoicingSubscription/invoicingSubscriptionReducer';
|
|
6
|
+
import { openSnackbar } from '../../../entity/snackbar/snackbarReducer';
|
|
6
7
|
import { createZeniAPIStatus, isSuccessResponse, } from '../../../responsePayload';
|
|
7
8
|
import { resetNewAddressDataInLocalStore } from '../../addressView/addressViewReducer';
|
|
8
9
|
import { submitInvoicingSubscriptionFormFailure, submitInvoicingSubscriptionFormSuccess, syncInvoicingSubscriptionCoupons, } from './editInvoicingSubscriptionDetailViewReducer';
|
|
@@ -39,7 +40,14 @@ export const syncInvoicingSubscriptionCouponsEpic = (actions$, _state$, zeniAPI)
|
|
|
39
40
|
: couponMutation$(zeniAPI, baseUrl, subscriptionId, 'remove-coupon', prev);
|
|
40
41
|
return removeStep$.pipe(mergeMap((removeResult) => {
|
|
41
42
|
if (!removeResult.success) {
|
|
42
|
-
return
|
|
43
|
+
return from([
|
|
44
|
+
submitInvoicingSubscriptionFormFailure(failureStatus(removeResult)),
|
|
45
|
+
openSnackbar({
|
|
46
|
+
messageSection: 'invoicing_subscription_saved',
|
|
47
|
+
messageText: 'failed',
|
|
48
|
+
type: 'error',
|
|
49
|
+
}),
|
|
50
|
+
]);
|
|
43
51
|
}
|
|
44
52
|
const applyStep$ = next === ''
|
|
45
53
|
? of({
|
|
@@ -51,6 +59,11 @@ export const syncInvoicingSubscriptionCouponsEpic = (actions$, _state$, zeniAPI)
|
|
|
51
59
|
if (!applyResult.success) {
|
|
52
60
|
return [
|
|
53
61
|
submitInvoicingSubscriptionFormFailure(failureStatus(applyResult)),
|
|
62
|
+
openSnackbar({
|
|
63
|
+
messageSection: 'invoicing_subscription_saved',
|
|
64
|
+
messageText: 'failed',
|
|
65
|
+
type: 'error',
|
|
66
|
+
}),
|
|
54
67
|
];
|
|
55
68
|
}
|
|
56
69
|
const couponUpdated = applyResult.payload ?? removeResult.payload;
|
|
@@ -58,7 +71,11 @@ export const syncInvoicingSubscriptionCouponsEpic = (actions$, _state$, zeniAPI)
|
|
|
58
71
|
if (couponUpdated != null) {
|
|
59
72
|
resultActions.push(updateInvoicingSubscriptions([couponUpdated], 'merge'), updateAddresses(extractInvoicingSubscriptionAddresses([couponUpdated])));
|
|
60
73
|
}
|
|
61
|
-
resultActions.push(submitInvoicingSubscriptionFormSuccess({ subscriptionId }), resetNewAddressDataInLocalStore(INVOICING_SUBSCRIPTION_SHIPPING_ADDRESS_TYPE)
|
|
74
|
+
resultActions.push(submitInvoicingSubscriptionFormSuccess({ subscriptionId }), resetNewAddressDataInLocalStore(INVOICING_SUBSCRIPTION_SHIPPING_ADDRESS_TYPE), openSnackbar({
|
|
75
|
+
messageSection: 'invoicing_subscription_saved',
|
|
76
|
+
messageText: 'success',
|
|
77
|
+
type: 'success',
|
|
78
|
+
}));
|
|
62
79
|
return resultActions;
|
|
63
80
|
}));
|
|
64
81
|
}));
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { from } from 'rxjs';
|
|
2
2
|
import { catchError, filter, mergeMap } from 'rxjs/operators';
|
|
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';
|
|
5
6
|
import { createZeniAPIStatus, isSuccessResponse } from '../../../responsePayload';
|
|
6
7
|
import { fetchInvoiceDetail } from '../invoiceDetail/invoiceDetailReducer';
|
|
7
8
|
import { addInvoicingTransactionToList } from '../invoicingTransactionListView/invoicingTransactionListViewReducer';
|
|
@@ -26,11 +27,30 @@ export const recordPaymentEpic = (actions$, state$, zeniAPI) => actions$.pipe(fi
|
|
|
26
27
|
updateInvoices([response.data], 'merge'),
|
|
27
28
|
fetchInvoiceDetail({ invoiceId }),
|
|
28
29
|
recordPaymentSuccess({ invoiceId }),
|
|
30
|
+
openSnackbar({
|
|
31
|
+
messageSection: 'invoicing_payment_recorded',
|
|
32
|
+
messageText: 'success',
|
|
33
|
+
type: 'success',
|
|
34
|
+
}),
|
|
29
35
|
];
|
|
30
36
|
}
|
|
31
|
-
return
|
|
32
|
-
|
|
33
|
-
|
|
37
|
+
return from([
|
|
38
|
+
recordPaymentFailure(response.status),
|
|
39
|
+
openSnackbar({
|
|
40
|
+
messageSection: 'invoicing_payment_recorded',
|
|
41
|
+
messageText: 'failed',
|
|
42
|
+
type: 'error',
|
|
43
|
+
}),
|
|
44
|
+
]);
|
|
45
|
+
}), catchError((error) => from([
|
|
46
|
+
recordPaymentFailure(createZeniAPIStatus('Unexpected Error', 'Record payment REST API call errored out ' +
|
|
47
|
+
JSON.stringify(error))),
|
|
48
|
+
openSnackbar({
|
|
49
|
+
messageSection: 'invoicing_payment_recorded',
|
|
50
|
+
messageText: 'failed',
|
|
51
|
+
type: 'error',
|
|
52
|
+
}),
|
|
53
|
+
])));
|
|
34
54
|
}
|
|
35
55
|
const apiUrl = `${zeniAPI.apiEndPoints.invoicingMicroServiceBaseUrl}/1.0/payments`;
|
|
36
56
|
const data = localDataToRecordPaymentPayload(draft);
|
|
@@ -49,9 +69,28 @@ export const recordPaymentEpic = (actions$, state$, zeniAPI) => actions$.pipe(fi
|
|
|
49
69
|
if (linkedInvoiceId != null) {
|
|
50
70
|
successActions.push(fetchInvoiceDetail({ invoiceId: linkedInvoiceId }));
|
|
51
71
|
}
|
|
72
|
+
successActions.push(openSnackbar({
|
|
73
|
+
messageSection: 'invoicing_payment_recorded',
|
|
74
|
+
messageText: 'success',
|
|
75
|
+
type: 'success',
|
|
76
|
+
}));
|
|
52
77
|
return successActions;
|
|
53
78
|
}
|
|
54
|
-
return
|
|
55
|
-
|
|
56
|
-
|
|
79
|
+
return from([
|
|
80
|
+
recordPaymentFailure(response.status),
|
|
81
|
+
openSnackbar({
|
|
82
|
+
messageSection: 'invoicing_payment_recorded',
|
|
83
|
+
messageText: 'failed',
|
|
84
|
+
type: 'error',
|
|
85
|
+
}),
|
|
86
|
+
]);
|
|
87
|
+
}), catchError((error) => from([
|
|
88
|
+
recordPaymentFailure(createZeniAPIStatus('Unexpected Error', 'Record payment REST API call errored out ' +
|
|
89
|
+
JSON.stringify(error))),
|
|
90
|
+
openSnackbar({
|
|
91
|
+
messageSection: 'invoicing_payment_recorded',
|
|
92
|
+
messageText: 'failed',
|
|
93
|
+
type: 'error',
|
|
94
|
+
}),
|
|
95
|
+
])));
|
|
57
96
|
}));
|
package/lib/view/invoicing/editInvoicingCatalogItemDetailView/saveInvoicingCatalogItemEpic.d.ts
CHANGED
|
@@ -2,9 +2,10 @@ import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
3
|
import { mergeInvoicingPlanSubFamily, updateInvoicingPlans } from '../../../entity/invoicing/plan/planReducer';
|
|
4
4
|
import { updateInvoicingProducts } from '../../../entity/invoicing/product/productReducer';
|
|
5
|
+
import { openSnackbar } from '../../../entity/snackbar/snackbarReducer';
|
|
5
6
|
import { RootState } from '../../../reducer';
|
|
6
7
|
import { ZeniAPI } from '../../../zeniAPI';
|
|
7
8
|
import { addInvoicingCatalogItem } from '../invoicingCatalogListView/invoicingCatalogListViewReducer';
|
|
8
9
|
import { saveInvoicingCatalogItem, submitInvoicingCatalogItemForm, submitInvoicingCatalogItemFormFailure, submitInvoicingCatalogItemFormSuccess } from './editInvoicingCatalogItemDetailViewReducer';
|
|
9
|
-
export type ActionType = ReturnType<typeof submitInvoicingCatalogItemForm> | ReturnType<typeof saveInvoicingCatalogItem> | ReturnType<typeof submitInvoicingCatalogItemFormSuccess> | ReturnType<typeof submitInvoicingCatalogItemFormFailure> | ReturnType<typeof updateInvoicingPlans> | ReturnType<typeof updateInvoicingProducts> | ReturnType<typeof mergeInvoicingPlanSubFamily> | ReturnType<typeof addInvoicingCatalogItem>;
|
|
10
|
+
export type ActionType = ReturnType<typeof submitInvoicingCatalogItemForm> | ReturnType<typeof saveInvoicingCatalogItem> | ReturnType<typeof submitInvoicingCatalogItemFormSuccess> | ReturnType<typeof submitInvoicingCatalogItemFormFailure> | ReturnType<typeof updateInvoicingPlans> | ReturnType<typeof updateInvoicingProducts> | ReturnType<typeof mergeInvoicingPlanSubFamily> | ReturnType<typeof addInvoicingCatalogItem> | ReturnType<typeof openSnackbar>;
|
|
10
11
|
export declare const saveInvoicingCatalogItemEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
package/lib/view/invoicing/editInvoicingCatalogItemDetailView/saveInvoicingCatalogItemEpic.js
CHANGED
|
@@ -5,6 +5,7 @@ const rxjs_1 = require("rxjs");
|
|
|
5
5
|
const operators_1 = require("rxjs/operators");
|
|
6
6
|
const planReducer_1 = require("../../../entity/invoicing/plan/planReducer");
|
|
7
7
|
const productReducer_1 = require("../../../entity/invoicing/product/productReducer");
|
|
8
|
+
const snackbarReducer_1 = require("../../../entity/snackbar/snackbarReducer");
|
|
8
9
|
const responsePayload_1 = require("../../../responsePayload");
|
|
9
10
|
const invoicingCatalogListViewReducer_1 = require("../invoicingCatalogListView/invoicingCatalogListViewReducer");
|
|
10
11
|
const editInvoicingCatalogItemDetailViewPayload_1 = require("./editInvoicingCatalogItemDetailViewPayload");
|
|
@@ -41,7 +42,14 @@ const saveInvoicingCatalogItemEpic = (actions$, state$, zeniAPI) => actions$.pip
|
|
|
41
42
|
const failedProductResponse = productResponses.find((productResponse) => !(0, responsePayload_1.isSuccessResponse)(productResponse) ||
|
|
42
43
|
productResponse.data == null);
|
|
43
44
|
if (failedProductResponse != null) {
|
|
44
|
-
return (0, rxjs_1.
|
|
45
|
+
return (0, rxjs_1.from)([
|
|
46
|
+
(0, editInvoicingCatalogItemDetailViewReducer_1.submitInvoicingCatalogItemFormFailure)(failedProductResponse.status),
|
|
47
|
+
(0, snackbarReducer_1.openSnackbar)({
|
|
48
|
+
messageSection: 'invoicing_catalog_item_saved',
|
|
49
|
+
messageText: 'failed',
|
|
50
|
+
type: 'error',
|
|
51
|
+
}),
|
|
52
|
+
]);
|
|
45
53
|
}
|
|
46
54
|
const savedProducts = productResponses.flatMap((productResponse) => productResponse.data != null ? [productResponse.data] : []);
|
|
47
55
|
const resultActions = [
|
|
@@ -68,6 +76,11 @@ const saveInvoicingCatalogItemEpic = (actions$, state$, zeniAPI) => actions$.pip
|
|
|
68
76
|
: 'plan';
|
|
69
77
|
resultActions.push((0, invoicingCatalogListViewReducer_1.addInvoicingCatalogItem)({ id: savedItem.id, type: itemType }));
|
|
70
78
|
}
|
|
79
|
+
resultActions.push((0, snackbarReducer_1.openSnackbar)({
|
|
80
|
+
messageSection: 'invoicing_catalog_item_saved',
|
|
81
|
+
messageText: 'success',
|
|
82
|
+
type: 'success',
|
|
83
|
+
}));
|
|
71
84
|
return resultActions;
|
|
72
85
|
};
|
|
73
86
|
const productUpdates = editInvoicingCatalogItemDetailViewReducer_1.saveInvoicingCatalogItem.match(action)
|
|
@@ -78,8 +91,22 @@ const saveInvoicingCatalogItemEpic = (actions$, state$, zeniAPI) => actions$.pip
|
|
|
78
91
|
}
|
|
79
92
|
return (0, rxjs_1.forkJoin)(productUpdates.map((productUpdate) => zeniAPI.putAndGetJSON(`${baseUrl}/catalog/products/${encodeURIComponent(productUpdate.id)}`, productUpdate.data))).pipe((0, operators_1.mergeMap)(completeSave));
|
|
80
93
|
}
|
|
81
|
-
return (0, rxjs_1.
|
|
82
|
-
|
|
83
|
-
|
|
94
|
+
return (0, rxjs_1.from)([
|
|
95
|
+
(0, editInvoicingCatalogItemDetailViewReducer_1.submitInvoicingCatalogItemFormFailure)(response.status),
|
|
96
|
+
(0, snackbarReducer_1.openSnackbar)({
|
|
97
|
+
messageSection: 'invoicing_catalog_item_saved',
|
|
98
|
+
messageText: 'failed',
|
|
99
|
+
type: 'error',
|
|
100
|
+
}),
|
|
101
|
+
]);
|
|
102
|
+
}), (0, operators_1.catchError)((error) => (0, rxjs_1.from)([
|
|
103
|
+
(0, editInvoicingCatalogItemDetailViewReducer_1.submitInvoicingCatalogItemFormFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Save catalog item REST API call errored out ' +
|
|
104
|
+
JSON.stringify(error))),
|
|
105
|
+
(0, snackbarReducer_1.openSnackbar)({
|
|
106
|
+
messageSection: 'invoicing_catalog_item_saved',
|
|
107
|
+
messageText: 'failed',
|
|
108
|
+
type: 'error',
|
|
109
|
+
}),
|
|
110
|
+
])));
|
|
84
111
|
}));
|
|
85
112
|
exports.saveInvoicingCatalogItemEpic = saveInvoicingCatalogItemEpic;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
3
|
import { updateInvoicingCoupons } from '../../../entity/invoicing/coupon/couponReducer';
|
|
4
|
+
import { openSnackbar } from '../../../entity/snackbar/snackbarReducer';
|
|
4
5
|
import { RootState } from '../../../reducer';
|
|
5
6
|
import { ZeniAPI } from '../../../zeniAPI';
|
|
6
7
|
import { addInvoicingCouponToList } from '../couponView/couponViewReducer';
|
|
7
8
|
import { saveInvoicingCoupon, submitInvoicingCouponForm, submitInvoicingCouponFormFailure, submitInvoicingCouponFormSuccess } from './editInvoicingCouponDetailViewReducer';
|
|
8
|
-
export type ActionType = ReturnType<typeof submitInvoicingCouponForm> | ReturnType<typeof saveInvoicingCoupon> | ReturnType<typeof submitInvoicingCouponFormSuccess> | ReturnType<typeof submitInvoicingCouponFormFailure> | ReturnType<typeof updateInvoicingCoupons> | ReturnType<typeof addInvoicingCouponToList>;
|
|
9
|
+
export type ActionType = ReturnType<typeof submitInvoicingCouponForm> | ReturnType<typeof saveInvoicingCoupon> | ReturnType<typeof submitInvoicingCouponFormSuccess> | ReturnType<typeof submitInvoicingCouponFormFailure> | ReturnType<typeof updateInvoicingCoupons> | ReturnType<typeof addInvoicingCouponToList> | ReturnType<typeof openSnackbar>;
|
|
9
10
|
export declare const saveInvoicingCouponEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -4,6 +4,7 @@ exports.saveInvoicingCouponEpic = void 0;
|
|
|
4
4
|
const rxjs_1 = require("rxjs");
|
|
5
5
|
const operators_1 = require("rxjs/operators");
|
|
6
6
|
const couponReducer_1 = require("../../../entity/invoicing/coupon/couponReducer");
|
|
7
|
+
const snackbarReducer_1 = require("../../../entity/snackbar/snackbarReducer");
|
|
7
8
|
const responsePayload_1 = require("../../../responsePayload");
|
|
8
9
|
const couponViewReducer_1 = require("../couponView/couponViewReducer");
|
|
9
10
|
const editInvoicingCouponDetailViewPayload_1 = require("./editInvoicingCouponDetailViewPayload");
|
|
@@ -46,9 +47,28 @@ const saveInvoicingCouponEpic = (actions$, state$, zeniAPI) => actions$.pipe((0,
|
|
|
46
47
|
status: couponPayload.status,
|
|
47
48
|
}));
|
|
48
49
|
}
|
|
50
|
+
resultActions.push((0, snackbarReducer_1.openSnackbar)({
|
|
51
|
+
messageSection: 'invoicing_coupon_saved',
|
|
52
|
+
messageText: 'success',
|
|
53
|
+
type: 'success',
|
|
54
|
+
}));
|
|
49
55
|
return resultActions;
|
|
50
56
|
}
|
|
51
|
-
return (0, rxjs_1.
|
|
52
|
-
|
|
57
|
+
return (0, rxjs_1.from)([
|
|
58
|
+
(0, editInvoicingCouponDetailViewReducer_1.submitInvoicingCouponFormFailure)(response.status),
|
|
59
|
+
(0, snackbarReducer_1.openSnackbar)({
|
|
60
|
+
messageSection: 'invoicing_coupon_saved',
|
|
61
|
+
messageText: 'failed',
|
|
62
|
+
type: 'error',
|
|
63
|
+
}),
|
|
64
|
+
]);
|
|
65
|
+
}), (0, operators_1.catchError)((error) => (0, rxjs_1.from)([
|
|
66
|
+
(0, editInvoicingCouponDetailViewReducer_1.submitInvoicingCouponFormFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Save coupon REST API call errored out ' + JSON.stringify(error))),
|
|
67
|
+
(0, snackbarReducer_1.openSnackbar)({
|
|
68
|
+
messageSection: 'invoicing_coupon_saved',
|
|
69
|
+
messageText: 'failed',
|
|
70
|
+
type: 'error',
|
|
71
|
+
}),
|
|
72
|
+
])));
|
|
53
73
|
}));
|
|
54
74
|
exports.saveInvoicingCouponEpic = saveInvoicingCouponEpic;
|
|
@@ -2,10 +2,11 @@ import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
3
|
import { updateAddresses } from '../../../entity/address/addressReducer';
|
|
4
4
|
import { updateInvoicingCustomers } from '../../../entity/invoicing/invoicingCustomer/invoicingCustomerReducer';
|
|
5
|
+
import { openSnackbar } from '../../../entity/snackbar/snackbarReducer';
|
|
5
6
|
import { RootState } from '../../../reducer';
|
|
6
7
|
import { ZeniAPI } from '../../../zeniAPI';
|
|
7
8
|
import { resetNewAddressDataInLocalStore } from '../../addressView/addressViewReducer';
|
|
8
9
|
import { addInvoicingCustomerToList } from '../invoicingCustomerListView/invoicingCustomerListViewReducer';
|
|
9
10
|
import { submitInvoicingCustomerForm, submitInvoicingCustomerFormFailure, submitInvoicingCustomerFormSuccess } from './editInvoicingCustomerDetailViewReducer';
|
|
10
|
-
export type ActionType = ReturnType<typeof submitInvoicingCustomerForm> | ReturnType<typeof submitInvoicingCustomerFormSuccess> | ReturnType<typeof submitInvoicingCustomerFormFailure> | ReturnType<typeof resetNewAddressDataInLocalStore> | ReturnType<typeof updateAddresses> | ReturnType<typeof updateInvoicingCustomers> | ReturnType<typeof addInvoicingCustomerToList>;
|
|
11
|
+
export type ActionType = ReturnType<typeof submitInvoicingCustomerForm> | ReturnType<typeof submitInvoicingCustomerFormSuccess> | ReturnType<typeof submitInvoicingCustomerFormFailure> | ReturnType<typeof resetNewAddressDataInLocalStore> | ReturnType<typeof updateAddresses> | ReturnType<typeof updateInvoicingCustomers> | ReturnType<typeof addInvoicingCustomerToList> | ReturnType<typeof openSnackbar>;
|
|
11
12
|
export declare const saveInvoicingCustomerEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -6,6 +6,7 @@ const operators_1 = require("rxjs/operators");
|
|
|
6
6
|
const addressReducer_1 = require("../../../entity/address/addressReducer");
|
|
7
7
|
const invoicingCustomerPayload_1 = require("../../../entity/invoicing/invoicingCustomer/invoicingCustomerPayload");
|
|
8
8
|
const invoicingCustomerReducer_1 = require("../../../entity/invoicing/invoicingCustomer/invoicingCustomerReducer");
|
|
9
|
+
const snackbarReducer_1 = require("../../../entity/snackbar/snackbarReducer");
|
|
9
10
|
const responsePayload_1 = require("../../../responsePayload");
|
|
10
11
|
const addressViewReducer_1 = require("../../addressView/addressViewReducer");
|
|
11
12
|
const invoicingCustomerListViewReducer_1 = require("../invoicingCustomerListView/invoicingCustomerListViewReducer");
|
|
@@ -48,10 +49,29 @@ const saveInvoicingCustomerEpic = (actions$, state$, zeniAPI) => actions$.pipe((
|
|
|
48
49
|
status: response.data.status,
|
|
49
50
|
}));
|
|
50
51
|
}
|
|
52
|
+
resultActions.push((0, snackbarReducer_1.openSnackbar)({
|
|
53
|
+
messageSection: 'invoicing_customer_saved',
|
|
54
|
+
messageText: 'success',
|
|
55
|
+
type: 'success',
|
|
56
|
+
}));
|
|
51
57
|
return resultActions;
|
|
52
58
|
}
|
|
53
|
-
return (0, rxjs_1.
|
|
54
|
-
|
|
55
|
-
|
|
59
|
+
return (0, rxjs_1.from)([
|
|
60
|
+
(0, editInvoicingCustomerDetailViewReducer_1.submitInvoicingCustomerFormFailure)(response.status),
|
|
61
|
+
(0, snackbarReducer_1.openSnackbar)({
|
|
62
|
+
messageSection: 'invoicing_customer_saved',
|
|
63
|
+
messageText: 'failed',
|
|
64
|
+
type: 'error',
|
|
65
|
+
}),
|
|
66
|
+
]);
|
|
67
|
+
}), (0, operators_1.catchError)((error) => (0, rxjs_1.from)([
|
|
68
|
+
(0, editInvoicingCustomerDetailViewReducer_1.submitInvoicingCustomerFormFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Save customer REST API call errored out ' +
|
|
69
|
+
JSON.stringify(error))),
|
|
70
|
+
(0, snackbarReducer_1.openSnackbar)({
|
|
71
|
+
messageSection: 'invoicing_customer_saved',
|
|
72
|
+
messageText: 'failed',
|
|
73
|
+
type: 'error',
|
|
74
|
+
}),
|
|
75
|
+
])));
|
|
56
76
|
}));
|
|
57
77
|
exports.saveInvoicingCustomerEpic = saveInvoicingCustomerEpic;
|
package/lib/view/invoicing/editInvoicingSubscriptionDetailView/saveInvoicingSubscriptionEpic.d.ts
CHANGED
|
@@ -2,10 +2,11 @@ import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
3
|
import { updateAddresses } from '../../../entity/address/addressReducer';
|
|
4
4
|
import { updateInvoicingSubscriptions } from '../../../entity/invoicing/invoicingSubscription/invoicingSubscriptionReducer';
|
|
5
|
+
import { openSnackbar } from '../../../entity/snackbar/snackbarReducer';
|
|
5
6
|
import { RootState } from '../../../reducer';
|
|
6
7
|
import { ZeniAPI } from '../../../zeniAPI';
|
|
7
8
|
import { resetNewAddressDataInLocalStore } from '../../addressView/addressViewReducer';
|
|
8
9
|
import { addInvoicingSubscriptionToList } from '../invoicingSubscriptionListView/invoicingSubscriptionListViewReducer';
|
|
9
10
|
import { submitInvoicingSubscriptionForm, submitInvoicingSubscriptionFormFailure, submitInvoicingSubscriptionFormSuccess, syncInvoicingSubscriptionCoupons } from './editInvoicingSubscriptionDetailViewReducer';
|
|
10
|
-
export type ActionType = ReturnType<typeof submitInvoicingSubscriptionForm> | ReturnType<typeof submitInvoicingSubscriptionFormSuccess> | ReturnType<typeof submitInvoicingSubscriptionFormFailure> | ReturnType<typeof syncInvoicingSubscriptionCoupons> | ReturnType<typeof resetNewAddressDataInLocalStore> | ReturnType<typeof updateAddresses> | ReturnType<typeof updateInvoicingSubscriptions> | ReturnType<typeof addInvoicingSubscriptionToList>;
|
|
11
|
+
export type ActionType = ReturnType<typeof submitInvoicingSubscriptionForm> | ReturnType<typeof submitInvoicingSubscriptionFormSuccess> | ReturnType<typeof submitInvoicingSubscriptionFormFailure> | ReturnType<typeof syncInvoicingSubscriptionCoupons> | ReturnType<typeof resetNewAddressDataInLocalStore> | ReturnType<typeof updateAddresses> | ReturnType<typeof updateInvoicingSubscriptions> | ReturnType<typeof addInvoicingSubscriptionToList> | ReturnType<typeof openSnackbar>;
|
|
11
12
|
export declare const saveInvoicingSubscriptionEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
package/lib/view/invoicing/editInvoicingSubscriptionDetailView/saveInvoicingSubscriptionEpic.js
CHANGED
|
@@ -6,6 +6,7 @@ const operators_1 = require("rxjs/operators");
|
|
|
6
6
|
const addressReducer_1 = require("../../../entity/address/addressReducer");
|
|
7
7
|
const invoicingSubscriptionPayload_1 = require("../../../entity/invoicing/invoicingSubscription/invoicingSubscriptionPayload");
|
|
8
8
|
const invoicingSubscriptionReducer_1 = require("../../../entity/invoicing/invoicingSubscription/invoicingSubscriptionReducer");
|
|
9
|
+
const snackbarReducer_1 = require("../../../entity/snackbar/snackbarReducer");
|
|
9
10
|
const responsePayload_1 = require("../../../responsePayload");
|
|
10
11
|
const addressViewReducer_1 = require("../../addressView/addressViewReducer");
|
|
11
12
|
const invoicingSubscriptionListViewReducer_1 = require("../invoicingSubscriptionListView/invoicingSubscriptionListViewReducer");
|
|
@@ -41,7 +42,14 @@ const saveInvoicingSubscriptionEpic = (actions$, state$, zeniAPI) => actions$.pi
|
|
|
41
42
|
: zeniAPI.postAndGetJSON(`${baseUrl}/subscriptions`, { ...data });
|
|
42
43
|
return request$.pipe((0, operators_1.mergeMap)((response) => {
|
|
43
44
|
if (!(0, responsePayload_1.isSuccessResponse)(response) || response.data == null) {
|
|
44
|
-
return [
|
|
45
|
+
return [
|
|
46
|
+
(0, editInvoicingSubscriptionDetailViewReducer_1.submitInvoicingSubscriptionFormFailure)(response.status),
|
|
47
|
+
(0, snackbarReducer_1.openSnackbar)({
|
|
48
|
+
messageSection: 'invoicing_subscription_saved',
|
|
49
|
+
messageText: 'failed',
|
|
50
|
+
type: 'error',
|
|
51
|
+
}),
|
|
52
|
+
];
|
|
45
53
|
}
|
|
46
54
|
const saved = response.data;
|
|
47
55
|
const couponChanged = id != null &&
|
|
@@ -81,8 +89,20 @@ const saveInvoicingSubscriptionEpic = (actions$, state$, zeniAPI) => actions$.pi
|
|
|
81
89
|
status: saved.status,
|
|
82
90
|
}));
|
|
83
91
|
}
|
|
92
|
+
resultActions.push((0, snackbarReducer_1.openSnackbar)({
|
|
93
|
+
messageSection: 'invoicing_subscription_saved',
|
|
94
|
+
messageText: 'success',
|
|
95
|
+
type: 'success',
|
|
96
|
+
}));
|
|
84
97
|
return resultActions;
|
|
85
|
-
}), (0, operators_1.catchError)((error) => (0, rxjs_1.
|
|
86
|
-
|
|
98
|
+
}), (0, operators_1.catchError)((error) => (0, rxjs_1.from)([
|
|
99
|
+
(0, editInvoicingSubscriptionDetailViewReducer_1.submitInvoicingSubscriptionFormFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Save subscription REST API call errored out ' +
|
|
100
|
+
JSON.stringify(error))),
|
|
101
|
+
(0, snackbarReducer_1.openSnackbar)({
|
|
102
|
+
messageSection: 'invoicing_subscription_saved',
|
|
103
|
+
messageText: 'failed',
|
|
104
|
+
type: 'error',
|
|
105
|
+
}),
|
|
106
|
+
])));
|
|
87
107
|
}));
|
|
88
108
|
exports.saveInvoicingSubscriptionEpic = saveInvoicingSubscriptionEpic;
|
|
@@ -2,11 +2,12 @@ import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
3
|
import { updateAddresses } from '../../../entity/address/addressReducer';
|
|
4
4
|
import { updateInvoicingSubscriptions } from '../../../entity/invoicing/invoicingSubscription/invoicingSubscriptionReducer';
|
|
5
|
+
import { openSnackbar } from '../../../entity/snackbar/snackbarReducer';
|
|
5
6
|
import { RootState } from '../../../reducer';
|
|
6
7
|
import { ZeniAPI } from '../../../zeniAPI';
|
|
7
8
|
import { resetNewAddressDataInLocalStore } from '../../addressView/addressViewReducer';
|
|
8
9
|
import { submitInvoicingSubscriptionFormFailure, submitInvoicingSubscriptionFormSuccess, syncInvoicingSubscriptionCoupons } from './editInvoicingSubscriptionDetailViewReducer';
|
|
9
|
-
export type ActionType = ReturnType<typeof syncInvoicingSubscriptionCoupons> | ReturnType<typeof submitInvoicingSubscriptionFormSuccess> | ReturnType<typeof submitInvoicingSubscriptionFormFailure> | ReturnType<typeof resetNewAddressDataInLocalStore> | ReturnType<typeof updateAddresses> | ReturnType<typeof updateInvoicingSubscriptions>;
|
|
10
|
+
export type ActionType = ReturnType<typeof syncInvoicingSubscriptionCoupons> | ReturnType<typeof submitInvoicingSubscriptionFormSuccess> | ReturnType<typeof submitInvoicingSubscriptionFormFailure> | ReturnType<typeof resetNewAddressDataInLocalStore> | ReturnType<typeof updateAddresses> | ReturnType<typeof updateInvoicingSubscriptions> | ReturnType<typeof openSnackbar>;
|
|
10
11
|
/**
|
|
11
12
|
* After a commercial PUT, sync coupon attach/detach via dedicated endpoints
|
|
12
13
|
* (PUT does not replace coupons). Runs remove-then-apply; on success finishes
|