Class PriceInfosEndpoint

java.lang.Object
com.broadleafcommerce.pricing.web.endpoint.PriceInfosEndpoint

@FrameworkRestController @FrameworkMapping("/price-infos") @DataRouteByExample(com.broadleafcommerce.pricing.client.domain.PriceInfo.class) public class PriceInfosEndpoint extends Object
Author:
Chad Harchar (charchar)
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
     
     
    protected org.springframework.data.domain.Page<com.broadleafcommerce.pricing.client.domain.PriceInfo>
    postProcessResponse(org.springframework.data.domain.Page<com.broadleafcommerce.pricing.client.domain.PriceInfo> priceInfos)
    Provide a hook to post-process the endpoint response before returning.
    boolean
    priceByProvidedPriceLists(com.broadleafcommerce.pricing.client.domain.context.PriceInfoContext priceInfoContext)
     
    org.springframework.data.domain.Page<com.broadleafcommerce.pricing.client.domain.PriceInfo>
    retrievePriceInfos(jakarta.servlet.http.HttpServletRequest request, com.broadleafcommerce.data.tracking.core.context.ContextInfo context, com.broadleafcommerce.pricing.client.domain.context.PriceContext priceContext, com.broadleafcommerce.pricing.client.domain.context.PriceInfoContext priceInfoContext)
    Used to retrieve a page of PriceInfos for the given context and priceable targets.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • retrievePriceInfos

      @FrameworkPostMapping @Policy(permissionRoots="PRICE_LIST") public org.springframework.data.domain.Page<com.broadleafcommerce.pricing.client.domain.PriceInfo> retrievePriceInfos(jakarta.servlet.http.HttpServletRequest request, @ContextOperation com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @RequestHeader(value="X-Price-Context",required=false) com.broadleafcommerce.pricing.client.domain.context.PriceContext priceContext, @RequestBody com.broadleafcommerce.pricing.client.domain.context.PriceInfoContext priceInfoContext)
      Used to retrieve a page of PriceInfos for the given context and priceable targets.
      Parameters:
      request - The HttpServletRequest made to the server
      context - context information around sandbox and multitenant state
      priceContext - context information used to filter price lists to determine which are applicable to the request if none are provided in priceInfoContext.
      priceInfoContext - Additional context information including a preselected group of price lists and the items for which to find pricing info.
      Returns:
      A page of PriceInfos for the given context and priceable targets.
    • priceByProvidedPriceLists

      public boolean priceByProvidedPriceLists(@RequestBody com.broadleafcommerce.pricing.client.domain.context.PriceInfoContext priceInfoContext)
    • postProcessResponse

      protected org.springframework.data.domain.Page<com.broadleafcommerce.pricing.client.domain.PriceInfo> postProcessResponse(org.springframework.data.domain.Page<com.broadleafcommerce.pricing.client.domain.PriceInfo> priceInfos)
      Provide a hook to post-process the endpoint response before returning. This can be used to explicitly truncate or embellish the object graph. By default, PriceableTarget.getAttributes() are truncated in every PriceInfo instance.
      Parameters:
      priceInfos - The page of PriceInfo instances to post-process.
    • getService

      @NonNull protected PriceInfoService getService()
    • getPricingCurrencyHelper

      @NonNull protected PricingCurrencyHelper getPricingCurrencyHelper()