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 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 given Cart can be submitted for checkout by the given CustomerRef.
    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 given Cart.
  • 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 - The Cart that is being submitted for approval.
      customer - The CustomerRef of the user who is submitting the cart for approval.
      cartApprovalProcessRequest - the CartApprovalProcessRequest passed in by CartApprovalService
      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 - The Cart that is rejected.
      customer - The CustomerRef of the user who is rejecting the cart.
      cartApprovalProcessRequest - the CartApprovalProcessRequest passed in by CartApprovalService
      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 given Cart can be submitted for checkout by the given CustomerRef.
      Parameters:
      cart - the Cart that the user is attempting to submit
      customerRef - the CustomerRef representing the user to validate against
      contextInfo - context information around sandbox and multitenant state
      Throws:
      CartApprovalValidationException - if the user doesn't have access to approve the given Cart
    • 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 given Cart.
      Parameters:
      cart - the Cart that the user is attempting to access
      customerRef - the CustomerRef representing the user to validate against
      contextInfo - context information around sandbox and multitenant state
      Throws:
      CartApprovalValidationException - if the user doesn't have access to reject or submit the given Cart