public interface PromotionService<T extends Promotion> extends ChangeGenerator<Object>
Promotion
s and PromotionForUser
sModifier 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
Promotion s |
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
Promotion s 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, setListeners
PromotionForUser save(PromotionForUser promotionForUser)
promotionForUser
- as PromotionForUser
int delete(PromotionForUser promotionForUser)
promotionForUser
- as PromotionForUser
PromotionForUser search(String userId, String promotionName)
PromotionForUser
userId
- as StringpromotionName
- as StringPromotionForUser
List<PromotionForUser> search(String userId)
userId
- List<PromotionForUser> search(List<String> codes)
Promotion
scodes
- as List of StringList<PromotionForUser> search(String userId, List<String> codes)
Promotion
s 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 ChangeListener
sint 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 ChangeListener
sCollection<PromotionForUser> validate(Collection<PromotionForUser> promotionForUsers) throws javax.validation.ValidationException
promotionForUsers
- javax.validation.ValidationException
void notifyAllListeners(List<String> userCouponIds, Promotion promotion, Object... context) throws javax.validation.ValidationException, PartialTransactionException
userCouponIds
- promotion
- context
- javax.validation.ValidationException
PartialTransactionException
Copyright © 2018. All rights reserved.