Class DefaultOfferAuditDetailService<P extends OfferAuditDetail>
- java.lang.Object
-
- com.broadleafcommerce.data.tracking.core.service.BaseCrudEntityService<P>
-
- com.broadleafcommerce.data.tracking.core.service.BaseRsqlCrudEntityService<P>
-
- com.broadleafcommerce.promotion.offer.service.DefaultOfferAuditDetailService<P>
-
- All Implemented Interfaces:
com.broadleafcommerce.data.tracking.core.service.CrudEntityService<P>,com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityService<P>,OfferAuditDetailService<P>
public class DefaultOfferAuditDetailService<P extends OfferAuditDetail> extends com.broadleafcommerce.data.tracking.core.service.BaseRsqlCrudEntityService<P> implements OfferAuditDetailService<P>
- Author:
- Nathan Moore (nathanmoore).
-
-
Constructor Summary
Constructors Constructor Description DefaultOfferAuditDetailService(OfferAuditDetailRepository<com.broadleafcommerce.data.tracking.core.Trackable> repository, com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityHelper helper)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidassertOfferIdNotNull(String offerId)LongcountByOffer(String offerId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Count allOfferAuditDetailrecords that relate to the provided offer id.LongcountByOfferAndCode(String offerId, String code, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Count allOfferAuditDetailrecords that relate to the provided offer id and code.LongcountByOfferAndUser(String offerId, UserTarget userTarget, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Count allOfferAuditDetailrecords that relate to the provided offer id and user target.LongcountByOfferAndUserAndBetweenDates(String offerId, UserTarget userTarget, Instant startDate, Instant endDate, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Count allOfferAuditDetailrecords that relate to the provided offer id and user target and that fall between the given dates.protected OfferAuditDetailRepository<com.broadleafcommerce.data.tracking.core.Trackable>getRepository()-
Methods inherited from class com.broadleafcommerce.data.tracking.core.service.BaseRsqlCrudEntityService
getRsqlHelper, readAll, readAll, readAll, readAll
-
Methods inherited from class com.broadleafcommerce.data.tracking.core.service.BaseCrudEntityService
convertFromPersistentDomain, convertToPersistentDomain, create, createAll, createAllAllowingPartialSuccess, delete, getHelper, getSortPositionStrategy, readAll, readAll, readAll, readAllByContextId, readByContextId, replace, replaceAll, replaceAllAllowingPartialSuccess, setSortPositionStrategy, update, updateAll, updateAllAllowingPartialSuccess, updateSort
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
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
-
-
-
-
Constructor Detail
-
DefaultOfferAuditDetailService
public DefaultOfferAuditDetailService(OfferAuditDetailRepository<com.broadleafcommerce.data.tracking.core.Trackable> repository, com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityHelper helper)
-
-
Method Detail
-
countByOffer
public Long countByOffer(String offerId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Description copied from interface:OfferAuditDetailServiceCount allOfferAuditDetailrecords that relate to the provided offer id.- Specified by:
countByOfferin interfaceOfferAuditDetailService<P extends OfferAuditDetail>- Parameters:
offerId- The offer id to use to count relatedOfferAuditDetailrecords.contextInfo- context information around sandbox and multitenant state- Returns:
- all
OfferAuditDetailrecords that relate to the provided offer id.
-
countByOfferAndUser
public Long countByOfferAndUser(String offerId, UserTarget userTarget, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Description copied from interface:OfferAuditDetailServiceCount allOfferAuditDetailrecords that relate to the provided offer id and user target.- Specified by:
countByOfferAndUserin interfaceOfferAuditDetailService<P extends OfferAuditDetail>- Parameters:
offerId- The offer id to use to count relatedOfferAuditDetailrecords.userTarget- The user target to use to count relatedOfferAuditDetailrecords.contextInfo- context information around sandbox and multitenant state- Returns:
- all
OfferAuditDetailrecords that relate to the provided offer id and user target.
-
countByOfferAndCode
public Long countByOfferAndCode(String offerId, String code, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Description copied from interface:OfferAuditDetailServiceCount allOfferAuditDetailrecords that relate to the provided offer id and code.- Specified by:
countByOfferAndCodein interfaceOfferAuditDetailService<P extends OfferAuditDetail>- Parameters:
offerId- The offer id to use to count relatedOfferAuditDetailrecords.code- The code to use to count relatedOfferAuditDetailrecordscontextInfo- context information around sandbox and multitenant state- Returns:
- all
OfferAuditDetailrecords that relate to the provided offer id and code.
-
countByOfferAndUserAndBetweenDates
public Long countByOfferAndUserAndBetweenDates(String offerId, UserTarget userTarget, Instant startDate, Instant endDate, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Description copied from interface:OfferAuditDetailServiceCount allOfferAuditDetailrecords that relate to the provided offer id and user target and that fall between the given dates. Used to determineOffer.maxUsesPerUserFrequency.- Specified by:
countByOfferAndUserAndBetweenDatesin interfaceOfferAuditDetailService<P extends OfferAuditDetail>- Parameters:
offerId- The offer id to use to count relatedOfferAuditDetailrecords.userTarget- The user target to use to count relatedOfferAuditDetailrecords.startDate- The startInstantto count related records againstendDate- The endInstantto count related records againstcontextInfo- context information around sandbox and multitenant state- Returns:
- all
OfferAuditDetailrecords that relate to the provided offer id and user between the given dates.
-
assertOfferIdNotNull
protected void assertOfferIdNotNull(String offerId)
-
getRepository
@NonNull protected OfferAuditDetailRepository<com.broadleafcommerce.data.tracking.core.Trackable> getRepository()
- Overrides:
getRepositoryin classcom.broadleafcommerce.data.tracking.core.service.BaseCrudEntityService<P extends OfferAuditDetail>
-
-