com.retek.component.customerorder.impl.command
Class CustomerOrderApplyPromotionsCommand

java.lang.Object
  extended bycom.retek.commons.domain.core.Command
      extended bycom.retek.component.customerorder.impl.command.CustomerOrderApplyPromotionsCommand

public class CustomerOrderApplyPromotionsCommand
extends Command

Class which encapsulates behavior for triggering promotion discounts and computing/creating discount records for a CustomerOrder within the order process. The command is invoked during various key events within the order process (ex. applying an order line, applying a new sale payment to the order, cancelling an order line).

    Command Inputs:
  1. order - customer order to apply promotions
  2. user - user which initiated the promotions command
  3. promotionApplyDate - effective date of the promotion triggering
    Command Outputs:
  1. order - customer order (mutated with any promotion discounts)
  2. qualifiedPromotions - customer order to apply promotions
    Promotions move through a sequence of states with respect to an order during the order taking process. The following terms have been chosen to refer to these states. Where these terms are used in this class, they have these specific meanings.
  1. Candidate: a promotion that has the potential to be available to the customer during an order capture session. For instance, "buy $100 of any items in source code x and get 10% off your order." The only requirement for this promotion to be a candidate is that the order is associated with the source code x. Once an order is created with the source code x, even before $100 of merchandise is ordered, the promotion is a candidate promotion on this order.
  2. Qualified: a promotion that meets the criteria for being a Candidate promotion, and whose threshold has been met is considered to be "Qualified". Continuing with the example above, once $100 of merchandise have been ordered, the example promotion would be Quailified. In other words, the order has met the criteria for the customer to take advantage of the promotion.
  3. Accepted: a promotion that meets the criteria for being a Qualified promotion, and that has been approved (explicitly or implicitly) for being applied to the order. Many promotions (like the one given in the example above) are accepted as soon as they are Qualified because they don't require explicit customer acceptance. Only promotions that will cost the customer additional money require explicit approval (e.g. buy $100 of a particular item and get a second item at %50 off--once the customer has order $100, they still need to approve the purchase of the second item to take advantage of the promotion).


Constructor Summary
CustomerOrderApplyPromotionsCommand()
           
 
Method Summary
protected  void doExecute()
           
 RDate getPromoApplyDate()
           
 java.util.Set getQualifiedPromotions()
           
 void setCancelReason(OrderCancelReason reason)
           
 void setOrder(CustomerOrder order)
           
 void setPromoApplyDate(RDate promoApplyDate)
           
 void setUser(User user)
           
 
Methods inherited from class com.retek.commons.domain.core.Command
addPostExecutionRule, addPreExecutionRule, execute, getContext, isExecuted, processRules, setContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CustomerOrderApplyPromotionsCommand

public CustomerOrderApplyPromotionsCommand()
Method Detail

setOrder

public void setOrder(CustomerOrder order)

setUser

public void setUser(User user)

getPromoApplyDate

public RDate getPromoApplyDate()

setPromoApplyDate

public void setPromoApplyDate(RDate promoApplyDate)

setCancelReason

public void setCancelReason(OrderCancelReason reason)

getQualifiedPromotions

public java.util.Set getQualifiedPromotions()
See Also:
for the definition of "qualified" promotions.

doExecute

protected void doExecute()
                  throws SystemException,
                         BusinessException
Specified by:
doExecute in class Command
Throws:
SystemException
BusinessException


Copyright © 2004 Retek Inc. All Rights Reserved. - Generated at Fri, 10/22/2004 07:28