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_MATCH

    Fields inherited from interface org.springframework.core.Ordered

    HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
     
    void
     
    <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, wait

    Methods inherited from interface com.broadleafcommerce.data.tracking.core.mapping.PostMapper

    transform

    Methods inherited from interface com.broadleafcommerce.data.tracking.core.mapping.PostMapperMember

    getOrder
  • Constructor Details

    • VariantCurrencyCorrectionPostMapperMember

      public VariantCurrencyCorrectionPostMapperMember()
  • Method Details

    • getDataRoutePartition

      public String getDataRoutePartition()
      Specified by:
      getDataRoutePartition in interface com.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:
      transform in interface com.broadleafcommerce.data.tracking.core.mapping.PostMapper
    • setProductService

      @Autowired @Lazy public void setProductService(ProductService<Product> productService)