Class DefaultOfferAndOfferCodeUsageValidator

java.lang.Object
com.broadleafcommerce.promotion.offer.service.validation.DefaultOfferAndOfferCodeUsageValidator
All Implemented Interfaces:
OfferAndOfferCodeUsageValidator

public class DefaultOfferAndOfferCodeUsageValidator extends Object implements OfferAndOfferCodeUsageValidator
  • 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 interface OfferAndOfferCodeUsageValidator
      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

      protected OfferAndOfferCodeUsabilityService getOfferAndOfferCodeUsabilityService()
    • getOfferService

      protected OfferService<? extends Offer> getOfferService()
    • getOfferFactory

      protected com.broadleafcommerce.common.extension.TypeFactory getOfferFactory()