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).
-
Field Summary
Modifier and TypeFieldDescriptionprotected OfferServiceProperties
protected com.broadleafcommerce.common.extension.TypeFactory
-
Constructor Summary
ConstructorDescriptionDefaultOfferAuditDetailService
(OfferAuditDetailRepository<com.broadleafcommerce.data.tracking.core.Trackable> repository, com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityHelper helper) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
assertOfferIdNotNull
(String offerId) protected void
buildAuditDetailList
(List<OfferUsageDetails> usageDetailsList, List<OfferCode> offerCodes, List<OfferAuditSummary> offerAuditSummaries, List<P> customerAuditDetailList, Offer offer) findAllOfferCodes
(List<OfferUsageDetails> usageDetailsList, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) protected List<OfferAuditSummary>
findAndUpdateAllOfferAuditSummaries
(List<OfferUsageDetails> usageDetailsList, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) protected List<SharedCodeAuditSummary>
findAndUpdateAllSharedCodeAuditSummaries
(List<OfferUsageDetails> usageDetailsList, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) protected OfferAuditSummary
findAndUpdateOfferAuditSummary
(String offerId, javax.money.MonetaryAmount totalSavings, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) protected SharedCodeAuditSummary
findAndUpdateSharedCodeAuditSummary
(OfferUsageDetails usageDetails, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) protected com.broadleafcommerce.data.tracking.core.mapping.DomainMapperManager
protected OfferCodeService<OfferCode>
protected OfferService<Offer>
protected OfferSummaryService<OfferAuditSummary>
protected OfferServiceProperties
protected OfferAuditDetailRepository<com.broadleafcommerce.data.tracking.core.Trackable>
protected SharedCodeAuditSummaryRepository<com.broadleafcommerce.data.tracking.core.Trackable>
protected SharedCodeSummaryService<SharedCodeAuditSummary>
protected OfferAuditSummaryRepository<com.broadleafcommerce.data.tracking.core.Trackable>
protected com.broadleafcommerce.common.extension.TypeFactory
readAllByOfferCodeIds
(Set<String> offerCodeIds, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Find allOfferAuditDetail
records that relate to the provided offer code ids.readAllByOfferCodeIdsInAndCustomerId
(Set<String> offerCodeIds, @NonNull String customerId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Find allOfferAuditDetail
records that relate to the provided offer code ids and customer ID.readAllByOfferCodeIdsInAndCustomerTargetValue
(Set<String> offerCodeIds, @NonNull String customerTargetValue, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Find allOfferAuditDetail
records that relate to the provided offer code ids and customer ID.readAllByOfferIds
(Set<String> offerIds, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Find allOfferAuditDetail
records that relate to the provided offer ids.readAllByOfferIdsInAndCustomerId
(Set<String> offerIds, @NonNull String customerId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Find allOfferAuditDetail
records that relate to the provided offer ids and customer ID.readAllByOfferIdsInAndCustomerTargetValue
(Set<String> offerIds, @NonNull String customerTargetValue, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Find allOfferAuditDetail
records that relate to the provided offer ids and customer ID.recordOfferUsages
(List<OfferUsageDetails> usageDetailsList, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Records offer usages specified in a list ofOfferUsageDetails
and persists the details inOfferAuditDetail
,OfferAuditSummary
, andSharedCodeAuditSummary
.void
setMapperManager
(com.broadleafcommerce.data.tracking.core.mapping.DomainMapperManager mapperManager) void
setOfferCodeService
(OfferCodeService<OfferCode> offerCodeService) void
setOfferService
(OfferService<Offer> offerService) void
setOfferSummaryService
(OfferSummaryService<OfferAuditSummary> offerSummaryService) void
setProperties
(OfferServiceProperties properties) void
setSharedCodeSummaryRepository
(SharedCodeAuditSummaryRepository<com.broadleafcommerce.data.tracking.core.Trackable> sharedCodeSummaryRepository) void
setSharedCodeSummaryService
(SharedCodeSummaryService<SharedCodeAuditSummary> sharedCodeSummaryService) void
setSummaryRepository
(OfferAuditSummaryRepository<com.broadleafcommerce.data.tracking.core.Trackable> summaryRepository) void
setTypeFactory
(com.broadleafcommerce.common.extension.TypeFactory typeFactory) 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
Methods inherited from interface com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityService
readAll, readAll, readAll, readAll
-
Field Details
-
properties
-
typeFactory
protected com.broadleafcommerce.common.extension.TypeFactory typeFactory
-
-
Constructor Details
-
DefaultOfferAuditDetailService
public DefaultOfferAuditDetailService(OfferAuditDetailRepository<com.broadleafcommerce.data.tracking.core.Trackable> repository, com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityHelper helper)
-
-
Method Details
-
readAllByOfferIds
public List<P> readAllByOfferIds(Set<String> offerIds, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:OfferAuditDetailService
Find allOfferAuditDetail
records that relate to the provided offer ids.- Specified by:
readAllByOfferIds
in interfaceOfferAuditDetailService<P extends OfferAuditDetail>
- Parameters:
offerIds
- The set of offer ids to use to fetch relatedOfferAuditDetail
records.contextInfo
- context information around sandbox and multitenant state- Returns:
- all
OfferAuditDetail
records that relate to the provided offer ids.
-
readAllByOfferCodeIds
public List<P> readAllByOfferCodeIds(Set<String> offerCodeIds, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:OfferAuditDetailService
Find allOfferAuditDetail
records that relate to the provided offer code ids.- Specified by:
readAllByOfferCodeIds
in interfaceOfferAuditDetailService<P extends OfferAuditDetail>
- Parameters:
offerCodeIds
- The set of offer code ids to use to fetch relatedOfferAuditDetail
records.contextInfo
- context information around sandbox and multitenant state- Returns:
- all
OfferAuditDetail
records that relate to the provided offer code ids.
-
readAllByOfferCodeIdsInAndCustomerId
public List<P> readAllByOfferCodeIdsInAndCustomerId(Set<String> offerCodeIds, @NonNull @NonNull String customerId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:OfferAuditDetailService
Find allOfferAuditDetail
records that relate to the provided offer code ids and customer ID.- Specified by:
readAllByOfferCodeIdsInAndCustomerId
in interfaceOfferAuditDetailService<P extends OfferAuditDetail>
customerId
- The customer id to use to fetch relatedOfferAuditDetail
recordscontextInfo
- context information around sandbox and multitenant state- Returns:
- all
OfferAuditDetail
records that relate to the provided offer code ids and customer ID.
-
readAllByOfferCodeIdsInAndCustomerTargetValue
public List<P> readAllByOfferCodeIdsInAndCustomerTargetValue(Set<String> offerCodeIds, @NonNull @NonNull String customerTargetValue, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:OfferAuditDetailService
Find allOfferAuditDetail
records that relate to the provided offer code ids and customer ID.- Specified by:
readAllByOfferCodeIdsInAndCustomerTargetValue
in interfaceOfferAuditDetailService<P extends OfferAuditDetail>
- Parameters:
offerCodeIds
- The set of offer code ids to use to fetch relatedOfferAuditDetail
records.customerTargetValue
- The customer id or email to use to fetch relatedOfferAuditDetail
recordscontextInfo
- context information around sandbox and multitenant state- Returns:
- all
OfferAuditDetail
records that relate to the provided offer code ids and customer ID.
-
readAllByOfferIdsInAndCustomerId
public List<P> readAllByOfferIdsInAndCustomerId(Set<String> offerIds, @NonNull @NonNull String customerId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:OfferAuditDetailService
Find allOfferAuditDetail
records that relate to the provided offer ids and customer ID.- Specified by:
readAllByOfferIdsInAndCustomerId
in interfaceOfferAuditDetailService<P extends OfferAuditDetail>
- Parameters:
offerIds
- The set of offer ids to use to fetch relatedOfferAuditDetail
records.customerId
- The customer id to use to fetch relatedOfferAuditDetail
recordscontextInfo
- context information around sandbox and multitenant state- Returns:
- all
OfferAuditDetail
records that relate to the provided offer ids and customer ID.
-
readAllByOfferIdsInAndCustomerTargetValue
public List<P> readAllByOfferIdsInAndCustomerTargetValue(Set<String> offerIds, @NonNull @NonNull String customerTargetValue, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:OfferAuditDetailService
Find allOfferAuditDetail
records that relate to the provided offer ids and customer ID.- Specified by:
readAllByOfferIdsInAndCustomerTargetValue
in interfaceOfferAuditDetailService<P extends OfferAuditDetail>
- Parameters:
offerIds
- The set of offer ids to use to fetch relatedOfferAuditDetail
records.customerTargetValue
- The customer id or email to use to fetch relatedOfferAuditDetail
recordscontextInfo
- context information around sandbox and multitenant state- Returns:
- all
OfferAuditDetail
records that relate to the provided offer ids and customer ID.
-
recordOfferUsages
public List<P> recordOfferUsages(List<OfferUsageDetails> usageDetailsList, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:OfferAuditDetailService
Records offer usages specified in a list ofOfferUsageDetails
and persists the details inOfferAuditDetail
,OfferAuditSummary
, andSharedCodeAuditSummary
.- Specified by:
recordOfferUsages
in interfaceOfferAuditDetailService<P extends OfferAuditDetail>
- Parameters:
usageDetailsList
- the list ofOfferUsageDetails
to recordcontextInfo
- context information around sandbox and multitenant state- Returns:
- all
OfferAuditDetail
records that were persisted
-
buildAuditDetailList
protected void buildAuditDetailList(List<OfferUsageDetails> usageDetailsList, List<OfferCode> offerCodes, List<OfferAuditSummary> offerAuditSummaries, List<P> customerAuditDetailList, Offer offer) -
findAllOfferCodes
protected List<OfferCode> findAllOfferCodes(List<OfferUsageDetails> usageDetailsList, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) -
findAndUpdateAllOfferAuditSummaries
protected List<OfferAuditSummary> findAndUpdateAllOfferAuditSummaries(List<OfferUsageDetails> usageDetailsList, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) -
findAndUpdateOfferAuditSummary
protected OfferAuditSummary findAndUpdateOfferAuditSummary(String offerId, javax.money.MonetaryAmount totalSavings, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) -
assertOfferIdNotNull
-
getProperties
-
setProperties
-
getTypeFactory
protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory() -
setTypeFactory
@Autowired public void setTypeFactory(com.broadleafcommerce.common.extension.TypeFactory typeFactory) -
getOfferService
-
setOfferService
-
getOfferCodeService
-
setOfferCodeService
-
getOfferSummaryService
-
setOfferSummaryService
@Autowired public void setOfferSummaryService(OfferSummaryService<OfferAuditSummary> offerSummaryService) -
getRepository
@NonNull protected OfferAuditDetailRepository<com.broadleafcommerce.data.tracking.core.Trackable> getRepository()- Overrides:
getRepository
in classcom.broadleafcommerce.data.tracking.core.service.BaseCrudEntityService<P extends OfferAuditDetail>
-
getSummaryRepository
protected OfferAuditSummaryRepository<com.broadleafcommerce.data.tracking.core.Trackable> getSummaryRepository() -
setSummaryRepository
@Autowired public void setSummaryRepository(@Nullable OfferAuditSummaryRepository<com.broadleafcommerce.data.tracking.core.Trackable> summaryRepository) -
getMapperManager
protected com.broadleafcommerce.data.tracking.core.mapping.DomainMapperManager getMapperManager() -
setMapperManager
@Autowired public void setMapperManager(@Nullable com.broadleafcommerce.data.tracking.core.mapping.DomainMapperManager mapperManager)
-