Interface CustomizedOfferRepository<D extends com.broadleafcommerce.data.tracking.core.Trackable>

  • All Known Subinterfaces:
    JpaOfferRepository<D>, OfferRepository<D>
    All Known Implementing Classes:
    JpaCustomizedOfferRepository

    public interface CustomizedOfferRepository<D extends com.broadleafcommerce.data.tracking.core.Trackable>
    Advanced functionality related to offer maintenance and filtering.
    Author:
    Chad Harchar (charchar)
    • Method Detail

      • findBySharedCodesCodeIn

        @Policy(operationTypes=READ)
        List<D> findBySharedCodesCodeIn​(Iterable<String> codes,
                                        @Nullable
                                        com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
        Reads all 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 Offers associated to the provided codes.
      • findAutomaticAndCodeAndCustomerOffers

        @Policy(operationTypes=READ)
        Stream<D> findAutomaticAndCodeAndCustomerOffers​(Iterable<? extends UserTarget> userTargets,
                                                        Iterable<String> codes,
                                                        Iterable<String> trackingIds,
                                                        @Nullable
                                                        com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
        Read all offers where Offer#getAutomaticallyConsidered is true, Offer.getCampaignTrackingIds() intersects with the provided tracking ids, Offer.getSharedCodes() intersects with the provided codes, or offers that contain the provided user targets. Intended to be used with the Campaign module and com.broadleafcommerce.promotion.campaign.domain.Campaign#id.
        Parameters:
        userTargets - The targets to match offers against
        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 offers where Offer#getAutomaticallyConsidered is true, or the offer is associated with the provided codes, tracking ids, or user targets.
      • findVoucherOffers

        @Policy(operationTypes=READ)
        Stream<D> findVoucherOffers​(Iterable<? extends UserTarget> userTargets,
                                    Iterable<String> codes,
                                    Iterable<String> trackingIds,
                                    com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
        Read all voucher offers where Offer#getAutomaticallyConsidered is true, Offer.getCampaignTrackingIds() intersects with the provided tracking ids, Offer.getSharedCodes() intersects with the provided codes, or offers that contain the provided user targets. Skips active date narrowing to fetch voucher offers for validation against submitted orders.
        Parameters:
        userTargets - The targets to match offers against
        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 where Offer#getAutomaticallyConsidered is true, or the offer is associated with the provided codes, tracking ids, or user targets.
      • findAllCustomerOffers

        @Policy(operationTypes=READ)
        Stream<D> findAllCustomerOffers​(Iterable<? extends UserTarget> userTargets,
                                        @Nullable
                                        com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
        Read all offers that have no user targets or contain the provided user targets.
        Parameters:
        userTargets - The targets to match offers against
        contextInfo - Context information around sandbox and multitenant state.
        Returns:
        all offers that have no user targets or contain the provided user targets.