@labdigital/commercetools-mock 2.29.0 → 2.29.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@labdigital/commercetools-mock",
3
- "version": "2.29.0",
3
+ "version": "2.29.1",
4
4
  "license": "MIT",
5
5
  "author": "Michael van Tellingen",
6
6
  "type": "module",
@@ -1,5 +1,6 @@
1
1
  import type {
2
2
  Project,
3
+ ProjectChangeBusinessUnitStatusOnCreationAction,
3
4
  ProjectChangeCartsConfigurationAction,
4
5
  ProjectChangeCountriesAction,
5
6
  ProjectChangeCountryTaxRateFallbackEnabledAction,
@@ -13,6 +14,7 @@ import type {
13
14
  ProjectSetShippingRateInputTypeAction,
14
15
  ProjectUpdateAction,
15
16
  } from "@commercetools/platform-sdk";
17
+ import { ProjectSetBusinessUnitAssociateRoleOnCreationAction } from "@commercetools/platform-sdk/dist/declarations/src/generated/models/project";
16
18
  import { maskSecretValue } from "../lib/masking";
17
19
  import { AbstractStorage } from "../storage/abstract";
18
20
  import type { Writable } from "../types";
@@ -111,6 +113,20 @@ class ProjectUpdateHandler
111
113
  messagesConfiguration.deleteDaysAfterCreation;
112
114
  }
113
115
 
116
+ changeMyBusinessUnitStatusOnCreation(
117
+ context: RepositoryContext,
118
+ resource: Writable<Project>,
119
+ { status }: ProjectChangeBusinessUnitStatusOnCreationAction,
120
+ ) {
121
+ if (resource.businessUnits === undefined) {
122
+ resource.businessUnits = {
123
+ myBusinessUnitStatusOnCreation: "Inactive",
124
+ };
125
+ }
126
+
127
+ resource.businessUnits.myBusinessUnitStatusOnCreation = status;
128
+ }
129
+
114
130
  changeName(
115
131
  context: RepositoryContext,
116
132
  resource: Writable<Project>,
@@ -153,6 +169,24 @@ class ProjectUpdateHandler
153
169
  resource.externalOAuth = externalOAuth;
154
170
  }
155
171
 
172
+ setMyBusinessUnitAssociateRoleOnCreation(
173
+ context: RepositoryContext,
174
+ resource: Writable<Project>,
175
+ { associateRole }: ProjectSetBusinessUnitAssociateRoleOnCreationAction,
176
+ ) {
177
+ if (resource.businessUnits === undefined) {
178
+ resource.businessUnits = {
179
+ //Default status, so we set it here also
180
+ myBusinessUnitStatusOnCreation: "Inactive",
181
+ };
182
+ }
183
+
184
+ resource.businessUnits.myBusinessUnitAssociateRoleOnCreation = {
185
+ typeId: associateRole.typeId,
186
+ key: associateRole.key ?? "unknown",
187
+ };
188
+ }
189
+
156
190
  setShippingRateInputType(
157
191
  context: RepositoryContext,
158
192
  resource: Writable<Project>,