Class DefaultQuoteFacade

java.lang.Object
de.hybris.platform.commercefacades.order.impl.DefaultQuoteFacade
All Implemented Interfaces:
QuoteFacade

public class DefaultQuoteFacade extends Object implements QuoteFacade
Default implementation of QuoteFacade.
  • Constructor Details

    • DefaultQuoteFacade

      public DefaultQuoteFacade()
  • Method Details

    • initiateQuote

      public QuoteData initiateQuote()
      Description copied from interface: QuoteFacade
      Creates a new Quote for the current user, based on what is on the session.
      Specified by:
      initiateQuote in interface QuoteFacade
      Returns:
      the newly created quote
    • createCartFromQuote

      public CartData createCartFromQuote(String quoteCode)
      Description copied from interface: QuoteFacade
      Creates a new cart data from an existing quote. Cart is linked to the quote.
      Specified by:
      createCartFromQuote in interface QuoteFacade
      Parameters:
      quoteCode - the code of the quote that will generate the cart
      Returns:
      the newly created cart
    • enableQuoteEdit

      public void enableQuoteEdit(String quoteCode)
      Description copied from interface: QuoteFacade
      Activate quote and set it to edit mode.
      Specified by:
      enableQuoteEdit in interface QuoteFacade
      Parameters:
      quoteCode - the code of the quote to process
    • newCart

      public QuoteData newCart()
      Description copied from interface: QuoteFacade
      Sync quote and close edit mode.
      Specified by:
      newCart in interface QuoteFacade
      Returns:
      the updated QuoteData object
    • submitQuote

      public void submitQuote(String quoteCode)
      Description copied from interface: QuoteFacade
      Submits an existing quote.
      Specified by:
      submitQuote in interface QuoteFacade
      Parameters:
      quoteCode - the code of the quote to process
    • getQuoteRequestThreshold

      public double getQuoteRequestThreshold(String quoteCode)
      Description copied from interface: QuoteFacade
      Gets quote threshold configured for the initial request, and the quote requires threshold validation.
      Specified by:
      getQuoteRequestThreshold in interface QuoteFacade
      Returns:
      The (positive) threshold value; 0, if none configured; or a negative number, if quote does not need threshold validation.
    • approveQuote

      public void approveQuote(String quoteCode)
      Description copied from interface: QuoteFacade
      Approve an existing quote.
      Specified by:
      approveQuote in interface QuoteFacade
      Parameters:
      quoteCode - the code of the quote to process
    • rejectQuote

      public void rejectQuote(String quoteCode)
      Description copied from interface: QuoteFacade
      Reject an existing quote.
      Specified by:
      rejectQuote in interface QuoteFacade
      Parameters:
      quoteCode - the code of the quote to process
    • acceptAndPrepareCheckout

      public void acceptAndPrepareCheckout(String quoteCode)
      Description copied from interface: QuoteFacade
      Prepare a quote to make checkout.
      Specified by:
      acceptAndPrepareCheckout in interface QuoteFacade
      Parameters:
      quoteCode - the code of the quote to process
    • getPagedQuotes

      public SearchPageData<QuoteData> getPagedQuotes(PageableData pageableData)
      Description copied from interface: QuoteFacade
      Retrieves the paged list of quotes for the current user and the current base store.
      Specified by:
      getPagedQuotes in interface QuoteFacade
      Parameters:
      pageableData - paging information
      Returns:
      the paged search results
    • getQuoteModelForCode

      protected QuoteModel getQuoteModelForCode(String quoteCode)
    • getQuoteForCode

      public QuoteData getQuoteForCode(String quoteCode)
      Description copied from interface: QuoteFacade
      Retrieve the latest snapshot (version) of a quote by its code, for the current user and current base store.
      Specified by:
      getQuoteForCode in interface QuoteFacade
      Parameters:
      quoteCode - The code of the quote
      Returns:
      the latest snapshot of the quote
    • addComment

      public void addComment(String text)
      Description copied from interface: QuoteFacade
      Adds a comment to the session cart.
      Specified by:
      addComment in interface QuoteFacade
      Parameters:
      text - the comment to be added to the quote
    • addEntryComment

      public void addEntryComment(long entryNumber, String text)
      Description copied from interface: QuoteFacade
      Method for adding a comment to a quote entry
      Specified by:
      addEntryComment in interface QuoteFacade
      Parameters:
      entryNumber - the entry number
      text - the comment to be added to the order entry
    • getAllowedActions

      public Set<QuoteAction> getAllowedActions(String quoteCode)
      Description copied from interface: QuoteFacade
      Gets the set of allowed actions for the given quote.
      Specified by:
      getAllowedActions in interface QuoteFacade
      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(Double discountRate, String discountTypeCode)
      Description copied from interface: QuoteFacade
      Applies the discount to the session cart given the discount and it's type.
      Specified by:
      applyQuoteDiscount in interface QuoteFacade
      Parameters:
      discountRate - the discount rate to be applied
      discountTypeCode - the code of the discount type to be applied
    • getDiscountTypes

      @Deprecated(since="6.4", forRemoval=true) public List<DiscountTypeData> getDiscountTypes()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Since 6.4.
      Description copied from interface: QuoteFacade
      Get discount types ready to be applied for discount.
      Specified by:
      getDiscountTypes in interface QuoteFacade
      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(String quoteCode)
      Description copied from interface: QuoteFacade
      Cancels a quote. The version of the quote visible to the user will have the state set to canceled.
      Specified by:
      cancelQuote in interface QuoteFacade
      Parameters:
      quoteCode - the code of the quote to cancel
    • getQuotesCountForCurrentUser

      public Integer getQuotesCountForCurrentUser()
      Description copied from interface: QuoteFacade
      Gets the number of quotes for the current user
      Specified by:
      getQuotesCountForCurrentUser in interface QuoteFacade
      Returns:
      the number of quotes
    • isQuoteSessionCartValidForCheckout

      public boolean isQuoteSessionCartValidForCheckout()
      Description copied from interface: QuoteFacade
      Validates if the session quote cart can be checked-out or not
      Specified by:
      isQuoteSessionCartValidForCheckout in interface QuoteFacade
      Returns:
      true if it's valid for checkout, false otherwise
    • removeQuoteCart

      public void removeQuoteCart(String quoteCode)
      Description copied from interface: QuoteFacade
      Removes the cart related to the given quote
      Specified by:
      removeQuoteCart in interface QuoteFacade
      Parameters:
      quoteCode - code of the quote to detach cart from
    • requote

      public QuoteData requote(String quoteCode)
      Description copied from interface: QuoteFacade
      Re-quote from the existing quote to create a new quote
      Specified by:
      requote in interface QuoteFacade
      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)
    • getCartConverter

      protected Converter<CartModel,CartData> getCartConverter()
    • setCartConverter

      public void setCartConverter(Converter<CartModel,CartData> cartConverter)
    • 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)