Interface CartStatusManager

All Known Implementing Classes:
DefaultCartStatusManager

public interface CartStatusManager
A service that facilitates the {@link Cart's} status change.
Author:
Sunny Yu
  • Method Summary

    Modifier and Type
    Method
    Description
    com.broadleafcommerce.cart.client.domain.Cart
    changeStatus(ChangeCartStatusRequest changeStatusRequest, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Changes the Cart.getStatus() to a specified status.
    void
    validateStatusIsReadableByUser(CartStatusValidationRequest validationRequest, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Determines if the given Cart is readable by the currently authenticated user based on its status and workflow.
    void
    validateStatusIsUpdatableByUser(CartStatusValidationRequest validationRequest, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Determines if the given Cart is updatable by the currently authenticated user based on its current status and workflow.
    void
    validateStatusTransition(ChangeCartStatusRequest changeStatusRequest, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Validates the status transition is valid.
  • Method Details

    • changeStatus

      com.broadleafcommerce.cart.client.domain.Cart changeStatus(ChangeCartStatusRequest changeStatusRequest, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Changes the Cart.getStatus() to a specified status.
      Parameters:
      changeStatusRequest - the ChangeCartStatusRequest to facilitate the cart status change
      contextInfo - context information surrounding sandboxing and multitenant state
      Returns:
      the Cart with the updated status
    • validateStatusTransition

      void validateStatusTransition(ChangeCartStatusRequest changeStatusRequest, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Validates the status transition is valid.
      Parameters:
      changeStatusRequest - the ChangeCartStatusRequest to facilitate the cart status change
      contextInfo - context information surrounding sandboxing and multitenant state
    • validateStatusIsReadableByUser

      void validateStatusIsReadableByUser(CartStatusValidationRequest validationRequest, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Determines if the given Cart is readable by the currently authenticated user based on its status and workflow.
      Parameters:
      validationRequest - the CartStatusValidationRequest containing the details for the validation
      contextInfo - context information surrounding sandboxing and multitenant state
      See Also:
    • validateStatusIsUpdatableByUser

      void validateStatusIsUpdatableByUser(CartStatusValidationRequest validationRequest, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Determines if the given Cart is updatable by the currently authenticated user based on its current status and workflow.

      For example, the flow being processed may be DefaultCartOperationFlows.UPDATE_CONTACT_INFO, which is allowed for a DefaultQuoteStatuses.PUBLISHED quote. However, other operations such as add item to quote may not be permitted in the DefaultQuoteStatuses.PUBLISHED status.

      Parameters:
      validationRequest - the CartStatusValidationRequest containing the details for the validation
      contextInfo - context information surrounding sandboxing and multitenant state
      See Also: