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
-
Method Summary
Modifier and TypeMethodDescriptionprotected OfferServiceProperties
protected boolean
isFulfillmentItemTargetType
(Offer offer) protected boolean
isFulfillmentTargetType
(Offer offer) protected boolean
isLessThanOrEqualTo
(BigDecimal actual, BigDecimal maxValue) protected boolean
isOrderItemTargetType
(Offer offer) protected boolean
isOrderTargetType
(Offer offer) void
setOfferServiceProperties
(OfferServiceProperties offerServiceProperties) boolean
supports
(Class<?> serviceClass, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) void
validate
(Object businessInstance, org.springframework.validation.Errors errors, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) protected void
validateActiveEndDate
(Offer offer, org.springframework.validation.Errors errors) protected void
validateActiveStartDate
(Offer offer, org.springframework.validation.Errors errors) protected void
validateApplyRemainderToFulfillment
(Offer offer, org.springframework.validation.Errors errors) protected void
validateCheapestTargetGroupingStrategyOnlyOrderItemTargetType
(Offer offer, org.springframework.validation.Errors errors) protected void
validateCombinabilityType
(Offer offer, org.springframework.validation.Errors errors) protected boolean
validateDiscount
(Offer offer, org.springframework.validation.Errors errors) protected void
validateDiscountTier
(Offer offer, DiscountTier discountTier, org.springframework.validation.Errors errors, String offerDiscountStrategy) protected void
validateDiscountTiers
(Offer offer, org.springframework.validation.Errors errors) protected void
validateFreeGiftOffer
(Offer offer, org.springframework.validation.Errors errors) protected void
validateItemCriteria
(Offer offer, org.springframework.validation.Errors errors) protected void
validateMaxUsesPerUserStrategy
(Offer offer, org.springframework.validation.Errors errors) protected void
validateName
(Offer offer, org.springframework.validation.Errors errors) protected void
validateNotFixedPrice
(Offer offer, org.springframework.validation.Errors errors) protected void
validateOfferCurrency
(Offer offer, org.springframework.validation.Errors errors) protected void
validateSubscriptionDiscount
(Offer offer, org.springframework.validation.Errors errors) protected void
validateUserTargets
(Offer offer, org.springframework.validation.Errors errors) protected void
validateVoucherOffer
(Offer offer, org.springframework.validation.Errors errors) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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:
supports
in 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:
validate
in 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
-