Interface PimcorePromotionModelMapper

All Known Implementing Classes:
PimcorePromotionModelMapperImpl

public interface PimcorePromotionModelMapper
Mapper interface for converting various Voucherify response bodies into PimcorePromotionModel instances. This interface uses MapStruct for automatic mapping between different object models.

The mappings handle specific field conversions, including the transformation of boolean values to strings and the formatting of date-time values.

  • Field Details

  • Method Details

    • updatePimcorePromotionModelFromCampaign

      void updatePimcorePromotionModelFromCampaign(io.voucherify.client.model.CampaignsGetResponseBody campaign, PimcorePromotionModel pimcorePromotionModel)
      Updates an existing PimcorePromotionModel instance with values from a CampaignsGetResponseBody.
      Parameters:
      campaign - the source CampaignsGetResponseBody containing data
      pimcorePromotionModel - the target PimcorePromotionModel instance to update
    • updatePimcorePromotionModelFromPromotion

      void updatePimcorePromotionModelFromPromotion(io.voucherify.client.model.PromotionsTiersGetResponseBody promotionTier, PimcorePromotionModel pimcorePromotionModel)
      Updates an existing PimcorePromotionModel instance with values from a PromotionsTiersGetResponseBody.
      Parameters:
      promotionTier - the source PromotionsTiersGetResponseBody containing data
      pimcorePromotionModel - the target PimcorePromotionModel instance to update
    • updatePimcorePromotionModelFromVoucher

      void updatePimcorePromotionModelFromVoucher(io.voucherify.client.model.VouchersGetResponseBody voucher, PimcorePromotionModel pimcorePromotionModel)
      Updates an existing PimcorePromotionModel instance with values from a VouchersGetResponseBody.
      Parameters:
      voucher - the source VouchersGetResponseBody containing data
      pimcorePromotionModel - the target PimcorePromotionModel instance to update
    • updatePimcorePromotionModelFromPromotion

      void updatePimcorePromotionModelFromPromotion(WebhookRequest.WebhookModel.BaseModel webhookModel, PimcorePromotionModel pimcorePromotionModel)
      Updates the specified PimcorePromotionModel instance with values from a given WebhookRequest.WebhookModel.BaseModel webhook model.
      Parameters:
      webhookModel - The source WebhookRequest.WebhookModel.BaseModel object containing the ID to be mapped to the promotion model.
      pimcorePromotionModel - The target PimcorePromotionModel instance that will be updated with the values from the webhook model.
    • updatePimcorePromotionModelToDelete

      void updatePimcorePromotionModelToDelete(String id, PimcorePromotionModel pimcorePromotionModel)
      Updates the specified PimcorePromotionModel instance to mark it for deletion using values from a given WebhookRequest.WebhookModel.BaseModel webhook model.
      Parameters:
      id - The ID to be mapped to both promotionId and entityId of the promotion model.
      pimcorePromotionModel - The target PimcorePromotionModel instance that will be updated to reflect the deletion status.
    • getLocalDateTimeFromOffSetDateTime

      default LocalDateTime getLocalDateTimeFromOffSetDateTime(OffsetDateTime offsetDateTime)
      Converts an OffsetDateTime to a LocalDateTime by discarding the offset information.
      Parameters:
      offsetDateTime - the OffsetDateTime to convert; may be null
      Returns:
      the corresponding LocalDateTime if input is non-null; otherwise null
    • mapAmountOff

      default BigDecimal mapAmountOff(BigDecimal amountOff)
      Maps the amount off value from a BigDecimal to a BigDecimal representation suitable for Pimcore by scaling;
      Parameters:
      amountOff - the amount off value to map
      Returns:
      the mapped amount off value as BigDecimal, or null if the input is null
    • mapPercentOff

      default BigDecimal mapPercentOff(BigDecimal percentOff)
      Maps the percent off value from a BigDecimal to a BigDecimal representation suitable for Pimcore. This method currently returns the input value as is, but can be overridden for custom mapping.
      Parameters:
      percentOff - the percent off value to map
      Returns:
      the mapped percent off value as BigDecimal, or null if the input is null
    • mapAmountLimit

      default Double mapAmountLimit(BigDecimal amountLimit)
      Maps the amount limit value from a BigDecimal to a Double representation suitable for Pimcore. by scaling;
      Parameters:
      amountLimit - the amount limit value to map
      Returns:
      the mapped amount limit value as Double, or null if the input is null