Package de.hybris.platform.order.impl
Class DefaultQuoteService
java.lang.Object
de.hybris.platform.order.impl.DefaultQuoteService
- All Implemented Interfaces:
QuoteService
Default implementation for
QuoteService-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateQuoteFromCart(CartModel cart) Creates a new quote based on the given cart.createQuoteSnapshot(QuoteModel quote, QuoteState quoteState) Creates a new quote snapshot by cloning the givenQuoteModel.protected CreateQuoteFromCartStrategyprotected CreateQuoteSnapshotStrategygetCurrentQuoteForCode(String code) Returns the latest quote snapshot for the given code, i.e.protected FlexibleSearchServicegetQuoteForCodeAndVersion(String code, Integer version) Returns a uniqueQuoteModelfor the given code and version.getQuotesForCode(String code) Returns a list of all quotes snapshots for the given code, ordered by version in descending order, i.e.voidsetCreateQuoteFromCartStrategy(CreateQuoteFromCartStrategy createQuoteFromCartStrategy) voidsetCreateQuoteSnapshotStrategy(CreateQuoteSnapshotStrategy createQuoteSnapshotStrategy) voidsetFlexibleSearchService(FlexibleSearchService flexibleSearchService)
-
Field Details
-
QUOTES_QUERY
- See Also:
-
WHERE_CODE_CLAUSE
- See Also:
-
WHERE_CODE_AND_VERSION
- See Also:
-
ORDER_BY_VERSION_DESC
- See Also:
-
-
Constructor Details
-
DefaultQuoteService
public DefaultQuoteService()
-
-
Method Details
-
getCurrentQuoteForCode
Description copied from interface:QuoteServiceReturns the latest quote snapshot for the given code, i.e. the one with the highest version.- Specified by:
getCurrentQuoteForCodein interfaceQuoteService- Parameters:
code- the code to query for- Returns:
- latest quote snapshot for the given code
-
getQuoteForCodeAndVersion
Description copied from interface:QuoteServiceReturns a uniqueQuoteModelfor the given code and version.- Specified by:
getQuoteForCodeAndVersionin interfaceQuoteService- Parameters:
code- the code to query forversion- the version to query for- Returns:
- unique quote for the given code and version
-
getQuotesForCode
Description copied from interface:QuoteServiceReturns a list of all quotes snapshots for the given code, ordered by version in descending order, i.e. the first item in the returned list is the latest snapshot of the quote.- Specified by:
getQuotesForCodein interfaceQuoteService- Parameters:
code- the code to query for- Returns:
- a list of ordered quote snapshots for the given code
-
createQuoteFromCart
Description copied from interface:QuoteServiceCreates a new quote based on the given cart. Please note that it is the caller's responsibility to persist the quote that is returned by this method. Callers may either set quote specific attributes before persisting the item or leave it to theDefaultQuotePrepareInterceptorto set default values. The cart that is passed into this method is not affected by its logic.- Specified by:
createQuoteFromCartin interfaceQuoteService- Parameters:
cart- the cart based on which the new quote will be created- Returns:
- the new quote
-
createQuoteSnapshot
Description copied from interface:QuoteServiceCreates a new quote snapshot by cloning the givenQuoteModel. The state of the new snapshot is determined by the givenQuoteState, its version is the given quote's version incremented by 1. Please note that it is the caller's responsibility to persist the quote that is returned by this method. The original quote passed into this method is not affected by its logic.- Specified by:
createQuoteSnapshotin interfaceQuoteService- Parameters:
quote- quote to create the snapshot fromquoteState- desired state of the quote- Returns:
- the new quote snapshot.
-
getFlexibleSearchService
-
setFlexibleSearchService
-
getCreateQuoteFromCartStrategy
-
setCreateQuoteFromCartStrategy
-
getCreateQuoteSnapshotStrategy
-
setCreateQuoteSnapshotStrategy
-