psoft.hsphere.promotion.calc
Interface PromoCalculator

All Known Implementing Classes:
PercentDiscountCalc

public interface PromoCalculator


Method Summary
 void delete(long promoId)
          Deletes the calculator data from the H-Sphere database
 double getPromoDiscount(psoft.hsphere.Account a, double sum)
          Calculates discount on a given sum
 void updateData(long promoId, java.util.Hashtable data)
          Updates calculator object and saves the data needed by the calculator to the H-SPhere database
 

Method Detail

getPromoDiscount

public double getPromoDiscount(psoft.hsphere.Account a,
                               double sum)
Calculates discount for passed sum

Parameters:
a - Account for which discount is being calculated
sum - Full amount of charge
Returns:
double

updateData

public void updateData(long promoId,
                       java.util.Hashtable data)
                throws java.lang.Exception
Updates calculator object and saves the data needed by the calculator to the H-SPhere database

Parameters:
promoId - id of the Promo object
data - name/value pairs of data
Throws:
java.lang.Exception

delete

public void delete(long promoId)
            throws java.lang.Exception
Deletes the calculator data from the H-Sphere database

Parameters:
promoId - id of the Promo object
Throws:
java.lang.Exception