com.ibm.commerce.couponredemption.commands

Class CalculateDiscountAmtCmdImpl

  • All Implemented Interfaces:
    BusinessPolicyCommand, com.ibm.commerce.command.CacheableECCommand, ECCommand, ECTargetableCommand, TaskCommand, CalculateDiscountAmtCmd, CalculationCmd, com.ibm.websphere.cache.Sizeable, com.ibm.websphere.command.CacheableCommand, com.ibm.websphere.command.Command, com.ibm.websphere.command.CommandCaller, com.ibm.websphere.command.TargetableCommand, java.io.Serializable

    Deprecated. 
    The WC54 coupon feature will be replaced by the WC56 promotion engine coupon feature.

    public class CalculateDiscountAmtCmdImpl
    extends CalculationCmdImpl
    implements CalculateDiscountAmtCmd

    The purpose of the task command is to computes the discount amount for each eCoupon that satisfy the purchase order conditions of the of the eCoupon.

    First the orderItems for a order are found out and for each cpwalletId, corresponding promoId is found out from the CouponWalletAccessBean. The corresponding calcodeId are found out from PromoDiscAccessBean by using the obtained promoId. A mapping is computed between OrderItemAccessBean (corresponding to the items qualified for this cpwalletId) and the Categorized MonetaryAmount(Set to zero). The task command CalculationCodeCalculate command with usage type as eCoupons and the mapping created above are called and the discount amounts are stored in TempCouponItemMapAccessBean. These above steps are performed for each cpwalletId.

    See Also:
    Serialized Form
    • Constructor Detail

      • CalculateDiscountAmtCmdImpl

        public CalculateDiscountAmtCmdImpl()
        Deprecated. 
        CouponDSSCmdImpl constructor, call super.
    • Method Detail

      • reset

        public void reset()
        Deprecated. 
        Resets the command properties. Prepares the command for re-execution.
        Specified by:
        reset in interface com.ibm.websphere.command.Command
        Overrides:
        reset in class CalculationCmdImpl
        See Also:
        Command.reset()
      • checkParentCatEntryIds

        public boolean checkParentCatEntryIds(java.lang.Long oiCatEntryId,
                                              java.lang.Long walletCatEntryId)
                                       throws ECSystemException
        Deprecated. 
        Checks the parent catalog entry.
        Parameters:
        oiCatEntryId - The child catalog entry ID.
        walletCatEntryId - The parent catalog entry ID.
        Returns:
        true if the oiCatEntryId is indeed the child of the walletCatEntryId.
        Throws:
        ECSystemException
      • getAppItems

        public java.util.Vector[] getAppItems()
        Deprecated. 
        Gets the applicable items.
        Returns:
        the applicable items.
      • getIClassName

        public static final java.lang.String getIClassName()
        Deprecated. 
        Gets the class name.
        Returns:
        name of the class.
      • getOrderId

        public java.lang.Long getOrderId()
        Deprecated. 
        Gets the orderId.
        Returns:
        the order ID for which the discount is being calculated.
      • getProcessingContext

        public CommandContext getProcessingContext()
        Deprecated. 
        Gets the processing context.
        Returns:
        the command context.
      • getReqProp

        public TypedProperty getReqProp()
        Deprecated. 
        Gets request properties.
        Returns:
        the request properties
      • getReturnTable

        public java.util.Hashtable getReturnTable()
        Deprecated. 
        Gets the return table.
        Specified by:
        getReturnTable in interface CalculateDiscountAmtCmd
        Returns:
        the hashtable containing the discount information.
      • isReadyToCallExecute

        public boolean isReadyToCallExecute()
        Deprecated. 
        It always returns true.
        Specified by:
        isReadyToCallExecute in interface com.ibm.websphere.command.Command
        Overrides:
        isReadyToCallExecute in class AbstractECTargetableCommand
        Returns:
        boolean
      • performExecute

        public void performExecute()
                            throws ECException
        Deprecated. 

        First the orderItems for a order are found out and for each cpwalletId, corresponding promoId is found out from the CouponWalletAccessBean. The corresponding calcodeId are found out from PromoDiscAccessBean by using the obtained promoId. A mapping is computed between OrderItemAccessBean (corresponding to the items qualified for this cpwalletId) and the Categorized MonetaryAmount(Set to zero). The task command CalculationCodeCalculate command with usage type as eCoupons and the mapping created above are called and the discount amounts are stored in TempCouponItemMapAccessBean. These above steps are performed for each cpwalletId.

        Specified by:
        performExecute in interface ECCommand
        Specified by:
        performExecute in interface com.ibm.websphere.command.TargetableCommand
        Overrides:
        performExecute in class AbstractECTargetableCommand
        Throws:
        ECException
      • setAppItems

        public void setAppItems(java.util.Vector[] newAppItems)
        Deprecated. 
        Sets the applied items.
        Specified by:
        setAppItems in interface CalculateDiscountAmtCmd
        Parameters:
        newAppItems - the applicable items to be set.
      • setBcIds

        public void setBcIds(java.lang.Long[] paramBcIds)
        Deprecated. 
        Sets the eCouponIds.
        Specified by:
        setBcIds in interface CalculateDiscountAmtCmd
        Parameters:
        paramBcIds - the couponIds to be used on this order.
      • setOrderId

        public void setOrderId(java.lang.Long newOrderId)
        Deprecated. 
        Sets the order IDs.
        Specified by:
        setOrderId in interface CalculateDiscountAmtCmd
        Parameters:
        newOrderId - the orderId
      • setReturnTable

        public void setReturnTable(java.util.Hashtable newReturnTable)
        Deprecated. 
        Sets the return table.
        Parameters:
        newReturnTable - the hashtable containing discount information
      • setRspProp

        public void setRspProp(TypedProperty newRspProp)
        Deprecated. 
        Sets the responce properties.
        Parameters:
        newRspProp - the new response properties