Interface OfferService<P extends Offer>

  • All Superinterfaces:
    com.broadleafcommerce.data.tracking.core.service.CrudEntityService<P>, com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityService<P>
    All Known Implementing Classes:
    DefaultOfferService

    public interface OfferService<P extends Offer>
    extends com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityService<P>
    Author:
    Nathan Moore (nathanmoore).
    • Method Detail

      • readAllByName

        org.springframework.data.domain.Page<P> readAllByName​(@Nullable
                                                              String name,
                                                              cz.jirutka.rsql.parser.ast.Node filters,
                                                              @Nullable
                                                              org.springframework.data.domain.Pageable page,
                                                              @Nullable
                                                              com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
      • readAutomaticAndCodeAndCustomerOffersIn

        Stream<P> readAutomaticAndCodeAndCustomerOffersIn​(Iterable<UserTarget> userTargets,
                                                          Iterable<String> codes,
                                                          Iterable<String> trackingIds,
                                                          @Nullable
                                                          com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
        Reads all active offers where Offer.userTargets intersects with the provided UserTargets, Offer.sharedCodes intersects with the provided codes, Offer.campaignTrackingIds intersects with the provided tracking ids, or Offer.automaticallyConsidered is true.
        Parameters:
        userTargets - users the returned Offer(s) should target
        codes - codes the returned Offer(s) are associated with.
        trackingIds - tracking ids the returned Offer(s) are associated with.
        contextInfo - Context information around sandbox and multitenant state.
        Returns:
        the offers matching the given criteria
      • readAllCustomerOffersIn

        Stream<P> readAllCustomerOffersIn​(Iterable<UserTarget> userTargets,
                                          @Nullable
                                          com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
        Reads all active offers where Offer.userTargets intersects with the provided UserTargets, or the offer has no UserTargets
        Parameters:
        userTargets - users the returned Offer(s) should target
        contextInfo - Context information around sandbox and multitenant state.
        Returns:
        the offers matching the given criteria
      • readAllActiveByCodesIn

        List<P> readAllActiveByCodesIn​(Iterable<String> codes,
                                       @Nullable
                                       com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
        Reads all active offers where Offer.sharedCodes intersects with the provided codes.
        Parameters:
        codes - codes the returned Offer(s) are associated with.
        contextInfo - Context information around sandbox and multitenant state.
        Returns:
        all active Offers associated to the provided codes.
      • readVoucherOffersIn

        Stream<P> readVoucherOffersIn​(Iterable<UserTarget> userTargets,
                                      Iterable<String> codes,
                                      Iterable<String> trackingIds,
                                      com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
        Reads all voucher offers based on the provided user targets, codes, or tracking ids. Skips the active date narrowing to retrieve offers that may have been validly applied in the past.
        Parameters:
        userTargets - users the returned Offer(s) should target
        codes - codes the returned Offer(s) are associated with.
        trackingIds - tracking ids the returned Offer(s) are associated with.
        contextInfo - Context information around sandbox and multitenant state.
        Returns:
        all voucher offers based on the provided user targets, codes, or tracking ids
      • getRepositoryDomain

        String getRepositoryDomain()