@daffodil/cart 0.64.2 → 0.66.1
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/driver/in-memory/backend/cart/cart.service.d.ts +3 -1
- package/driver/in-memory/backend/cart-items/cart-items.service.d.ts +3 -1
- package/driver/in-memory/backend/cart-shipping-information/cart-shipping-information.service.d.ts +3 -1
- package/driver/in-memory/helpers/compute-cart-item-prices.d.ts +3 -0
- package/driver/in-memory/helpers/compute-cart-totals.d.ts +3 -0
- package/driver/magento/models/responses/cart.d.ts +1 -1
- package/esm2020/driver/in-memory/backend/cart/cart.service.mjs +9 -5
- package/esm2020/driver/in-memory/backend/cart-items/cart-items.service.mjs +21 -16
- package/esm2020/driver/in-memory/backend/cart-shipping-information/cart-shipping-information.service.mjs +10 -6
- package/esm2020/driver/in-memory/helpers/compute-cart-item-prices.mjs +7 -0
- package/esm2020/driver/in-memory/helpers/compute-cart-totals.mjs +46 -0
- package/esm2020/driver/magento/models/responses/cart.mjs +1 -1
- package/esm2020/driver/magento/transforms/outputs/cart-totals-transformer.mjs +23 -18
- package/esm2020/injection-tokens/public_api.mjs +1 -2
- package/esm2020/models/cart-total.mjs +1 -1
- package/esm2020/models/cart.mjs +1 -1
- package/esm2020/state/actions/cart-address.actions.mjs +1 -1
- package/esm2020/state/actions/cart-billing-address.actions.mjs +1 -1
- package/esm2020/state/actions/cart-coupon.actions.mjs +1 -1
- package/esm2020/state/actions/cart-item.actions.mjs +1 -1
- package/esm2020/state/actions/cart-order.actions.mjs +1 -1
- package/esm2020/state/actions/cart-payment-methods.actions.mjs +1 -1
- package/esm2020/state/actions/cart-payment.actions.mjs +1 -1
- package/esm2020/state/actions/cart-retrieval.mjs +71 -0
- package/esm2020/state/actions/cart-shipping-address.actions.mjs +1 -1
- package/esm2020/state/actions/cart-shipping-information.actions.mjs +1 -1
- package/esm2020/state/actions/cart-shipping-methods.actions.mjs +1 -1
- package/esm2020/state/actions/cart.actions.mjs +1 -1
- package/esm2020/state/actions/public_api.mjs +2 -1
- package/esm2020/state/cart-retrieval/get-response.mjs +12 -0
- package/esm2020/state/cart-retrieval/public_api.mjs +4 -0
- package/esm2020/state/cart-retrieval/token.mjs +14 -0
- package/esm2020/state/cart-retrieval/type.mjs +2 -0
- package/esm2020/state/cart-state.module.mjs +8 -3
- package/esm2020/state/effects/cart-address.effects.mjs +8 -7
- package/esm2020/state/effects/cart-billing-address.effects.mjs +7 -5
- package/esm2020/state/effects/cart-coupon.effects.mjs +17 -16
- package/esm2020/state/effects/cart-item.effects.mjs +12 -10
- package/esm2020/state/effects/cart-order.effects.mjs +8 -7
- package/esm2020/state/effects/cart-payment-methods.effects.mjs +6 -4
- package/esm2020/state/effects/cart-payment-processor.effects.mjs +7 -6
- package/esm2020/state/effects/cart-payment.effects.mjs +9 -7
- package/esm2020/state/effects/cart-resolver.effects.mjs +20 -15
- package/esm2020/state/effects/cart-shipping-address.effects.mjs +7 -5
- package/esm2020/state/effects/cart-shipping-information.effects.mjs +8 -6
- package/esm2020/state/effects/cart-shipping-methods.effects.mjs +6 -4
- package/esm2020/state/effects/cart.effects.mjs +16 -15
- package/esm2020/state/injection-tokens/error-matcher.token.mjs +8 -0
- package/esm2020/state/injection-tokens/public_api.mjs +2 -1
- package/esm2020/state/models/public_api.mjs +2 -1
- package/esm2020/state/models/stateful-cart.mjs +2 -0
- package/esm2020/state/public_api.mjs +2 -1
- package/esm2020/state/reducers/cart/cart.reducer.mjs +3 -16
- package/esm2020/state/reducers/cart/retrieval-actions.reducer.mjs +21 -0
- package/esm2020/state/reducers/cart-billing-address/cart-billing-address.reducer.mjs +2 -6
- package/esm2020/state/reducers/cart-coupon/cart-coupon.reducer.mjs +2 -6
- package/esm2020/state/reducers/cart-item/cart-item.reducer.mjs +2 -10
- package/esm2020/state/reducers/cart-item-entities/cart-item-entities.reducer.mjs +2 -35
- package/esm2020/state/reducers/cart-item-entities/retrieval-actions.reducer.mjs +20 -0
- package/esm2020/state/reducers/cart-item-entities/set-state.meta-reducer.mjs +46 -0
- package/esm2020/state/reducers/cart-order/cart-order.reducer.mjs +2 -5
- package/esm2020/state/reducers/cart-payment/cart-payment.reducer.mjs +2 -6
- package/esm2020/state/reducers/cart-payment/payment.reducer.mjs +2 -2
- package/esm2020/state/reducers/cart-payment-methods/cart-payment-methods.reducer.mjs +2 -2
- package/esm2020/state/reducers/cart-shipping-address/cart-shipping-address.reducer.mjs +2 -6
- package/esm2020/state/reducers/cart-shipping-information/cart-shipping-information.reducer.mjs +2 -8
- package/esm2020/state/reducers/cart-shipping-methods/cart-shipping-methods.reducer.mjs +2 -2
- package/esm2020/state/reducers/public_api.mjs +3 -1
- package/esm2020/state/reducers/token/config.token.mjs +18 -0
- package/esm2020/state/reducers/token/meta.token.mjs +27 -0
- package/esm2020/state/reducers/token/public_api.mjs +2 -1
- package/esm2020/state/reducers/token/reducers.token.mjs +20 -6
- package/esm2020/state/selectors/cart/cart.selector.mjs +11 -11
- package/esm2020/state/testing/cart-testing.module.mjs +6 -6
- package/esm2020/state/testing/mock-cart-facade.mjs +2 -2
- package/esm2020/state/testing/public_api.mjs +2 -2
- package/esm2020/testing/factories/cart-shipping-information.factory.mjs +25 -0
- package/esm2020/testing/factories/cart-total.factory.mjs +97 -0
- package/esm2020/testing/factories/cart.factory.mjs +14 -50
- package/esm2020/testing/factories/public_api.mjs +3 -1
- package/fesm2015/daffodil-cart-driver-in-memory.mjs +44 -18
- package/fesm2015/daffodil-cart-driver-in-memory.mjs.map +1 -1
- package/fesm2015/daffodil-cart-driver-magento.mjs +22 -17
- package/fesm2015/daffodil-cart-driver-magento.mjs.map +1 -1
- package/fesm2015/daffodil-cart-state-testing.mjs +7 -7
- package/fesm2015/daffodil-cart-state-testing.mjs.map +1 -1
- package/fesm2015/daffodil-cart-state.mjs +326 -141
- package/fesm2015/daffodil-cart-state.mjs.map +1 -1
- package/fesm2015/daffodil-cart-testing.mjs +148 -75
- package/fesm2015/daffodil-cart-testing.mjs.map +1 -1
- package/fesm2015/daffodil-cart.mjs +1 -8
- package/fesm2015/daffodil-cart.mjs.map +1 -1
- package/fesm2020/daffodil-cart-driver-in-memory.mjs +81 -24
- package/fesm2020/daffodil-cart-driver-in-memory.mjs.map +1 -1
- package/fesm2020/daffodil-cart-driver-magento.mjs +22 -17
- package/fesm2020/daffodil-cart-driver-magento.mjs.map +1 -1
- package/fesm2020/daffodil-cart-state-testing.mjs +7 -7
- package/fesm2020/daffodil-cart-state-testing.mjs.map +1 -1
- package/fesm2020/daffodil-cart-state.mjs +330 -178
- package/fesm2020/daffodil-cart-state.mjs.map +1 -1
- package/fesm2020/daffodil-cart-testing.mjs +148 -75
- package/fesm2020/daffodil-cart-testing.mjs.map +1 -1
- package/fesm2020/daffodil-cart.mjs +1 -8
- package/fesm2020/daffodil-cart.mjs.map +1 -1
- package/injection-tokens/public_api.d.ts +0 -1
- package/models/cart-total.d.ts +4 -0
- package/models/cart.d.ts +1 -1
- package/package.json +1 -1
- package/state/actions/cart-address.actions.d.ts +6 -5
- package/state/actions/cart-billing-address.actions.d.ts +9 -8
- package/state/actions/cart-coupon.actions.d.ts +17 -16
- package/state/actions/cart-item.actions.d.ts +18 -17
- package/state/actions/cart-order.actions.d.ts +4 -4
- package/state/actions/cart-payment-methods.actions.d.ts +4 -4
- package/state/actions/cart-payment.actions.d.ts +16 -15
- package/state/actions/cart-retrieval.d.ts +5 -0
- package/state/actions/cart-shipping-address.actions.d.ts +9 -8
- package/state/actions/cart-shipping-information.actions.d.ts +13 -12
- package/state/actions/cart-shipping-methods.actions.d.ts +4 -4
- package/state/actions/cart.actions.d.ts +25 -28
- package/state/actions/public_api.d.ts +1 -0
- package/state/cart-retrieval/get-response.d.ts +8 -0
- package/state/cart-retrieval/public_api.d.ts +3 -0
- package/state/cart-retrieval/token.d.ts +10 -0
- package/state/cart-retrieval/type.d.ts +40 -0
- package/state/effects/cart-address.effects.d.ts +2 -16
- package/state/effects/cart-billing-address.effects.d.ts +3 -17
- package/state/effects/cart-coupon.effects.d.ts +5 -5
- package/state/effects/cart-item.effects.d.ts +7 -49
- package/state/effects/cart-order.effects.d.ts +2 -2
- package/state/effects/cart-payment-methods.effects.d.ts +2 -2
- package/state/effects/cart-payment-processor.effects.d.ts +1 -16
- package/state/effects/cart-payment.effects.d.ts +5 -19
- package/state/effects/cart-shipping-address.effects.d.ts +3 -17
- package/state/effects/cart-shipping-information.effects.d.ts +4 -32
- package/state/effects/cart-shipping-methods.effects.d.ts +2 -2
- package/state/effects/cart.effects.d.ts +5 -19
- package/state/injection-tokens/public_api.d.ts +1 -0
- package/state/models/public_api.d.ts +1 -0
- package/state/models/stateful-cart.d.ts +8 -0
- package/state/public_api.d.ts +1 -0
- package/state/reducers/cart/retrieval-actions.reducer.d.ts +9 -0
- package/state/reducers/cart-item-entities/retrieval-actions.reducer.d.ts +10 -0
- package/state/reducers/cart-item-entities/set-state.meta-reducer.d.ts +11 -0
- package/state/reducers/public_api.d.ts +2 -0
- package/state/reducers/token/config.token.d.ts +10 -0
- package/state/reducers/token/meta.token.d.ts +23 -0
- package/state/reducers/token/public_api.d.ts +1 -0
- package/state/selectors/cart/cart.selector.d.ts +1 -0
- package/state/testing/cart-testing.module.d.ts +4 -4
- package/state/testing/public_api.d.ts +1 -1
- package/testing/factories/cart-shipping-information.factory.d.ts +12 -0
- package/testing/factories/cart-total.factory.d.ts +23 -0
- package/testing/factories/cart.factory.d.ts +9 -8
- package/testing/factories/public_api.d.ts +2 -0
- package/esm2020/injection-tokens/error-matcher.token.mjs +0 -8
- /package/{injection-tokens → state/injection-tokens}/error-matcher.token.d.ts +0 -0
|
@@ -1,21 +1,20 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { InjectionToken, Injectable, Inject, PLATFORM_ID, inject, NgModule } from '@angular/core';
|
|
1
3
|
import * as i1$1 from '@ngrx/store';
|
|
2
4
|
import { createFeatureSelector, createSelector, defaultMemoize, select, combineReducers, StoreModule } from '@ngrx/store';
|
|
3
5
|
import * as i2 from '@daffodil/cart';
|
|
4
|
-
import { DaffCartItemInputType, DaffCartTotalTypeEnum,
|
|
6
|
+
import { DaffCartItemInputType, DaffCartTotalTypeEnum, DaffCartResolutionError, DaffCartStorageResolutionError, DaffCartServerSideResolutionError, DaffCartPaymentMethodIdMap } from '@daffodil/cart';
|
|
5
7
|
import { daffComparePersonalAddresses } from '@daffodil/geography';
|
|
6
8
|
import { createEntityAdapter } from '@ngrx/entity';
|
|
7
|
-
import { daffComposeReducers } from '@daffodil/core/state';
|
|
9
|
+
import { daffComposeReducers, daffTransformErrorToStateError, daffIdentityReducer } from '@daffodil/core/state';
|
|
8
10
|
import * as i4 from '@daffodil/cart/driver';
|
|
9
11
|
import { DaffCartDriverErrorCodes, DaffCartAddressDriver, DaffCartBillingAddressDriver, DaffCartCouponDriver, daffCartDriverHandleCartNotFound, DaffCartItemDriver, DaffCartOrderDriver, DaffCartPaymentMethodsDriver, DaffCartPaymentDriver, DaffCartShippingAddressDriver, DaffCartShippingInformationDriver, DaffCartShippingMethodsDriver, DaffCartDriver } from '@daffodil/cart/driver';
|
|
10
|
-
import
|
|
11
|
-
import { InjectionToken, Injectable, Inject, PLATFORM_ID, inject, NgModule } from '@angular/core';
|
|
12
|
-
import { daffAdd, DaffStorageServiceError, DaffInheritableError, DaffServerSideStorageError } from '@daffodil/core';
|
|
12
|
+
import { daffAdd, catchAndArrayifyErrors, DAFF_STORAGE_SERVICE_ERROR_CODE, DaffInheritableError, DAFF_SERVER_STORAGE_SERVICE_ERROR_CODE } from '@daffodil/core';
|
|
13
13
|
import * as i1 from '@ngrx/effects';
|
|
14
14
|
import { createEffect, ofType, EffectsModule } from '@ngrx/effects';
|
|
15
|
-
import { DaffPaymentGenerateTokenFailure, DAFF_PAYMENT_PROCESSOR_COLLECTION, DaffPaymentStateReducerAdapter, daffPaymentInitialState, daffPaymentProvideExtraReducers } from '@daffodil/payment/state';
|
|
15
|
+
import { DaffPaymentGenerateTokenFailure, DAFF_PAYMENT_PROCESSOR_COLLECTION, DAFF_PAYMENT_ERROR_MATCHER, DaffPaymentStateReducerAdapter, daffPaymentInitialState, daffPaymentProvideExtraReducers } from '@daffodil/payment/state';
|
|
16
16
|
import { defer, of, combineLatest, iif, EMPTY } from 'rxjs';
|
|
17
|
-
import { switchMap, map,
|
|
18
|
-
import { DAFF_PAYMENT_ERROR_MATCHER } from '@daffodil/payment';
|
|
17
|
+
import { switchMap, map, concatMap, mergeMap, debounceTime, take, tap } from 'rxjs/operators';
|
|
19
18
|
import { isPlatformBrowser } from '@angular/common';
|
|
20
19
|
|
|
21
20
|
/**
|
|
@@ -1055,6 +1054,94 @@ class DaffCartCouponClearErrors {
|
|
|
1055
1054
|
}
|
|
1056
1055
|
}
|
|
1057
1056
|
|
|
1057
|
+
/**
|
|
1058
|
+
* A list of the Daffodil cart actions that are cart retrieval actions, in injection form.
|
|
1059
|
+
*/
|
|
1060
|
+
const daffCartRetrivalActions = [
|
|
1061
|
+
{
|
|
1062
|
+
type: DaffCartItemActionTypes.CartItemAddSuccessAction,
|
|
1063
|
+
},
|
|
1064
|
+
{
|
|
1065
|
+
type: DaffCartItemActionTypes.CartItemUpdateSuccessAction,
|
|
1066
|
+
},
|
|
1067
|
+
{
|
|
1068
|
+
type: DaffCartItemActionTypes.CartItemDeleteSuccessAction,
|
|
1069
|
+
},
|
|
1070
|
+
{
|
|
1071
|
+
type: DaffCartItemActionTypes.CartItemDeleteOutOfStockSuccessAction,
|
|
1072
|
+
},
|
|
1073
|
+
{
|
|
1074
|
+
type: DaffCartActionTypes.CartLoadSuccessAction,
|
|
1075
|
+
},
|
|
1076
|
+
{
|
|
1077
|
+
type: DaffCartActionTypes.ResolveCartSuccessAction,
|
|
1078
|
+
},
|
|
1079
|
+
{
|
|
1080
|
+
type: DaffCartActionTypes.CartLoadPartialSuccessAction,
|
|
1081
|
+
},
|
|
1082
|
+
{
|
|
1083
|
+
type: DaffCartActionTypes.ResolveCartPartialSuccessAction,
|
|
1084
|
+
},
|
|
1085
|
+
{
|
|
1086
|
+
type: DaffCartActionTypes.CartClearSuccessAction,
|
|
1087
|
+
},
|
|
1088
|
+
{
|
|
1089
|
+
type: DaffCartAddressActionTypes.CartAddressUpdateSuccessAction,
|
|
1090
|
+
},
|
|
1091
|
+
{
|
|
1092
|
+
type: DaffCartBillingAddressActionTypes.CartBillingAddressUpdateSuccessAction,
|
|
1093
|
+
},
|
|
1094
|
+
{
|
|
1095
|
+
type: DaffCartCouponActionTypes.CartCouponApplySuccessAction,
|
|
1096
|
+
},
|
|
1097
|
+
{
|
|
1098
|
+
type: DaffCartCouponActionTypes.CartCouponRemoveSuccessAction,
|
|
1099
|
+
},
|
|
1100
|
+
{
|
|
1101
|
+
type: DaffCartCouponActionTypes.CartCouponRemoveAllSuccessAction,
|
|
1102
|
+
},
|
|
1103
|
+
{
|
|
1104
|
+
type: DaffCartPaymentActionTypes.CartPaymentUpdateSuccessAction,
|
|
1105
|
+
},
|
|
1106
|
+
{
|
|
1107
|
+
type: DaffCartPaymentActionTypes.CartPaymentUpdateWithBillingSuccessAction,
|
|
1108
|
+
},
|
|
1109
|
+
{
|
|
1110
|
+
type: DaffCartShippingAddressActionTypes.CartShippingAddressUpdateSuccessAction,
|
|
1111
|
+
},
|
|
1112
|
+
{
|
|
1113
|
+
type: DaffCartShippingInformationActionTypes.CartShippingInformationUpdateSuccessAction,
|
|
1114
|
+
},
|
|
1115
|
+
{
|
|
1116
|
+
type: DaffCartShippingInformationActionTypes.CartShippingInformationDeleteSuccessAction,
|
|
1117
|
+
},
|
|
1118
|
+
];
|
|
1119
|
+
|
|
1120
|
+
/**
|
|
1121
|
+
* A token to hold {@link DaffCartRetrievalActionInjection}s.
|
|
1122
|
+
*/
|
|
1123
|
+
const DAFF_CART_RETRIEVAL_ACTIONS = new InjectionToken('DAFF_CART_RETRIEVAL_ACTIONS', { factory: () => [] });
|
|
1124
|
+
/**
|
|
1125
|
+
* A provider function for {@link DAFF_CART_RETRIEVAL_ACTIONS}.
|
|
1126
|
+
*/
|
|
1127
|
+
const daffCartProvideRetrievalActions = (...actions) => actions.map((action) => ({
|
|
1128
|
+
provide: DAFF_CART_RETRIEVAL_ACTIONS,
|
|
1129
|
+
useValue: action,
|
|
1130
|
+
multi: true,
|
|
1131
|
+
}));
|
|
1132
|
+
|
|
1133
|
+
/**
|
|
1134
|
+
* Gets the cart from the passed action if it is a recognized retrieval action and applies the transformation if needed.
|
|
1135
|
+
* If the action is not recognized as a retrieval action, returns `null`.
|
|
1136
|
+
*/
|
|
1137
|
+
function daffCartRetrievalGetResponse(action, retrievalActions) {
|
|
1138
|
+
const actionInjection = retrievalActions.find(({ type }) => type === action.type);
|
|
1139
|
+
if (actionInjection) {
|
|
1140
|
+
return actionInjection.transform?.(action) || action.payload;
|
|
1141
|
+
}
|
|
1142
|
+
return null;
|
|
1143
|
+
}
|
|
1144
|
+
|
|
1058
1145
|
/**
|
|
1059
1146
|
* Cart Item Entities Adapter for changing/overwriting entity state.
|
|
1060
1147
|
*/
|
|
@@ -1094,29 +1181,14 @@ function daffCartItemEntitiesReducer(state = daffCartItemEntitiesAdapter().getIn
|
|
|
1094
1181
|
daffState: getDaffState(state.entities[action.payload.id]) || DaffCartItemStateEnum.Default,
|
|
1095
1182
|
daffErrors: [],
|
|
1096
1183
|
}, state);
|
|
1097
|
-
case DaffCartItemActionTypes.CartItemAddSuccessAction:
|
|
1098
|
-
return adapter.setAll(updateAddedCartItemState(state.entities, action.payload.items), state);
|
|
1099
|
-
case DaffCartItemActionTypes.CartItemUpdateSuccessAction:
|
|
1100
|
-
return adapter.setAll(updateMutatedCartItemState(action.payload.items, state.entities, action.itemId), state);
|
|
1101
1184
|
case DaffCartItemActionTypes.CartItemDeleteFailureAction:
|
|
1102
1185
|
case DaffCartItemActionTypes.CartItemLoadFailureAction:
|
|
1103
1186
|
case DaffCartItemActionTypes.CartItemUpdateFailureAction:
|
|
1104
1187
|
return adapter.upsertOne({
|
|
1105
1188
|
...state.entities[action.itemId],
|
|
1106
1189
|
daffState: DaffCartItemStateEnum.Error,
|
|
1107
|
-
daffErrors: state.entities[action.itemId]?.daffErrors?.concat(action.payload) ||
|
|
1190
|
+
daffErrors: state.entities[action.itemId]?.daffErrors?.concat(action.payload) || action.payload,
|
|
1108
1191
|
}, state);
|
|
1109
|
-
case DaffCartItemActionTypes.CartItemDeleteSuccessAction:
|
|
1110
|
-
case DaffCartItemActionTypes.CartItemDeleteOutOfStockSuccessAction:
|
|
1111
|
-
case DaffCartActionTypes.CartLoadSuccessAction:
|
|
1112
|
-
case DaffCartActionTypes.ResolveCartSuccessAction:
|
|
1113
|
-
case DaffCartActionTypes.CartLoadPartialSuccessAction:
|
|
1114
|
-
case DaffCartActionTypes.ResolveCartPartialSuccessAction:
|
|
1115
|
-
case DaffCartActionTypes.CartClearSuccessAction:
|
|
1116
|
-
return adapter.setAll(action.payload.items.map(item => ({
|
|
1117
|
-
...item,
|
|
1118
|
-
daffState: getDaffState(state.entities[item.id]) || DaffCartItemStateEnum.Default,
|
|
1119
|
-
})), state);
|
|
1120
1192
|
case DaffCartItemActionTypes.CartItemStateResetAction:
|
|
1121
1193
|
return adapter.setAll(Object.keys(state.entities).map(key => ({
|
|
1122
1194
|
...state.entities[key],
|
|
@@ -1137,24 +1209,6 @@ function daffCartItemEntitiesReducer(state = daffCartItemEntitiesAdapter().getIn
|
|
|
1137
1209
|
function getDaffState(item) {
|
|
1138
1210
|
return item?.daffState;
|
|
1139
1211
|
}
|
|
1140
|
-
function updateAddedCartItemState(oldCartItems, newCartItems) {
|
|
1141
|
-
return newCartItems.map(newItem => {
|
|
1142
|
-
const oldItem = oldCartItems[newItem.id];
|
|
1143
|
-
switch (true) {
|
|
1144
|
-
case !oldItem:
|
|
1145
|
-
return { ...newItem, daffState: DaffCartItemStateEnum.New, daffErrors: [] };
|
|
1146
|
-
case oldItem?.qty !== newItem.qty:
|
|
1147
|
-
return { ...newItem, daffState: DaffCartItemStateEnum.Updated, daffErrors: [] };
|
|
1148
|
-
default:
|
|
1149
|
-
return newItem;
|
|
1150
|
-
}
|
|
1151
|
-
});
|
|
1152
|
-
}
|
|
1153
|
-
function updateMutatedCartItemState(responseItems, stateItems, itemId) {
|
|
1154
|
-
return responseItems.map(item => item.id === itemId ?
|
|
1155
|
-
{ ...item, daffState: DaffCartItemStateEnum.Updated, daffErrors: [] } :
|
|
1156
|
-
{ ...item, daffState: getDaffState(stateItems[item.id]) || DaffCartItemStateEnum.Default });
|
|
1157
|
-
}
|
|
1158
1212
|
|
|
1159
1213
|
const daffCartOrderInitialState = {
|
|
1160
1214
|
cartOrderResult: {
|
|
@@ -1184,10 +1238,7 @@ function daffCartOrderReducer(state = daffCartOrderInitialState, action) {
|
|
|
1184
1238
|
return {
|
|
1185
1239
|
...state,
|
|
1186
1240
|
loading: "Stable" /* DaffState.Complete */,
|
|
1187
|
-
errors:
|
|
1188
|
-
...state.errors,
|
|
1189
|
-
action.payload,
|
|
1190
|
-
],
|
|
1241
|
+
errors: action.payload,
|
|
1191
1242
|
};
|
|
1192
1243
|
case DaffCartActionTypes.CartClearSuccessAction:
|
|
1193
1244
|
case DaffCartActionTypes.CartCreateSuccessAction:
|
|
@@ -1329,11 +1380,7 @@ function cartReducer(state = daffCartReducerInitialState, action) {
|
|
|
1329
1380
|
return {
|
|
1330
1381
|
...state,
|
|
1331
1382
|
...resetErrors$8(state.errors),
|
|
1332
|
-
|
|
1333
|
-
...state.cart,
|
|
1334
|
-
...action.payload,
|
|
1335
|
-
},
|
|
1336
|
-
...setLoading$8(state.loading, "Stable" /* DaffState.Complete */),
|
|
1383
|
+
...setLoading$8(state.loading, "Stable" /* DaffState.Stable */),
|
|
1337
1384
|
};
|
|
1338
1385
|
case DaffCartActionTypes.CartCreateSuccessAction:
|
|
1339
1386
|
return {
|
|
@@ -1343,17 +1390,12 @@ function cartReducer(state = daffCartReducerInitialState, action) {
|
|
|
1343
1390
|
...daffCartReducerInitialState.cart,
|
|
1344
1391
|
...action.payload,
|
|
1345
1392
|
},
|
|
1346
|
-
...setLoading$8(state.loading, "Stable" /* DaffState.
|
|
1393
|
+
...setLoading$8(state.loading, "Stable" /* DaffState.Stable */),
|
|
1347
1394
|
};
|
|
1348
1395
|
case DaffCartActionTypes.CartClearFailureAction:
|
|
1349
1396
|
case DaffCartActionTypes.AddToCartFailureAction:
|
|
1350
1397
|
case DaffCartActionTypes.CartCreateFailureAction:
|
|
1351
1398
|
case DaffCartActionTypes.CartStorageFailureAction:
|
|
1352
|
-
return {
|
|
1353
|
-
...state,
|
|
1354
|
-
...addError$8(state.errors, action.payload),
|
|
1355
|
-
...setLoading$8(state.loading, "Stable" /* DaffState.Complete */),
|
|
1356
|
-
};
|
|
1357
1399
|
case DaffCartActionTypes.CartLoadFailureAction:
|
|
1358
1400
|
case DaffCartActionTypes.ResolveCartFailureAction:
|
|
1359
1401
|
return {
|
|
@@ -1365,10 +1407,6 @@ function cartReducer(state = daffCartReducerInitialState, action) {
|
|
|
1365
1407
|
case DaffCartActionTypes.CartLoadPartialSuccessAction:
|
|
1366
1408
|
return {
|
|
1367
1409
|
...state,
|
|
1368
|
-
cart: {
|
|
1369
|
-
...state.cart,
|
|
1370
|
-
...action.payload,
|
|
1371
|
-
},
|
|
1372
1410
|
...addError$8(state.errors, ...action.errors),
|
|
1373
1411
|
...setLoading$8(state.loading, "Stable" /* DaffState.Stable */),
|
|
1374
1412
|
};
|
|
@@ -1408,10 +1446,6 @@ function cartBillingAddressReducer(state = daffCartReducerInitialState, action)
|
|
|
1408
1446
|
return {
|
|
1409
1447
|
...state,
|
|
1410
1448
|
...resetErrors$7(state.errors),
|
|
1411
|
-
cart: {
|
|
1412
|
-
...state.cart,
|
|
1413
|
-
...action.payload,
|
|
1414
|
-
},
|
|
1415
1449
|
...setLoading$7(state.loading, "Stable" /* DaffState.Complete */),
|
|
1416
1450
|
};
|
|
1417
1451
|
case DaffCartBillingAddressActionTypes.CartBillingAddressLoadFailureAction:
|
|
@@ -1419,7 +1453,7 @@ function cartBillingAddressReducer(state = daffCartReducerInitialState, action)
|
|
|
1419
1453
|
case DaffCartAddressActionTypes.CartAddressUpdateFailureAction:
|
|
1420
1454
|
return {
|
|
1421
1455
|
...state,
|
|
1422
|
-
...addError$7(state.errors, action.payload),
|
|
1456
|
+
...addError$7(state.errors, ...action.payload),
|
|
1423
1457
|
...setLoading$7(state.loading, "Stable" /* DaffState.Complete */),
|
|
1424
1458
|
};
|
|
1425
1459
|
default:
|
|
@@ -1450,10 +1484,6 @@ function cartCouponReducer(state = daffCartReducerInitialState, action) {
|
|
|
1450
1484
|
return {
|
|
1451
1485
|
...state,
|
|
1452
1486
|
...resetErrors$6(state.errors),
|
|
1453
|
-
cart: {
|
|
1454
|
-
...state.cart,
|
|
1455
|
-
...action.payload,
|
|
1456
|
-
},
|
|
1457
1487
|
...setLoading$6(state.loading, "Stable" /* DaffState.Complete */),
|
|
1458
1488
|
};
|
|
1459
1489
|
case DaffCartCouponActionTypes.CartCouponClearErrorsAction:
|
|
@@ -1477,7 +1507,7 @@ function cartCouponReducer(state = daffCartReducerInitialState, action) {
|
|
|
1477
1507
|
case DaffCartCouponActionTypes.CartCouponRemoveFailureAction:
|
|
1478
1508
|
return {
|
|
1479
1509
|
...state,
|
|
1480
|
-
...addError$6(state.errors, action.payload),
|
|
1510
|
+
...addError$6(state.errors, ...action.payload),
|
|
1481
1511
|
...setLoading$6(state.loading, "Stable" /* DaffState.Complete */),
|
|
1482
1512
|
};
|
|
1483
1513
|
default:
|
|
@@ -1536,10 +1566,6 @@ function cartItemReducer(state = daffCartReducerInitialState, action) {
|
|
|
1536
1566
|
return {
|
|
1537
1567
|
...state,
|
|
1538
1568
|
...resetErrors$5(state.errors),
|
|
1539
|
-
cart: {
|
|
1540
|
-
...state.cart,
|
|
1541
|
-
...action.payload,
|
|
1542
|
-
},
|
|
1543
1569
|
...setLoading$5(state.loading, "Stable" /* DaffState.Complete */),
|
|
1544
1570
|
};
|
|
1545
1571
|
case DaffCartItemActionTypes.CartItemDeleteOutOfStockSuccessAction:
|
|
@@ -1551,10 +1577,6 @@ function cartItemReducer(state = daffCartReducerInitialState, action) {
|
|
|
1551
1577
|
// out of stock errors can be in the main cart, remove them here
|
|
1552
1578
|
[DaffCartOperationType.Cart]: state.errors[DaffCartOperationType.Cart].filter(({ code }) => code !== DaffCartDriverErrorCodes.PRODUCT_OUT_OF_STOCK),
|
|
1553
1579
|
},
|
|
1554
|
-
cart: {
|
|
1555
|
-
...state.cart,
|
|
1556
|
-
...action.payload,
|
|
1557
|
-
},
|
|
1558
1580
|
...setLoading$5(state.loading, "Stable" /* DaffState.Complete */),
|
|
1559
1581
|
};
|
|
1560
1582
|
case DaffCartItemActionTypes.CartItemListFailureAction:
|
|
@@ -1563,7 +1585,7 @@ function cartItemReducer(state = daffCartReducerInitialState, action) {
|
|
|
1563
1585
|
case DaffCartItemActionTypes.CartItemDeleteOutOfStockFailureAction:
|
|
1564
1586
|
return {
|
|
1565
1587
|
...state,
|
|
1566
|
-
...addError$5(state.errors, action.payload),
|
|
1588
|
+
...addError$5(state.errors, ...action.payload),
|
|
1567
1589
|
...setLoading$5(state.loading, "Stable" /* DaffState.Complete */),
|
|
1568
1590
|
};
|
|
1569
1591
|
case DaffCartItemActionTypes.CartItemUpdateFailureAction:
|
|
@@ -1619,10 +1641,6 @@ function cartPaymentReducer(state = daffCartReducerInitialState, action) {
|
|
|
1619
1641
|
return {
|
|
1620
1642
|
...state,
|
|
1621
1643
|
...resetErrors$4(state.errors),
|
|
1622
|
-
cart: {
|
|
1623
|
-
...state.cart,
|
|
1624
|
-
...action.payload,
|
|
1625
|
-
},
|
|
1626
1644
|
...setLoading$4(state.loading, "Stable" /* DaffState.Complete */),
|
|
1627
1645
|
};
|
|
1628
1646
|
case DaffCartPaymentActionTypes.CartPaymentLoadFailureAction:
|
|
@@ -1631,7 +1649,7 @@ function cartPaymentReducer(state = daffCartReducerInitialState, action) {
|
|
|
1631
1649
|
case DaffCartPaymentActionTypes.CartPaymentRemoveFailureAction:
|
|
1632
1650
|
return {
|
|
1633
1651
|
...state,
|
|
1634
|
-
...addError$4(state.errors, action.payload),
|
|
1652
|
+
...addError$4(state.errors, ...action.payload),
|
|
1635
1653
|
...setLoading$4(state.loading, "Stable" /* DaffState.Complete */),
|
|
1636
1654
|
};
|
|
1637
1655
|
/**
|
|
@@ -1678,7 +1696,7 @@ function cartPaymentMethodsReducer(state = daffCartReducerInitialState, action)
|
|
|
1678
1696
|
case DaffCartPaymentMethodsActionTypes.CartPaymentMethodsLoadFailureAction:
|
|
1679
1697
|
return {
|
|
1680
1698
|
...state,
|
|
1681
|
-
...addError$3(state.errors, action.payload),
|
|
1699
|
+
...addError$3(state.errors, ...action.payload),
|
|
1682
1700
|
...setLoading$3(state.loading, "Stable" /* DaffState.Complete */),
|
|
1683
1701
|
};
|
|
1684
1702
|
default:
|
|
@@ -1746,10 +1764,6 @@ function cartShippingAddressReducer(state = daffCartReducerInitialState, action)
|
|
|
1746
1764
|
return {
|
|
1747
1765
|
...state,
|
|
1748
1766
|
...resetErrors$2(state.errors),
|
|
1749
|
-
cart: {
|
|
1750
|
-
...state.cart,
|
|
1751
|
-
...action.payload,
|
|
1752
|
-
},
|
|
1753
1767
|
...setLoading$2(state.loading, "Stable" /* DaffState.Complete */),
|
|
1754
1768
|
};
|
|
1755
1769
|
case DaffCartShippingAddressActionTypes.CartShippingAddressLoadFailureAction:
|
|
@@ -1757,7 +1771,7 @@ function cartShippingAddressReducer(state = daffCartReducerInitialState, action)
|
|
|
1757
1771
|
case DaffCartAddressActionTypes.CartAddressUpdateFailureAction:
|
|
1758
1772
|
return {
|
|
1759
1773
|
...state,
|
|
1760
|
-
...addError$2(state.errors, action.payload),
|
|
1774
|
+
...addError$2(state.errors, ...action.payload),
|
|
1761
1775
|
...setLoading$2(state.loading, "Stable" /* DaffState.Complete */),
|
|
1762
1776
|
};
|
|
1763
1777
|
default:
|
|
@@ -1797,12 +1811,6 @@ function cartShippingInformationReducer(state = daffCartReducerInitialState, act
|
|
|
1797
1811
|
return {
|
|
1798
1812
|
...state,
|
|
1799
1813
|
...resetErrors$1(state.errors),
|
|
1800
|
-
cart: {
|
|
1801
|
-
...state.cart,
|
|
1802
|
-
// ensure that shipping_information is set to null in case its not included in action.payload
|
|
1803
|
-
shipping_information: null,
|
|
1804
|
-
...action.payload,
|
|
1805
|
-
},
|
|
1806
1814
|
...setLoading$1(state.loading, "Stable" /* DaffState.Complete */),
|
|
1807
1815
|
};
|
|
1808
1816
|
case DaffCartShippingInformationActionTypes.CartShippingInformationLoadFailureAction:
|
|
@@ -1810,7 +1818,7 @@ function cartShippingInformationReducer(state = daffCartReducerInitialState, act
|
|
|
1810
1818
|
case DaffCartShippingInformationActionTypes.CartShippingInformationDeleteFailureAction:
|
|
1811
1819
|
return {
|
|
1812
1820
|
...state,
|
|
1813
|
-
...addError$1(state.errors, action.payload),
|
|
1821
|
+
...addError$1(state.errors, ...action.payload),
|
|
1814
1822
|
...setLoading$1(state.loading, "Stable" /* DaffState.Complete */),
|
|
1815
1823
|
};
|
|
1816
1824
|
default:
|
|
@@ -1841,7 +1849,7 @@ function cartShippingMethodsReducer(state = daffCartReducerInitialState, action)
|
|
|
1841
1849
|
case DaffCartShippingMethodsActionTypes.CartShippingMethodsLoadFailureAction:
|
|
1842
1850
|
return {
|
|
1843
1851
|
...state,
|
|
1844
|
-
...addError(state.errors, action.payload),
|
|
1852
|
+
...addError(state.errors, ...action.payload),
|
|
1845
1853
|
...setLoading(state.loading, "Stable" /* DaffState.Complete */),
|
|
1846
1854
|
};
|
|
1847
1855
|
default:
|
|
@@ -1877,6 +1885,42 @@ const daffCartReducers = {
|
|
|
1877
1885
|
|
|
1878
1886
|
const DAFF_CART_STORE_FEATURE_KEY = 'daffCart';
|
|
1879
1887
|
|
|
1888
|
+
/**
|
|
1889
|
+
* Reducer function factory that updates cart item entities according to a list of passed cart retrieval actions.
|
|
1890
|
+
* See {@link DaffCartRetrievalActionInjection}.
|
|
1891
|
+
*/
|
|
1892
|
+
function daffCartItemEntitiesRetrievalActionsReducerFactory(retrievalActions) {
|
|
1893
|
+
return (state = daffCartItemEntitiesAdapter().getInitialState(), action) => {
|
|
1894
|
+
const adapter = daffCartItemEntitiesAdapter();
|
|
1895
|
+
const cart = daffCartRetrievalGetResponse(action, retrievalActions);
|
|
1896
|
+
return cart?.items
|
|
1897
|
+
? adapter.setAll(cart.items.map((item) => ({
|
|
1898
|
+
...item,
|
|
1899
|
+
daffState: item.daffState || state.entities[item.id]?.daffState || DaffCartItemStateEnum.Default,
|
|
1900
|
+
})), state)
|
|
1901
|
+
: state;
|
|
1902
|
+
};
|
|
1903
|
+
}
|
|
1904
|
+
|
|
1905
|
+
/**
|
|
1906
|
+
* Reducer function factory that updates cart state according to a list of passed cart retrieval actions.
|
|
1907
|
+
* See {@link DaffCartRetrievalActionInjection}.
|
|
1908
|
+
*/
|
|
1909
|
+
function daffCartRetrievalActionsReducerFactory(retrievalActions) {
|
|
1910
|
+
return (state = daffCartReducerInitialState, action) => {
|
|
1911
|
+
const cart = daffCartRetrievalGetResponse(action, retrievalActions);
|
|
1912
|
+
return cart
|
|
1913
|
+
? {
|
|
1914
|
+
...state,
|
|
1915
|
+
cart: {
|
|
1916
|
+
...state.cart,
|
|
1917
|
+
...cart,
|
|
1918
|
+
},
|
|
1919
|
+
}
|
|
1920
|
+
: state;
|
|
1921
|
+
};
|
|
1922
|
+
}
|
|
1923
|
+
|
|
1880
1924
|
/**
|
|
1881
1925
|
* A token to hold the injectable extra reducers.
|
|
1882
1926
|
*
|
|
@@ -1903,6 +1947,32 @@ function daffCartProvideExtraReducers(...reducers) {
|
|
|
1903
1947
|
}));
|
|
1904
1948
|
}
|
|
1905
1949
|
|
|
1950
|
+
/**
|
|
1951
|
+
* A token to hold the injectable extra meta-reducers.
|
|
1952
|
+
*
|
|
1953
|
+
* Prefer using {@link daffCartProvideMetaReducers}.
|
|
1954
|
+
*/
|
|
1955
|
+
const DAFF_CART_META_REDUCERS = new InjectionToken('DAFF_CART_META_REDUCERS', { factory: () => [] });
|
|
1956
|
+
/**
|
|
1957
|
+
* Provides additional meta-reducers that run after the standard Daffodil cart meta-reducers.
|
|
1958
|
+
*
|
|
1959
|
+
* ```ts
|
|
1960
|
+
* providers: [
|
|
1961
|
+
* ...daffCartProvideMetaReducers(
|
|
1962
|
+
* myMetaReducer1,
|
|
1963
|
+
* myMetaReducer2
|
|
1964
|
+
* )
|
|
1965
|
+
* ]
|
|
1966
|
+
* ```
|
|
1967
|
+
*/
|
|
1968
|
+
function daffCartProvideMetaReducers(...metaReducers) {
|
|
1969
|
+
return metaReducers.map(metaReducer => ({
|
|
1970
|
+
provide: DAFF_CART_META_REDUCERS,
|
|
1971
|
+
useValue: metaReducer,
|
|
1972
|
+
multi: true,
|
|
1973
|
+
}));
|
|
1974
|
+
}
|
|
1975
|
+
|
|
1906
1976
|
const getDaffCartFeatureSelector = (() => {
|
|
1907
1977
|
let cache;
|
|
1908
1978
|
return () => cache = cache
|
|
@@ -2079,39 +2149,39 @@ const createCartSelectors$1 = () => {
|
|
|
2079
2149
|
* @deprecated use selectCartSubtotalExcludingTax selector instead.
|
|
2080
2150
|
*/
|
|
2081
2151
|
const selectCartSubtotal = createSelector(selectCartValue, (state) => {
|
|
2082
|
-
const subtotalObject = state.totals
|
|
2152
|
+
const subtotalObject = state.totals[DaffCartTotalTypeEnum.subtotalExcludingTax];
|
|
2083
2153
|
return subtotalObject ? subtotalObject.value : null;
|
|
2084
2154
|
});
|
|
2085
2155
|
const selectCartGrandTotal = createSelector(selectCartValue, (state) => {
|
|
2086
|
-
const grandTotalObject = state.totals
|
|
2156
|
+
const grandTotalObject = state.totals[DaffCartTotalTypeEnum.grandTotal];
|
|
2087
2157
|
return grandTotalObject ? grandTotalObject.value : null;
|
|
2088
2158
|
});
|
|
2089
2159
|
const selectCartSubtotalExcludingTax = createSelector(selectCartValue, (state) => {
|
|
2090
|
-
const subtotalExcludingTaxObject = state.totals
|
|
2160
|
+
const subtotalExcludingTaxObject = state.totals[DaffCartTotalTypeEnum.subtotalExcludingTax];
|
|
2091
2161
|
return subtotalExcludingTaxObject ? subtotalExcludingTaxObject.value : null;
|
|
2092
2162
|
});
|
|
2093
2163
|
const selectCartSubtotalIncludingTax = createSelector(selectCartValue, (state) => {
|
|
2094
|
-
const subtotalIncludingTaxObject = state.totals
|
|
2164
|
+
const subtotalIncludingTaxObject = state.totals[DaffCartTotalTypeEnum.subtotalIncludingTax];
|
|
2095
2165
|
return subtotalIncludingTaxObject ? subtotalIncludingTaxObject.value : null;
|
|
2096
2166
|
});
|
|
2097
2167
|
const selectCartSubtotalWithDiscountExcludingTax = createSelector(selectCartValue, (state) => {
|
|
2098
|
-
const subtotalWithDiscountExcludingTaxObject = state.totals
|
|
2168
|
+
const subtotalWithDiscountExcludingTaxObject = state.totals[DaffCartTotalTypeEnum.subtotalWithDiscountExcludingTax];
|
|
2099
2169
|
return subtotalWithDiscountExcludingTaxObject ? subtotalWithDiscountExcludingTaxObject.value : null;
|
|
2100
2170
|
});
|
|
2101
2171
|
const selectCartSubtotalWithDiscountIncludingTax = createSelector(selectCartValue, (state) => {
|
|
2102
|
-
const subtotalWithDiscountIncludingTaxObject = state.totals
|
|
2172
|
+
const subtotalWithDiscountIncludingTaxObject = state.totals[DaffCartTotalTypeEnum.subtotalWithDiscountIncludingTax];
|
|
2103
2173
|
return subtotalWithDiscountIncludingTaxObject ? subtotalWithDiscountIncludingTaxObject.value : null;
|
|
2104
2174
|
});
|
|
2105
2175
|
const selectCartTotalTax = createSelector(selectCartValue, (state) => {
|
|
2106
|
-
const taxObject = state.totals
|
|
2176
|
+
const taxObject = state.totals[DaffCartTotalTypeEnum.tax];
|
|
2107
2177
|
return taxObject ? taxObject.value : null;
|
|
2108
2178
|
});
|
|
2109
2179
|
const selectCartDiscountTotals = createSelector(selectCartValue, (state) => {
|
|
2110
|
-
const
|
|
2111
|
-
return
|
|
2180
|
+
const discount = state.totals[DaffCartTotalTypeEnum.discount];
|
|
2181
|
+
return discount ? [discount] : [];
|
|
2112
2182
|
});
|
|
2113
2183
|
const selectCartShippingTotal = createSelector(selectCartValue, (state) => {
|
|
2114
|
-
const shippingTotalObject = state.totals
|
|
2184
|
+
const shippingTotalObject = state.totals[DaffCartTotalTypeEnum.shipping];
|
|
2115
2185
|
return shippingTotalObject ? shippingTotalObject.value : null;
|
|
2116
2186
|
});
|
|
2117
2187
|
const selectCartCoupons = createSelector(selectCartValue, (state) => state.coupons);
|
|
@@ -2265,15 +2335,21 @@ const getDaffCartSelectors = (() => {
|
|
|
2265
2335
|
*/
|
|
2266
2336
|
const DaffCartItemStateDebounceTime = new InjectionToken('DaffCartItemStateDebounceTime');
|
|
2267
2337
|
|
|
2338
|
+
/**
|
|
2339
|
+
* Transforms `DaffError`s into `DaffStateError`s before they are serialized into state.
|
|
2340
|
+
* Can be used to further refine Daffodil errors into more specific app errors.
|
|
2341
|
+
*/
|
|
2342
|
+
const DAFF_CART_ERROR_MATCHER = new InjectionToken('DAFF_CART_ERROR_MATCHER', { factory: () => daffTransformErrorToStateError });
|
|
2343
|
+
|
|
2268
2344
|
class DaffCartAddressEffects {
|
|
2269
2345
|
constructor(actions$, errorMatcher, driver, storage) {
|
|
2270
2346
|
this.actions$ = actions$;
|
|
2271
2347
|
this.errorMatcher = errorMatcher;
|
|
2272
2348
|
this.driver = driver;
|
|
2273
2349
|
this.storage = storage;
|
|
2274
|
-
this.update$ = createEffect(() => this.actions$.pipe(ofType(DaffCartAddressActionTypes.CartAddressUpdateAction), switchMap((action) => defer(() => of(this.storage.getCartId())).pipe(switchMap(cartId => this.driver.update(cartId, action.payload)), map((resp) => new DaffCartAddressUpdateSuccess(resp)),
|
|
2275
|
-
? new DaffCartStorageFailure(this.errorMatcher
|
|
2276
|
-
: new DaffCartAddressUpdateFailure(this.errorMatcher
|
|
2350
|
+
this.update$ = createEffect(() => this.actions$.pipe(ofType(DaffCartAddressActionTypes.CartAddressUpdateAction), switchMap((action) => defer(() => of(this.storage.getCartId())).pipe(switchMap(cartId => this.driver.update(cartId, action.payload)), map((resp) => new DaffCartAddressUpdateSuccess(resp)), catchAndArrayifyErrors(error => of(error.find((err) => err.code === DAFF_STORAGE_SERVICE_ERROR_CODE)
|
|
2351
|
+
? new DaffCartStorageFailure(error.map(this.errorMatcher))
|
|
2352
|
+
: new DaffCartAddressUpdateFailure(error.map(this.errorMatcher))))))));
|
|
2277
2353
|
}
|
|
2278
2354
|
}
|
|
2279
2355
|
/** @nocollapse */ DaffCartAddressEffects.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffCartAddressEffects, deps: [{ token: i1.Actions }, { token: DAFF_CART_ERROR_MATCHER }, { token: DaffCartAddressDriver }, { token: i2.DaffCartStorageService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
@@ -2294,8 +2370,8 @@ class DaffCartBillingAddressEffects {
|
|
|
2294
2370
|
this.errorMatcher = errorMatcher;
|
|
2295
2371
|
this.driver = driver;
|
|
2296
2372
|
this.storage = storage;
|
|
2297
|
-
this.get$ = createEffect(() => this.actions$.pipe(ofType(DaffCartBillingAddressActionTypes.CartBillingAddressLoadAction), switchMap((action) => this.driver.get(this.storage.getCartId()).pipe(map((resp) => new DaffCartBillingAddressLoadSuccess(resp)),
|
|
2298
|
-
this.update$ = createEffect(() => this.actions$.pipe(ofType(DaffCartBillingAddressActionTypes.CartBillingAddressUpdateAction), switchMap((action) => this.driver.update(this.storage.getCartId(), action.payload).pipe(map((resp) => new DaffCartBillingAddressUpdateSuccess(resp)),
|
|
2373
|
+
this.get$ = createEffect(() => this.actions$.pipe(ofType(DaffCartBillingAddressActionTypes.CartBillingAddressLoadAction), switchMap((action) => this.driver.get(this.storage.getCartId()).pipe(map((resp) => new DaffCartBillingAddressLoadSuccess(resp)), catchAndArrayifyErrors(error => of(new DaffCartBillingAddressLoadFailure(error.map(this.errorMatcher))))))));
|
|
2374
|
+
this.update$ = createEffect(() => this.actions$.pipe(ofType(DaffCartBillingAddressActionTypes.CartBillingAddressUpdateAction), switchMap((action) => this.driver.update(this.storage.getCartId(), action.payload).pipe(map((resp) => new DaffCartBillingAddressUpdateSuccess(resp)), catchAndArrayifyErrors(error => of(new DaffCartBillingAddressUpdateFailure(error.map(this.errorMatcher))))))));
|
|
2299
2375
|
}
|
|
2300
2376
|
}
|
|
2301
2377
|
/** @nocollapse */ DaffCartBillingAddressEffects.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffCartBillingAddressEffects, deps: [{ token: i1.Actions }, { token: DAFF_CART_ERROR_MATCHER }, { token: DaffCartBillingAddressDriver }, { token: i2.DaffCartStorageService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
@@ -2316,18 +2392,18 @@ class DaffCartCouponEffects {
|
|
|
2316
2392
|
this.errorMatcher = errorMatcher;
|
|
2317
2393
|
this.driver = driver;
|
|
2318
2394
|
this.storage = storage;
|
|
2319
|
-
this.apply$ = createEffect(() => this.actions$.pipe(ofType(DaffCartCouponActionTypes.CartCouponApplyAction), switchMap((action) => defer(() => of(this.storage.getCartId())).pipe(switchMap(cartId => this.driver.apply(cartId, action.payload)), map(resp => new DaffCartCouponApplySuccess(resp)),
|
|
2320
|
-
? new DaffCartStorageFailure(this.errorMatcher
|
|
2321
|
-
: new DaffCartCouponApplyFailure(this.errorMatcher
|
|
2322
|
-
this.list$ = createEffect(() => this.actions$.pipe(ofType(DaffCartCouponActionTypes.CartCouponListAction), switchMap((action) => defer(() => of(this.storage.getCartId())).pipe(switchMap(cartId => this.driver.list(cartId)), map(resp => new DaffCartCouponListSuccess(resp)),
|
|
2323
|
-
? new DaffCartStorageFailure(this.errorMatcher
|
|
2324
|
-
: new DaffCartCouponListFailure(this.errorMatcher
|
|
2325
|
-
this.remove$ = createEffect(() => this.actions$.pipe(ofType(DaffCartCouponActionTypes.CartCouponRemoveAction), switchMap((action) => defer(() => of(this.storage.getCartId())).pipe(switchMap(cartId => this.driver.remove(cartId, action.payload)), map(resp => new DaffCartCouponRemoveSuccess(resp)),
|
|
2326
|
-
? new DaffCartStorageFailure(this.errorMatcher
|
|
2327
|
-
: new DaffCartCouponRemoveFailure(this.errorMatcher
|
|
2328
|
-
this.removeAll$ = createEffect(() => this.actions$.pipe(ofType(DaffCartCouponActionTypes.CartCouponRemoveAllAction), switchMap((action) => defer(() => of(this.storage.getCartId())).pipe(switchMap(cartId => this.driver.removeAll(cartId)), map(resp => new DaffCartCouponRemoveAllSuccess(resp)),
|
|
2329
|
-
? new DaffCartStorageFailure(this.errorMatcher
|
|
2330
|
-
: new DaffCartCouponRemoveAllFailure(this.errorMatcher
|
|
2395
|
+
this.apply$ = createEffect(() => this.actions$.pipe(ofType(DaffCartCouponActionTypes.CartCouponApplyAction), switchMap((action) => defer(() => of(this.storage.getCartId())).pipe(switchMap(cartId => this.driver.apply(cartId, action.payload)), map(resp => new DaffCartCouponApplySuccess(resp)), catchAndArrayifyErrors(error => of(error.find((err) => err.code === DAFF_STORAGE_SERVICE_ERROR_CODE)
|
|
2396
|
+
? new DaffCartStorageFailure(error.map(this.errorMatcher))
|
|
2397
|
+
: new DaffCartCouponApplyFailure(error.map(this.errorMatcher))))))));
|
|
2398
|
+
this.list$ = createEffect(() => this.actions$.pipe(ofType(DaffCartCouponActionTypes.CartCouponListAction), switchMap((action) => defer(() => of(this.storage.getCartId())).pipe(switchMap(cartId => this.driver.list(cartId)), map(resp => new DaffCartCouponListSuccess(resp)), catchAndArrayifyErrors(error => of(error.find((err) => err.code === DAFF_STORAGE_SERVICE_ERROR_CODE)
|
|
2399
|
+
? new DaffCartStorageFailure(error.map(this.errorMatcher))
|
|
2400
|
+
: new DaffCartCouponListFailure(error.map(this.errorMatcher))))))));
|
|
2401
|
+
this.remove$ = createEffect(() => this.actions$.pipe(ofType(DaffCartCouponActionTypes.CartCouponRemoveAction), switchMap((action) => defer(() => of(this.storage.getCartId())).pipe(switchMap(cartId => this.driver.remove(cartId, action.payload)), map(resp => new DaffCartCouponRemoveSuccess(resp)), catchAndArrayifyErrors(error => of(error.find((err) => err.code === DAFF_STORAGE_SERVICE_ERROR_CODE)
|
|
2402
|
+
? new DaffCartStorageFailure(error.map(this.errorMatcher))
|
|
2403
|
+
: new DaffCartCouponRemoveFailure(error.map(this.errorMatcher))))))));
|
|
2404
|
+
this.removeAll$ = createEffect(() => this.actions$.pipe(ofType(DaffCartCouponActionTypes.CartCouponRemoveAllAction), switchMap((action) => defer(() => of(this.storage.getCartId())).pipe(switchMap(cartId => this.driver.removeAll(cartId)), map(resp => new DaffCartCouponRemoveAllSuccess(resp)), catchAndArrayifyErrors(error => of(error.find((err) => err.code === DAFF_STORAGE_SERVICE_ERROR_CODE)
|
|
2405
|
+
? new DaffCartStorageFailure(error.map(this.errorMatcher))
|
|
2406
|
+
: new DaffCartCouponRemoveAllFailure(error.map(this.errorMatcher))))))));
|
|
2331
2407
|
}
|
|
2332
2408
|
}
|
|
2333
2409
|
/** @nocollapse */ DaffCartCouponEffects.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffCartCouponEffects, deps: [{ token: i1.Actions }, { token: DAFF_CART_ERROR_MATCHER }, { token: DaffCartCouponDriver }, { token: i2.DaffCartStorageService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
@@ -2351,25 +2427,25 @@ class DaffCartItemEffects {
|
|
|
2351
2427
|
this.cartItemStateDebounceTime = cartItemStateDebounceTime;
|
|
2352
2428
|
this.store = store;
|
|
2353
2429
|
this.cartResolver = cartResolver;
|
|
2354
|
-
this.list$ = createEffect(() => this.actions$.pipe(ofType(DaffCartItemActionTypes.CartItemListAction), switchMap((action) => this.driver.list(this.storage.getCartId()).pipe(map((resp) => new DaffCartItemListSuccess(resp)),
|
|
2355
|
-
this.get$ = createEffect(() => this.actions$.pipe(ofType(DaffCartItemActionTypes.CartItemLoadAction), switchMap((action) => this.driver.get(this.storage.getCartId(), action.itemId).pipe(map((resp) => new DaffCartItemLoadSuccess(resp)),
|
|
2430
|
+
this.list$ = createEffect(() => this.actions$.pipe(ofType(DaffCartItemActionTypes.CartItemListAction), switchMap((action) => this.driver.list(this.storage.getCartId()).pipe(map((resp) => new DaffCartItemListSuccess(resp)), catchAndArrayifyErrors(error => of(new DaffCartItemListFailure(error.map(this.errorMatcher))))))));
|
|
2431
|
+
this.get$ = createEffect(() => this.actions$.pipe(ofType(DaffCartItemActionTypes.CartItemLoadAction), switchMap((action) => this.driver.get(this.storage.getCartId(), action.itemId).pipe(map((resp) => new DaffCartItemLoadSuccess(resp)), catchAndArrayifyErrors(error => of(new DaffCartItemLoadFailure(error.map(this.errorMatcher), action.itemId)))))));
|
|
2356
2432
|
this.add$ = createEffect(() => this.actions$.pipe(ofType(DaffCartItemActionTypes.CartItemAddAction), concatMap((action) => combineLatest([
|
|
2357
2433
|
of(action),
|
|
2358
2434
|
this.cartResolver.getCartIdOrFail(),
|
|
2359
|
-
])), mergeMap(([action, id]) => this.addCartItem$(id, action.input)), daffCartDriverHandleCartNotFound(this.storage),
|
|
2360
|
-
this.update$ = createEffect(() => this.actions$.pipe(ofType(DaffCartItemActionTypes.CartItemUpdateAction), mergeMap((action) => this.driver.update(this.storage.getCartId(), action.itemId, action.changes).pipe(map((resp) => new DaffCartItemUpdateSuccess(resp, action.itemId)),
|
|
2435
|
+
])), mergeMap(([action, id]) => this.addCartItem$(id, action.input)), daffCartDriverHandleCartNotFound(this.storage), catchAndArrayifyErrors(error => of(new DaffCartItemAddFailure(error.map(this.errorMatcher))))));
|
|
2436
|
+
this.update$ = createEffect(() => this.actions$.pipe(ofType(DaffCartItemActionTypes.CartItemUpdateAction), mergeMap((action) => this.driver.update(this.storage.getCartId(), action.itemId, action.changes).pipe(map((resp) => new DaffCartItemUpdateSuccess(resp, action.itemId)), catchAndArrayifyErrors(error => of(new DaffCartItemUpdateFailure(error.map(this.errorMatcher), action.itemId)))))));
|
|
2361
2437
|
this.resetCartItemStateAfterChange$ = createEffect(() => this.actions$.pipe(ofType(
|
|
2362
2438
|
// these actions will reset the debounce interval
|
|
2363
2439
|
DaffCartItemActionTypes.CartItemAddSuccessAction, DaffCartItemActionTypes.CartItemUpdateSuccessAction, DaffCartItemActionTypes.CartItemUpdateAction), debounceTime(this.cartItemStateDebounceTime), ofType(
|
|
2364
2440
|
// these actions will cause the cart item state reset
|
|
2365
2441
|
DaffCartItemActionTypes.CartItemAddSuccessAction, DaffCartItemActionTypes.CartItemUpdateSuccessAction), map(() => new DaffCartItemStateReset())));
|
|
2366
|
-
this.delete$ = createEffect(() => this.actions$.pipe(ofType(DaffCartItemActionTypes.CartItemDeleteAction), mergeMap((action) => this.driver.delete(this.storage.getCartId(), action.itemId).pipe(map((resp) => new DaffCartItemDeleteSuccess(resp)),
|
|
2442
|
+
this.delete$ = createEffect(() => this.actions$.pipe(ofType(DaffCartItemActionTypes.CartItemDeleteAction), mergeMap((action) => this.driver.delete(this.storage.getCartId(), action.itemId).pipe(map((resp) => new DaffCartItemDeleteSuccess(resp)), catchAndArrayifyErrors(error => of(new DaffCartItemDeleteFailure(error.map(this.errorMatcher), action.itemId)))))));
|
|
2367
2443
|
this.removeOutOfStock$ = createEffect(() => this.actions$.pipe(ofType(DaffCartItemActionTypes.CartItemDeleteOutOfStockAction), switchMap((action) => this.store.pipe(select(getDaffCartSelectors().selectOutOfStockCartItems), take(1))), switchMap(items => items.length > 0
|
|
2368
2444
|
? combineLatest(items.map(item => this.driver.delete(this.storage.getCartId(), item.id))).pipe(map(partialCarts => Object.assign({}, ...partialCarts)))
|
|
2369
|
-
: this.store.pipe(select(getDaffCartSelectors().selectCartValue), take(1))), map(cart => new DaffCartItemDeleteOutOfStockSuccess(cart)),
|
|
2445
|
+
: this.store.pipe(select(getDaffCartSelectors().selectCartValue), take(1))), map(cart => new DaffCartItemDeleteOutOfStockSuccess(cart)), catchAndArrayifyErrors(error => of(new DaffCartItemDeleteOutOfStockFailure(error.map(this.errorMatcher))))));
|
|
2370
2446
|
}
|
|
2371
2447
|
addCartItem$(cartId, input) {
|
|
2372
|
-
return this.driver.add(cartId, input).pipe(map((resp) => new DaffCartItemAddSuccess(resp)),
|
|
2448
|
+
return this.driver.add(cartId, input).pipe(map((resp) => new DaffCartItemAddSuccess(resp)), catchAndArrayifyErrors(error => of(new DaffCartItemAddFailure(error.map(this.errorMatcher)))));
|
|
2373
2449
|
}
|
|
2374
2450
|
}
|
|
2375
2451
|
/** @nocollapse */ DaffCartItemEffects.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffCartItemEffects, deps: [{ token: i1.Actions }, { token: DAFF_CART_ERROR_MATCHER }, { token: DaffCartItemDriver }, { token: i2.DaffCartStorageService }, { token: DaffCartItemStateDebounceTime }, { token: i1$1.Store }, { token: i4.DaffCartDriverResolveService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
@@ -2393,9 +2469,9 @@ class DaffCartOrderEffects {
|
|
|
2393
2469
|
this.errorMatcher = errorMatcher;
|
|
2394
2470
|
this.driver = driver;
|
|
2395
2471
|
this.storage = storage;
|
|
2396
|
-
this.placeOrder$ = createEffect(() => this.actions$.pipe(ofType(DaffCartOrderActionTypes.CartPlaceOrderAction), switchMap((action) => defer(() => of(this.storage.getCartId())).pipe(switchMap(cartId => this.driver.placeOrder(cartId, action.payload)), map((resp) => new DaffCartPlaceOrderSuccess(resp)),
|
|
2397
|
-
? new DaffCartStorageFailure(this.errorMatcher
|
|
2398
|
-
: new DaffCartPlaceOrderFailure(this.errorMatcher
|
|
2472
|
+
this.placeOrder$ = createEffect(() => this.actions$.pipe(ofType(DaffCartOrderActionTypes.CartPlaceOrderAction), switchMap((action) => defer(() => of(this.storage.getCartId())).pipe(switchMap(cartId => this.driver.placeOrder(cartId, action.payload)), map((resp) => new DaffCartPlaceOrderSuccess(resp)), catchAndArrayifyErrors(error => of(error.find((err) => err.code === DAFF_STORAGE_SERVICE_ERROR_CODE)
|
|
2473
|
+
? new DaffCartStorageFailure(error.map(this.errorMatcher))
|
|
2474
|
+
: new DaffCartPlaceOrderFailure(error.map(this.errorMatcher))))))));
|
|
2399
2475
|
this.resetCart$ = createEffect(() => this.actions$.pipe(ofType(DaffCartOrderActionTypes.CartPlaceOrderSuccessAction), map(() => new DaffCartCreate())));
|
|
2400
2476
|
}
|
|
2401
2477
|
}
|
|
@@ -2417,7 +2493,7 @@ class DaffCartPaymentMethodsEffects {
|
|
|
2417
2493
|
this.errorMatcher = errorMatcher;
|
|
2418
2494
|
this.driver = driver;
|
|
2419
2495
|
this.storage = storage;
|
|
2420
|
-
this.list$ = createEffect(() => this.actions$.pipe(ofType(DaffCartPaymentMethodsActionTypes.CartPaymentMethodsLoadAction), switchMap((action) => this.driver.list(this.storage.getCartId()).pipe(map((resp) => new DaffCartPaymentMethodsLoadSuccess(resp)),
|
|
2496
|
+
this.list$ = createEffect(() => this.actions$.pipe(ofType(DaffCartPaymentMethodsActionTypes.CartPaymentMethodsLoadAction), switchMap((action) => this.driver.list(this.storage.getCartId()).pipe(map((resp) => new DaffCartPaymentMethodsLoadSuccess(resp)), catchAndArrayifyErrors(error => of(new DaffCartPaymentMethodsLoadFailure(error.map(this.errorMatcher))))))));
|
|
2421
2497
|
}
|
|
2422
2498
|
}
|
|
2423
2499
|
/** @nocollapse */ DaffCartPaymentMethodsEffects.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffCartPaymentMethodsEffects, deps: [{ token: i1.Actions }, { token: DAFF_CART_ERROR_MATCHER }, { token: DaffCartPaymentMethodsDriver }, { token: i2.DaffCartStorageService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
@@ -2447,7 +2523,7 @@ class DaffCartPaymentProcessorEffects {
|
|
|
2447
2523
|
defer(() => this.injector.get(this.processors[action.request.kind].driver).generateToken(action.request).pipe(map(e => [e, action]), switchMap(([response, act]) => this.driver.update(this.storage.getCartId(), {
|
|
2448
2524
|
method: response.method,
|
|
2449
2525
|
payment_info: response.data,
|
|
2450
|
-
}, act.address).pipe(map((resp) => new DaffCartPaymentUpdateSuccess(resp)),
|
|
2526
|
+
}, act.address).pipe(map((resp) => new DaffCartPaymentUpdateSuccess(resp)), catchAndArrayifyErrors(error => of(new DaffCartPaymentUpdateFailure(error.map(this.errorMatcher)))))), catchAndArrayifyErrors(error => of(new DaffPaymentGenerateTokenFailure(this.paymentErrorMatcher(error[0])))))))));
|
|
2451
2527
|
}
|
|
2452
2528
|
}
|
|
2453
2529
|
/** @nocollapse */ DaffCartPaymentProcessorEffects.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffCartPaymentProcessorEffects, deps: [{ token: i1.Actions }, { token: DAFF_PAYMENT_PROCESSOR_COLLECTION }, { token: DAFF_CART_ERROR_MATCHER }, { token: DAFF_PAYMENT_ERROR_MATCHER }, { token: DaffCartPaymentDriver }, { token: i2.DaffCartStorageService }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
@@ -2474,10 +2550,10 @@ class DaffCartPaymentEffects {
|
|
|
2474
2550
|
this.errorMatcher = errorMatcher;
|
|
2475
2551
|
this.driver = driver;
|
|
2476
2552
|
this.storage = storage;
|
|
2477
|
-
this.get$ = createEffect(() => this.actions$.pipe(ofType(DaffCartPaymentActionTypes.CartPaymentLoadAction), switchMap((action) => this.driver.get(this.storage.getCartId()).pipe(map((resp) => new DaffCartPaymentLoadSuccess(resp)),
|
|
2478
|
-
this.update$ = createEffect(() => this.actions$.pipe(ofType(DaffCartPaymentActionTypes.CartPaymentUpdateAction), switchMap((action) => this.driver.update(this.storage.getCartId(), action.payload).pipe(map((resp) => new DaffCartPaymentUpdateSuccess(resp)),
|
|
2479
|
-
this.updateWithBilling$ = createEffect(() => this.actions$.pipe(ofType(DaffCartPaymentActionTypes.CartPaymentUpdateWithBillingAction), switchMap((action) => this.driver.updateWithBilling(this.storage.getCartId(), action.payment, action.address).pipe(map(resp => new DaffCartPaymentUpdateWithBillingSuccess(resp)),
|
|
2480
|
-
this.remove$ = createEffect(() => this.actions$.pipe(ofType(DaffCartPaymentActionTypes.CartPaymentRemoveAction), switchMap((action) => this.driver.remove(this.storage.getCartId()).pipe(map(() => new DaffCartPaymentRemoveSuccess()),
|
|
2553
|
+
this.get$ = createEffect(() => this.actions$.pipe(ofType(DaffCartPaymentActionTypes.CartPaymentLoadAction), switchMap((action) => this.driver.get(this.storage.getCartId()).pipe(map((resp) => new DaffCartPaymentLoadSuccess(resp)), catchAndArrayifyErrors(error => of(new DaffCartPaymentLoadFailure(error.map(this.errorMatcher))))))));
|
|
2554
|
+
this.update$ = createEffect(() => this.actions$.pipe(ofType(DaffCartPaymentActionTypes.CartPaymentUpdateAction), switchMap((action) => this.driver.update(this.storage.getCartId(), action.payload).pipe(map((resp) => new DaffCartPaymentUpdateSuccess(resp)), catchAndArrayifyErrors(error => of(new DaffCartPaymentUpdateFailure(error.map(this.errorMatcher))))))));
|
|
2555
|
+
this.updateWithBilling$ = createEffect(() => this.actions$.pipe(ofType(DaffCartPaymentActionTypes.CartPaymentUpdateWithBillingAction), switchMap((action) => this.driver.updateWithBilling(this.storage.getCartId(), action.payment, action.address).pipe(map(resp => new DaffCartPaymentUpdateWithBillingSuccess(resp)), catchAndArrayifyErrors(error => of(new DaffCartPaymentUpdateWithBillingFailure(error.map(this.errorMatcher))))))));
|
|
2556
|
+
this.remove$ = createEffect(() => this.actions$.pipe(ofType(DaffCartPaymentActionTypes.CartPaymentRemoveAction), switchMap((action) => this.driver.remove(this.storage.getCartId()).pipe(map(() => new DaffCartPaymentRemoveSuccess()), catchAndArrayifyErrors(error => of(new DaffCartPaymentRemoveFailure(error.map(this.errorMatcher))))))));
|
|
2481
2557
|
}
|
|
2482
2558
|
}
|
|
2483
2559
|
/** @nocollapse */ DaffCartPaymentEffects.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffCartPaymentEffects, deps: [{ token: i1.Actions }, { token: DAFF_CART_ERROR_MATCHER }, { token: DaffCartPaymentDriver }, { token: i2.DaffCartStorageService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
@@ -2511,19 +2587,23 @@ class DaffCartResolverEffects {
|
|
|
2511
2587
|
() => action.type === DaffCartActionTypes.ResolveCartSuccessAction,
|
|
2512
2588
|
// then just cancel the outstanding operation
|
|
2513
2589
|
EMPTY, this.cartResolver.getCartOrFail().pipe(map(({ response, errors }) => errors.length > 0
|
|
2514
|
-
? new DaffResolveCartPartialSuccess(response, errors.map(
|
|
2515
|
-
: new DaffResolveCartSuccess(response)), daffCartDriverHandleCartNotFound(this.cartStorage),
|
|
2590
|
+
? new DaffResolveCartPartialSuccess(response, errors.map(this.errorMatcher))
|
|
2591
|
+
: new DaffResolveCartSuccess(response)), daffCartDriverHandleCartNotFound(this.cartStorage), catchAndArrayifyErrors((error) => {
|
|
2516
2592
|
switch (true) {
|
|
2517
|
-
case error
|
|
2518
|
-
return of(new DaffResolveCartServerSide(
|
|
2519
|
-
|
|
2520
|
-
|
|
2593
|
+
case !!error.find((err) => err.code === DAFF_SERVER_STORAGE_SERVICE_ERROR_CODE):
|
|
2594
|
+
return of(new DaffResolveCartServerSide([
|
|
2595
|
+
this.errorMatcher(new DaffCartServerSideResolutionError(error[0].message)),
|
|
2596
|
+
]));
|
|
2597
|
+
case !!error.find((err) => err.code === DAFF_STORAGE_SERVICE_ERROR_CODE):
|
|
2598
|
+
return of(new DaffResolveCartFailure([
|
|
2599
|
+
this.errorMatcher(new DaffCartStorageResolutionError(error[0].message)),
|
|
2600
|
+
]));
|
|
2521
2601
|
default:
|
|
2522
|
-
return of(new DaffResolveCartFailure(
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
|
|
2526
|
-
|
|
2602
|
+
return of(new DaffResolveCartFailure(error.map((err) =>
|
|
2603
|
+
// I wish there was a better way to check this
|
|
2604
|
+
this.errorMatcher(err instanceof DaffInheritableError || !!err.code
|
|
2605
|
+
? err
|
|
2606
|
+
: new DaffCartResolutionError(err.message)))));
|
|
2527
2607
|
}
|
|
2528
2608
|
}))))));
|
|
2529
2609
|
}
|
|
@@ -2549,8 +2629,8 @@ class DaffCartShippingAddressEffects {
|
|
|
2549
2629
|
this.errorMatcher = errorMatcher;
|
|
2550
2630
|
this.driver = driver;
|
|
2551
2631
|
this.storage = storage;
|
|
2552
|
-
this.get$ = createEffect(() => this.actions$.pipe(ofType(DaffCartShippingAddressActionTypes.CartShippingAddressLoadAction), switchMap((action) => this.driver.get(this.storage.getCartId()).pipe(map((resp) => new DaffCartShippingAddressLoadSuccess(resp)),
|
|
2553
|
-
this.update$ = createEffect(() => this.actions$.pipe(ofType(DaffCartShippingAddressActionTypes.CartShippingAddressUpdateAction), switchMap((action) => this.driver.update(this.storage.getCartId(), action.payload).pipe(map((resp) => new DaffCartShippingAddressUpdateSuccess(resp)),
|
|
2632
|
+
this.get$ = createEffect(() => this.actions$.pipe(ofType(DaffCartShippingAddressActionTypes.CartShippingAddressLoadAction), switchMap((action) => this.driver.get(this.storage.getCartId()).pipe(map((resp) => new DaffCartShippingAddressLoadSuccess(resp)), catchAndArrayifyErrors(error => of(new DaffCartShippingAddressLoadFailure(error.map(this.errorMatcher))))))));
|
|
2633
|
+
this.update$ = createEffect(() => this.actions$.pipe(ofType(DaffCartShippingAddressActionTypes.CartShippingAddressUpdateAction), switchMap((action) => this.driver.update(this.storage.getCartId(), action.payload).pipe(map((resp) => new DaffCartShippingAddressUpdateSuccess(resp)), catchAndArrayifyErrors(error => of(new DaffCartShippingAddressUpdateFailure(error.map(this.errorMatcher))))))));
|
|
2554
2634
|
}
|
|
2555
2635
|
}
|
|
2556
2636
|
/** @nocollapse */ DaffCartShippingAddressEffects.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffCartShippingAddressEffects, deps: [{ token: i1.Actions }, { token: DAFF_CART_ERROR_MATCHER }, { token: DaffCartShippingAddressDriver }, { token: i2.DaffCartStorageService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
@@ -2571,9 +2651,9 @@ class DaffCartShippingInformationEffects {
|
|
|
2571
2651
|
this.errorMatcher = errorMatcher;
|
|
2572
2652
|
this.driver = driver;
|
|
2573
2653
|
this.storage = storage;
|
|
2574
|
-
this.get$ = createEffect(() => this.actions$.pipe(ofType(DaffCartShippingInformationActionTypes.CartShippingInformationLoadAction), switchMap((action) => this.driver.get(this.storage.getCartId()).pipe(map((resp) => new DaffCartShippingInformationLoadSuccess(resp)),
|
|
2575
|
-
this.update$ = createEffect(() => this.actions$.pipe(ofType(DaffCartShippingInformationActionTypes.CartShippingInformationUpdateAction), switchMap((action) => this.driver.update(this.storage.getCartId(), action.payload).pipe(map((resp) => new DaffCartShippingInformationUpdateSuccess(resp)),
|
|
2576
|
-
this.delete$ = createEffect(() => this.actions$.pipe(ofType(DaffCartShippingInformationActionTypes.CartShippingInformationDeleteAction), switchMap((action) => this.driver.delete(this.storage.getCartId()).pipe(map((resp) => new DaffCartShippingInformationDeleteSuccess(resp)),
|
|
2654
|
+
this.get$ = createEffect(() => this.actions$.pipe(ofType(DaffCartShippingInformationActionTypes.CartShippingInformationLoadAction), switchMap((action) => this.driver.get(this.storage.getCartId()).pipe(map((resp) => new DaffCartShippingInformationLoadSuccess(resp)), catchAndArrayifyErrors(error => of(new DaffCartShippingInformationLoadFailure(error.map(this.errorMatcher))))))));
|
|
2655
|
+
this.update$ = createEffect(() => this.actions$.pipe(ofType(DaffCartShippingInformationActionTypes.CartShippingInformationUpdateAction), switchMap((action) => this.driver.update(this.storage.getCartId(), action.payload).pipe(map((resp) => new DaffCartShippingInformationUpdateSuccess(resp)), catchAndArrayifyErrors(error => of(new DaffCartShippingInformationUpdateFailure(error.map(this.errorMatcher))))))));
|
|
2656
|
+
this.delete$ = createEffect(() => this.actions$.pipe(ofType(DaffCartShippingInformationActionTypes.CartShippingInformationDeleteAction), switchMap((action) => this.driver.delete(this.storage.getCartId()).pipe(map((resp) => new DaffCartShippingInformationDeleteSuccess(resp)), catchAndArrayifyErrors(error => of(new DaffCartShippingInformationDeleteFailure(error.map(this.errorMatcher))))))));
|
|
2577
2657
|
}
|
|
2578
2658
|
}
|
|
2579
2659
|
/** @nocollapse */ DaffCartShippingInformationEffects.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffCartShippingInformationEffects, deps: [{ token: i1.Actions }, { token: DAFF_CART_ERROR_MATCHER }, { token: DaffCartShippingInformationDriver }, { token: i2.DaffCartStorageService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
@@ -2594,7 +2674,7 @@ class DaffCartShippingMethodsEffects {
|
|
|
2594
2674
|
this.errorMatcher = errorMatcher;
|
|
2595
2675
|
this.driver = driver;
|
|
2596
2676
|
this.storage = storage;
|
|
2597
|
-
this.list$ = createEffect(() => this.actions$.pipe(ofType(DaffCartShippingMethodsActionTypes.CartShippingMethodsLoadAction), switchMap((action) => this.driver.list(this.storage.getCartId()).pipe(map((resp) => new DaffCartShippingMethodsLoadSuccess(resp)),
|
|
2677
|
+
this.list$ = createEffect(() => this.actions$.pipe(ofType(DaffCartShippingMethodsActionTypes.CartShippingMethodsLoadAction), switchMap((action) => this.driver.list(this.storage.getCartId()).pipe(map((resp) => new DaffCartShippingMethodsLoadSuccess(resp)), catchAndArrayifyErrors(error => of(new DaffCartShippingMethodsLoadFailure(error.map(this.errorMatcher))))))));
|
|
2598
2678
|
}
|
|
2599
2679
|
}
|
|
2600
2680
|
/** @nocollapse */ DaffCartShippingMethodsEffects.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffCartShippingMethodsEffects, deps: [{ token: i1.Actions }, { token: DAFF_CART_ERROR_MATCHER }, { token: DaffCartShippingMethodsDriver }, { token: i2.DaffCartStorageService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
@@ -2615,26 +2695,26 @@ class DaffCartEffects {
|
|
|
2615
2695
|
this.errorMatcher = errorMatcher;
|
|
2616
2696
|
this.driver = driver;
|
|
2617
2697
|
this.storage = storage;
|
|
2618
|
-
this.create$ = createEffect(() => this.actions$.pipe(ofType(DaffCartActionTypes.CartCreateAction), switchMap((action) => this.driver.create().pipe(map((resp) => new DaffCartCreateSuccess(resp)),
|
|
2698
|
+
this.create$ = createEffect(() => this.actions$.pipe(ofType(DaffCartActionTypes.CartCreateAction), switchMap((action) => this.driver.create().pipe(map((resp) => new DaffCartCreateSuccess(resp)), catchAndArrayifyErrors(error => of(new DaffCartCreateFailure(error.map(this.errorMatcher))))))));
|
|
2619
2699
|
this.storeId$ = createEffect(() => this.actions$.pipe(ofType(DaffCartActionTypes.CartCreateSuccessAction, DaffCartActionTypes.ResolveCartSuccessAction), switchMap((action) => of(null).pipe(tap(() => {
|
|
2620
2700
|
this.storage.setCartId(action.payload.id);
|
|
2621
|
-
}), switchMap(() => EMPTY),
|
|
2701
|
+
}), switchMap(() => EMPTY), catchAndArrayifyErrors(error => of(new DaffCartStorageFailure(error.map(this.errorMatcher))))))));
|
|
2622
2702
|
this.get$ = createEffect(() => this.actions$.pipe(ofType(DaffCartActionTypes.CartLoadAction), switchMap((action) => defer(() => of(this.storage.getCartId())).pipe(switchMap(cartId => this.driver.get(cartId)), map(({ response, errors }) => {
|
|
2623
2703
|
if (errors.length === 0) {
|
|
2624
2704
|
return new DaffCartLoadSuccess(response);
|
|
2625
2705
|
}
|
|
2626
2706
|
const hasOnlyRecoverableErrors = errors.reduce((acc, error) => acc && error.recoverable, true);
|
|
2627
2707
|
if (hasOnlyRecoverableErrors) {
|
|
2628
|
-
return new DaffCartLoadPartialSuccess(response, errors.map(
|
|
2708
|
+
return new DaffCartLoadPartialSuccess(response, errors.map(this.errorMatcher));
|
|
2629
2709
|
}
|
|
2630
|
-
return new DaffCartLoadFailure(errors.map(
|
|
2631
|
-
}),
|
|
2632
|
-
? new DaffCartStorageFailure(this.errorMatcher
|
|
2633
|
-
: new DaffCartLoadFailure(
|
|
2634
|
-
this.addToCart$ = createEffect(() => this.actions$.pipe(ofType(DaffCartActionTypes.AddToCartAction), switchMap((action) => this.driver.addToCart(action.payload.productId, action.payload.qty).pipe(map((resp) => new DaffAddToCartSuccess(resp)),
|
|
2635
|
-
this.clear$ = createEffect(() => this.actions$.pipe(ofType(DaffCartActionTypes.CartClearAction), switchMap((action) => defer(() => of(this.storage.getCartId())).pipe(switchMap(cartId => this.driver.clear(cartId)), map((resp) => new DaffCartClearSuccess(resp)),
|
|
2636
|
-
? new DaffCartStorageFailure(this.errorMatcher
|
|
2637
|
-
: new DaffCartClearFailure(this.errorMatcher
|
|
2710
|
+
return new DaffCartLoadFailure(errors.map(this.errorMatcher));
|
|
2711
|
+
}), catchAndArrayifyErrors(error => of(error.find((err) => err.code === DAFF_STORAGE_SERVICE_ERROR_CODE)
|
|
2712
|
+
? new DaffCartStorageFailure(error.map(this.errorMatcher))
|
|
2713
|
+
: new DaffCartLoadFailure(error.map(this.errorMatcher))))))));
|
|
2714
|
+
this.addToCart$ = createEffect(() => this.actions$.pipe(ofType(DaffCartActionTypes.AddToCartAction), switchMap((action) => this.driver.addToCart(action.payload.productId, action.payload.qty).pipe(map((resp) => new DaffAddToCartSuccess(resp)), catchAndArrayifyErrors(error => of(new DaffAddToCartFailure(error.map(this.errorMatcher))))))));
|
|
2715
|
+
this.clear$ = createEffect(() => this.actions$.pipe(ofType(DaffCartActionTypes.CartClearAction), switchMap((action) => defer(() => of(this.storage.getCartId())).pipe(switchMap(cartId => this.driver.clear(cartId)), map((resp) => new DaffCartClearSuccess(resp)), catchAndArrayifyErrors(error => of(error.find((err) => err.code === DAFF_STORAGE_SERVICE_ERROR_CODE)
|
|
2716
|
+
? new DaffCartStorageFailure(error.map(this.errorMatcher))
|
|
2717
|
+
: new DaffCartClearFailure(error.map(this.errorMatcher))))))));
|
|
2638
2718
|
}
|
|
2639
2719
|
}
|
|
2640
2720
|
/** @nocollapse */ DaffCartEffects.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffCartEffects, deps: [{ token: i1.Actions }, { token: DAFF_CART_ERROR_MATCHER }, { token: DaffCartDriver }, { token: i2.DaffCartStorageService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
@@ -2657,12 +2737,71 @@ const daffCartPaymentReducer = (state = daffPaymentInitialState, action) => {
|
|
|
2657
2737
|
return adapter.tokenGenerated(state);
|
|
2658
2738
|
case DaffCartPaymentActionTypes.CartPaymentUpdateFailureAction:
|
|
2659
2739
|
case DaffCartPaymentActionTypes.CartPaymentUpdateWithBillingFailureAction:
|
|
2660
|
-
return adapter.storeError(
|
|
2740
|
+
return adapter.storeError(action.payload, state);
|
|
2661
2741
|
default:
|
|
2662
2742
|
return state;
|
|
2663
2743
|
}
|
|
2664
2744
|
};
|
|
2665
2745
|
|
|
2746
|
+
/**
|
|
2747
|
+
* A meta reducer for determining and setting the correct `daffState` values on cart items.
|
|
2748
|
+
*/
|
|
2749
|
+
function daffCartSetItemStateMetaReducer(reducer) {
|
|
2750
|
+
return (state, action) => {
|
|
2751
|
+
switch (action.type) {
|
|
2752
|
+
case DaffCartItemActionTypes.CartItemAddSuccessAction:
|
|
2753
|
+
action.payload.items = updateAddedCartItemState(state.cartItems.entities, action.payload.items.map((item) => ({
|
|
2754
|
+
...item,
|
|
2755
|
+
daffErrors: [],
|
|
2756
|
+
})));
|
|
2757
|
+
return reducer(state, action);
|
|
2758
|
+
case DaffCartItemActionTypes.CartItemUpdateSuccessAction:
|
|
2759
|
+
action.payload.items = updateMutatedCartItemState(action.payload.items.map((item) => item.id === action.itemId
|
|
2760
|
+
? {
|
|
2761
|
+
...item,
|
|
2762
|
+
daffErrors: [],
|
|
2763
|
+
}
|
|
2764
|
+
: item), state.cartItems.entities, action.itemId);
|
|
2765
|
+
return reducer(state, action);
|
|
2766
|
+
default:
|
|
2767
|
+
return reducer(state, action);
|
|
2768
|
+
}
|
|
2769
|
+
};
|
|
2770
|
+
}
|
|
2771
|
+
function updateAddedCartItemState(oldCartItems, newCartItems) {
|
|
2772
|
+
return newCartItems.map(newItem => {
|
|
2773
|
+
const oldItem = oldCartItems[newItem.id];
|
|
2774
|
+
switch (true) {
|
|
2775
|
+
case !oldItem:
|
|
2776
|
+
return { ...newItem, daffState: DaffCartItemStateEnum.New, daffErrors: [] };
|
|
2777
|
+
case oldItem?.qty !== newItem.qty:
|
|
2778
|
+
return { ...newItem, daffState: DaffCartItemStateEnum.Updated, daffErrors: [] };
|
|
2779
|
+
default:
|
|
2780
|
+
return newItem;
|
|
2781
|
+
}
|
|
2782
|
+
});
|
|
2783
|
+
}
|
|
2784
|
+
function updateMutatedCartItemState(responseItems, stateItems, itemId) {
|
|
2785
|
+
return responseItems.map(item => item.id === itemId ?
|
|
2786
|
+
{ ...item, daffState: DaffCartItemStateEnum.Updated, daffErrors: [] } :
|
|
2787
|
+
{ ...item, daffState: stateItems[item.id]?.daffState || DaffCartItemStateEnum.Default });
|
|
2788
|
+
}
|
|
2789
|
+
|
|
2790
|
+
/**
|
|
2791
|
+
* An internal token to hold the Daffodil cart feature store config.
|
|
2792
|
+
*
|
|
2793
|
+
* @docs-private
|
|
2794
|
+
*/
|
|
2795
|
+
const DAFF_CART_STORE_CONFIG = new InjectionToken('DAFF_CART_STORE_CONFIG', {
|
|
2796
|
+
providedIn: 'any',
|
|
2797
|
+
factory: () => ({
|
|
2798
|
+
metaReducers: [
|
|
2799
|
+
daffCartSetItemStateMetaReducer,
|
|
2800
|
+
...inject(DAFF_CART_META_REDUCERS),
|
|
2801
|
+
],
|
|
2802
|
+
}),
|
|
2803
|
+
});
|
|
2804
|
+
|
|
2666
2805
|
/**
|
|
2667
2806
|
* An internal token to hold the Daffodil cart reducers.
|
|
2668
2807
|
* Includes the extra and standard reducers.
|
|
@@ -2670,10 +2809,21 @@ const daffCartPaymentReducer = (state = daffPaymentInitialState, action) => {
|
|
|
2670
2809
|
* @docs-private
|
|
2671
2810
|
*/
|
|
2672
2811
|
const DAFF_CART_REDUCERS = new InjectionToken('DAFF_CART_REDUCERS', {
|
|
2673
|
-
factory: () =>
|
|
2674
|
-
|
|
2675
|
-
|
|
2676
|
-
|
|
2812
|
+
factory: () => {
|
|
2813
|
+
const retrievalActions = inject(DAFF_CART_RETRIEVAL_ACTIONS);
|
|
2814
|
+
return daffComposeReducers([
|
|
2815
|
+
// daffodil reducers should run first, don't change this
|
|
2816
|
+
// TODO: enforce this somehow (meta-reducers?)
|
|
2817
|
+
combineReducers(daffCartReducers),
|
|
2818
|
+
//
|
|
2819
|
+
combineReducers({
|
|
2820
|
+
cart: daffCartRetrievalActionsReducerFactory(retrievalActions),
|
|
2821
|
+
cartItems: daffCartItemEntitiesRetrievalActionsReducerFactory(retrievalActions),
|
|
2822
|
+
order: daffIdentityReducer,
|
|
2823
|
+
}),
|
|
2824
|
+
...inject(DAFF_CART_EXTRA_REDUCERS),
|
|
2825
|
+
]);
|
|
2826
|
+
},
|
|
2677
2827
|
});
|
|
2678
2828
|
|
|
2679
2829
|
class DaffCartStateModule {
|
|
@@ -2685,7 +2835,8 @@ class DaffCartStateModule {
|
|
|
2685
2835
|
...daffPaymentProvideExtraReducers(combineReducers({
|
|
2686
2836
|
payment: daffCartPaymentReducer,
|
|
2687
2837
|
})),
|
|
2688
|
-
|
|
2838
|
+
daffCartProvideRetrievalActions(...daffCartRetrivalActions),
|
|
2839
|
+
], imports: [StoreModule.forFeature(DAFF_CART_STORE_FEATURE_KEY, DAFF_CART_REDUCERS, DAFF_CART_STORE_CONFIG),
|
|
2689
2840
|
EffectsModule.forFeature([
|
|
2690
2841
|
DaffCartEffects,
|
|
2691
2842
|
DaffCartItemEffects,
|
|
@@ -2705,7 +2856,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
|
|
|
2705
2856
|
type: NgModule,
|
|
2706
2857
|
args: [{
|
|
2707
2858
|
imports: [
|
|
2708
|
-
StoreModule.forFeature(DAFF_CART_STORE_FEATURE_KEY, DAFF_CART_REDUCERS),
|
|
2859
|
+
StoreModule.forFeature(DAFF_CART_STORE_FEATURE_KEY, DAFF_CART_REDUCERS, DAFF_CART_STORE_CONFIG),
|
|
2709
2860
|
EffectsModule.forFeature([
|
|
2710
2861
|
DaffCartEffects,
|
|
2711
2862
|
DaffCartItemEffects,
|
|
@@ -2727,6 +2878,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
|
|
|
2727
2878
|
...daffPaymentProvideExtraReducers(combineReducers({
|
|
2728
2879
|
payment: daffCartPaymentReducer,
|
|
2729
2880
|
})),
|
|
2881
|
+
daffCartProvideRetrievalActions(...daffCartRetrivalActions),
|
|
2730
2882
|
],
|
|
2731
2883
|
}]
|
|
2732
2884
|
}] });
|
|
@@ -2890,5 +3042,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
|
|
|
2890
3042
|
* Generated bundle index. Do not edit.
|
|
2891
3043
|
*/
|
|
2892
3044
|
|
|
2893
|
-
export { DAFF_CART_EXTRA_REDUCERS, DAFF_CART_STORE_FEATURE_KEY, DaffAddToCart, DaffAddToCartFailure, DaffAddToCartSuccess, DaffCartActionTypes, DaffCartAddressActionTypes, DaffCartAddressUpdate, DaffCartAddressUpdateFailure, DaffCartAddressUpdateSuccess, DaffCartBillingAddressActionTypes, DaffCartBillingAddressLoad, DaffCartBillingAddressLoadFailure, DaffCartBillingAddressLoadSuccess, DaffCartBillingAddressUpdate, DaffCartBillingAddressUpdateFailure, DaffCartBillingAddressUpdateSuccess, DaffCartClear, DaffCartClearFailure, DaffCartClearSuccess, DaffCartCouponActionTypes, DaffCartCouponApply, DaffCartCouponApplyFailure, DaffCartCouponApplySuccess, DaffCartCouponClearErrors, DaffCartCouponList, DaffCartCouponListFailure, DaffCartCouponListSuccess, DaffCartCouponRemove, DaffCartCouponRemoveAll, DaffCartCouponRemoveAllFailure, DaffCartCouponRemoveAllSuccess, DaffCartCouponRemoveFailure, DaffCartCouponRemoveSuccess, DaffCartCreate, DaffCartCreateFailure, DaffCartCreateSuccess, DaffCartFacade, DaffCartItemActionTypes, DaffCartItemAdd, DaffCartItemAddFailure, DaffCartItemAddSuccess, DaffCartItemDelete, DaffCartItemDeleteFailure, DaffCartItemDeleteOutOfStock, DaffCartItemDeleteOutOfStockFailure, DaffCartItemDeleteOutOfStockSuccess, DaffCartItemDeleteSuccess, DaffCartItemList, DaffCartItemListFailure, DaffCartItemListSuccess, DaffCartItemLoad, DaffCartItemLoadFailure, DaffCartItemLoadSuccess, DaffCartItemStateDebounceTime, DaffCartItemStateEnum, DaffCartItemStateReset, DaffCartItemUpdate, DaffCartItemUpdateFailure, DaffCartItemUpdateSuccess, DaffCartLoad, DaffCartLoadFailure, DaffCartLoadPartialSuccess, DaffCartLoadSuccess, DaffCartOperationType, DaffCartOrderActionTypes, DaffCartPaymentActionTypes, DaffCartPaymentLoad, DaffCartPaymentLoadFailure, DaffCartPaymentLoadSuccess, DaffCartPaymentMethodAdd, DaffCartPaymentMethodsActionTypes, DaffCartPaymentMethodsLoad, DaffCartPaymentMethodsLoadFailure, DaffCartPaymentMethodsLoadSuccess, DaffCartPaymentRemove, DaffCartPaymentRemoveFailure, DaffCartPaymentRemoveSuccess, DaffCartPaymentUpdate, DaffCartPaymentUpdateFailure, DaffCartPaymentUpdateSuccess, DaffCartPaymentUpdateWithBilling, DaffCartPaymentUpdateWithBillingFailure, DaffCartPaymentUpdateWithBillingSuccess, DaffCartPlaceOrder, DaffCartPlaceOrderFailure, DaffCartPlaceOrderSuccess, DaffCartResolveState, DaffCartShippingAddressActionTypes, DaffCartShippingAddressLoad, DaffCartShippingAddressLoadFailure, DaffCartShippingAddressLoadSuccess, DaffCartShippingAddressUpdate, DaffCartShippingAddressUpdateFailure, DaffCartShippingAddressUpdateSuccess, DaffCartShippingInformationActionTypes, DaffCartShippingInformationDelete, DaffCartShippingInformationDeleteFailure, DaffCartShippingInformationDeleteSuccess, DaffCartShippingInformationLoad, DaffCartShippingInformationLoadFailure, DaffCartShippingInformationLoadSuccess, DaffCartShippingInformationUpdate, DaffCartShippingInformationUpdateFailure, DaffCartShippingInformationUpdateSuccess, DaffCartShippingMethodsActionTypes, DaffCartShippingMethodsLoad, DaffCartShippingMethodsLoadFailure, DaffCartShippingMethodsLoadSuccess, DaffCartStateModule, DaffCartStorageFailure, DaffResolveCart, DaffResolveCartFailure, DaffResolveCartPartialSuccess, DaffResolveCartServerSide, DaffResolveCartSuccess, daffCartItemEntitiesAdapter, daffCartOrderInitialState, daffCartOrderReducer, daffCartProvideExtraReducers, daffCartReducer, daffCartReducerInitialState, daffCartReducers, getDaffCartSelectors, initializeLoadingSetter };
|
|
3045
|
+
export { DAFF_CART_ERROR_MATCHER, DAFF_CART_EXTRA_REDUCERS, DAFF_CART_META_REDUCERS, DAFF_CART_RETRIEVAL_ACTIONS, DAFF_CART_STORE_FEATURE_KEY, DaffAddToCart, DaffAddToCartFailure, DaffAddToCartSuccess, DaffCartActionTypes, DaffCartAddressActionTypes, DaffCartAddressUpdate, DaffCartAddressUpdateFailure, DaffCartAddressUpdateSuccess, DaffCartBillingAddressActionTypes, DaffCartBillingAddressLoad, DaffCartBillingAddressLoadFailure, DaffCartBillingAddressLoadSuccess, DaffCartBillingAddressUpdate, DaffCartBillingAddressUpdateFailure, DaffCartBillingAddressUpdateSuccess, DaffCartClear, DaffCartClearFailure, DaffCartClearSuccess, DaffCartCouponActionTypes, DaffCartCouponApply, DaffCartCouponApplyFailure, DaffCartCouponApplySuccess, DaffCartCouponClearErrors, DaffCartCouponList, DaffCartCouponListFailure, DaffCartCouponListSuccess, DaffCartCouponRemove, DaffCartCouponRemoveAll, DaffCartCouponRemoveAllFailure, DaffCartCouponRemoveAllSuccess, DaffCartCouponRemoveFailure, DaffCartCouponRemoveSuccess, DaffCartCreate, DaffCartCreateFailure, DaffCartCreateSuccess, DaffCartFacade, DaffCartItemActionTypes, DaffCartItemAdd, DaffCartItemAddFailure, DaffCartItemAddSuccess, DaffCartItemDelete, DaffCartItemDeleteFailure, DaffCartItemDeleteOutOfStock, DaffCartItemDeleteOutOfStockFailure, DaffCartItemDeleteOutOfStockSuccess, DaffCartItemDeleteSuccess, DaffCartItemList, DaffCartItemListFailure, DaffCartItemListSuccess, DaffCartItemLoad, DaffCartItemLoadFailure, DaffCartItemLoadSuccess, DaffCartItemStateDebounceTime, DaffCartItemStateEnum, DaffCartItemStateReset, DaffCartItemUpdate, DaffCartItemUpdateFailure, DaffCartItemUpdateSuccess, DaffCartLoad, DaffCartLoadFailure, DaffCartLoadPartialSuccess, DaffCartLoadSuccess, DaffCartOperationType, DaffCartOrderActionTypes, DaffCartPaymentActionTypes, DaffCartPaymentLoad, DaffCartPaymentLoadFailure, DaffCartPaymentLoadSuccess, DaffCartPaymentMethodAdd, DaffCartPaymentMethodsActionTypes, DaffCartPaymentMethodsLoad, DaffCartPaymentMethodsLoadFailure, DaffCartPaymentMethodsLoadSuccess, DaffCartPaymentRemove, DaffCartPaymentRemoveFailure, DaffCartPaymentRemoveSuccess, DaffCartPaymentUpdate, DaffCartPaymentUpdateFailure, DaffCartPaymentUpdateSuccess, DaffCartPaymentUpdateWithBilling, DaffCartPaymentUpdateWithBillingFailure, DaffCartPaymentUpdateWithBillingSuccess, DaffCartPlaceOrder, DaffCartPlaceOrderFailure, DaffCartPlaceOrderSuccess, DaffCartResolveState, DaffCartShippingAddressActionTypes, DaffCartShippingAddressLoad, DaffCartShippingAddressLoadFailure, DaffCartShippingAddressLoadSuccess, DaffCartShippingAddressUpdate, DaffCartShippingAddressUpdateFailure, DaffCartShippingAddressUpdateSuccess, DaffCartShippingInformationActionTypes, DaffCartShippingInformationDelete, DaffCartShippingInformationDeleteFailure, DaffCartShippingInformationDeleteSuccess, DaffCartShippingInformationLoad, DaffCartShippingInformationLoadFailure, DaffCartShippingInformationLoadSuccess, DaffCartShippingInformationUpdate, DaffCartShippingInformationUpdateFailure, DaffCartShippingInformationUpdateSuccess, DaffCartShippingMethodsActionTypes, DaffCartShippingMethodsLoad, DaffCartShippingMethodsLoadFailure, DaffCartShippingMethodsLoadSuccess, DaffCartStateModule, DaffCartStorageFailure, DaffResolveCart, DaffResolveCartFailure, DaffResolveCartPartialSuccess, DaffResolveCartServerSide, DaffResolveCartSuccess, daffCartItemEntitiesAdapter, daffCartItemEntitiesRetrievalActionsReducerFactory, daffCartOrderInitialState, daffCartOrderReducer, daffCartProvideExtraReducers, daffCartProvideMetaReducers, daffCartProvideRetrievalActions, daffCartReducer, daffCartReducerInitialState, daffCartReducers, daffCartRetrievalActionsReducerFactory, daffCartRetrievalGetResponse, daffCartRetrivalActions, getDaffCartSelectors, initializeLoadingSetter };
|
|
2894
3046
|
//# sourceMappingURL=daffodil-cart-state.mjs.map
|