Class DefaultOfferUserService
java.lang.Object
com.broadleafcommerce.promotion.offer.service.engine.candidate.DefaultOfferUserService
- All Implemented Interfaces:
OfferUserService
- Author:
- Chad Harchar (charchar)
-
Field Summary
Modifier and TypeFieldDescriptionprotected final OfferAuditDetailService<? extends OfferAuditDetail>
protected final CustomerFields
protected final com.broadleafcommerce.common.extension.TypeFactory
-
Constructor Summary
ConstructorDescriptionDefaultOfferUserService
(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 ofUserTargets
based 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 UserTarget
createUserTarget
(String targetValue, String targetType) protected UserTarget
createUserTargetForOtherUserType
(String userId, CustomerFields customerFields, String maxUsesPerUserStrategy) protected OfferAuditDetailService<? extends OfferAuditDetail>
protected CustomerFields
protected OfferCodeService<OfferCode>
protected com.broadleafcommerce.common.extension.TypeFactory
protected String
getUserIdForOtherUserType
(com.broadleafcommerce.promotion.offer.client.web.context.CustomerContext customerContext, String maxUsesPerUserStrategy) void
setOfferCodeService
(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:OfferUserService
Build and return a list ofUserTargets
based on the information provided in theCustomerContext
.- Specified by:
buildUserTargetsForCustomerContext
in interfaceOfferUserService
- Parameters:
customerContext
- TheCustomerContext
with 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:OfferUserService
For the provided customer information, check if there are no more usages for the provided offer available.- Specified by:
buildUserTargetsForOfferCustomerContext
in 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
-