Interface CartApprovalValidationService
- All Known Implementing Classes:
DefaultCartApprovalValidationService
public interface CartApprovalValidationService
This service is responsible for validating the
CartStatus of a Cart to perform
actions in the cart approval flow.-
Method Summary
Modifier and TypeMethodDescriptiondefault voidvalidateCartSubmission(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 givenCartcan be submitted for checkout by the givenCustomerRef.voidvalidateRequestForRejection(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.voidvalidateSubmitForApproval(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.voidvalidateUserIsCartReviewer(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 Details
-
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- TheCartthat is being submitted for approval.customer- TheCustomerRefof the user who is submitting the cart for approval.cartApprovalProcessRequest- theCartApprovalProcessRequestpassed in byCartApprovalServicecontextInfo- 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- TheCartthat is rejected.customer- TheCustomerRefof the user who is rejecting the cart.cartApprovalProcessRequest- theCartApprovalProcessRequestpassed in byCartApprovalServicecontextInfo- 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 givenCartcan be submitted for checkout by the givenCustomerRef.- Parameters:
cart- theCartthat the user is attempting to submitcustomerRef- theCustomerRefrepresenting 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- theCartthat the user is attempting to accesscustomerRef- theCustomerRefrepresenting 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
-