public interface CommerceQuoteService
| Modifier and Type | Method and Description |
|---|---|
CartModel |
acceptAndPrepareCheckout(QuoteModel quoteModel,
UserModel userModel)
Accept and prepare checkout.
|
void |
applyQuoteDiscount(AbstractOrderModel abstractOrderModel,
UserModel userModel,
java.lang.Double discountRate,
DiscountType discountType)
Applies a quote specific discount to abstract order model given the discount rate and discount type.
|
QuoteModel |
approveQuote(QuoteModel quoteModel,
UserModel userModel)
Approve a quote from seller representative.
|
void |
assignQuoteToUser(QuoteModel quote,
UserModel assignee,
UserModel assigner)
Assigns quote to an assignee
|
void |
cancelQuote(QuoteModel quoteModel,
UserModel userModel)
Cancels a quote.
|
QuoteModel |
createQuoteFromCart(CartModel cartModel,
UserModel userModel)
Creates a new quote based on given cart.
|
QuoteModel |
createQuoteSnapshotWithState(QuoteModel quoteModel,
QuoteState quoteState)
Create a new quote snapshot for a given quote state and persist the model.
|
java.util.Set<QuoteAction> |
getAllowedActions(QuoteModel quoteModel,
UserModel userModel)
Get currently allowed actions for a quote.
|
QuoteModel |
getQuoteByCodeAndCustomerAndStore(CustomerModel customerModel,
UserModel quoteUserModel,
BaseStoreModel store,
java.lang.String quoteCode)
Finds a quote with highest version by code, customer and store.
|
SearchPageData<QuoteModel> |
getQuoteList(CustomerModel customerModel,
UserModel quoteUserModel,
BaseStoreModel store,
PageableData pageableData)
Retrieves the paged list of quotes according to the provided selection criteria.
|
double |
getQuoteRequestThreshold(QuoteModel quote,
UserModel user,
CartModel sessionCart)
Get quote request threshold defined in properties.
|
java.lang.Integer |
getQuotesCountForStoreAndUser(CustomerModel customerModel,
UserModel quoteUserModel,
BaseStoreModel store)
Get the number of quotes for the specified user and store.
|
boolean |
isQuoteCartValidForCheckout(CartModel cart)
Validates if the quote cart can be checked-out or not
|
CartModel |
loadQuoteAsSessionCart(QuoteModel quoteModel,
UserModel userModel)
Loads the given quote into a new session cart or returns the existing session cart if existing session cart
already has the quote loaded.
|
QuoteModel |
rejectQuote(QuoteModel quoteModel,
UserModel userModel)
Reject a quote from seller representative.
|
void |
removeQuoteCart(QuoteModel quote)
Removes the cart related to the given quote
|
QuoteModel |
requote(QuoteModel quoteModel,
UserModel userModel)
Re-quote from an existing quote to create a new quote
|
boolean |
shouldAutoApproveTheQuoteForSellerApproval(QuoteModel quoteModel)
Checks whether a quote can be auto approved or requires seller approval based on the configured threshold.
|
QuoteModel |
submitQuote(QuoteModel quoteModel,
UserModel userModel)
Submits a quote from buyer to seller representative or from seller representative to seller approver.
|
void |
unassignQuote(QuoteModel quote,
UserModel assigner)
Unassigns the assignee from the quote
|
QuoteModel |
updateQuoteFromCart(CartModel cartModel,
UserModel userModel)
Updates quote with data from cart (and existing quote).
|
void |
validateQuoteThreshold(QuoteModel quote,
UserModel user,
CartModel sessionCart)
Validates if quote meets threshold.
|
QuoteModel createQuoteFromCart(CartModel cartModel, UserModel userModel)
cartModel - the cart modeluserModel - the user performing the operation on the quotejava.lang.IllegalArgumentException - if any of the parameters is nullSearchPageData<QuoteModel> getQuoteList(CustomerModel customerModel, UserModel quoteUserModel, BaseStoreModel store, PageableData pageableData)
pageableData - paging informationcustomerModel - the customer to be used for selecting the quotesquoteUserModel - the user asking for the list.store - the store to be used for selecting the quotesjava.lang.IllegalArgumentException - if any of the parameters is nullQuoteModel getQuoteByCodeAndCustomerAndStore(CustomerModel customerModel, UserModel quoteUserModel, BaseStoreModel store, java.lang.String quoteCode)
customerModel - the customer to be used for selecting the quotequoteUserModel - the user asking for the list.store - the store to be used for selecting the quotequoteCode - the code of the quotejava.lang.IllegalArgumentException - if any of the parameters is nullCartModel loadQuoteAsSessionCart(QuoteModel quoteModel, UserModel userModel)
quoteModel - the quote to processuserModel - the user performing the operation on the quoteQuoteModel submitQuote(QuoteModel quoteModel, UserModel userModel)
quoteModel - the quote to processuserModel - the user performing the operation on the quotejava.lang.IllegalArgumentException - if any of the parameters is nullvoid validateQuoteThreshold(QuoteModel quote, UserModel user, CartModel sessionCart) throws QuoteUnderThresholdException
quote - the quote to validateuser - the user performing the operation on the quotesessionCart - the cart in sessionQuoteUnderThresholdException - if quote does not meet thresholddouble getQuoteRequestThreshold(QuoteModel quote, UserModel user, CartModel sessionCart)
quote - user - sessionCart - QuoteModel approveQuote(QuoteModel quoteModel, UserModel userModel)
quoteModel - the quote to processuserModel - the user performing the operation on the quotejava.lang.IllegalArgumentException - if any of the parameters is nullQuoteModel rejectQuote(QuoteModel quoteModel, UserModel userModel)
quoteModel - the quote to processuserModel - the user performing the operation on the quotejava.lang.IllegalArgumentException - if any of the parameters is nullQuoteModel updateQuoteFromCart(CartModel cartModel, UserModel userModel)
cartModel - cart that has an association to a quoteuserModel - the user performing the operation on the quotejava.lang.IllegalArgumentException - if any of the parameters is nulljava.util.Set<QuoteAction> getAllowedActions(QuoteModel quoteModel, UserModel userModel)
quoteModel - the quote to processuserModel - the user for which the allowed actions will be determinedjava.lang.IllegalArgumentException - if any of the parameter is nullCartModel acceptAndPrepareCheckout(QuoteModel quoteModel, UserModel userModel)
loadQuoteAsSessionCart(QuoteModel, UserModel) but for checkout.quoteModel - the quote to processuserModel - the user performing the operation on the quotejava.lang.IllegalArgumentException - if any of parameters is nullCommerceQuoteExpirationTimeException - if the quote has expiredvoid applyQuoteDiscount(AbstractOrderModel abstractOrderModel, UserModel userModel, java.lang.Double discountRate, DiscountType discountType)
abstractOrderModel - the abstract order model to add a discount to. Must either be a QuoteModel or a
CartModel associated with a quote.userModel - the user performing the operation on the quotediscountRate - the discount rate to be applieddiscountType - the type of discount to be appliedjava.lang.IllegalArgumentException - In case
QuoteModel nor a CartModel associated with a quote orSystemException - if an error occurs during cart calculationvoid cancelQuote(QuoteModel quoteModel, UserModel userModel)
quoteModel - the quote to canceluserModel - the user performing the operation on the quotejava.lang.IllegalArgumentException - if any of the parameters is nullvoid assignQuoteToUser(QuoteModel quote, UserModel assignee, UserModel assigner)
quote - the quote to be assignedassignee - the user to which the quote should be assignedassigner - the user assigning the quote to the assigneejava.lang.IllegalArgumentException - if any of parameters is nullCommerceQuoteAssignmentException - if the quote is already assigned to a different uservoid unassignQuote(QuoteModel quote, UserModel assigner)
quote - the quote to be unassignedassigner - the user un-assigning the quote from the assigneejava.lang.IllegalArgumentException - if any of parameters is nullCommerceQuoteAssignmentException - if the quote is assigned to a different userboolean shouldAutoApproveTheQuoteForSellerApproval(QuoteModel quoteModel)
quoteModel - the quote to inspect for auto approvaljava.lang.Integer getQuotesCountForStoreAndUser(CustomerModel customerModel, UserModel quoteUserModel, BaseStoreModel store)
customerModel - the customer to be used for selecting the quotesquoteUserModel - the user asking for the number of quotesstore - the store to be used for selecting the quotesjava.lang.IllegalArgumentException - if any of the parameters is nullQuoteModel createQuoteSnapshotWithState(QuoteModel quoteModel, QuoteState quoteState)
quoteModel - the quoteModel to create a snapshot fromquoteState - the new quoteStatejava.lang.IllegalArgumentException - if any of the parameters is nullboolean isQuoteCartValidForCheckout(CartModel cart)
cart - the cart to validatevoid removeQuoteCart(QuoteModel quote)
quote - the quote to detach cart fromQuoteModel requote(QuoteModel quoteModel, UserModel userModel)
quoteModel - the existing quoteModeluserModel - the current quote userCopyright © 2018 SAP SE. All Rights Reserved.