Class DefaultOfferUserService
java.lang.Object
com.broadleafcommerce.promotion.offer.service.engine.candidate.DefaultOfferUserService
- All Implemented Interfaces:
OfferUserService
- Author:
- Chad Harchar (charchar)
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final OfferAuditDetailService<? extends OfferAuditDetail>protected final CustomerFieldsprotected final com.broadleafcommerce.common.extension.TypeFactory -
Constructor Summary
ConstructorsConstructorDescriptionDefaultOfferUserService(OfferAuditDetailService<? extends OfferAuditDetail> auditService, CustomerFields customerFields, com.broadleafcommerce.common.extension.TypeFactory offerFactory) -
Method Summary
Modifier and TypeMethodDescriptionbuildUserTargetsForCustomerContext(com.broadleafcommerce.promotion.offer.client.web.context.CustomerContext customerContext) Build and return a list ofUserTargetsbased on the information provided in theCustomerContext.buildUserTargetsForOfferCustomerContext(Offer offer, com.broadleafcommerce.promotion.offer.client.web.context.CustomerContext customerContext, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) For the provided customer information, check if there are no more usages for the provided offer available.protected UserTargetcreateUserTarget(String targetValue, String targetType) protected UserTargetcreateUserTargetForOtherUserType(String userId, CustomerFields customerFields, String maxUsesPerUserStrategy) protected OfferAuditDetailService<? extends OfferAuditDetail>protected CustomerFieldsprotected OfferCodeService<OfferCode>protected com.broadleafcommerce.common.extension.TypeFactoryprotected StringgetUserIdForOtherUserType(com.broadleafcommerce.promotion.offer.client.web.context.CustomerContext customerContext, String maxUsesPerUserStrategy) voidsetOfferCodeService(OfferCodeService<OfferCode> offerCodeService)
-
Field Details
-
auditService
-
customerFields
-
offerFactory
protected final com.broadleafcommerce.common.extension.TypeFactory offerFactory
-
-
Constructor Details
-
DefaultOfferUserService
public DefaultOfferUserService(OfferAuditDetailService<? extends OfferAuditDetail> auditService, CustomerFields customerFields, com.broadleafcommerce.common.extension.TypeFactory offerFactory)
-
-
Method Details
-
buildUserTargetsForCustomerContext
@NonNull public Set<UserTarget> buildUserTargetsForCustomerContext(@Nullable com.broadleafcommerce.promotion.offer.client.web.context.CustomerContext customerContext) Description copied from interface:OfferUserServiceBuild and return a list ofUserTargetsbased on the information provided in theCustomerContext.- Specified by:
buildUserTargetsForCustomerContextin interfaceOfferUserService- Parameters:
customerContext- TheCustomerContextwith which to buildUserTargets- Returns:
- a set of
UserTargets
-
buildUserTargetsForOfferCustomerContext
public UserTarget buildUserTargetsForOfferCustomerContext(@NonNull Offer offer, @Nullable com.broadleafcommerce.promotion.offer.client.web.context.CustomerContext customerContext, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:OfferUserServiceFor the provided customer information, check if there are no more usages for the provided offer available.- Specified by:
buildUserTargetsForOfferCustomerContextin interfaceOfferUserService- Parameters:
offer- the offer that we are checking usage againstcustomerContext- context information for the customercontextInfo- context information around sandbox and multitenant state- Returns:
- whether this offer has met it's max user usage for the given order and context info
-
createUserTargetForOtherUserType
protected UserTarget createUserTargetForOtherUserType(String userId, CustomerFields customerFields, String maxUsesPerUserStrategy) -
getUserIdForOtherUserType
-
createUserTarget
-
getAuditService
-
getCustomerFields
-
getOfferFactory
protected com.broadleafcommerce.common.extension.TypeFactory getOfferFactory() -
getOfferCodeService
-
setOfferCodeService
-