Class QuoteAssignedStatusHandler
- All Implemented Interfaces:
CartStatusHandler
Cart
in or changing to the DefaultQuoteStatuses.ASSIGNED
status.-
Field Summary
Fields inherited from class com.broadleafcommerce.cartoperation.service.status.AbstractCartStatusChangeHandler
INACCESSIBLE_CART_STATUS, USER_AUTHENTICATION_FAILED
-
Constructor Summary
ConstructorDescriptionQuoteAssignedStatusHandler
(com.broadleafcommerce.resource.security.utils.service.AuthenticationUtils authenticationUtils, com.broadleafcommerce.common.extension.TypeFactory typeFactory, QuoteAuthUtils quoteAuthUtils, com.broadleafcommerce.cart.client.properties.QuoteProperties properties) -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
canBeReadByUser
(@NonNull CartStatusValidationRequest statusValidationRequest, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Determines if the cart can be read by the currently authenticated user when the cart's current status isAbstractCartStatusChangeHandler.getStatusToHandle()
.protected boolean
canBeTransitionedToByUser
(@NonNull ChangeCartStatusRequest changeStatusRequest, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Determines if the cart can be transitioned toAbstractCartStatusChangeHandler.getStatusToHandle()
by the currently authenticated user.protected boolean
canBeUpdatedByUser
(@NonNull CartStatusValidationRequest statusValidationRequest, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Determines if the cart can be updated by the currently authenticated user when the cart's current status isAbstractCartStatusChangeHandler.getStatusToHandle()
.protected String
getCartActionType
(ChangeCartStatusRequest cartStatusRequest) Hook point to determine the cart action type.protected String
Gets the status to handle by this handlerprotected com.broadleafcommerce.common.extension.TypeFactory
getValidOriginatingStatuses
(com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Gets a set of valid originating statuses that can transition to theAbstractCartStatusChangeHandler.getStatusToHandle()
.protected ChangeCartStatusRequest
processStatusChange
(@NonNull ChangeCartStatusRequest changeStatusRequest, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Perform the status change of theCart
.protected com.broadleafcommerce.cart.client.domain.Cart
setAssignedSalesRepFields
(@NonNull com.broadleafcommerce.cart.client.domain.Cart quote, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Methods inherited from class com.broadleafcommerce.cartoperation.service.status.quote.AbstractQuoteCartStatusHandler
addCartActionAuditUserInfo, canHandle, getProperties, getQuoteAuthUtils, isAssignedToThisQuote, isAssignedToThisQuote, isConvertingToQuote
Methods inherited from class com.broadleafcommerce.cartoperation.service.status.AbstractCartStatusChangeHandler
buildCartActionAuditToCreate, getAuthenticationUtils, getPolicyUtils, isCartOwner, isCartOwner, postProcessStatusChange, process, setPolicyUtils, validateOriginatingStatus, validateStatusIsReadableByUser, validateStatusIsUpdatableByUser, validateStatusTransition, validateTransitionRules
-
Constructor Details
-
QuoteAssignedStatusHandler
public QuoteAssignedStatusHandler(com.broadleafcommerce.resource.security.utils.service.AuthenticationUtils authenticationUtils, com.broadleafcommerce.common.extension.TypeFactory typeFactory, QuoteAuthUtils quoteAuthUtils, com.broadleafcommerce.cart.client.properties.QuoteProperties properties)
-
-
Method Details
-
getStatusToHandle
Description copied from class:AbstractCartStatusChangeHandler
Gets the status to handle by this handler- Specified by:
getStatusToHandle
in classAbstractCartStatusChangeHandler
- Returns:
- the status to handle by this handler
-
getValidOriginatingStatuses
protected Set<String> getValidOriginatingStatuses(@Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from class:AbstractCartStatusChangeHandler
Gets a set of valid originating statuses that can transition to theAbstractCartStatusChangeHandler.getStatusToHandle()
.The valid originating statuses may vary depending on the context and
certain quote configurations
.- Specified by:
getValidOriginatingStatuses
in classAbstractCartStatusChangeHandler
- Parameters:
contextInfo
- the contextInfo for the request- Returns:
- a set of valid originating statuses that can transition to the
AbstractCartStatusChangeHandler.getStatusToHandle()
-
processStatusChange
protected ChangeCartStatusRequest processStatusChange(@NonNull @NonNull ChangeCartStatusRequest changeStatusRequest, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from class:AbstractCartStatusChangeHandler
Perform the status change of theCart
.By default, this updates the status and creates a corresponding
CartActionAudit
. This serves as a hook point for additional steps for the status change.- Overrides:
processStatusChange
in classAbstractCartStatusChangeHandler
- Parameters:
changeStatusRequest
- theChangeCartStatusRequest
to facilitate the cart status changecontextInfo
- context information surrounding sandboxing and multitenant state- Returns:
- the
ChangeCartStatusRequest
with the updated cart
-
canBeReadByUser
protected boolean canBeReadByUser(@NonNull @NonNull CartStatusValidationRequest statusValidationRequest, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from class:AbstractCartStatusChangeHandler
Determines if the cart can be read by the currently authenticated user when the cart's current status isAbstractCartStatusChangeHandler.getStatusToHandle()
.This is helpful to restrict certain user types to read a cart in certain statuses.
For example, in a B2B quote context, a sales rep should not be able to read quotes in the
DefaultQuoteStatuses.DRAFTING
status, only the cart owner can.- Overrides:
canBeReadByUser
in classAbstractCartStatusChangeHandler
- Parameters:
statusValidationRequest
- theChangeCartStatusRequest
to facilitate the cart status changecontextInfo
- context information surrounding sandboxing and multitenant state- Returns:
- true if it is readable by the user, otherwise false
-
canBeUpdatedByUser
protected boolean canBeUpdatedByUser(@NonNull @NonNull CartStatusValidationRequest statusValidationRequest, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from class:AbstractCartStatusChangeHandler
Determines if the cart can be updated by the currently authenticated user when the cart's current status isAbstractCartStatusChangeHandler.getStatusToHandle()
.This is helpful to restrict certain user types to update a cart in certain statuses.
For example, in a B2B quote context, only the cart owner should be able to update quotes in the
DefaultQuoteStatuses.DRAFTING
status.- Overrides:
canBeUpdatedByUser
in classAbstractCartStatusChangeHandler
- Parameters:
statusValidationRequest
- theCartStatusValidationRequest
to facilitate the cart status validationcontextInfo
- context information surrounding sandboxing and multitenant state- Returns:
- true if it is updatable by the user, otherwise false
-
canBeTransitionedToByUser
protected boolean canBeTransitionedToByUser(@NonNull @NonNull ChangeCartStatusRequest changeStatusRequest, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from class:AbstractCartStatusChangeHandler
Determines if the cart can be transitioned toAbstractCartStatusChangeHandler.getStatusToHandle()
by the currently authenticated user.This is helpful to restrict certain user types to update a cart in certain statuses.
For example, in a B2B quote context, only the sales rep can transition a quote from
DefaultQuoteStatuses.ASSIGNED
toDefaultQuoteStatuses.PUBLISHED
.- Overrides:
canBeTransitionedToByUser
in classAbstractCartStatusChangeHandler
- Parameters:
changeStatusRequest
- theChangeCartStatusRequest
to facilitate the cart status changecontextInfo
- context information surrounding sandboxing and multitenant state- Returns:
- true if it can be transitioned to the status by the user, otherwise false
-
getCartActionType
Description copied from class:AbstractCartStatusChangeHandler
Hook point to determine the cart action type.Returns
DefaultQuoteActionTypes.UNKNOWN
by default unless overridden.- Overrides:
getCartActionType
in classAbstractCartStatusChangeHandler
- Parameters:
cartStatusRequest
- the change cart status request- Returns:
DefaultQuoteActionTypes.UNKNOWN
by default unless overridden.
-
setAssignedSalesRepFields
protected com.broadleafcommerce.cart.client.domain.Cart setAssignedSalesRepFields(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart quote, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) -
getTypeFactory
protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory()- Overrides:
getTypeFactory
in classAbstractCartStatusChangeHandler
-