@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.js CHANGED
@@ -3867,6 +3867,7 @@ var PaymentRepository = class extends AbstractResourceRepository {
3867
3867
  create(context, draft) {
3868
3868
  const resource = {
3869
3869
  ...getBaseResourceProperties(),
3870
+ key: draft.key,
3870
3871
  amountPlanned: createCentPrecisionMoney(draft.amountPlanned),
3871
3872
  paymentMethodInfo: draft.paymentMethodInfo,
3872
3873
  paymentStatus: draft.paymentStatus ? {
@@ -4969,9 +4970,17 @@ var variantFromDraft = (context, storage, variantId, variant) => ({
4969
4970
  key: variant?.key,
4970
4971
  attributes: variant?.attributes ?? [],
4971
4972
  prices: variant?.prices?.map((p) => priceFromDraft(context, storage, p)),
4972
- assets: [],
4973
- images: []
4973
+ assets: variant.assets?.map((a) => assetFromDraft(context, storage, a)) ?? [],
4974
+ images: variant.images ?? []
4974
4975
  });
4976
+ var assetFromDraft = (context, storage, draft) => {
4977
+ const asset = {
4978
+ ...draft,
4979
+ id: uuidv410(),
4980
+ custom: createCustomFields(draft.custom, context.projectKey, storage)
4981
+ };
4982
+ return asset;
4983
+ };
4975
4984
  var priceFromDraft = (context, storage, draft) => ({
4976
4985
  id: uuidv410(),
4977
4986
  key: draft.key,