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 Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiondefault LocalDateTimegetLocalDateTimeFromOffSetDateTime(OffsetDateTime offsetDateTime) Converts anOffsetDateTimeto aLocalDateTimeby discarding the offset information.default DoublemapAmountLimit(BigDecimal amountLimit) Maps the amount limit value from a BigDecimal to a Double representation suitable for Pimcore.default BigDecimalmapAmountOff(BigDecimal amountOff) Maps the amount off value from a BigDecimal to a BigDecimal representation suitable for Pimcore by scaling;default BigDecimalmapPercentOff(BigDecimal percentOff) Maps the percent off value from a BigDecimal to a BigDecimal representation suitable for Pimcore.voidupdatePimcorePromotionModelFromCampaign(io.voucherify.client.model.CampaignsGetResponseBody campaign, PimcorePromotionModel pimcorePromotionModel) Updates an existingPimcorePromotionModelinstance with values from aCampaignsGetResponseBody.voidupdatePimcorePromotionModelFromPromotion(io.voucherify.client.model.PromotionsTiersGetResponseBody promotionTier, PimcorePromotionModel pimcorePromotionModel) Updates an existingPimcorePromotionModelinstance with values from aPromotionsTiersGetResponseBody.voidupdatePimcorePromotionModelFromPromotion(WebhookRequest.WebhookModel.BaseModel webhookModel, PimcorePromotionModel pimcorePromotionModel) Updates the specifiedPimcorePromotionModelinstance with values from a givenWebhookRequest.WebhookModel.BaseModelwebhook model.voidupdatePimcorePromotionModelFromVoucher(io.voucherify.client.model.VouchersGetResponseBody voucher, PimcorePromotionModel pimcorePromotionModel) Updates an existingPimcorePromotionModelinstance with values from aVouchersGetResponseBody.voidupdatePimcorePromotionModelToDelete(String id, PimcorePromotionModel pimcorePromotionModel) Updates the specifiedPimcorePromotionModelinstance to mark it for deletion using values from a givenWebhookRequest.WebhookModel.BaseModelwebhook model.
-
Field Details
-
INSTANCE
-
-
Method Details
-
updatePimcorePromotionModelFromCampaign
void updatePimcorePromotionModelFromCampaign(io.voucherify.client.model.CampaignsGetResponseBody campaign, PimcorePromotionModel pimcorePromotionModel) Updates an existingPimcorePromotionModelinstance with values from aCampaignsGetResponseBody.- Parameters:
campaign- the source CampaignsGetResponseBody containing datapimcorePromotionModel- the target PimcorePromotionModel instance to update
-
updatePimcorePromotionModelFromPromotion
void updatePimcorePromotionModelFromPromotion(io.voucherify.client.model.PromotionsTiersGetResponseBody promotionTier, PimcorePromotionModel pimcorePromotionModel) Updates an existingPimcorePromotionModelinstance with values from aPromotionsTiersGetResponseBody.- Parameters:
promotionTier- the source PromotionsTiersGetResponseBody containing datapimcorePromotionModel- the target PimcorePromotionModel instance to update
-
updatePimcorePromotionModelFromVoucher
void updatePimcorePromotionModelFromVoucher(io.voucherify.client.model.VouchersGetResponseBody voucher, PimcorePromotionModel pimcorePromotionModel) Updates an existingPimcorePromotionModelinstance with values from aVouchersGetResponseBody.- Parameters:
voucher- the source VouchersGetResponseBody containing datapimcorePromotionModel- the target PimcorePromotionModel instance to update
-
updatePimcorePromotionModelFromPromotion
void updatePimcorePromotionModelFromPromotion(WebhookRequest.WebhookModel.BaseModel webhookModel, PimcorePromotionModel pimcorePromotionModel) Updates the specifiedPimcorePromotionModelinstance with values from a givenWebhookRequest.WebhookModel.BaseModelwebhook model.- Parameters:
webhookModel- The sourceWebhookRequest.WebhookModel.BaseModelobject containing the ID to be mapped to the promotion model.pimcorePromotionModel- The targetPimcorePromotionModelinstance that will be updated with the values from the webhook model.
-
updatePimcorePromotionModelToDelete
Updates the specifiedPimcorePromotionModelinstance to mark it for deletion using values from a givenWebhookRequest.WebhookModel.BaseModelwebhook model.- Parameters:
id- The ID to be mapped to bothpromotionIdandentityIdof the promotion model.pimcorePromotionModel- The targetPimcorePromotionModelinstance that will be updated to reflect the deletion status.
-
getLocalDateTimeFromOffSetDateTime
Converts anOffsetDateTimeto aLocalDateTimeby 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
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
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
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
-