java.lang.Object
com.broadleafcommerce.cartoperation.web.endpoint.QuoteEndpoint

@FrameworkRestController @FrameworkMapping("/quotes") public class QuoteEndpoint extends Object
Endpoints for Quote.

Note that these endpoints are guarded by the QuoteProperties.

Author:
Kyrylo Boiko (kboiko2)
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    QuoteEndpoint(CartResolverService cartResolverService, QuoteService quoteService, com.broadleafcommerce.cart.client.properties.QuoteProperties quoteProperties, com.broadleafcommerce.common.extension.TypeFactory typeFactory)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    buildQuotePropertiesResponse(com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Builds a QuoteConfigurationResponse based on the given ContextInfo.
    changeQuoteStatus(QuoteProcessRequest quoteProcessRequest, Integer cartVersion, com.broadleafcommerce.order.common.domain.CustomerRef customer, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
     
    void
    deleteQuote(String id, Integer cartVersion, com.broadleafcommerce.order.common.domain.CustomerRef customer, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
     
     
    protected com.broadleafcommerce.cart.client.properties.QuoteProperties
     
    getQuoteProperties(com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Endpoint to return quote-related properties based on the given context.
    protected QuoteService
     
    protected com.broadleafcommerce.common.extension.TypeFactory
     
    protected com.broadleafcommerce.cart.client.domain.Cart
    resolveCartForDelete(@NonNull String cartId, Integer cartVersion, com.broadleafcommerce.order.common.domain.CustomerRef customer, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
     
    protected com.broadleafcommerce.cart.client.domain.Cart
    resolveCartForStatusChange(@NonNull String cartId, Integer cartVersion, com.broadleafcommerce.order.common.domain.CustomerRef customer, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
     
    org.springframework.data.domain.Page<com.broadleafcommerce.cart.client.domain.Cart>
    retrieveQuotes(com.broadleafcommerce.order.common.domain.CustomerRef customerRef, cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable pageable, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Endpoint intended for customers to retrieve their quotes and for CSRs to retrieve a customer's quotes when acting as that customer
    org.springframework.data.domain.Page<com.broadleafcommerce.cart.client.domain.Cart>
    retrieveRequestedQuotes(cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable pageable, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Endpoint intended for sales reps to retrieve requested quotes

    Methods inherited from class java.lang.Object

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

  • Constructor Details

    • QuoteEndpoint

      public QuoteEndpoint(CartResolverService cartResolverService, QuoteService quoteService, com.broadleafcommerce.cart.client.properties.QuoteProperties quoteProperties, com.broadleafcommerce.common.extension.TypeFactory typeFactory)
  • Method Details

    • retrieveQuotes

      @Policy(permissionRoots={"CUSTOMER","CUSTOMER_PROFILE","CSR"}) @FrameworkGetMapping public org.springframework.data.domain.Page<com.broadleafcommerce.cart.client.domain.Cart> retrieveQuotes(com.broadleafcommerce.order.common.domain.CustomerRef customerRef, cz.jirutka.rsql.parser.ast.Node filters, @PageableDefault(size=50,sort="createDate",direction=DESC) org.springframework.data.domain.Pageable pageable, @ContextOperation com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Endpoint intended for customers to retrieve their quotes and for CSRs to retrieve a customer's quotes when acting as that customer
    • retrieveRequestedQuotes

      @Policy(permissionRoots="PUBLISH_QUOTE") @FrameworkGetMapping(params="requested") public org.springframework.data.domain.Page<com.broadleafcommerce.cart.client.domain.Cart> retrieveRequestedQuotes(cz.jirutka.rsql.parser.ast.Node filters, @PageableDefault(size=50,sort="createDate",direction=DESC) org.springframework.data.domain.Pageable pageable, @ContextOperation com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Endpoint intended for sales reps to retrieve requested quotes
    • changeQuoteStatus

      @FrameworkPostMapping(value="/{id}/status", consumes="application/json") public QuoteProcessResponse changeQuoteStatus(@RequestBody QuoteProcessRequest quoteProcessRequest, Integer cartVersion, com.broadleafcommerce.order.common.domain.CustomerRef customer, @ContextOperation com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    • deleteQuote

      @Policy(permissionRoots="PUBLISH_QUOTE") @FrameworkDeleteMapping("/{id}") public void deleteQuote(@PathVariable("id") String id, Integer cartVersion, com.broadleafcommerce.order.common.domain.CustomerRef customer, @ContextOperation(DELETE) com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    • getQuoteProperties

      @FrameworkGetMapping(value="/properties", produces="application/json") public QuoteConfigurationResponse getQuoteProperties(@ContextOperation(READ) com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Endpoint to return quote-related properties based on the given context.

      Sensitive information should not be returned

      Parameters:
      contextInfo - the context to get the properties for
      Returns:
      quote-related properties based on the given context
    • resolveCartForDelete

      protected com.broadleafcommerce.cart.client.domain.Cart resolveCartForDelete(@NonNull @NonNull String cartId, @Nullable Integer cartVersion, @Nullable com.broadleafcommerce.order.common.domain.CustomerRef customer, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    • resolveCartForStatusChange

      protected com.broadleafcommerce.cart.client.domain.Cart resolveCartForStatusChange(@NonNull @NonNull String cartId, @Nullable Integer cartVersion, @Nullable com.broadleafcommerce.order.common.domain.CustomerRef customer, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    • buildQuotePropertiesResponse

      protected QuoteConfigurationResponse buildQuotePropertiesResponse(@Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Builds a QuoteConfigurationResponse based on the given ContextInfo.
      Parameters:
      contextInfo - the context to get the properties for
      Returns:
      a QuoteConfigurationResponse based on the given ContextInfo
    • getCartResolverService

      protected CartResolverService getCartResolverService()
    • getQuoteService

      protected QuoteService getQuoteService()
    • getQuoteProperties

      protected com.broadleafcommerce.cart.client.properties.QuoteProperties getQuoteProperties()
    • getTypeFactory

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