@labdigital/commercetools-mock 2.38.0 → 2.39.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@labdigital/commercetools-mock",
3
- "version": "2.38.0",
3
+ "version": "2.39.0",
4
4
  "license": "MIT",
5
5
  "author": "Michael van Tellingen",
6
6
  "type": "module",
@@ -7,6 +7,7 @@ import type {
7
7
  CartDiscountSetCustomTypeAction,
8
8
  CartDiscountSetDescriptionAction,
9
9
  CartDiscountSetKeyAction,
10
+ CartDiscountSetStoresAction,
10
11
  CartDiscountSetValidFromAction,
11
12
  CartDiscountSetValidFromAndUntilAction,
12
13
  CartDiscountSetValidUntilAction,
@@ -18,6 +19,7 @@ import type { UpdateHandlerInterface } from "../abstract";
18
19
  import { AbstractUpdateHandler, type RepositoryContext } from "../abstract";
19
20
 
20
21
  import { CommercetoolsError } from "~src/exceptions";
22
+ import { getStoreKeyReference } from "~src/repositories/helpers";
21
23
 
22
24
  export class CartDiscountUpdateHandler
23
25
  extends AbstractUpdateHandler
@@ -118,6 +120,16 @@ export class CartDiscountUpdateHandler
118
120
  resource.key = key;
119
121
  }
120
122
 
123
+ setStores(
124
+ context: RepositoryContext,
125
+ resource: Writable<CartDiscount>,
126
+ { stores }: CartDiscountSetStoresAction,
127
+ ) {
128
+ resource.stores = stores?.map((s) =>
129
+ getStoreKeyReference(s, context.projectKey, this._storage),
130
+ );
131
+ }
132
+
121
133
  setValidFrom(
122
134
  context: RepositoryContext,
123
135
  resource: Writable<CartDiscount>,