com.ibm.commerce.couponredemption.commands

Class CheckApplicabilityCmdImpl

  • All Implemented Interfaces:
    com.ibm.commerce.command.CacheableECCommand, ECCommand, ECTargetableCommand, TaskCommand, CheckApplicabilityCmd, 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 CheckApplicabilityCmdImpl
    extends TaskCommandImpl
    implements CheckApplicabilityCmd

    The purpose of this command is to check for applicability of the coupons on the shopping cart. The purchase condition are evaluated and the information is put in applicable variable which is used by the calling command.

    First the order amount is calculated. Then the cppmnId is found out by using corresponding cpwalletId for that eCoupon. If the purchase order condition type for an eCoupon promotion is of product type, then the required products and their minumum quantities are found out from PromoProdAccessBean. If all the required products are present in the order with the required quantities, then the applicable eCoupons are found out.If the purchase order condition type for an eCoupon promotion is of type order, then the required amount for that order is found from PromoOrderAccessBean and the currency from CouponPromotionAccessBean. If the order amount satisfies the conditions, then the eCoupon is applicable. These above steps are performed for each cpwalletId.

    See Also:
    Serialized Form
    • Constructor Detail

      • CheckApplicabilityCmdImpl

        public CheckApplicabilityCmdImpl()
        Deprecated. 
        CheckValidityCmdImpl constructor calls super.
    • Method Detail

      • 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
      • getApplicableItems

        public java.util.Vector[] getApplicableItems()
        Deprecated. 
        Gets applicable items.
        Specified by:
        getApplicableItems in interface CheckApplicabilityCmd
        Returns:
        the applicable items.
      • getBcIds

        public java.lang.Long[] getBcIds()
        Deprecated. 
        Gets the eCoupon IDs.
        Returns:
        the coupon IDs to be checked for applicability.
      • getCurrentTimeStamp

        public java.sql.Timestamp getCurrentTimeStamp()
        Deprecated. 
        Gets current time from system.
        Returns:
        the current time stamp.
      • getOrderId

        public java.lang.Long getOrderId()
        Deprecated. 
        Gets order ID.
        Returns:
        the order on which the coupons are being applied.
      • getProcessingContext

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

        public TypedProperty getRequestProperties()
        Deprecated. 
        Gets the request properties.
        Returns:
        the request properties.
      • getValidCoupons

        public boolean[] getValidCoupons()
        Deprecated. 
        Gets the array indicating whether the Coupons are applicable or not.
        Specified by:
        getValidCoupons in interface CheckApplicabilityCmd
        Returns:
        the nth element of the returned array is true if the nth coupon was applicable.
      • performExecute

        public void performExecute()
                            throws ECException
        Deprecated. 

        First the order amount is calculated. Then the cppmnId is found out by using corresponding cpwalletId for that eCoupon. If the purchase order condition type for an eCoupon promotion is of product type, then the required products and their minumum quantities are found out from PromoProdAccessBean. If all the required products are present in the order with the required quantities, then the applicable eCoupons are found out. If the purchase order condition type for an eCoupon promotion is of type order, then the required amount for that order is found from PromoOrderAccessBean and the currency from CouponPromotionAccessBean. If the order amount satisfies the conditions, then the eCoupon is applicable. 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.
        ECException
      • setApplicableItems

        public void setApplicableItems(java.util.Vector[] newApplicableItems)
        Deprecated. 
        Sets the applicable items.
        Specified by:
        setApplicableItems in interface CheckApplicabilityCmd
        Parameters:
        newApplicableItems - the applicable items.
      • setBcIds

        public void setBcIds(java.lang.Long[] newBcIds)
        Deprecated. 
        Sets eCoupon IDs.
        Specified by:
        setBcIds in interface CheckApplicabilityCmd
        Parameters:
        newBcId - The coupons to be checked for applicability.
      • setCurrentTimeStamp

        public void setCurrentTimeStamp(java.sql.Timestamp newCurrentTimeStamp)
        Deprecated. 
        Sets the current time from system.
        Parameters:
        newCurrentTimeStamp - the current time
      • setOrderId

        public void setOrderId(java.lang.Long newOrderId)
        Deprecated. 
        Sets the order ID.
        Specified by:
        setOrderId in interface CheckApplicabilityCmd
        Parameters:
        newOrderId - the order ID.
      • setProcessingContext

        public void setProcessingContext(CommandContext newProcessingContext)
        Deprecated. 
        Sets the processing context.
        Specified by:
        setProcessingContext in interface CheckApplicabilityCmd
        Parameters:
        newProcessingContext - the command context to be used.
      • setValidCoupons

        public void setValidCoupons(boolean[] newValidCoupons)
        Deprecated. 
        Sets the array indicating whether the Coupons are applicable or not.
        Parameters:
        newValidCoupons - array whose nth element indicates if the nth coupon is applicable