Class VariantPriceableTargetUtils

java.lang.Object
com.broadleafcommerce.datafeed.service.collector.product.support.VariantPriceableTargetUtils

public class VariantPriceableTargetUtils extends Object
  • Constructor Details

    • VariantPriceableTargetUtils

      public VariantPriceableTargetUtils(com.broadleafcommerce.common.extension.TypeFactory typeFactory, CollectedProductJsonAccessorUtils collectedProductJsonAccessorUtils)
  • Method Details

    • createTargets

      public Set<com.broadleafcommerce.pricing.client.domain.PriceableTarget> createTargets(@NonNull @NonNull VariantSummary variant, @Nullable CollectedProduct product)
      Creates PriceableTargets for a VariantSummary. By default, this will just produce a single target based on its VariantSummary.getSku().
      Parameters:
      variant - VariantSummary for which to create PriceableTargets.
      Returns:
      PriceableTargets for a VariantSummary.
    • getPriceableFields

      protected Map<String,javax.money.MonetaryAmount> getPriceableFields(@NonNull @NonNull VariantSummary variant, @Nullable CollectedProduct product)
      Builds the map of priceable fields for a VariantSummary that will be added as PriceableTarget.getPriceableFields(). The key is the type of the priceable field and the value is the amount.
      Parameters:
      variant - VariantSummary for which to determine the priceable fields.
      Returns:
      map of priceable fields for a VariantSummary
      See Also:
    • createTargetForSku

      protected com.broadleafcommerce.pricing.client.domain.PriceableTarget createTargetForSku(@NonNull @NonNull VariantSummary variant, @NonNull @NonNull Map<String,javax.money.MonetaryAmount> priceableFields)
      Creates the PriceableTarget for a VariantSummary using VariantSummary.getSku() as PriceableTarget.getTargetId().
      Parameters:
      variant - VariantSummary for which to create PriceableTargets.
      priceableFields - Map of the priceable fields for the variant to add as PriceableTarget.getPriceableFields().
      Returns:
      the PriceableTarget for a VariantSummary using VariantSummary.getSku() as PriceableTarget.getTargetId().
    • createTargetForProductPricingKey

      protected com.broadleafcommerce.pricing.client.domain.PriceableTarget createTargetForProductPricingKey(@NonNull @NonNull VariantSummary variant, @NonNull @NonNull CollectedProduct product, @NonNull @NonNull Map<String,javax.money.MonetaryAmount> priceableFields)
      Creates the PriceableTarget for a VariantSummary using its owning product's CollectedProduct's pricingKey as PriceableTarget.getTargetId().
      Parameters:
      variant - VariantSummary for which to create PriceableTargets.
      product - CollectedProduct for which to get the pricingKey from.
      priceableFields - Map of the priceable fields for the product to add as PriceableTarget.getPriceableFields().
      Returns:
      the PriceableTarget for a VariantSummary using its owning product's CollectedProduct's pricingKey as PriceableTarget.getTargetId().
    • getTypeFactory

      protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory()
    • getCollectedProductJsonAccessorUtils

      protected CollectedProductJsonAccessorUtils getCollectedProductJsonAccessorUtils()