Class QuoteQuoteRequestedStatusHandler

All Implemented Interfaces:
CartStatusHandler

public class QuoteQuoteRequestedStatusHandler extends AbstractQuoteCartStatusHandler
Handles a Cart in or changing to the DefaultQuoteStatuses.QUOTE_REQUESTED status.
  • Constructor Details

    • QuoteQuoteRequestedStatusHandler

      public QuoteQuoteRequestedStatusHandler(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

      protected String getStatusToHandle()
      Description copied from class: AbstractCartStatusChangeHandler
      Gets the status to handle by this handler
      Specified by:
      getStatusToHandle in class AbstractCartStatusChangeHandler
      Returns:
      the status to handle by this handler
    • getValidOriginatingStatuses

      protected Set<String> getValidOriginatingStatuses(@Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Assigned can go back to quote requested, essentially means the sales rep is un-assigned.

      Published can also transition to quote requested for scenarios such as when a buyer sees the quote response from the seller and is not satisfied with the pricing, and negotiate further by requesting quote again with a comment. For example, seller responds to a quote with $5 each, buyer is dissatisfied and request quote again with comment "another seller is offering $4.5 each, can you price match?". Seller can then see the comment and decide to price match, and adjust price and publish again.

      Another use case for a quote to go from published to quote requested is for the seller to recall a published quote.

      Specified by:
      getValidOriginatingStatuses in class AbstractCartStatusChangeHandler
      Parameters:
      contextInfo - the contextInfo for the request
      Returns:
      a set of valid originating statuses that can transition to the AbstractCartStatusChangeHandler.getStatusToHandle()
    • 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 is AbstractCartStatusChangeHandler.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 class AbstractCartStatusChangeHandler
      Parameters:
      statusValidationRequest - the ChangeCartStatusRequest to facilitate the cart status change
      contextInfo - 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)
      If QuoteProperties.requiresSalesRepAssignment(ContextInfo) is true, a DefaultQuoteStatuses.QUOTE_REQUESTED quote should not be edited, must shift into DefaultQuoteStatuses.ASSIGNED first by the sales rep. Otherwise, updatable by a sales rep with appropriate permissions
      Overrides:
      canBeUpdatedByUser in class AbstractCartStatusChangeHandler
      Parameters:
      statusValidationRequest - the CartStatusValidationRequest to facilitate the cart status validation
      contextInfo - 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 to AbstractCartStatusChangeHandler.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 to DefaultQuoteStatuses.PUBLISHED.

      Overrides:
      canBeTransitionedToByUser in class AbstractCartStatusChangeHandler
      Parameters:
      changeStatusRequest - the ChangeCartStatusRequest to facilitate the cart status change
      contextInfo - context information surrounding sandboxing and multitenant state
      Returns:
      true if it can be transitioned to the status by the user, otherwise false
    • getCartActionType

      protected String getCartActionType(ChangeCartStatusRequest cartStatusRequest)
      Description copied from class: AbstractCartStatusChangeHandler
      Hook point to determine the cart action type.

      Returns DefaultQuoteActionTypes.UNKNOWN by default unless overridden.

      Overrides:
      getCartActionType in class AbstractCartStatusChangeHandler
      Parameters:
      cartStatusRequest - the change cart status request
      Returns:
      DefaultQuoteActionTypes.UNKNOWN by default unless overridden.
    • postProcessStatusChange

      protected ChangeCartStatusRequest postProcessStatusChange(@NonNull @NonNull ChangeCartStatusRequest changeStatusRequest, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      By default, this erases the expiration date for this status. This also serves as a hook point for customization.
      Overrides:
      postProcessStatusChange in class AbstractCartStatusChangeHandler
      Parameters:
      changeStatusRequest - the ChangeCartStatusRequest to facilitate the quote status change
      contextInfo - context information surrounding sandboxing and multitenant state
      Returns:
      the change status request after performing any additional handling.