public interface PromotionService<T extends Promotion> extends ChangeGenerator<Object>
Promotions and PromotionForUsers| Modifier and Type | Method and Description |
|---|---|
int |
delete(PromotionForUser promotionForUser) |
void |
delete(T promotion) |
int |
deleteCoupons(List<String> userCouponIds,
Promotion promotion,
Object... context) |
void |
generateCoupons(List<String> userCouponIds,
Promotion promotion,
Object... context) |
T |
load(String promotionName)
Load by Promotion Name
|
void |
notifyAllListeners(List<String> userCouponIds,
Promotion promotion,
Object... context)
Allow notifications using the coupon Id notation; notify all users of the Coupons about something.
|
PromotionForUser |
save(PromotionForUser promotionForUser) |
T |
save(T promotion) |
List<PromotionForUser> |
search(List<String> codes)
For provided list of Codes, get
Promotions |
List<PromotionForUser> |
search(String userId)
Fpr a given user Id get all the Active Promotions
|
List<PromotionForUser> |
search(String userId,
List<String> codes)
For provided list of Codes, get
Promotions for a given userId |
PromotionForUser |
search(String userId,
String promotionName)
Search for a
PromotionForUser |
Collection<PromotionForUser> |
validate(Collection<PromotionForUser> promotionForUsers)
Ensure the passed collection contains valid entities; returns back only valid entities.
|
addChangeListener, getListeners, notifyAllListeners, setListenersPromotionForUser save(PromotionForUser promotionForUser)
promotionForUser - as PromotionForUserint delete(PromotionForUser promotionForUser)
promotionForUser - as PromotionForUserPromotionForUser search(String userId, String promotionName)
PromotionForUseruserId - as StringpromotionName - as StringPromotionForUserList<PromotionForUser> search(String userId)
userId - List<PromotionForUser> search(List<String> codes)
Promotionscodes - as List of StringList<PromotionForUser> search(String userId, List<String> codes)
Promotions for a given userIdcodes - as List of StringuserId - as Stringvoid generateCoupons(List<String> userCouponIds, Promotion promotion, Object... context)
userCouponIds - as Lit of of Strings. if the String contains :code then it will consider that the Promotion#getCode() ; the part
before ":" delimiter is considered as the user idpromotion - context - as varargs, as context to pass to the ChangeListenersint deleteCoupons(List<String> userCouponIds, Promotion promotion, Object... context)
userCouponIds - as Lit of of Strings. if the String contains :code then it will consider that the Promotion#getCode() ; the part
before ":" delimiter is considered as the user idpromotion - context - as varargs, as context to pass to the ChangeListenersCollection<PromotionForUser> validate(Collection<PromotionForUser> promotionForUsers) throws javax.validation.ValidationException
promotionForUsers - javax.validation.ValidationExceptionvoid notifyAllListeners(List<String> userCouponIds, Promotion promotion, Object... context) throws javax.validation.ValidationException, PartialTransactionException
userCouponIds - promotion - context - javax.validation.ValidationExceptionPartialTransactionExceptionCopyright © 2018. All rights reserved.