All Superinterfaces:
Serializable
All Known Implementing Classes:
SubscriptionAdjustment, SubscriptionItemAdjustment

public interface Adjustment extends Serializable
Represents a price adjustment (discount) applied from an offer added to a Subscription or SubscriptionItem.
Author:
Nathan Moore (nathandmoore)
  • Method Details

    • getOwnerId

      String getOwnerId()
      Identifier for the subscription entity that owns this adjustment, e.g., the Subscription ID.
      Returns:
      Identifier for the subscription entity that owns this adjustment, e.g., the Subscription ID.
    • getOwnerType

      String getOwnerType()
      The type of subscription entity that owns this adjustment, e.g., DefaultAdjustmentOwnerType.SUBSCRIPTION.
      Returns:
      The type of subscription entity that owns this adjustment, e.g., DefaultAdjustmentOwnerType.SUBSCRIPTION.
      See Also:
    • getAdjustmentRef

      String getAdjustmentRef()
      Reference to the promotion or offer that drives this adjustment
      Returns:
      Reference to the promotion or offer that drives this adjustment
    • getSubscriptionAdjustmentType

      String getSubscriptionAdjustmentType()
      Type of adjustment that this adds
      Returns:
      Type of adjustment that this adds
      See Also:
    • getAdjustmentAmount

      BigDecimal getAdjustmentAmount()
      Adjustment amount applied to the unit price of the target item.
      Returns:
      Amount of the price adjustment
    • getBeginPeriod

      Integer getBeginPeriod()
      Number of the billing period this adjustment starts being active
      Returns:
      Number of the billing period this adjustment starts being active
    • getEndPeriod

      @Nullable Integer getEndPeriod()
      Number of the billing period this adjustment stops. If this field is null, the adjustment is considered indefinite
      Returns:
      Number of the billing period this adjustment stops. If this field is null, the adjustment is considered indefinite
    • getAdjustmentName

      String getAdjustmentName()
      Name of the adjustment applied.
      Returns:
      Name of the adjustment applied.
    • getAdjustmentCartLabel

      @Nullable String getAdjustmentCartLabel()
      Friendly label to display in the cart or to a customer in general instead of the getAdjustmentName().
      Returns:
      Friendly label to display in the cart or to a customer in general instead of the getAdjustmentName().
    • getAdjustmentDescription

      @Nullable String getAdjustmentDescription()
      A description of what benefits the adjustment provides to a customer.
      Returns:
      A description of what benefits the adjustment provides to a customer.
    • getAdjustmentProrationType

      String getAdjustmentProrationType()
      Determines how an adjustment's discount amount is distributed across the adjustment's related item types. This can either be set to prorate across target items or target and qualifier items.
      Returns:
      Determines how an adjustment's discount amount is distributed across the adjustment's related item types. This can either be set to prorate across target items or target and qualifier items.
    • getAdjustmentCodeRef

      @Nullable String getAdjustmentCodeRef()
      A reference to the Offer Code (if any).
      Returns:
      A reference to the Offer Code (if any).
    • getAdjustmentDiscountMethodType

      String getAdjustmentDiscountMethodType()
      Determines the method used to apply the discount. Typically in Broadleaf, the getSubscriptionAdjustmentType() ends up as DefaultSubscriptionAdjustmentType.AMOUNT_OFF since the offer system calculates the actual amount to discount even if the base offer was a percentage off or fixed price. This field then is distinguished as the actual method specified on the offer before it was applied.
      Returns:
      The type of discount method used for this adjustment.
    • getAdjustmentDiscountFactor

      BigDecimal getAdjustmentDiscountFactor()
      The discount factor by which to discount a target. If the amount is 10, then whether it is calculated as a percentage (10%) or a currency amount ($10) is determined by getAdjustmentDiscountMethodType(). This does not represent that actual amount discounted from the target.
      Returns:
      The discount factor used for this adjustment.
    • getCodeUsed

      @Nullable String getCodeUsed()
      The code used (if any) that triggered the application of the adjustment for this adjustment.
      Returns:
      The code used (if any) that triggered the application of the adjustment for this adjustment.
    • getCampaignTrackingId

      @Nullable String getCampaignTrackingId()
      The campaign tracking id (if any) for this adjustment.
      Returns:
      The campaign tracking id (if any) for this adjustment.
    • getDiscountType

      String getDiscountType()
      Defines the type of the discount, e.g., free trial, order discount, future credit, etc. This primarily determines when it should be applied to the order or items. This helps distinguish whether the adjustment applies at checkout or later such as for a subscription.
      Returns:
      The type of the discount.
    • getAdjustmentQuantity

      default Optional<Integer> getAdjustmentQuantity()
      The quantity of the target item's units the adjustment applies to. If null, then the full quantity of the item is targeted. Not applicable to all types of adjustments.
      Returns:
      The quantity of the adjustment owner the adjustment applies to if applicable.
    • getFreeTrialLength

      @Nullable Integer getFreeTrialLength()
      If getDiscountType() is FREE_TRIAL, then this defines the free trial's length.
      Returns:
      If getDiscountType() is FREE_TRIAL, then this defines the free trial's length.
      See Also:
    • getFreeTrialLengthUnits

      @Nullable String getFreeTrialLengthUnits()
      If getDiscountType() is FREE_TRIAL, then this defines the units for getFreeTrialLength().
      Returns:
      If getDiscountType() is FREE_TRIAL, then this defines the units for getFreeTrialLength().
      See Also: