@labdigital/commercetools-mock 2.34.2 → 2.34.3
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/dist/index.cjs +6 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +6 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/repositories/cart/index.test.ts +151 -0
- package/src/repositories/cart/index.ts +15 -5
package/dist/index.js
CHANGED
|
@@ -2775,8 +2775,11 @@ var CartRepository = class extends AbstractResourceRepository {
|
|
|
2775
2775
|
) ?? [];
|
|
2776
2776
|
const resource = {
|
|
2777
2777
|
...getBaseResourceProperties(),
|
|
2778
|
+
anonymousId: draft.anonymousId,
|
|
2779
|
+
billingAddress: draft.billingAddress ? createAddress(draft.billingAddress, context.projectKey, this._storage) : void 0,
|
|
2778
2780
|
cartState: "Active",
|
|
2779
2781
|
country: draft.country,
|
|
2782
|
+
customerEmail: draft.customerEmail,
|
|
2780
2783
|
customLineItems: [],
|
|
2781
2784
|
directDiscounts: [],
|
|
2782
2785
|
discountCodes: [],
|
|
@@ -2794,11 +2797,11 @@ var CartRepository = class extends AbstractResourceRepository {
|
|
|
2794
2797
|
fractionDigits: 0
|
|
2795
2798
|
},
|
|
2796
2799
|
shippingMode: "Single",
|
|
2797
|
-
shippingAddress: createAddress(
|
|
2800
|
+
shippingAddress: draft.shippingAddress ? createAddress(
|
|
2798
2801
|
draft.shippingAddress,
|
|
2799
2802
|
context.projectKey,
|
|
2800
2803
|
this._storage
|
|
2801
|
-
),
|
|
2804
|
+
) : void 0,
|
|
2802
2805
|
shipping: [],
|
|
2803
2806
|
origin: draft.origin ?? "Customer",
|
|
2804
2807
|
refusedGifts: [],
|
|
@@ -2809,6 +2812,7 @@ var CartRepository = class extends AbstractResourceRepository {
|
|
|
2809
2812
|
)
|
|
2810
2813
|
};
|
|
2811
2814
|
resource.totalPrice.centAmount = calculateCartTotalPrice(resource);
|
|
2815
|
+
resource.store = context.storeKey ? { typeId: "store", key: context.storeKey } : void 0;
|
|
2812
2816
|
return this.saveNew(context, resource);
|
|
2813
2817
|
}
|
|
2814
2818
|
getActiveCart(projectKey) {
|