Class SubscriptionItemAdjustmentPriceDetail

java.lang.Object
com.broadleafcommerce.cartoperation.service.provider.domain.SubscriptionItemAdjustmentPriceDetail
All Implemented Interfaces:
Serializable

public class SubscriptionItemAdjustmentPriceDetail extends Object implements Serializable
Represent the details of the price adjustment for a subscription item.
Since:
Cart Operation Service 2.3.0, Release Train 2.3.0
Author:
Sunny Yu
See Also:
  • Constructor Details

    • SubscriptionItemAdjustmentPriceDetail

      public SubscriptionItemAdjustmentPriceDetail()
  • Method Details

    • addAttribute

      public void addAttribute(String name, Object value)
      Takes in any additional attributes passed in the request not matching any defined properties.
      Parameters:
      name - Name of the additional attribute
      value - Value of the additional attribute
    • getAttribute

      public Map<String,Object> getAttribute()
      Return any additional attributes passed in the request not matching any defined properties.
      Returns:
      any additional attributes passed in the request not matching any defined properties.
    • getAdjustmentRef

      public String getAdjustmentRef()
      Reference to the promotion or offer that drives this adjustment.
    • getExistingItemAdjustmentQuantity

      public Integer getExistingItemAdjustmentQuantity()
      The quantity of the item impacted by the adjustment prior to the subscription modification.

      It is important to keep track because the impacted quantity may change after the modification, and this is used to calculate the credited and prior unbilled amounts. For example, if the quantity is reduced from 10 to 5 from the modification, the discount amount to deduct from the credited amount should be calculated based on the original quantity of 10, whereas the discount amount to deduct from the prorated amount should be calculated based on the new quantity of 5.

      This is only relevant for subscription modification flows.

      See Also:
    • getAdjustmentQuantity

      public Integer getAdjustmentQuantity()
      The quantity of the item impacted by the adjustment after the subscription modification.

      For DefaultSubscriptionActionFlow.CREATE, this is just the item's quantity.

    • getProratedUnitDiscountAmount

      public javax.money.MonetaryAmount getProratedUnitDiscountAmount()
      Similar to SubscriptionItemPriceDetail.getProratedUnitAmount(), this is the original discount amount prorated relative to the next invoice date. For a new purchase, this reflects the full date range. For edits, upgrades, & downgrades, this reflects the prorated price between the action & the end of the billing period.
    • getCreditedUnitDiscountAmount

      public javax.money.MonetaryAmount getCreditedUnitDiscountAmount()
      The subscription item discount per unit to be deducted from the SubscriptionItemPriceDetail.getCreditedUnitAmount().

      Similar to SubscriptionItemPriceDetail.getCreditedUnitAmount(), the customer had the full discount applied in their previous payment, so when it needs to be credited due to an edit, upgrade, or downgrade, the discount amount needs to be prorated and deducted from the credited amount.

    • getPriorUnbilledUnitDiscountAmount

      public javax.money.MonetaryAmount getPriorUnbilledUnitDiscountAmount()
      The subscription item discount per unit to be deducted from the SubscriptionItemPriceDetail.getPriorUnbilledUnitAmount().

      Similar to SubscriptionItemPriceDetail.getPriorUnbilledUnitAmount(), the discount amount also needs to be prorated and deducted from the prior unbilled amount, since the discount was applied prior to the edit, upgrade, or downgrade.

    • getAttributes

      public Map<String,Object> getAttributes()
      Map holding any additional attributes passed in the request not matching any defined properties.
    • getAdditionalAttributes

      public Map<String,Object> getAdditionalAttributes()
      Miscellaneous attributes that can be set to this request in order to inform business logic
    • setAdjustmentRef

      public void setAdjustmentRef(String adjustmentRef)
      Reference to the promotion or offer that drives this adjustment.
    • setExistingItemAdjustmentQuantity

      public void setExistingItemAdjustmentQuantity(Integer existingItemAdjustmentQuantity)
      The quantity of the item impacted by the adjustment prior to the subscription modification.

      It is important to keep track because the impacted quantity may change after the modification, and this is used to calculate the credited and prior unbilled amounts. For example, if the quantity is reduced from 10 to 5 from the modification, the discount amount to deduct from the credited amount should be calculated based on the original quantity of 10, whereas the discount amount to deduct from the prorated amount should be calculated based on the new quantity of 5.

      This is only relevant for subscription modification flows.

      See Also:
    • setAdjustmentQuantity

      public void setAdjustmentQuantity(Integer adjustmentQuantity)
      The quantity of the item impacted by the adjustment after the subscription modification.

      For DefaultSubscriptionActionFlow.CREATE, this is just the item's quantity.

    • setProratedUnitDiscountAmount

      public void setProratedUnitDiscountAmount(javax.money.MonetaryAmount proratedUnitDiscountAmount)
      Similar to SubscriptionItemPriceDetail.getProratedUnitAmount(), this is the original discount amount prorated relative to the next invoice date. For a new purchase, this reflects the full date range. For edits, upgrades, & downgrades, this reflects the prorated price between the action & the end of the billing period.
    • setCreditedUnitDiscountAmount

      public void setCreditedUnitDiscountAmount(javax.money.MonetaryAmount creditedUnitDiscountAmount)
      The subscription item discount per unit to be deducted from the SubscriptionItemPriceDetail.getCreditedUnitAmount().

      Similar to SubscriptionItemPriceDetail.getCreditedUnitAmount(), the customer had the full discount applied in their previous payment, so when it needs to be credited due to an edit, upgrade, or downgrade, the discount amount needs to be prorated and deducted from the credited amount.

    • setPriorUnbilledUnitDiscountAmount

      public void setPriorUnbilledUnitDiscountAmount(javax.money.MonetaryAmount priorUnbilledUnitDiscountAmount)
      The subscription item discount per unit to be deducted from the SubscriptionItemPriceDetail.getPriorUnbilledUnitAmount().

      Similar to SubscriptionItemPriceDetail.getPriorUnbilledUnitAmount(), the discount amount also needs to be prorated and deducted from the prior unbilled amount, since the discount was applied prior to the edit, upgrade, or downgrade.

    • setAttributes

      public void setAttributes(Map<String,Object> attributes)
      Map holding any additional attributes passed in the request not matching any defined properties.
    • setAdditionalAttributes

      public void setAdditionalAttributes(Map<String,Object> additionalAttributes)
      Miscellaneous attributes that can be set to this request in order to inform business logic
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • canEqual

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object