Class OfferCodeData
java.lang.Object
com.broadleafcommerce.promotion.offer.service.dto.OfferCodeData
This class builds convenience structures that represent the code and related offer settings that
are used by the offer engine processing.
Specifically, it maintains a convenient mapping from client offer code representations, server
offer code representations to the related offers and campaigns.
It is intended to be used by the CandidateOffer to resolve properties that rely on a combination
of request based and persisted properties.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addOfferCodeDtos
(List<com.broadleafcommerce.promotion.offer.client.web.context.OfferCodeDto> dtos) void
addOfferCodes
(List<OfferCode> offerCodes) A map of campaignId to offerCodeA map of offer codes to the dto passed in on the Order as part of the client request.A map of offerId to offerCodeA map of offer codes to the persisted OfferCode structures.void
setCampaignIdOfferCodeMap
(Map<String, Set<OfferCode>> campaignIdOfferCodeMap) A map of campaignId to offerCodevoid
setClientOfferCodeMap
(Map<String, com.broadleafcommerce.promotion.offer.client.web.context.OfferCodeDto> clientOfferCodeMap) A map of offer codes to the dto passed in on the Order as part of the client request.void
setOfferIdOfferCodeMap
(Map<String, Set<OfferCode>> offerIdOfferCodeMap) A map of offerId to offerCodevoid
setServerOfferCodes
(Map<String, Set<OfferCode>> serverOfferCodes) A map of offer codes to the persisted OfferCode structures.
-
Constructor Details
-
OfferCodeData
public OfferCodeData()
-
-
Method Details
-
addOfferCodeDtos
public void addOfferCodeDtos(List<com.broadleafcommerce.promotion.offer.client.web.context.OfferCodeDto> dtos) -
addOfferCodes
-
getClientOfferCodeMap
public Map<String,com.broadleafcommerce.promotion.offer.client.web.context.OfferCodeDto> getClientOfferCodeMap()A map of offer codes to the dto passed in on the Order as part of the client request. -
getServerOfferCodes
A map of offer codes to the persisted OfferCode structures. -
getCampaignIdOfferCodeMap
A map of campaignId to offerCode -
getOfferIdOfferCodeMap
A map of offerId to offerCode -
setClientOfferCodeMap
public void setClientOfferCodeMap(Map<String, com.broadleafcommerce.promotion.offer.client.web.context.OfferCodeDto> clientOfferCodeMap) A map of offer codes to the dto passed in on the Order as part of the client request. -
setServerOfferCodes
A map of offer codes to the persisted OfferCode structures. -
setCampaignIdOfferCodeMap
A map of campaignId to offerCode -
setOfferIdOfferCodeMap
A map of offerId to offerCode
-