public class RedeemCouponCmdImpl extends ControllerCommandImpl implements RedeemCouponCmd
This command is invoked when the user asks to redeem her eCoupons before preparing order and it displays a set of eCoupons that can be applied to this order.
First the temporary and permanent table are cleaned up, which stores the eCoupon discount. Then the eCoupons for this shopper are found out from CouponWalletAccessBean with state as USABLE. The CheckValidityCmd command is called to find the coupons that are not expired and for not expired coupons CheckApplicabilityCmd command is called to find out which eCoupons are applicable for this order. For applicable eCoupons, CalculateDiscountAmtCmd command is called to calculate the discount amount and the view command is redirected to show the applicable coupons and corresponding discounts.
Modifier and Type | Field and Description |
---|---|
protected java.lang.Integer | calculationUsage
Deprecated.
The calculation usage code.
|
protected java.lang.String | curCurrency
Deprecated.
Currency to be used in calculations.
|
protected java.lang.Long | orderId
Deprecated.
The order for which the coupons are to be found out
|
protected CommandContext | processingContext
Deprecated.
The command context holder
|
protected java.lang.Long | shopperId
Deprecated.
ID of the shopper invoking the command.
|
protected java.lang.Integer | storeId
Deprecated.
The store ID.
|
Constructor and Description |
---|
RedeemCouponCmdImpl()
Deprecated.
Constructor for RedeemCouponCmdImpl, calls super.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Long | getOrderId()
Deprecated.
Gets the order ID.
|
CommandContext | getProcessingContext()
Deprecated.
Gets the processing context.
|
java.lang.Long | getShopperId()
Deprecated.
Gets the shopper ID.
|
void | insertIntoDB(java.lang.Long orderId, java.util.Hashtable couponHashtable)
Deprecated.
Inserts the coupon related information in the database.
|
boolean | isReadyToCallExecute()
Deprecated.
It always returns true.
|
void | performExecute()
Deprecated.
First the temporary and permanent table are cleaned up, which stores the eCoupon discount.
|
void | removeExistingAdjustments(java.lang.Long anOrderId)
Deprecated.
Removes the existing adjustments for the orderitems.
|
void | removeOldEntries()
Deprecated.
Removes the existing entries from TempOrderCouponMapAccessBean and TempCouponItemMapAccessBean.
|
void | setOrderId(java.lang.Long newOrderId)
Deprecated.
Sets the order ID.
|
void | setProcessingContext(CommandContext newProcessingContext)
Deprecated.
Sets the processingContext.
|
void | setShopperId(java.lang.Long newShopperId)
Deprecated.
Sets the shopper ID.
|
void | trace(java.lang.String traceString)
Deprecated.
Trace the debug info only.
|
void | validateParameters()
Deprecated.
This method extracts and validates the parameters.
|
protected java.lang.Long orderId
protected java.lang.Long shopperId
protected CommandContext processingContext
protected java.lang.Integer calculationUsage
protected java.lang.String curCurrency
protected java.lang.Integer storeId
public RedeemCouponCmdImpl()
public java.lang.Long getOrderId()
public CommandContext getProcessingContext()
public java.lang.Long getShopperId()
public void insertIntoDB(java.lang.Long orderId, java.util.Hashtable couponHashtable) throws ECSystemException
public boolean isReadyToCallExecute()
public void performExecute() throws ECException
First the temporary and permanent table are cleaned up, which stores the eCoupon discount. Then the eCoupons for this shopper are found out from CouponWalletAccessBean with state as USABLE. The CheckValidityCmd command is called to find the coupons that are not expired and for not expired coupons CheckApplicabilityCmd command is called to find out which eCoupons are applicable for this order. For applicable eCoupons, CalculateDiscountAmtCmd command is called to calculate the discount amount and the view command is redirected to show the applicable coupons and corresponding discounts.
public void removeExistingAdjustments(java.lang.Long anOrderId) throws ECSystemException
public void removeOldEntries() throws ECSystemException
public void setOrderId(java.lang.Long newOrderId)
public void setProcessingContext(CommandContext newProcessingContext)
public void setShopperId(java.lang.Long newShopperId)
public void validateParameters() throws ECException
public void trace(java.lang.String traceString)