Class DefaultQuoteFacade

    • Constructor Detail

      • DefaultQuoteFacade

        public DefaultQuoteFacade()
    • Method Detail

      • 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​(java.lang.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​(java.lang.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​(java.lang.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​(java.lang.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​(java.lang.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​(java.lang.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​(java.lang.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​(java.lang.String quoteCode)
      • getQuoteForCode

        public QuoteData getQuoteForCode​(java.lang.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​(java.lang.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,
                                    java.lang.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 java.util.Set<QuoteAction> getAllowedActions​(java.lang.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​(java.lang.Double discountRate,
                                       java.lang.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")
        public java.util.List<DiscountTypeData> getDiscountTypes()
        Deprecated.
        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​(java.lang.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 java.lang.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​(java.lang.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​(java.lang.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)
      • getCartService

        protected CartService getCartService()
      • setCartService

        public void setCartService​(CartService cartService)
      • setCommerceQuoteService

        public void setCommerceQuoteService​(CommerceQuoteService commerceQuoteService)
      • 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)
      • getUserService

        protected UserService getUserService()
      • setUserService

        public void setUserService​(UserService userService)
      • setBaseStoreService

        public void setBaseStoreService​(BaseStoreService baseStoreService)
      • setEnumerationService

        public void setEnumerationService​(EnumerationService enumerationService)
      • setTypeService

        public void setTypeService​(TypeService typeService)
      • setCommerceCommentService

        public void setCommerceCommentService​(CommerceCommentService commerceCommentService)