@labdigital/commercetools-mock 1.4.0 → 1.5.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/dist/index.cjs +11 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +11 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/lib/parser.ts +2 -2
- package/src/repositories/customer.ts +16 -2
- package/src/repositories/order.ts +5 -1
- package/src/services/customer.test.ts +22 -0
package/dist/index.cjs
CHANGED
|
@@ -2520,6 +2520,12 @@ var CustomerRepository = class extends AbstractResourceRepository {
|
|
|
2520
2520
|
},
|
|
2521
2521
|
400
|
|
2522
2522
|
);
|
|
2523
|
+
},
|
|
2524
|
+
setCustomField: (_context, resource, { name, value }) => {
|
|
2525
|
+
if (!resource.custom) {
|
|
2526
|
+
throw new Error("Resource has no custom field");
|
|
2527
|
+
}
|
|
2528
|
+
resource.custom.fields[name] = value;
|
|
2523
2529
|
}
|
|
2524
2530
|
};
|
|
2525
2531
|
};
|
|
@@ -3028,7 +3034,11 @@ var OrderRepository = class extends AbstractResourceRepository {
|
|
|
3028
3034
|
`No state found with key=${state.key} or id=${state.key}`
|
|
3029
3035
|
);
|
|
3030
3036
|
}
|
|
3031
|
-
resource.state = {
|
|
3037
|
+
resource.state = {
|
|
3038
|
+
typeId: "state",
|
|
3039
|
+
id: resolvedType.id,
|
|
3040
|
+
obj: { ...resolvedType, key: state.key ?? "" }
|
|
3041
|
+
};
|
|
3032
3042
|
},
|
|
3033
3043
|
setBillingAddress: (context, resource, { address }) => {
|
|
3034
3044
|
resource.billingAddress = createAddress(
|