Interface QuoteFacade

  • All Known Implementing Classes:
    DefaultQuoteFacade

    public interface QuoteFacade
    Facade interface providing an API for performing various quote management operations.
    • Method Detail

      • initiateQuote

        QuoteData initiateQuote()
        Creates a new Quote for the current user, based on what is on the session.
        Returns:
        the newly created quote
      • submitQuote

        void submitQuote​(java.lang.String quoteCode)
        Submits an existing quote.
        Parameters:
        quoteCode - the code of the quote to process
      • getQuoteRequestThreshold

        double getQuoteRequestThreshold​(java.lang.String quoteCode)
        Gets quote threshold configured for the initial request, and the quote requires threshold validation.
        Parameters:
        quoteCode -
        Returns:
        The (positive) threshold value; 0, if none configured; or a negative number, if quote does not need threshold validation.
      • approveQuote

        void approveQuote​(java.lang.String quoteCode)
        Approve an existing quote.
        Parameters:
        quoteCode - the code of the quote to process
      • rejectQuote

        void rejectQuote​(java.lang.String quoteCode)
        Reject an existing quote.
        Parameters:
        quoteCode - the code of the quote to process
      • acceptAndPrepareCheckout

        void acceptAndPrepareCheckout​(java.lang.String quoteCode)
        Prepare a quote to make checkout.
        Parameters:
        quoteCode - the code of the quote to process
      • getPagedQuotes

        SearchPageData<QuoteData> getPagedQuotes​(PageableData pageableData)
        Retrieves the paged list of quotes for the current user and the current base store.
        Parameters:
        pageableData - paging information
        Returns:
        the paged search results
      • createCartFromQuote

        CartData createCartFromQuote​(java.lang.String quoteCode)
        Creates a new cart data from an existing quote. Cart is linked to the quote.
        Parameters:
        quoteCode - the code of the quote that will generate the cart
        Returns:
        the newly created cart
      • enableQuoteEdit

        void enableQuoteEdit​(java.lang.String quoteCode)
        Activate quote and set it to edit mode.
        Parameters:
        quoteCode - the code of the quote to process
      • newCart

        QuoteData newCart()
        Sync quote and close edit mode.
        Returns:
        the updated QuoteData object
      • addComment

        void addComment​(java.lang.String text)
        Adds a comment to the session cart.
        Parameters:
        text - the comment to be added to the quote
      • addEntryComment

        void addEntryComment​(long entryNumber,
                             java.lang.String comment)
        Method for adding a comment to a quote entry
        Parameters:
        entryNumber - the entry number
        comment - the comment to be added to the order entry
      • getAllowedActions

        java.util.Set<QuoteAction> getAllowedActions​(java.lang.String quoteCode)
        Gets the set of allowed actions for the given quote.
        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

        void applyQuoteDiscount​(java.lang.Double discountRate,
                                java.lang.String discountTypeCode)
        Applies the discount to the session cart given the discount and it's type.
        Parameters:
        discountRate - the discount rate to be applied
        discountTypeCode - the code of the discount type to be applied
      • getDiscountTypes

        @Deprecated(since="6.4")
        java.util.List<DiscountTypeData> getDiscountTypes()
        Deprecated.
        since 6.4 This method is not used anywhere
        Get discount types ready to be applied for discount.
        Returns:
        the list of discount types to be applied for quote. Empty list will be returned if nothing can be applied.
      • cancelQuote

        void cancelQuote​(java.lang.String quoteCode)
        Cancels a quote. The version of the quote visible to the user will have the state set to canceled.
        Parameters:
        quoteCode - the code of the quote to cancel
      • getQuotesCountForCurrentUser

        java.lang.Integer getQuotesCountForCurrentUser()
        Gets the number of quotes for the current user
        Returns:
        the number of quotes
      • isQuoteSessionCartValidForCheckout

        boolean isQuoteSessionCartValidForCheckout()
        Validates if the session quote cart can be checked-out or not
        Returns:
        true if it's valid for checkout, false otherwise
      • removeQuoteCart

        void removeQuoteCart​(java.lang.String quoteCode)
        Removes the cart related to the given quote
        Parameters:
        quoteCode - code of the quote to detach cart from
      • getQuoteForCode

        QuoteData getQuoteForCode​(java.lang.String quoteCode)
        Retrieve the latest snapshot (version) of a quote by its code, for the current user and current base store.
        Parameters:
        quoteCode - The code of the quote
        Returns:
        the latest snapshot of the quote
      • requote

        QuoteData requote​(java.lang.String quoteCode)
        Re-quote from the existing quote to create a new quote
        Parameters:
        quoteCode - The code of the quote to be re-quoted
        Returns:
        the new quote