@labdigital/commercetools-mock 2.31.1 → 2.31.2

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.js CHANGED
@@ -2401,7 +2401,14 @@ var CartUpdateHandler = class extends AbstractUpdateHandler {
2401
2401
  resource.itemShippingAddresses.push(newAddress);
2402
2402
  }
2403
2403
  }
2404
- addLineItem(context, resource, { productId, variantId, sku, custom, quantity = 1 }) {
2404
+ addLineItem(context, resource, {
2405
+ productId,
2406
+ variantId,
2407
+ sku,
2408
+ custom,
2409
+ quantity = 1,
2410
+ addedAt
2411
+ }) {
2405
2412
  let product = null;
2406
2413
  if (productId && variantId) {
2407
2414
  product = this._storage.get(context.projectKey, "product", productId, {});
@@ -2467,6 +2474,7 @@ var CartUpdateHandler = class extends AbstractUpdateHandler {
2467
2474
  }
2468
2475
  resource.lineItems.push({
2469
2476
  id: uuidv45(),
2477
+ addedAt: addedAt ? addedAt : (/* @__PURE__ */ new Date()).toISOString(),
2470
2478
  productId: product.id,
2471
2479
  productKey: product.key,
2472
2480
  productSlug: product.masterData.current.slug,
@@ -6779,7 +6787,13 @@ var ShippingMethodRepository = class extends AbstractResourceRepository {
6779
6787
  // src/repositories/shopping-list/actions.ts
6780
6788
  import { v4 as uuidv411 } from "uuid";
6781
6789
  var ShoppingListUpdateHandler = class extends AbstractUpdateHandler {
6782
- addLineItem(context, resource, { productId, variantId, sku, quantity = 1 }) {
6790
+ addLineItem(context, resource, {
6791
+ productId,
6792
+ variantId,
6793
+ sku,
6794
+ quantity = 1,
6795
+ addedAt
6796
+ }) {
6783
6797
  let product = null;
6784
6798
  if (productId) {
6785
6799
  product = this._storage.get(context.projectKey, "product", productId, {});
@@ -6820,7 +6834,7 @@ var ShoppingListUpdateHandler = class extends AbstractUpdateHandler {
6820
6834
  });
6821
6835
  } else {
6822
6836
  resource.lineItems.push({
6823
- addedAt: (/* @__PURE__ */ new Date()).toISOString(),
6837
+ addedAt: addedAt ? addedAt : (/* @__PURE__ */ new Date()).toISOString(),
6824
6838
  id: uuidv411(),
6825
6839
  productId: product.id,
6826
6840
  productSlug: product.masterData.current.slug,