Class DefaultQuoteService

java.lang.Object
com.broadleafcommerce.cartoperation.service.quote.DefaultQuoteService
All Implemented Interfaces:
QuoteService

public class DefaultQuoteService extends Object implements QuoteService
Author:
Sunny Yu
  • Field Summary

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

    Constructors
    Constructor
    Description
    DefaultQuoteService(CartStatusManager cartStatusManager, CartProvider cartProvider, QuoteAuthUtils quoteAuthUtils, com.broadleafcommerce.common.extension.TypeFactory typeFactory, QuoteConfigurationProperties quoteConfigurationProperties, com.broadleafcommerce.data.tracking.core.filtering.fetch.FilterParser<cz.jirutka.rsql.parser.ast.Node> rsqlFilterParser)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    buildChangeCartStatusRequest(@NonNull QuoteProcessRequest quoteProcessRequest, boolean saveCart)
    Builds a ChangeCartStatusRequest based on the given QuoteProcessRequest.
    protected List<cz.jirutka.rsql.parser.ast.Node>
    buildCustomerQuotesFilters(@NonNull com.broadleafcommerce.order.common.domain.CustomerRef customerRef)
    Builds the RSQL filters for customer id and account-related attributes based on the given CustomerRef.
    protected cz.jirutka.rsql.parser.ast.Node
    buildQuoteFilters(@NonNull com.broadleafcommerce.order.common.domain.CustomerRef customerRef, @NonNull cz.jirutka.rsql.parser.ast.Node existingFilters, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Builds a Node filter for retrieving quotes.
    protected cz.jirutka.rsql.parser.ast.Node
    buildQuoteFilters(@NonNull com.broadleafcommerce.order.common.domain.CustomerRef customerRef, String quoteStatus, @NonNull cz.jirutka.rsql.parser.ast.Node existingFilters, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Builds a Node filter for retrieving quotes.
    protected cz.jirutka.rsql.parser.ast.Node
    buildRequestedQuotesFilter(cz.jirutka.rsql.parser.ast.Node filters)
    Builds the RSQL filters to incldue those specific for sellers to manage quotes.
    changeStatus(@NonNull QuoteProcessRequest quoteProcessRequest, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Changes the status of a quote based on the given QuoteProcessRequest.
    void
    deleteQuote(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull com.broadleafcommerce.order.common.domain.CustomerRef customerRef, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Deletes (archives) a quote.
    protected CartProvider
     
     
    protected QuoteAuthUtils
     
     
    protected com.broadleafcommerce.data.tracking.core.filtering.fetch.FilterParser<cz.jirutka.rsql.parser.ast.Node>
     
    protected com.broadleafcommerce.common.extension.TypeFactory
     
    org.springframework.data.domain.Page<com.broadleafcommerce.cart.client.domain.Cart>
    retrieveQuotes(@NonNull com.broadleafcommerce.order.common.domain.CustomerRef customerRef, @NonNull cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable pageable, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Retrieve a page of quotes in the current authenticated user's context.
    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)
    Retrieve a page of quotes for sellers to manage.

    Methods inherited from class java.lang.Object

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

  • Constructor Details

    • DefaultQuoteService

      public DefaultQuoteService(CartStatusManager cartStatusManager, CartProvider cartProvider, QuoteAuthUtils quoteAuthUtils, com.broadleafcommerce.common.extension.TypeFactory typeFactory, QuoteConfigurationProperties quoteConfigurationProperties, com.broadleafcommerce.data.tracking.core.filtering.fetch.FilterParser<cz.jirutka.rsql.parser.ast.Node> rsqlFilterParser)
  • Method Details

    • retrieveQuotes

      public org.springframework.data.domain.Page<com.broadleafcommerce.cart.client.domain.Cart> retrieveQuotes(@NonNull @NonNull com.broadleafcommerce.order.common.domain.CustomerRef customerRef, @NonNull @NonNull cz.jirutka.rsql.parser.ast.Node filters, @Nullable org.springframework.data.domain.Pageable pageable, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Description copied from interface: QuoteService
      Retrieve a page of quotes in the current authenticated user's context.
      Specified by:
      retrieveQuotes in interface QuoteService
      Parameters:
      customerRef - the currently authenticated CustomerRef
      filters - exising filters to build on top of
      pageable - the requested page of results
      contextInfo - context information related to multitenancy
      Returns:
      a page of quotes in the current authenticated user's context
    • retrieveRequestedQuotes

      public org.springframework.data.domain.Page<com.broadleafcommerce.cart.client.domain.Cart> retrieveRequestedQuotes(@Nullable cz.jirutka.rsql.parser.ast.Node filters, @Nullable org.springframework.data.domain.Pageable pageable, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Description copied from interface: QuoteService
      Retrieve a page of quotes for sellers to manage.
      Specified by:
      retrieveRequestedQuotes in interface QuoteService
      Parameters:
      filters - exising filters to build on top of
      pageable - the requested page of results
      contextInfo - context information related to multitenancy
      Returns:
      a page of quotes in the current authenticated user's context
    • changeStatus

      public QuoteProcessResponse changeStatus(@NonNull @NonNull QuoteProcessRequest quoteProcessRequest, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Description copied from interface: QuoteService
      Changes the status of a quote based on the given QuoteProcessRequest.
      Specified by:
      changeStatus in interface QuoteService
      Parameters:
      quoteProcessRequest - the QuoteProcessRequest containing the details of the status change
      contextInfo - context information related to multitenancy
      Returns:
      a QuoteProcessResponse representing the result of the status change
    • deleteQuote

      public void deleteQuote(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull @NonNull com.broadleafcommerce.order.common.domain.CustomerRef customerRef, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Description copied from interface: QuoteService
      Deletes (archives) a quote.
      Specified by:
      deleteQuote in interface QuoteService
      Parameters:
      cart - Cart of type DefaultCartTypes.QUOTE to delete.
      customerRef - user performing the action.
      contextInfo - context information related to multitenancy.
    • buildChangeCartStatusRequest

      protected ChangeCartStatusRequest buildChangeCartStatusRequest(@NonNull @NonNull QuoteProcessRequest quoteProcessRequest, boolean saveCart)
      Builds a ChangeCartStatusRequest based on the given QuoteProcessRequest. The `CartActionAuditToCreate` field is populated later in the flow.
      Parameters:
      quoteProcessRequest - the QuoteProcessRequest used for changing the quote status
      saveCart - whether to save the Cart after changing its status
      Returns:
      a ChangeCartStatusRequest based on the given QuoteProcessRequest
    • buildQuoteFilters

      protected cz.jirutka.rsql.parser.ast.Node buildQuoteFilters(@NonNull @NonNull com.broadleafcommerce.order.common.domain.CustomerRef customerRef, @NonNull @NonNull cz.jirutka.rsql.parser.ast.Node existingFilters, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Builds a Node filter for retrieving quotes.
      Parameters:
      customerRef - the currently authenticated CustomerRef
      existingFilters - exising filters to build on top of
      Returns:
      a Node filter for retrieving quotes
    • buildQuoteFilters

      protected cz.jirutka.rsql.parser.ast.Node buildQuoteFilters(@NonNull @NonNull com.broadleafcommerce.order.common.domain.CustomerRef customerRef, @Nullable String quoteStatus, @NonNull @NonNull cz.jirutka.rsql.parser.ast.Node existingFilters, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Builds a Node filter for retrieving quotes.
      Parameters:
      customerRef - the currently authenticated CustomerRef
      quoteStatus - the status to filter the quotes by
      existingFilters - exising filters to build on top of
      Returns:
      a Node filter for retrieving quotes
    • buildCustomerQuotesFilters

      protected List<cz.jirutka.rsql.parser.ast.Node> buildCustomerQuotesFilters(@NonNull @NonNull com.broadleafcommerce.order.common.domain.CustomerRef customerRef)
      Builds the RSQL filters for customer id and account-related attributes based on the given CustomerRef.
      Parameters:
      customerRef - the currently authenticated CustomerRef
      Returns:
      The RSQL filters for customer id and account-related attributes based on the given CustomerRef
    • buildRequestedQuotesFilter

      protected cz.jirutka.rsql.parser.ast.Node buildRequestedQuotesFilter(@Nullable cz.jirutka.rsql.parser.ast.Node filters)
      Builds the RSQL filters to incldue those specific for sellers to manage quotes. See broadleaf.cartoperation.service.quote.requested-quote-statuses to control the statuses filtered on.
      Parameters:
      filters - Preexisting filters from another request
      Returns:
      The combined RSQL filters
    • getCartStatusManager

      protected CartStatusManager getCartStatusManager()
    • getCartProvider

      protected CartProvider getCartProvider()
    • getQuoteAuthUtils

      protected QuoteAuthUtils getQuoteAuthUtils()
    • getTypeFactory

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

      protected QuoteConfigurationProperties getQuoteConfigurationProperties()
    • getRsqlFilterParser

      protected com.broadleafcommerce.data.tracking.core.filtering.fetch.FilterParser<cz.jirutka.rsql.parser.ast.Node> getRsqlFilterParser()