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 TypeMethodDescriptioncom.broadleafcommerce.cart.client.domain.Cart
changeStatus
(ChangeCartStatusRequest changeStatusRequest, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Changes theCart.getStatus()
to a specified status.void
validateStatusIsReadableByUser
(CartStatusValidationRequest validationRequest, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Determines if the givenCart
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 givenCart
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 theCart.getStatus()
to a specified status.- Parameters:
changeStatusRequest
- theChangeCartStatusRequest
to facilitate the cart status changecontextInfo
- 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
- theChangeCartStatusRequest
to facilitate the cart status changecontextInfo
- context information surrounding sandboxing and multitenant state
-
validateStatusIsReadableByUser
void validateStatusIsReadableByUser(CartStatusValidationRequest validationRequest, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Determines if the givenCart
is readable by the currently authenticated user based on its status and workflow.- Parameters:
validationRequest
- theCartStatusValidationRequest
containing the details for the validationcontextInfo
- 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 givenCart
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 aDefaultQuoteStatuses.PUBLISHED
quote. However, other operations such as add item to quote may not be permitted in theDefaultQuoteStatuses.PUBLISHED
status.- Parameters:
validationRequest
- theCartStatusValidationRequest
containing the details for the validationcontextInfo
- context information surrounding sandboxing and multitenant state- See Also:
-