@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.cjs CHANGED
@@ -2438,7 +2438,14 @@ var CartUpdateHandler = class extends AbstractUpdateHandler {
2438
2438
  resource.itemShippingAddresses.push(newAddress);
2439
2439
  }
2440
2440
  }
2441
- addLineItem(context, resource, { productId, variantId, sku, custom, quantity = 1 }) {
2441
+ addLineItem(context, resource, {
2442
+ productId,
2443
+ variantId,
2444
+ sku,
2445
+ custom,
2446
+ quantity = 1,
2447
+ addedAt
2448
+ }) {
2442
2449
  let product = null;
2443
2450
  if (productId && variantId) {
2444
2451
  product = this._storage.get(context.projectKey, "product", productId, {});
@@ -2504,6 +2511,7 @@ var CartUpdateHandler = class extends AbstractUpdateHandler {
2504
2511
  }
2505
2512
  resource.lineItems.push({
2506
2513
  id: (0, import_uuid5.v4)(),
2514
+ addedAt: addedAt ? addedAt : (/* @__PURE__ */ new Date()).toISOString(),
2507
2515
  productId: product.id,
2508
2516
  productKey: product.key,
2509
2517
  productSlug: product.masterData.current.slug,
@@ -6816,7 +6824,13 @@ var ShippingMethodRepository = class extends AbstractResourceRepository {
6816
6824
  // src/repositories/shopping-list/actions.ts
6817
6825
  var import_uuid11 = require("uuid");
6818
6826
  var ShoppingListUpdateHandler = class extends AbstractUpdateHandler {
6819
- addLineItem(context, resource, { productId, variantId, sku, quantity = 1 }) {
6827
+ addLineItem(context, resource, {
6828
+ productId,
6829
+ variantId,
6830
+ sku,
6831
+ quantity = 1,
6832
+ addedAt
6833
+ }) {
6820
6834
  let product = null;
6821
6835
  if (productId) {
6822
6836
  product = this._storage.get(context.projectKey, "product", productId, {});
@@ -6857,7 +6871,7 @@ var ShoppingListUpdateHandler = class extends AbstractUpdateHandler {
6857
6871
  });
6858
6872
  } else {
6859
6873
  resource.lineItems.push({
6860
- addedAt: (/* @__PURE__ */ new Date()).toISOString(),
6874
+ addedAt: addedAt ? addedAt : (/* @__PURE__ */ new Date()).toISOString(),
6861
6875
  id: (0, import_uuid11.v4)(),
6862
6876
  productId: product.id,
6863
6877
  productSlug: product.masterData.current.slug,