Search in sources :

Example 1 with PromotionMessage

use of org.broadleafcommerce.core.promotionMessage.domain.PromotionMessage in project BroadleafCommerce by BroadleafCommerce.

the class PromotionMessageDTOServiceImpl method convertPromotionMessagesToDTOs.

@Override
public Map<String, List<PromotionMessageDTO>> convertPromotionMessagesToDTOs(Set<PromotionMessage> promotionMessages, Offer offer) {
    MultiValueMap promotionMessageDTOs = new MultiValueMap();
    for (PromotionMessage message : promotionMessages) {
        PromotionMessageDTO dto = new PromotionMessageDTO(message);
        CustomerRuleHolder customerRuleHolder = buildCustomerRuleHolder(offer);
        dto.setCustomerRuleHolder(customerRuleHolder);
        promotionMessageDTOs.put(dto.getMessagePlacement(), dto);
    }
    return promotionMessageDTOs;
}
Also used : PromotionMessage(org.broadleafcommerce.core.promotionMessage.domain.PromotionMessage) CustomerRuleHolder(org.broadleafcommerce.profile.core.dto.CustomerRuleHolder) PromotionMessageDTO(org.broadleafcommerce.core.promotionMessage.dto.PromotionMessageDTO) MultiValueMap(org.apache.commons.collections.map.MultiValueMap)

Aggregations

MultiValueMap (org.apache.commons.collections.map.MultiValueMap)1 PromotionMessage (org.broadleafcommerce.core.promotionMessage.domain.PromotionMessage)1 PromotionMessageDTO (org.broadleafcommerce.core.promotionMessage.dto.PromotionMessageDTO)1 CustomerRuleHolder (org.broadleafcommerce.profile.core.dto.CustomerRuleHolder)1