Class DefaultQuoteService
java.lang.Object
com.broadleafcommerce.cartoperation.service.quote.DefaultQuoteService
- All Implemented Interfaces:
QuoteService
- Author:
- Sunny Yu
-
Field Summary
-
Constructor Summary
ConstructorDescriptionDefaultQuoteService
(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 TypeMethodDescriptionprotected ChangeCartStatusRequest
buildChangeCartStatusRequest
(@NonNull QuoteProcessRequest quoteProcessRequest, boolean saveCart) Builds aChangeCartStatusRequest
based on the givenQuoteProcessRequest
.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 givenCustomerRef
.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 aNode
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 aNode
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 givenQuoteProcessRequest
.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 CartStatusManager
protected QuoteAuthUtils
protected QuoteConfigurationProperties
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.
-
Field Details
-
ANONYMOUS_AUTHENTICATION_FAILURE
- See Also:
-
CUSTOMER_ID
- See Also:
-
ACCOUNT_ID
- See Also:
-
ACCOUNT_HIERARCHY
- See Also:
-
-
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 interfaceQuoteService
- Parameters:
customerRef
- the currently authenticatedCustomerRef
filters
- exising filters to build on top ofpageable
- the requested page of resultscontextInfo
- 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 interfaceQuoteService
- Parameters:
filters
- exising filters to build on top ofpageable
- the requested page of resultscontextInfo
- 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 givenQuoteProcessRequest
.- Specified by:
changeStatus
in interfaceQuoteService
- Parameters:
quoteProcessRequest
- theQuoteProcessRequest
containing the details of the status changecontextInfo
- 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 interfaceQuoteService
- Parameters:
cart
-Cart
of typeDefaultCartTypes.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 aChangeCartStatusRequest
based on the givenQuoteProcessRequest
. The `CartActionAuditToCreate` field is populated later in the flow.- Parameters:
quoteProcessRequest
- theQuoteProcessRequest
used for changing the quote statussaveCart
- whether to save theCart
after changing its status- Returns:
- a
ChangeCartStatusRequest
based on the givenQuoteProcessRequest
-
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 aNode
filter for retrieving quotes.- Parameters:
customerRef
- the currently authenticatedCustomerRef
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 aNode
filter for retrieving quotes.- Parameters:
customerRef
- the currently authenticatedCustomerRef
quoteStatus
- the status to filter the quotes byexistingFilters
- 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 givenCustomerRef
.- Parameters:
customerRef
- the currently authenticatedCustomerRef
- 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. Seebroadleaf.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
-
getCartProvider
-
getQuoteAuthUtils
-
getTypeFactory
protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory() -
getQuoteConfigurationProperties
-
getRsqlFilterParser
protected com.broadleafcommerce.data.tracking.core.filtering.fetch.FilterParser<cz.jirutka.rsql.parser.ast.Node> getRsqlFilterParser()
-