Class VariantCurrencyCorrectionPostMapperMember
java.lang.Object
com.broadleafcommerce.catalog.mapping.VariantCurrencyCorrectionPostMapperMember
- All Implemented Interfaces:
com.broadleafcommerce.common.extension.data.DataRoutePartitionAware,com.broadleafcommerce.data.tracking.core.mapping.PostMapper,com.broadleafcommerce.data.tracking.core.mapping.PostMapperMember,org.springframework.core.Ordered
public class VariantCurrencyCorrectionPostMapperMember
extends Object
implements com.broadleafcommerce.data.tracking.core.mapping.PostMapperMember
Since
Variants belong to Products, they don't have their own
currency, but rather assume the currency of their parent product, by default. Variants do contain
numeric values (without currency) for Default Price, Sale Price, and Cost. These values can be
set with the wrong currency when the product's currency is unknown.
Often times, when fetching Variants, we don't know the default currency of the product, so the
ContextInfo.getDefaultCurrency() is used, which may not match the product's currency. As
a result, you may get the correct values with the wrong currency on Variants.
This component corrects the currency as part of the mapping process from the
JpaVariant entity to the
Variant projection instance.- Author:
- Kelly Tisdell (ktisdell)
-
Field Summary
Fields inherited from interface com.broadleafcommerce.common.extension.data.DataRoutePartitionAware
ALL_MATCHFields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidsetProductService(ProductService<Product> productService) <P,D> void transform(List<P> projections, List<D> entities, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.broadleafcommerce.data.tracking.core.mapping.PostMapper
transformMethods inherited from interface com.broadleafcommerce.data.tracking.core.mapping.PostMapperMember
getOrder
-
Constructor Details
-
VariantCurrencyCorrectionPostMapperMember
public VariantCurrencyCorrectionPostMapperMember()
-
-
Method Details
-
getDataRoutePartition
- Specified by:
getDataRoutePartitionin interfacecom.broadleafcommerce.common.extension.data.DataRoutePartitionAware
-
transform
public <P,D> void transform(List<P> projections, List<D> entities, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) - Specified by:
transformin interfacecom.broadleafcommerce.data.tracking.core.mapping.PostMapper
-
setProductService
-