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
    List<com.broadleafcommerce.pricing.client.domain.PriceInfo>
    getPricingForRequest(PriceableTargetsRequest request, 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 PriceableTargetsRequest.
    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(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 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
    • getPricingForRequest

      List<com.broadleafcommerce.pricing.client.domain.PriceInfo> getPricingForRequest(@NonNull PriceableTargetsRequest request, @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 PriceableTargetsRequest.
      Parameters:
      request - The request with 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 request
      Since:
      Catalog Browse Service 2.2.0, Release Train 2.3.0
    • 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.