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 Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description StringgetRepositoryDomain()List<P>readAllActiveByCodesIn(Iterable<String> codes, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Reads all active offers whereOffer.sharedCodesintersects with the provided codes.org.springframework.data.domain.Page<P>readAllByName(String name, cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)Stream<P>readAllCustomerOffersIn(Iterable<UserTarget> userTargets, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Reads all active offers whereOffer.userTargetsintersects with the providedUserTargets, or the offer has noUserTargetsStream<P>readAutomaticAndCodeAndCustomerOffersIn(Iterable<UserTarget> userTargets, Iterable<String> codes, Iterable<String> trackingIds, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Reads all active offers whereOffer.userTargetsintersects with the providedUserTargets,Offer.sharedCodesintersects with the provided codes,Offer.campaignTrackingIdsintersects with the provided tracking ids, orOffer.automaticallyConsideredis true.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.-
Methods inherited from interface com.broadleafcommerce.data.tracking.core.service.CrudEntityService
create, createAll, createAllAllowingPartialSuccess, delete, readAll, readAll, readAll, readAllByContextId, readByContextId, replace, replaceAll, replaceAllAllowingPartialSuccess, update, updateAll, updateAllAllowingPartialSuccess, updateSort
-
-
-
-
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 whereOffer.userTargetsintersects with the providedUserTargets,Offer.sharedCodesintersects with the provided codes,Offer.campaignTrackingIdsintersects with the provided tracking ids, orOffer.automaticallyConsideredis true.- Parameters:
userTargets- users the returnedOffer(s) should targetcodes- codes the returnedOffer(s) are associated with.trackingIds- tracking ids the returnedOffer(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 whereOffer.userTargetsintersects with the providedUserTargets, or the offer has noUserTargets- Parameters:
userTargets- users the returnedOffer(s) should targetcontextInfo- 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 whereOffer.sharedCodesintersects with 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 returnedOffer(s) should targetcodes- codes the returnedOffer(s) are associated with.trackingIds- tracking ids the returnedOffer(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()
-
-