public class DefaultQuoteService extends java.lang.Object implements QuoteService
QuoteService| Modifier and Type | Field and Description |
|---|---|
protected static java.lang.String |
ORDER_BY_VERSION_DESC |
protected static java.lang.String |
QUOTES_QUERY |
protected static java.lang.String |
WHERE_CODE_AND_VERSION |
protected static java.lang.String |
WHERE_CODE_CLAUSE |
| Constructor and Description |
|---|
DefaultQuoteService() |
| Modifier and Type | Method and Description |
|---|---|
QuoteModel |
createQuoteFromCart(CartModel cart)
Creates a new quote based on the given cart.
|
QuoteModel |
createQuoteSnapshot(QuoteModel quote,
QuoteState quoteState)
Creates a new quote snapshot by cloning the given
QuoteModel. |
protected CreateQuoteFromCartStrategy |
getCreateQuoteFromCartStrategy() |
protected CreateQuoteSnapshotStrategy |
getCreateQuoteSnapshotStrategy() |
QuoteModel |
getCurrentQuoteForCode(java.lang.String code)
Returns the latest quote snapshot for the given code, i.e.
|
protected FlexibleSearchService |
getFlexibleSearchService() |
QuoteModel |
getQuoteForCodeAndVersion(java.lang.String code,
java.lang.Integer version)
Returns a unique
QuoteModel for the given code and version. |
java.util.List<QuoteModel> |
getQuotesForCode(java.lang.String code)
Returns a list of all quotes snapshots for the given code, ordered by version in descending order, i.e.
|
void |
setCreateQuoteFromCartStrategy(CreateQuoteFromCartStrategy createQuoteFromCartStrategy) |
void |
setCreateQuoteSnapshotStrategy(CreateQuoteSnapshotStrategy createQuoteSnapshotStrategy) |
void |
setFlexibleSearchService(FlexibleSearchService flexibleSearchService) |
protected static final java.lang.String QUOTES_QUERY
protected static final java.lang.String WHERE_CODE_CLAUSE
protected static final java.lang.String WHERE_CODE_AND_VERSION
protected static final java.lang.String ORDER_BY_VERSION_DESC
public QuoteModel getCurrentQuoteForCode(java.lang.String code)
QuoteServicegetCurrentQuoteForCode in interface QuoteServicecode - the code to query forpublic QuoteModel getQuoteForCodeAndVersion(java.lang.String code, java.lang.Integer version)
QuoteServiceQuoteModel for the given code and version.getQuoteForCodeAndVersion in interface QuoteServicecode - the code to query forversion - the version to query forpublic java.util.List<QuoteModel> getQuotesForCode(java.lang.String code)
QuoteServicegetQuotesForCode in interface QuoteServicecode - the code to query forpublic QuoteModel createQuoteFromCart(CartModel cart)
QuoteServiceDefaultQuotePrepareInterceptor to set default values. The cart that is passed into this
method is not affected by its logic.createQuoteFromCart in interface QuoteServicecart - the cart based on which the new quote will be createdpublic QuoteModel createQuoteSnapshot(QuoteModel quote, QuoteState quoteState)
QuoteServiceQuoteModel. The state of the new snapshot is determined
by the given QuoteState, 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.createQuoteSnapshot in interface QuoteServicequote - quote to create the snapshot fromquoteState - desired state of the quoteprotected FlexibleSearchService getFlexibleSearchService()
public void setFlexibleSearchService(FlexibleSearchService flexibleSearchService)
protected CreateQuoteFromCartStrategy getCreateQuoteFromCartStrategy()
public void setCreateQuoteFromCartStrategy(CreateQuoteFromCartStrategy createQuoteFromCartStrategy)
protected CreateQuoteSnapshotStrategy getCreateQuoteSnapshotStrategy()
public void setCreateQuoteSnapshotStrategy(CreateQuoteSnapshotStrategy createQuoteSnapshotStrategy)
Copyright © 2018 SAP SE. All Rights Reserved.