Interface PricingProvider

All Known Implementing Classes:
ExternalPricingProvider

public interface PricingProvider
Provider for interfacing with operations around pricing. Typically utilizes WebClient to make requests to an external REST API.

Note that priceable entities such as Product should implement the interface Priceable to aid in mapping the PriceInfos back onto them.

Author:
Nathan Moore (nathandmoore)
  • Method Summary

    Modifier and Type
    Method
    Description
    priceProduct(Product product, com.broadleafcommerce.pricing.client.domain.context.PriceContext priceContext, com.broadleafcommerce.pricing.client.domain.context.PriceInfoContext priceInfoContext, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Populates pricing info for the provided Product and its related priceable entities: Variant, IncludedProduct, SpecificItemChoice.
    <P extends Product>
    List<P>
    priceProducts(Collection<P> products, com.broadleafcommerce.pricing.client.domain.context.PriceContext priceContext, com.broadleafcommerce.pricing.client.domain.context.PriceInfoContext priceInfoContext, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Populates pricing info for the provided Products and their related priceable entities: Variant, IncludedProduct, SpecificItemChoice.
    List<com.broadleafcommerce.pricing.client.domain.PriceInfo>
    priceTargets(@NonNull Map<Object,Set<com.broadleafcommerce.pricing.client.domain.PriceableTarget>> targetsMap, com.broadleafcommerce.pricing.client.domain.context.PriceContext priceContext, com.broadleafcommerce.pricing.client.domain.context.PriceInfoContext priceInfoContext, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Populates pricing info for the provided targetsMap
  • Method Details

    • priceProduct

      Product priceProduct(Product product, @Nullable com.broadleafcommerce.pricing.client.domain.context.PriceContext priceContext, @Nullable com.broadleafcommerce.pricing.client.domain.context.PriceInfoContext priceInfoContext, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Populates pricing info for the provided Product and its related priceable entities: Variant, IncludedProduct, SpecificItemChoice.
      Parameters:
      product - The product to price
      priceContext - PriceContext from the original request containing general pricing info
      priceInfoContext - PriceInfoContext from the original request containing info specific for getting PriceInfos such as prefetched PriceLists.
      contextInfo - ContextInfo from the original request containing tenant info
      Returns:
      The product with pricing attached.
      Throws:
      ProviderApiException - if the provider encounters an error with the request.
    • priceTargets

      List<com.broadleafcommerce.pricing.client.domain.PriceInfo> priceTargets(@NonNull @NonNull Map<Object,Set<com.broadleafcommerce.pricing.client.domain.PriceableTarget>> targetsMap, @Nullable com.broadleafcommerce.pricing.client.domain.context.PriceContext priceContext, @Nullable com.broadleafcommerce.pricing.client.domain.context.PriceInfoContext priceInfoContext, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Populates pricing info for the provided targetsMap
      Parameters:
      targetsMap - The targets to price
      priceContext - PriceContext from the original request containing general pricing info
      priceInfoContext - PriceInfoContext from the original request containing info specific for getting PriceInfos such as prefetched PriceLists.
      contextInfo - ContextInfo from the original request containing tenant info
      Returns:
      The price infos for the targets
    • priceProducts

      <P extends Product> List<P> priceProducts(Collection<P> products, @Nullable com.broadleafcommerce.pricing.client.domain.context.PriceContext priceContext, @Nullable com.broadleafcommerce.pricing.client.domain.context.PriceInfoContext priceInfoContext, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Populates pricing info for the provided Products and their related priceable entities: Variant, IncludedProduct, SpecificItemChoice.
      Parameters:
      products - The products to price
      priceContext - PriceContext from the original request containing general pricing info
      priceInfoContext - PriceInfoContext from the original request containing info specific for getting PriceInfos such as prefetched PriceLists.
      contextInfo - ContextInfo from the original request containing tenant info
      Returns:
      The products with pricing attached.
      Throws:
      ProviderApiException - if the provider encounters an error with the request.