Class DefaultOfferAndOfferCodeUsageValidator
java.lang.Object
com.broadleafcommerce.promotion.offer.service.validation.DefaultOfferAndOfferCodeUsageValidator
- All Implemented Interfaces:
OfferAndOfferCodeUsageValidator
public class DefaultOfferAndOfferCodeUsageValidator
extends Object
implements OfferAndOfferCodeUsageValidator
-
Constructor Summary
ConstructorDescriptionDefaultOfferAndOfferCodeUsageValidator
(OfferAndOfferCodeUsabilityService offerAndOfferCodeUsabilityService, OfferService<? extends Offer> offerService, com.broadleafcommerce.common.extension.TypeFactory offerFactory) -
Method Summary
Modifier and TypeMethodDescriptionprotected OfferAndOfferCodeUsabilityService
protected com.broadleafcommerce.common.extension.TypeFactory
protected OfferService<? extends Offer>
com.broadleafcommerce.promotion.offer.client.web.context.OfferAndOfferCodeUsageValidationResult
validateOfferAndOfferCodeUsages
(List<String> offerCodes, List<String> offerIds, com.broadleafcommerce.promotion.offer.client.web.context.CustomerContext customerContext, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) With a provided list of offer codes and offer ids, determine which offers and codes are no longer usable in a given context.
-
Constructor Details
-
DefaultOfferAndOfferCodeUsageValidator
public DefaultOfferAndOfferCodeUsageValidator(OfferAndOfferCodeUsabilityService offerAndOfferCodeUsabilityService, OfferService<? extends Offer> offerService, com.broadleafcommerce.common.extension.TypeFactory offerFactory)
-
-
Method Details
-
validateOfferAndOfferCodeUsages
public com.broadleafcommerce.promotion.offer.client.web.context.OfferAndOfferCodeUsageValidationResult validateOfferAndOfferCodeUsages(@NonNull List<String> offerCodes, @NonNull List<String> offerIds, @Nullable com.broadleafcommerce.promotion.offer.client.web.context.CustomerContext customerContext, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Description copied from interface:OfferAndOfferCodeUsageValidator
With a provided list of offer codes and offer ids, determine which offers and codes are no longer usable in a given context.- Specified by:
validateOfferAndOfferCodeUsages
in interfaceOfferAndOfferCodeUsageValidator
- Parameters:
offerCodes
- The offer codes to validate.offerIds
- The offer IDs to validate.customerContext
- Context information around the customer.context
- Context information around sandbox and multitenant state.- Returns:
- A DTO holding the validation results for the offers and offer codes.
-
getOfferAndOfferCodeUsabilityService
-
getOfferService
-
getOfferFactory
protected com.broadleafcommerce.common.extension.TypeFactory getOfferFactory()
-