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

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      Product 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.
    • Method Detail

      • 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.
      • priceProducts

        <P extends ProductList<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.