Interface CartApprovalService
- All Known Implementing Classes:
DefaultCartApprovalService
public interface CartApprovalService
Defines a service that handles cart approval operations performed on a
Cart
.-
Method Summary
Modifier and TypeMethodDescriptionrejectCart
(com.broadleafcommerce.cart.client.domain.Cart cart, com.broadleafcommerce.order.common.domain.CustomerRef customer, CartApprovalProcessRequest cartApprovalProcessRequest, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Action performed by an account approver to reject aCart
.org.springframework.data.domain.Page<com.broadleafcommerce.cart.client.domain.Cart>
retrieveCartsRequiringApproval
(String requestedAccountId, com.broadleafcommerce.order.common.domain.CustomerRef customerRef, cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable pageable, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Retrieve a page ofCarts
that require approval in the current authenticated user's account context and requested account id if applicable.submitForApproval
(com.broadleafcommerce.cart.client.domain.Cart cart, com.broadleafcommerce.order.common.domain.CustomerRef customer, CartApprovalProcessRequest cartApprovalProcessRequest, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Action performed by an account member to submit for approval of aCart
.
-
Method Details
-
retrieveCartsRequiringApproval
org.springframework.data.domain.Page<com.broadleafcommerce.cart.client.domain.Cart> retrieveCartsRequiringApproval(@Nullable String requestedAccountId, com.broadleafcommerce.order.common.domain.CustomerRef customerRef, cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable pageable, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Retrieve a page ofCarts
that require approval in the current authenticated user's account context and requested account id if applicable.- Parameters:
requestedAccountId
- optional parameter to retrieve carts from a specific account, if not specified, carts in the current account and its sub-accounts context will be retrievedcustomerRef
- the currently authenticatedCustomerRef
containing user's account detailsfilters
- exising filters to build on top ofpageable
- the requested page of resultscontextInfo
- context information related to multitenancy- Returns:
- a page of
Carts
that require approval in the current authenticated user's account context and requested account id if applicable.
-
submitForApproval
CartApprovalProcessResponse submitForApproval(com.broadleafcommerce.cart.client.domain.Cart cart, com.broadleafcommerce.order.common.domain.CustomerRef customer, CartApprovalProcessRequest cartApprovalProcessRequest, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Action performed by an account member to submit for approval of aCart
. Produces aCartActionAudit
.- Parameters:
cart
- The cart that was submitted for approvalcustomer
- The customer who submitted the cart for approvalcartApprovalProcessRequest
- the request with whichCartApprovalEndpoint
is hitcontextInfo
- Context information around sandbox and multitenant state.- Returns:
- a
CartApprovalProcessResponse
that contains the updated cart, any validation errors encountered, status of the request, and additionalAttributes - Throws:
CartApprovalValidationException
- when the validation fails for the request
-
rejectCart
CartApprovalProcessResponse rejectCart(com.broadleafcommerce.cart.client.domain.Cart cart, com.broadleafcommerce.order.common.domain.CustomerRef customer, CartApprovalProcessRequest cartApprovalProcessRequest, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Action performed by an account approver to reject aCart
. Produces aCartActionAudit
. Produces aCartRejectionEvent
- Parameters:
cart
- The cart that was rejectedcustomer
- The customer who rejected the cartcartApprovalProcessRequest
- the request with whichCartApprovalEndpoint
is hitcontextInfo
- Context information around sandbox and multitenant state.- Returns:
- The rejected cart
- Throws:
CartApprovalValidationException
- if an error is encountered during rejection
-