@labdigital/commercetools-mock 2.44.0 → 2.45.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/dist/index.cjs +11 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +11 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/repositories/payment/index.ts +1 -0
- package/src/repositories/product/helpers.ts +18 -2
package/dist/index.cjs
CHANGED
|
@@ -3904,6 +3904,7 @@ var PaymentRepository = class extends AbstractResourceRepository {
|
|
|
3904
3904
|
create(context, draft) {
|
|
3905
3905
|
const resource = {
|
|
3906
3906
|
...getBaseResourceProperties(),
|
|
3907
|
+
key: draft.key,
|
|
3907
3908
|
amountPlanned: createCentPrecisionMoney(draft.amountPlanned),
|
|
3908
3909
|
paymentMethodInfo: draft.paymentMethodInfo,
|
|
3909
3910
|
paymentStatus: draft.paymentStatus ? {
|
|
@@ -5006,9 +5007,17 @@ var variantFromDraft = (context, storage, variantId, variant) => ({
|
|
|
5006
5007
|
key: variant?.key,
|
|
5007
5008
|
attributes: variant?.attributes ?? [],
|
|
5008
5009
|
prices: variant?.prices?.map((p) => priceFromDraft(context, storage, p)),
|
|
5009
|
-
assets: [],
|
|
5010
|
-
images: []
|
|
5010
|
+
assets: variant.assets?.map((a) => assetFromDraft(context, storage, a)) ?? [],
|
|
5011
|
+
images: variant.images ?? []
|
|
5011
5012
|
});
|
|
5013
|
+
var assetFromDraft = (context, storage, draft) => {
|
|
5014
|
+
const asset = {
|
|
5015
|
+
...draft,
|
|
5016
|
+
id: (0, import_uuid10.v4)(),
|
|
5017
|
+
custom: createCustomFields(draft.custom, context.projectKey, storage)
|
|
5018
|
+
};
|
|
5019
|
+
return asset;
|
|
5020
|
+
};
|
|
5012
5021
|
var priceFromDraft = (context, storage, draft) => ({
|
|
5013
5022
|
id: (0, import_uuid10.v4)(),
|
|
5014
5023
|
key: draft.key,
|