public class AcceptCouponFromBannerAdCmdImpl extends ControllerCommandImpl implements AcceptCouponFromBannerAdCmd
If the promotion in CouponPromotionAccessBean corresponding to the parameter promoName (and optionally the storeId), has an ACTIVE status and if TOTALNUMOFFER is -1 (implying any number of coupons can be issued for this promotion) or number of coupons already issued from this promotion is less then total number of coupons that can be issued, then a coupon may be issued. Further, the customer should not have already accepted too many coupons. If the user is unregistered and accepts the coupon from e-mail, number of coupons already accepted is found from the PromoAcceptedAccessBean for that user's SHOPPEREMAILID. For registered shoppers, the number of coupons accepted is found from the CouponWalletAccessBean. Then an entry is created in the CouponWalletAccessBean. The number of accepted coupons is updated for this promotion. If the conditions are not satisfied then an error page is displayed.
Modifier and Type | Field and Description |
---|---|
protected java.lang.Integer | promotionId
Deprecated.
The ID of the promotion from which the coupon is being accepted
|
protected boolean | selectionOK
Deprecated.
Indicates if the parameters are OK for further processing.
|
protected java.lang.Integer | storeId
Deprecated.
The ID of the store from which this coupon is being accepted
|
protected java.lang.Long | userId
Deprecated.
The ID of the user invoking this command.
|
Constructor and Description |
---|
AcceptCouponFromBannerAdCmdImpl()
Deprecated.
AcceptCouponFromBannerAdCmdImpl constructor,calls super.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Integer | getStoreId()
Deprecated.
Gets the store ID.
|
boolean | isReadyToCallExecute()
Deprecated.
It always returns true.
|
void | performExecute()
Deprecated.
If the promotion in CouponPromotionAccessBean corresponding to the parameter promoName (and optionally the storeId), has an ACTIVE status and if TOTALNUMOFFER is -1 (implying any number of coupons can be issued for this promotion) or number of coupons already issued from this promotion is less then total number of coupons that can be issued, then a coupon may be issued.
|
void | setStoreId(java.lang.Integer newStoreId)
Deprecated.
Sets the store ID.
|
void | validateParameters()
Deprecated.
It extracts the parameters from request and command context and checks for their correctness.
|
protected java.lang.Long userId
protected java.lang.Integer promotionId
protected java.lang.Integer storeId
protected boolean selectionOK
public AcceptCouponFromBannerAdCmdImpl()
public java.lang.Integer getStoreId()
public boolean isReadyToCallExecute()
public void performExecute() throws ECException
If the promotion in CouponPromotionAccessBean corresponding to the parameter promoName (and optionally the storeId), has an ACTIVE status and if TOTALNUMOFFER is -1 (implying any number of coupons can be issued for this promotion) or number of coupons already issued from this promotion is less then total number of coupons that can be issued, then a coupon may be issued. Further, the customer should not have already accepted too many coupons. If the user is unregistered and accepts the coupon from e-mail, number of coupons already accepted is found from the PromoAcceptedAccessBean for that user's SHOPPEREMAILID. For registered shoppers, the number of coupons accepted is found from the CouponWalletAccessBean. Then an entry is created in the CouponWalletAccessBean. The number of accepted coupons is updated for this promotion. If the conditions are not satisfied then an error page is displayed.
public void setStoreId(java.lang.Integer newStoreId)
public void validateParameters() throws ECException
It takes the promoName, acceptedFromType, successURL and shopperEmailId from the request. It takes storeId and userId from the commandContext. It finds the promotionId for this promoName.