Interface CartApprovalValidationService
-
- All Known Implementing Classes:
DefaultCartApprovalValidationService
public interface CartApprovalValidationService
This service is responsible for validating theCartStatus
of aCart
to perform actions in the cart approval flow.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default void
validateCartSubmission(com.broadleafcommerce.cart.client.domain.Cart cart, com.broadleafcommerce.order.common.domain.CustomerRef customerRef, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Validates whether the givenCart
can be submitted for checkout by the givenCustomerRef
.void
validateRequestForRejection(com.broadleafcommerce.cart.client.domain.Cart cart, com.broadleafcommerce.order.common.domain.CustomerRef customer, CartApprovalProcessRequest cartApprovalProcessRequest, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Method that calls all validators performing checks on conditions necessary for a cart to be rejected.void
validateSubmitForApproval(com.broadleafcommerce.cart.client.domain.Cart cart, com.broadleafcommerce.order.common.domain.CustomerRef customer, CartApprovalProcessRequest cartApprovalProcessRequest, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Method that calls all validators performing checks on conditions necessary for a cart to be submitted for approval.void
validateUserIsCartReviewer(com.broadleafcommerce.cart.client.domain.Cart cart, com.broadleafcommerce.order.common.domain.CustomerRef customerRef, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Validates that the user has the correct access to reject or submit the givenCart
.
-
-
-
Method Detail
-
validateSubmitForApproval
void validateSubmitForApproval(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)
Method that calls all validators performing checks on conditions necessary for a cart to be submitted for approval.- Parameters:
cart
- TheCart
that is being submitted for approval.customer
- TheCustomerRef
of the user who is submitting the cart for approval.cartApprovalProcessRequest
- theCartApprovalProcessRequest
passed in byCartApprovalService
contextInfo
- context information around sandbox and multitenant state.- Throws:
CartApprovalValidationException
- if the cart is not prepared to submit for approval.
-
validateRequestForRejection
void validateRequestForRejection(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)
Method that calls all validators performing checks on conditions necessary for a cart to be rejected.- Parameters:
cart
- TheCart
that is rejected.customer
- TheCustomerRef
of the user who is rejecting the cart.cartApprovalProcessRequest
- theCartApprovalProcessRequest
passed in byCartApprovalService
contextInfo
- context information around sandbox and multitenant state- Throws:
CartApprovalValidationException
- if the cart is not in the correct state to be rejected.
-
validateCartSubmission
default void validateCartSubmission(com.broadleafcommerce.cart.client.domain.Cart cart, @Nullable com.broadleafcommerce.order.common.domain.CustomerRef customerRef, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Validates whether the givenCart
can be submitted for checkout by the givenCustomerRef
.- Parameters:
cart
- theCart
that the user is attempting to submitcustomerRef
- theCustomerRef
representing the user to validate againstcontextInfo
- context information around sandbox and multitenant state- Throws:
CartApprovalValidationException
- if the user doesn't have access to approve the givenCart
-
validateUserIsCartReviewer
void validateUserIsCartReviewer(com.broadleafcommerce.cart.client.domain.Cart cart, @Nullable com.broadleafcommerce.order.common.domain.CustomerRef customerRef, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Validates that the user has the correct access to reject or submit the givenCart
.- Parameters:
cart
- theCart
that the user is attempting to accesscustomerRef
- theCustomerRef
representing the user to validate againstcontextInfo
- context information around sandbox and multitenant state- Throws:
CartApprovalValidationException
- if the user doesn't have access to reject or submit the givenCart
-
-