Class OfferValidator
java.lang.Object
com.broadleafcommerce.promotion.offer.service.validation.OfferValidator
- All Implemented Interfaces:
com.broadleafcommerce.data.tracking.core.mapping.validation.EntityValidator
public class OfferValidator
extends Object
implements com.broadleafcommerce.data.tracking.core.mapping.validation.EntityValidator
Validations for
Offer.- Author:
- Samarth Dhruva (samarthd)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected OfferServicePropertiesprotected booleanisFulfillmentItemTargetType(Offer offer) protected booleanisFulfillmentTargetType(Offer offer) protected booleanisLessThanOrEqualTo(BigDecimal actual, BigDecimal maxValue) protected booleanisOrderItemTargetType(Offer offer) protected booleanisOrderTargetType(Offer offer) voidsetOfferServiceProperties(OfferServiceProperties offerServiceProperties) booleansupports(Class<?> serviceClass, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) voidvalidate(Object businessInstance, org.springframework.validation.Errors errors, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) protected voidvalidateActiveEndDate(Offer offer, org.springframework.validation.Errors errors) protected voidvalidateActiveStartDate(Offer offer, org.springframework.validation.Errors errors) protected voidvalidateApplyRemainderToFulfillment(Offer offer, org.springframework.validation.Errors errors) protected voidvalidateCheapestTargetGroupingStrategyOnlyOrderItemTargetType(Offer offer, org.springframework.validation.Errors errors) protected voidvalidateCombinabilityType(Offer offer, org.springframework.validation.Errors errors) protected booleanvalidateDiscount(Offer offer, org.springframework.validation.Errors errors) protected voidvalidateDiscountTier(Offer offer, DiscountTier discountTier, org.springframework.validation.Errors errors, String offerDiscountStrategy) protected voidvalidateDiscountTiers(Offer offer, org.springframework.validation.Errors errors) protected voidvalidateFreeGiftOffer(Offer offer, org.springframework.validation.Errors errors) protected voidvalidateItemCriteria(Offer offer, org.springframework.validation.Errors errors) protected voidvalidateMaxUsesPerUserStrategy(Offer offer, org.springframework.validation.Errors errors) protected voidvalidateName(Offer offer, org.springframework.validation.Errors errors) protected voidvalidateNotFixedPrice(Offer offer, org.springframework.validation.Errors errors) protected voidvalidateOfferCurrency(Offer offer, org.springframework.validation.Errors errors) protected voidvalidateSubscriptionDiscount(Offer offer, org.springframework.validation.Errors errors) protected voidvalidateUserTargets(Offer offer, org.springframework.validation.Errors errors) protected voidvalidateVoucherOffer(Offer offer, org.springframework.validation.Errors errors) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.broadleafcommerce.data.tracking.core.mapping.validation.EntityValidator
validateForCreate, validateForReplace, validateForUpdate
-
Constructor Details
-
OfferValidator
public OfferValidator()
-
-
Method Details
-
supports
public boolean supports(Class<?> serviceClass, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) - Specified by:
supportsin interfacecom.broadleafcommerce.data.tracking.core.mapping.validation.EntityValidator
-
validate
public void validate(@NonNull Object businessInstance, @NonNull org.springframework.validation.Errors errors, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) - Specified by:
validatein interfacecom.broadleafcommerce.data.tracking.core.mapping.validation.EntityValidator
-
validateCheapestTargetGroupingStrategyOnlyOrderItemTargetType
protected void validateCheapestTargetGroupingStrategyOnlyOrderItemTargetType(Offer offer, org.springframework.validation.Errors errors) -
validateFreeGiftOffer
-
validateVoucherOffer
-
validateNotFixedPrice
-
validateItemCriteria
-
validateName
-
validateActiveStartDate
-
validateActiveEndDate
-
validateDiscount
-
isLessThanOrEqualTo
-
validateDiscountTiers
-
validateDiscountTier
protected void validateDiscountTier(Offer offer, DiscountTier discountTier, org.springframework.validation.Errors errors, String offerDiscountStrategy) -
validateUserTargets
-
validateCombinabilityType
-
validateMaxUsesPerUserStrategy
protected void validateMaxUsesPerUserStrategy(Offer offer, org.springframework.validation.Errors errors) -
validateSubscriptionDiscount
protected void validateSubscriptionDiscount(Offer offer, org.springframework.validation.Errors errors) -
validateOfferCurrency
-
validateApplyRemainderToFulfillment
protected void validateApplyRemainderToFulfillment(Offer offer, org.springframework.validation.Errors errors) -
isOrderTargetType
-
isOrderItemTargetType
-
isFulfillmentTargetType
-
isFulfillmentItemTargetType
-
getOfferServiceProperties
-
setOfferServiceProperties
-