Interface QuoteFacade
- All Known Implementing Classes:
DefaultQuoteFacade
public interface QuoteFacade
Facade interface providing an API for performing various quote management operations.
-
Method Summary
Modifier and TypeMethodDescriptionvoidacceptAndPrepareCheckout(String quoteCode) Prepare a quote to make checkout.voidaddComment(String text) Adds a comment to the session cart.voidaddEntryComment(long entryNumber, String comment) Method for adding a comment to a quote entryvoidapplyQuoteDiscount(Double discountRate, String discountTypeCode) Applies the discount to the session cart given the discount and it's type.voidapproveQuote(String quoteCode) Approve an existing quote.voidcancelQuote(String quoteCode) Cancels a quote.createCartFromQuote(String quoteCode) Creates a new cart data from an existing quote.voidenableQuoteEdit(String quoteCode) Activate quote and set it to edit mode.getAllowedActions(String quoteCode) Gets the set of allowed actions for the given quote.Deprecated, for removal: This API element is subject to removal in a future version.since 6.4 This method is not used anywheregetPagedQuotes(PageableData pageableData) Retrieves the paged list of quotes for the current user and the current base store.getQuoteForCode(String quoteCode) Retrieve the latest snapshot (version) of a quote by its code, for the current user and current base store.doublegetQuoteRequestThreshold(String quoteCode) Gets quote threshold configured for the initial request, and the quote requires threshold validation.Gets the number of quotes for the current userCreates a new Quote for the current user, based on what is on the session.booleanValidates if the session quote cart can be checked-out or notnewCart()Sync quote and close edit mode.voidrejectQuote(String quoteCode) Reject an existing quote.voidremoveQuoteCart(String quoteCode) Removes the cart related to the given quoteRe-quote from the existing quote to create a new quotevoidsubmitQuote(String quoteCode) Submits an existing quote.
-
Method Details
-
initiateQuote
QuoteData initiateQuote()Creates a new Quote for the current user, based on what is on the session.- Returns:
- the newly created quote
-
submitQuote
Submits an existing quote.- Parameters:
quoteCode- the code of the quote to process
-
getQuoteRequestThreshold
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
Approve an existing quote.- Parameters:
quoteCode- the code of the quote to process
-
rejectQuote
Reject an existing quote.- Parameters:
quoteCode- the code of the quote to process
-
acceptAndPrepareCheckout
Prepare a quote to make checkout.- Parameters:
quoteCode- the code of the quote to process
-
getPagedQuotes
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
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
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
Adds a comment to the session cart.- Parameters:
text- the comment to be added to the quote
-
addEntryComment
Method for adding a comment to a quote entry- Parameters:
entryNumber- the entry numbercomment- the comment to be added to the order entry
-
getAllowedActions
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
Applies the discount to the session cart given the discount and it's type.- Parameters:
discountRate- the discount rate to be applieddiscountTypeCode- the code of the discount type to be applied
-
getDiscountTypes
Deprecated, for removal: This API element is subject to removal in a future version.since 6.4 This method is not used anywhereGet 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
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
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
Removes the cart related to the given quote- Parameters:
quoteCode- code of the quote to detach cart from
-
getQuoteForCode
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
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
-