Class DefaultFulfillmentStatusChangeValidator

    • Field Detail

      • ZERO_QUANTITY_CODE

        protected static final String ZERO_QUANTITY_CODE
      • INVALID_QUANTITY_CODE

        protected static final String INVALID_QUANTITY_CODE
      • MISSING_ITEM_CODE

        protected static final String MISSING_ITEM_CODE
      • INSUFFICIENT_QUANTITY_CODE

        protected static final String INSUFFICIENT_QUANTITY_CODE
    • Constructor Detail

      • DefaultFulfillmentStatusChangeValidator

        public DefaultFulfillmentStatusChangeValidator()
    • Method Detail

      • validateQuantities

        protected void validateQuantities​(FulfillmentStatusChangeRequest request,
                                          com.broadleafcommerce.order.client.domain.OrderFulfillment fulfillment,
                                          org.springframework.validation.Errors errors)
        Checks that the fulfillment has the necessary item quantities for the status change request.
        Parameters:
        request - the request to change the status of the fulfillment
        fulfillment - the fulfillment to have its status changed
        errors - the errors bound to the request object being validated
      • validateNotAllZeroQuantities

        protected void validateNotAllZeroQuantities​(Map<String,​Integer> itemQuantities,
                                                    org.springframework.validation.Errors errors)
      • checkAndValidateQuantityValueValid

        protected boolean checkAndValidateQuantityValueValid​(Integer quantity,
                                                             String itemId,
                                                             org.springframework.validation.Errors errors)
      • checkAndValidateItemExistsInFulfillment

        protected boolean checkAndValidateItemExistsInFulfillment​(String itemId,
                                                                  Map<String,​Integer> fulfillmentItemQuantities,
                                                                  org.springframework.validation.Errors errors)
      • validateSufficientQuantityInFulfillment

        protected void validateSufficientQuantityInFulfillment​(String itemId,
                                                               Integer quantity,
                                                               Map<String,​Integer> fulfillmentItemQuantities,
                                                               org.springframework.validation.Errors errors)
      • prefixWithEntityValidationMessageKey

        protected static String prefixWithEntityValidationMessageKey​(String errorCode)