com.ibm.commerce.marketing.promotion.code

Interface GenericPromotionCodeManager

  • All Superinterfaces:
    java.io.Serializable, XMLizable
    All Known Implementing Classes:
    DefaultGenericPromotionCodeManager


    public interface GenericPromotionCodeManager
    extends XMLizable
    Interface for PromotionCodeManager. This is the interface that exposes the features required to manage promotion codes in the promotion engine.
    • Field Detail

      • PROMO_CODE_IN_USE

        static final int PROMO_CODE_IN_USE
        A promotion code is being used in an order.
        See Also:
        Constant Field Values
      • PROMO_CODE_USED

        static final int PROMO_CODE_USED
        A promotion code has been used in an order that's completed.
        See Also:
        Constant Field Values
    • Method Detail

      • addCodeForOrder

        void addCodeForOrder(java.lang.String code,
                             OrderKey okey,
                             java.util.Date date)
                      throws PromotionApplicationException
        Add a promotion code to an order
        Parameters:
        code - The code
        okey - The order key
        date - The date on which the code is entered
        Throws:
        PromotionApplicationException - is thrown when system fails to add the code to the order
      • listCodeForOrder

        java.lang.String[] listCodeForOrder(OrderKey okey)
        List all the codes that are used in an order
        Parameters:
        okey - The order key of the order.
        Returns:
        all the codes that are used in an order
      • validatePromotionCode

        PromotionErrorReport validatePromotionCode(java.lang.String code,
                                                   CustomerKey ukey,
                                                   StoreKey storeKey)
                                            throws PromotionApplicationException
        Validates a promotion code. Performs the following tasks:
        1. Checks if the code is valid
        2. Checks if the promotion identified by this code is active
        3. Checks if the promotion identified by this code has reached the redemption limit both overall and for this user in particular
        Not checked are:
        1. If the promotion identified by this code is applicable to the current order based on its content
        2. If the promotion identified by this code will be eliminated as a result of policy violations.
        Parameters:
        code - the code
        ukey - customer who entered the code
        storeKey - key of the store where the customer is shopping
        Returns:
        PromotionErrorReport that indicates any validation errors that might have arisen.
        Throws:
        PromotionApplicationException - if any of the 3 criteria is not satisfied.
      • validatePromotionCode

        PromotionErrorReport validatePromotionCode(java.lang.String code,
                                                   CustomerKey ukey,
                                                   StoreKey storeKey,
                                                   java.util.Date date)
                                            throws PromotionApplicationException
        Validates a promotion code. Performs the following tasks:
        1. Checks if the code is valid
        2. Checks if the promotion identified by this code is active
        3. Checks if the promotion identified by this code has reached the redemption limit both overall and for this user in particular
        Not checked are:
        1. If the promotion identified by this code is applicable to the current order based on its content
        2. If the promotion identified by this code will be eliminated as a result of policy violations.
        Parameters:
        code - the code
        ukey - customer who entered the code
        storeKey - key of the store where the customer is shopping
        date - the date on which the code is entered
        Returns:
        PromotionErrorReport that indicates any validation errors that might have arisen.
        Throws:
        PromotionApplicationException - if any of the 3 criteria is not satisfied.
      • getPromotionCodeResolver

        GenericPromotionCodeResolver getPromotionCodeResolver()
        Returns the promotion code resolver used by this promotion code manager.
        Returns:
        a generic promotion code resolver this promotion code manager uses to resolve promotion codes