Class DefaultQuoteFacade
- java.lang.Object
-
- de.hybris.platform.commercefacades.order.impl.DefaultQuoteFacade
-
- All Implemented Interfaces:
QuoteFacade
public class DefaultQuoteFacade extends java.lang.Object implements QuoteFacade
Default implementation ofQuoteFacade.
-
-
Constructor Summary
Constructors Constructor Description DefaultQuoteFacade()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidacceptAndPrepareCheckout(java.lang.String quoteCode)Prepare a quote to make checkout.voidaddComment(java.lang.String text)Adds a comment to the session cart.voidaddEntryComment(long entryNumber, java.lang.String text)Method for adding a comment to a quote entryvoidapplyQuoteDiscount(java.lang.Double discountRate, java.lang.String discountTypeCode)Applies the discount to the session cart given the discount and it's type.voidapproveQuote(java.lang.String quoteCode)Approve an existing quote.voidcancelQuote(java.lang.String quoteCode)Cancels a quote.CartDatacreateCartFromQuote(java.lang.String quoteCode)Creates a new cart data from an existing quote.voidenableQuoteEdit(java.lang.String quoteCode)Activate quote and set it to edit mode.java.util.Set<QuoteAction>getAllowedActions(java.lang.String quoteCode)Gets the set of allowed actions for the given quote.protected BaseStoreServicegetBaseStoreService()protected Converter<CartModel,CartData>getCartConverter()protected CartServicegetCartService()protected CommerceCartServicegetCommerceCartService()protected CommerceCommentServicegetCommerceCommentService()protected CommerceQuoteServicegetCommerceQuoteService()java.util.List<DiscountTypeData>getDiscountTypes()Deprecated.Since 6.4.protected AbstractOrderEntryModelgetEntryForEntryNumber(AbstractOrderModel order, int number)EnumerationServicegetEnumerationService()protected ModelServicegetModelService()SearchPageData<QuoteData>getPagedQuotes(PageableData pageableData)Retrieves the paged list of quotes for the current user and the current base store.protected Converter<QuoteModel,QuoteData>getQuoteConverter()QuoteDatagetQuoteForCode(java.lang.String quoteCode)Retrieve the latest snapshot (version) of a quote by its code, for the current user and current base store.protected QuoteModelgetQuoteModelForCode(java.lang.String quoteCode)doublegetQuoteRequestThreshold(java.lang.String quoteCode)Gets quote threshold configured for the initial request, and the quote requires threshold validation.java.lang.IntegergetQuotesCountForCurrentUser()Gets the number of quotes for the current userprotected QuoteServicegetQuoteService()protected QuoteUserIdentificationStrategygetQuoteUserIdentificationStrategy()TypeServicegetTypeService()protected UserServicegetUserService()QuoteDatainitiateQuote()Creates a new Quote for the current user, based on what is on the session.booleanisQuoteSessionCartValidForCheckout()Validates if the session quote cart can be checked-out or notQuoteDatanewCart()Sync quote and close edit mode.voidrejectQuote(java.lang.String quoteCode)Reject an existing quote.voidremoveQuoteCart(java.lang.String quoteCode)Removes the cart related to the given quoteQuoteDatarequote(java.lang.String quoteCode)Re-quote from the existing quote to create a new quotevoidsetBaseStoreService(BaseStoreService baseStoreService)voidsetCartConverter(Converter<CartModel,CartData> cartConverter)voidsetCartService(CartService cartService)voidsetCommerceCartService(CommerceCartService commerceCartService)voidsetCommerceCommentService(CommerceCommentService commerceCommentService)voidsetCommerceQuoteService(CommerceQuoteService commerceQuoteService)voidsetEnumerationService(EnumerationService enumerationService)voidsetModelService(ModelService modelService)voidsetQuoteConverter(Converter<QuoteModel,QuoteData> quoteConverter)voidsetQuoteService(QuoteService quoteService)voidsetQuoteUserIdentificationStrategy(QuoteUserIdentificationStrategy quoteUserIdentificationStrategy)voidsetTypeService(TypeService typeService)voidsetUserService(UserService userService)voidsubmitQuote(java.lang.String quoteCode)Submits an existing quote.protected voidvalidateQuoteCart(CartModel cartModel)
-
-
-
Method Detail
-
initiateQuote
public QuoteData initiateQuote()
Description copied from interface:QuoteFacadeCreates a new Quote for the current user, based on what is on the session.- Specified by:
initiateQuotein interfaceQuoteFacade- Returns:
- the newly created quote
-
createCartFromQuote
public CartData createCartFromQuote(java.lang.String quoteCode)
Description copied from interface:QuoteFacadeCreates a new cart data from an existing quote. Cart is linked to the quote.- Specified by:
createCartFromQuotein interfaceQuoteFacade- Parameters:
quoteCode- the code of the quote that will generate the cart- Returns:
- the newly created cart
-
enableQuoteEdit
public void enableQuoteEdit(java.lang.String quoteCode)
Description copied from interface:QuoteFacadeActivate quote and set it to edit mode.- Specified by:
enableQuoteEditin interfaceQuoteFacade- Parameters:
quoteCode- the code of the quote to process
-
newCart
public QuoteData newCart()
Description copied from interface:QuoteFacadeSync quote and close edit mode.- Specified by:
newCartin interfaceQuoteFacade- Returns:
- the updated QuoteData object
-
submitQuote
public void submitQuote(java.lang.String quoteCode)
Description copied from interface:QuoteFacadeSubmits an existing quote.- Specified by:
submitQuotein interfaceQuoteFacade- Parameters:
quoteCode- the code of the quote to process
-
getQuoteRequestThreshold
public double getQuoteRequestThreshold(java.lang.String quoteCode)
Description copied from interface:QuoteFacadeGets quote threshold configured for the initial request, and the quote requires threshold validation.- Specified by:
getQuoteRequestThresholdin interfaceQuoteFacade- Returns:
- The (positive) threshold value; 0, if none configured; or a negative number, if quote does not need threshold validation.
-
approveQuote
public void approveQuote(java.lang.String quoteCode)
Description copied from interface:QuoteFacadeApprove an existing quote.- Specified by:
approveQuotein interfaceQuoteFacade- Parameters:
quoteCode- the code of the quote to process
-
rejectQuote
public void rejectQuote(java.lang.String quoteCode)
Description copied from interface:QuoteFacadeReject an existing quote.- Specified by:
rejectQuotein interfaceQuoteFacade- Parameters:
quoteCode- the code of the quote to process
-
acceptAndPrepareCheckout
public void acceptAndPrepareCheckout(java.lang.String quoteCode)
Description copied from interface:QuoteFacadePrepare a quote to make checkout.- Specified by:
acceptAndPrepareCheckoutin interfaceQuoteFacade- Parameters:
quoteCode- the code of the quote to process
-
getPagedQuotes
public SearchPageData<QuoteData> getPagedQuotes(PageableData pageableData)
Description copied from interface:QuoteFacadeRetrieves the paged list of quotes for the current user and the current base store.- Specified by:
getPagedQuotesin interfaceQuoteFacade- Parameters:
pageableData- paging information- Returns:
- the paged search results
-
getQuoteModelForCode
protected QuoteModel getQuoteModelForCode(java.lang.String quoteCode)
-
getQuoteForCode
public QuoteData getQuoteForCode(java.lang.String quoteCode)
Description copied from interface:QuoteFacadeRetrieve the latest snapshot (version) of a quote by its code, for the current user and current base store.- Specified by:
getQuoteForCodein interfaceQuoteFacade- Parameters:
quoteCode- The code of the quote- Returns:
- the latest snapshot of the quote
-
addComment
public void addComment(java.lang.String text)
Description copied from interface:QuoteFacadeAdds a comment to the session cart.- Specified by:
addCommentin interfaceQuoteFacade- Parameters:
text- the comment to be added to the quote
-
addEntryComment
public void addEntryComment(long entryNumber, java.lang.String text)Description copied from interface:QuoteFacadeMethod for adding a comment to a quote entry- Specified by:
addEntryCommentin interfaceQuoteFacade- Parameters:
entryNumber- the entry numbertext- the comment to be added to the order entry
-
getAllowedActions
public java.util.Set<QuoteAction> getAllowedActions(java.lang.String quoteCode)
Description copied from interface:QuoteFacadeGets the set of allowed actions for the given quote.- Specified by:
getAllowedActionsin interfaceQuoteFacade- Parameters:
quoteCode- the code of the quote- Returns:
- the set of actions allowed for the quote. Empty set will be returned if none of the action is allowed.
-
applyQuoteDiscount
public void applyQuoteDiscount(java.lang.Double discountRate, java.lang.String discountTypeCode)Description copied from interface:QuoteFacadeApplies the discount to the session cart given the discount and it's type.- Specified by:
applyQuoteDiscountin interfaceQuoteFacade- Parameters:
discountRate- the discount rate to be applieddiscountTypeCode- the code of the discount type to be applied
-
getDiscountTypes
@Deprecated(since="6.4") public java.util.List<DiscountTypeData> getDiscountTypes()
Deprecated.Since 6.4.Description copied from interface:QuoteFacadeGet discount types ready to be applied for discount.- Specified by:
getDiscountTypesin interfaceQuoteFacade- Returns:
- the list of discount types to be applied for quote. Empty list will be returned if nothing can be applied.
-
cancelQuote
public void cancelQuote(java.lang.String quoteCode)
Description copied from interface:QuoteFacadeCancels a quote. The version of the quote visible to the user will have the state set to canceled.- Specified by:
cancelQuotein interfaceQuoteFacade- Parameters:
quoteCode- the code of the quote to cancel
-
getQuotesCountForCurrentUser
public java.lang.Integer getQuotesCountForCurrentUser()
Description copied from interface:QuoteFacadeGets the number of quotes for the current user- Specified by:
getQuotesCountForCurrentUserin interfaceQuoteFacade- Returns:
- the number of quotes
-
isQuoteSessionCartValidForCheckout
public boolean isQuoteSessionCartValidForCheckout()
Description copied from interface:QuoteFacadeValidates if the session quote cart can be checked-out or not- Specified by:
isQuoteSessionCartValidForCheckoutin interfaceQuoteFacade- Returns:
- true if it's valid for checkout, false otherwise
-
removeQuoteCart
public void removeQuoteCart(java.lang.String quoteCode)
Description copied from interface:QuoteFacadeRemoves the cart related to the given quote- Specified by:
removeQuoteCartin interfaceQuoteFacade- Parameters:
quoteCode- code of the quote to detach cart from
-
requote
public QuoteData requote(java.lang.String quoteCode)
Description copied from interface:QuoteFacadeRe-quote from the existing quote to create a new quote- Specified by:
requotein interfaceQuoteFacade- Parameters:
quoteCode- The code of the quote to be re-quoted- Returns:
- the new quote
-
validateQuoteCart
protected void validateQuoteCart(CartModel cartModel)
-
getEntryForEntryNumber
protected AbstractOrderEntryModel getEntryForEntryNumber(AbstractOrderModel order, int number)
-
getCartService
protected CartService getCartService()
-
setCartService
public void setCartService(CartService cartService)
-
getCommerceQuoteService
protected CommerceQuoteService getCommerceQuoteService()
-
setCommerceQuoteService
public void setCommerceQuoteService(CommerceQuoteService commerceQuoteService)
-
getCommerceCartService
protected CommerceCartService getCommerceCartService()
-
setCommerceCartService
public void setCommerceCartService(CommerceCartService commerceCartService)
-
getQuoteService
protected QuoteService getQuoteService()
-
setQuoteService
public void setQuoteService(QuoteService quoteService)
-
getModelService
protected ModelService getModelService()
-
setModelService
public void setModelService(ModelService modelService)
-
getQuoteConverter
protected Converter<QuoteModel,QuoteData> getQuoteConverter()
-
setQuoteConverter
public void setQuoteConverter(Converter<QuoteModel,QuoteData> quoteConverter)
-
getUserService
protected UserService getUserService()
-
setUserService
public void setUserService(UserService userService)
-
getBaseStoreService
protected BaseStoreService getBaseStoreService()
-
setBaseStoreService
public void setBaseStoreService(BaseStoreService baseStoreService)
-
getEnumerationService
public EnumerationService getEnumerationService()
-
setEnumerationService
public void setEnumerationService(EnumerationService enumerationService)
-
getTypeService
public TypeService getTypeService()
-
setTypeService
public void setTypeService(TypeService typeService)
-
getCommerceCommentService
protected CommerceCommentService getCommerceCommentService()
-
setCommerceCommentService
public void setCommerceCommentService(CommerceCommentService commerceCommentService)
-
getQuoteUserIdentificationStrategy
protected QuoteUserIdentificationStrategy getQuoteUserIdentificationStrategy()
-
setQuoteUserIdentificationStrategy
public void setQuoteUserIdentificationStrategy(QuoteUserIdentificationStrategy quoteUserIdentificationStrategy)
-
-