Class DefaultFulfillmentStatusChangeValidator
java.lang.Object
com.broadleafcommerce.orderoperation.service.validator.DefaultFulfillmentStatusChangeValidator
- All Implemented Interfaces:
FulfillmentStatusChangeValidator
public class DefaultFulfillmentStatusChangeValidator
extends Object
implements FulfillmentStatusChangeValidator
-
Field Summary
Modifier and TypeFieldDescriptionprotected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
checkAndValidateItemExistsInFulfillment
(String itemId, Map<String, Integer> fulfillmentItemQuantities, org.springframework.validation.Errors errors) protected boolean
checkAndValidateQuantityValueValid
(Integer quantity, String itemId, org.springframework.validation.Errors errors) protected static String
prefixWithEntityValidationMessageKey
(String errorCode) void
validate
(FulfillmentStatusChangeRequest request, com.broadleafcommerce.order.client.domain.OrderFulfillment fulfillment) Determines that the status change request is valid for the given fulfillment.protected void
validateNotAllZeroQuantities
(Map<String, Integer> itemQuantities, org.springframework.validation.Errors errors) 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.protected void
validateSufficientQuantityInFulfillment
(String itemId, Integer quantity, Map<String, Integer> fulfillmentItemQuantities, org.springframework.validation.Errors errors)
-
Field Details
-
ITEM_QUANTITIES_FIELD
- See Also:
-
ZERO_QUANTITY_CODE
-
ZERO_QUANTITY_MESSAGE
- See Also:
-
INVALID_QUANTITY_CODE
-
INVALID_QUANTITY_MESSAGE
- See Also:
-
MISSING_ITEM_CODE
-
MISSING_ITEM_MESSAGE
- See Also:
-
INSUFFICIENT_QUANTITY_CODE
-
INSUFFICIENT_QUANTITY_MESSAGE
- See Also:
-
-
Constructor Details
-
DefaultFulfillmentStatusChangeValidator
public DefaultFulfillmentStatusChangeValidator()
-
-
Method Details
-
validate
public void validate(FulfillmentStatusChangeRequest request, com.broadleafcommerce.order.client.domain.OrderFulfillment fulfillment) Description copied from interface:FulfillmentStatusChangeValidator
Determines that the status change request is valid for the given fulfillment.- Specified by:
validate
in interfaceFulfillmentStatusChangeValidator
- Parameters:
request
- the request to change the status of the fulfillmentfulfillment
- the fulfillment to have its status changed
-
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 fulfillmentfulfillment
- the fulfillment to have its status changederrors
- the errors bound to the request object being validated
-
validateNotAllZeroQuantities
-
checkAndValidateQuantityValueValid
-
checkAndValidateItemExistsInFulfillment
-
validateSufficientQuantityInFulfillment
-
prefixWithEntityValidationMessageKey
-