com.ibm.commerce.marketing.promotion.reward

Interface MonetaryAdjustment

    • Field Detail

      • COPYRIGHT

        static final java.lang.String COPYRIGHT
        IBM copyright notice field.
        See Also:
        Constant Field Values
      • PRICE

        static final int PRICE
        Adjustment is on the sub total of an order or a subset of an order
        See Also:
        Constant Field Values
      • SHIPPING

        static final int SHIPPING
        Adjustment is on the shipping charges of an order or a subset of an order
        See Also:
        Constant Field Values
      • SHIPPING_TAX

        static final int SHIPPING_TAX
        Adjustment is on the tax levied on the shipping charges of an order or a subset of an order
        See Also:
        Constant Field Values
      • TAX

        static final int TAX
        Adjustment is on the tax levied on an order or a subset of an order
        See Also:
        Constant Field Values
      • ZERO

        static final java.math.BigDecimal ZERO
        A simple BigDecimal constant value of 0
      • MAX_SCALE_FOR_DIVIDE

        static final int MAX_SCALE_FOR_DIVIDE
        The scale to use for division of BigDecimal.
        See Also:
        Constant Field Values
    • Method Detail

      • getTheTypeOfMonetaryValueToBeAdjusted

        int getTheTypeOfMonetaryValueToBeAdjusted()
        Returns the target of a monetary adjustment. Possible values are: SUBTOTAL=1, SHIPPING=2, SHIPPING_TAX=4, TAX=8.
        Returns:
        target of a monetary adjustment
      • getPerUnitAdjustment

        java.math.BigDecimal getPerUnitAdjustment(AssociatedOrderItem one,
                                                  AssociatedOrderItem[] all,
                                                  PromotionContext context)
        This method returns the monetary adjustment that needs to be applied to each unit. One unit could be an order item or a portion of an order item (as identified by the AssociationOrderItem). It is guaranteed that all units in one have been adjusted by exactly the same set of monetary adjustments.
        Parameters:
        one - the order item or portion of an order item for which a per unit adjustment amount needs to be calculated.
        all - all of the AssociatedOrderItems to which this adjustment applies.
        context - PromotionContext
        Returns:
        a perUnit value, value could be positive which means a discount, negative which means a markup or zero which means no change is needed.