Class SubscriptionItemPriceDetail

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

public class SubscriptionItemPriceDetail extends Object implements Serializable
Describes the amount being charged for this item. This may be an amount due now, or a future payment.
Since:
Cart Operation Service 2.3.0, Release Train 2.3.0
See Also:
  • Constructor Details

    • SubscriptionItemPriceDetail

      public SubscriptionItemPriceDetail()
  • 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.
    • getCartItemId

      public String getCartItemId()
      Reference to the subscription CartItem
    • getItemRefType

      public String getItemRefType()
      Type of item that this object represents. For example, BLC_PRODUCT.
    • getItemRef

      public String getItemRef()
      Reference to the id of the item represented by this object. For example, the product id.
    • getItemName

      public String getItemName()
      Name of the item identified by getItemRefType() & getItemRef().
    • getParentItemRefType

      public String getParentItemRefType()
      Type of the parent subscription item's backing item if this is a child subscription item
    • getParentItemRef

      public String getParentItemRef()
      Reference of the parent subscription item's backing item if this is a child subscription item
    • getParentQuantity

      public Integer getParentQuantity()
      The item's parent quantity following the subscription action (e.g. create, edit, upgrade, downgrade, etc.).

      This is typically used to scale a dependent item's quantity based on its parent for calculating subtotals.

    • getProratedUnitAmount

      public javax.money.MonetaryAmount getProratedUnitAmount()
      The subscription item price per unit, 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.
    • getCreditedUnitAmount

      public javax.money.MonetaryAmount getCreditedUnitAmount()
      For edits, upgrades, and downgrades on a subscription that’s using a PREPAID payment strategy, the customer has already paid the full amount for this billing cycle at the previous rate.

      For example, consider a customer who is upgrading from 10 to 20 licenses at $1 each half-way through a 30-day month. The user prorated amount would be $10 for 20 licenses. This user has already partially paid for 10 of the licenses, so they will be due a credit of $5 toward the second-half-of-the-month amount.

      Note: This typically only impacts the first period in the estimatedFuturePayments list.

    • getPriorUnbilledUnitAmount

      public javax.money.MonetaryAmount getPriorUnbilledUnitAmount()
      Prior to an edit, upgrade, or downgrade on a subscription that’s using a Postpaid payment strategy, the system will have prior unbilled charges that will be part of the next invoice. In this case, the user will owe this in addition to the prorated charges for the changes being made.

      For example, consider a customer who is upgrading from 10 to 20 licenses at $1 each half-way through a 30-day month. The user prorated amount would be $10 for 20 licenses. This user also owes $5 for access to the 10 licenses in the first half of the month.

      Note: This typically only impacts the first period in the estimatedFuturePayments list.

    • getQuantity

      public Integer getQuantity()
      The item's quantity following the subscription action (e.g. create, edit, upgrade, downgrade, etc.).
    • getDueNowQuantityOverride

      public Integer getDueNowQuantityOverride()
      An item's quantity override value used for "due now" price calculations where the item's quantity decreased due to the subscription action.
    • getExistingSubscriptionItemQuantity

      public Integer getExistingSubscriptionItemQuantity()
      The existing subscription item's quantity prior the subscription action (e.g. edit, upgrade, downgrade, etc.).
    • getAdjustmentPriceDetailsByAdjustmentRef

      public Map<String,SubscriptionItemAdjustmentPriceDetail> getAdjustmentPriceDetailsByAdjustmentRef()
      The map of SubscriptionItemAdjustmentPriceDetail by adjustment reference, containing the details about how the discount affects the prorated unit amount, credited amount, and prior unbilled amount.
    • getAttributes

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

      public javax.money.MonetaryAmount getItemSubtotal()
      Stores the item subtotal, which is equal to getProratedAmount() + getPriorUnbilledAmount() - getCreditedAmount().

      Note: Keep in mind that the getProratedAmount() is based on a unit price that's scaled based on the item's new quantity, whereas the getPriorUnbilledAmount() & getCreditedAmount() are based on unit prices that are scaled based on the item's previous quantity.

      Returns:
      the item subtotal.
    • getProratedAmount

      public javax.money.MonetaryAmount getProratedAmount()
      Stores the prorated portion of the item subtotal, which is based on the getProratedUnitAmount(). This unit amount is scaled by the getDueNowQuantityOverride() if it's present. Otherwise, the unit amount is scaled by the getQuantity().
      Returns:
      the prorated portion of the item subtotal.
    • getCreditedAmount

      public javax.money.MonetaryAmount getCreditedAmount()
      Stores the credited portion of the item subtotal, which is based on the getCreditedUnitAmount(). This unit amount is scaled by the getExistingSubscriptionItemQuantity().
      Returns:
      the credited portion of the item subtotal.
    • getPriorUnbilledAmount

      public javax.money.MonetaryAmount getPriorUnbilledAmount()
      Stores the prior unbilled portion of the item subtotal, which is based on the getPriorUnbilledUnitAmount(). This unit amount is scaled by the getExistingSubscriptionItemQuantity().
      Returns:
      the prior unbilled portion of the item subtotal.
    • setCartItemId

      public void setCartItemId(String cartItemId)
      Reference to the subscription CartItem
    • setItemRefType

      public void setItemRefType(String itemRefType)
      Type of item that this object represents. For example, BLC_PRODUCT.
    • setItemRef

      public void setItemRef(String itemRef)
      Reference to the id of the item represented by this object. For example, the product id.
    • setItemName

      public void setItemName(String itemName)
      Name of the item identified by getItemRefType() & getItemRef().
    • setParentItemRefType

      public void setParentItemRefType(String parentItemRefType)
      Type of the parent subscription item's backing item if this is a child subscription item
    • setParentItemRef

      public void setParentItemRef(String parentItemRef)
      Reference of the parent subscription item's backing item if this is a child subscription item
    • setParentQuantity

      public void setParentQuantity(Integer parentQuantity)
      The item's parent quantity following the subscription action (e.g. create, edit, upgrade, downgrade, etc.).

      This is typically used to scale a dependent item's quantity based on its parent for calculating subtotals.

    • setProratedUnitAmount

      public void setProratedUnitAmount(javax.money.MonetaryAmount proratedUnitAmount)
      The subscription item price per unit, 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.
    • setCreditedUnitAmount

      public void setCreditedUnitAmount(javax.money.MonetaryAmount creditedUnitAmount)
      For edits, upgrades, and downgrades on a subscription that’s using a PREPAID payment strategy, the customer has already paid the full amount for this billing cycle at the previous rate.

      For example, consider a customer who is upgrading from 10 to 20 licenses at $1 each half-way through a 30-day month. The user prorated amount would be $10 for 20 licenses. This user has already partially paid for 10 of the licenses, so they will be due a credit of $5 toward the second-half-of-the-month amount.

      Note: This typically only impacts the first period in the estimatedFuturePayments list.

    • setPriorUnbilledUnitAmount

      public void setPriorUnbilledUnitAmount(javax.money.MonetaryAmount priorUnbilledUnitAmount)
      Prior to an edit, upgrade, or downgrade on a subscription that’s using a Postpaid payment strategy, the system will have prior unbilled charges that will be part of the next invoice. In this case, the user will owe this in addition to the prorated charges for the changes being made.

      For example, consider a customer who is upgrading from 10 to 20 licenses at $1 each half-way through a 30-day month. The user prorated amount would be $10 for 20 licenses. This user also owes $5 for access to the 10 licenses in the first half of the month.

      Note: This typically only impacts the first period in the estimatedFuturePayments list.

    • setQuantity

      public void setQuantity(Integer quantity)
      The item's quantity following the subscription action (e.g. create, edit, upgrade, downgrade, etc.).
    • setDueNowQuantityOverride

      public void setDueNowQuantityOverride(Integer dueNowQuantityOverride)
      An item's quantity override value used for "due now" price calculations where the item's quantity decreased due to the subscription action.
    • setExistingSubscriptionItemQuantity

      public void setExistingSubscriptionItemQuantity(Integer existingSubscriptionItemQuantity)
      The existing subscription item's quantity prior the subscription action (e.g. edit, upgrade, downgrade, etc.).
    • setAdjustmentPriceDetailsByAdjustmentRef

      public void setAdjustmentPriceDetailsByAdjustmentRef(Map<String,SubscriptionItemAdjustmentPriceDetail> adjustmentPriceDetailsByAdjustmentRef)
      The map of SubscriptionItemAdjustmentPriceDetail by adjustment reference, containing the details about how the discount affects the prorated unit amount, credited amount, and prior unbilled amount.
    • setAttributes

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

      public void setItemSubtotal(javax.money.MonetaryAmount itemSubtotal)
      Stores the item subtotal, which is equal to getProratedAmount() + getPriorUnbilledAmount() - getCreditedAmount().

      Note: Keep in mind that the getProratedAmount() is based on a unit price that's scaled based on the item's new quantity, whereas the getPriorUnbilledAmount() & getCreditedAmount() are based on unit prices that are scaled based on the item's previous quantity.

    • setProratedAmount

      public void setProratedAmount(javax.money.MonetaryAmount proratedAmount)
      Stores the prorated portion of the item subtotal, which is based on the getProratedUnitAmount(). This unit amount is scaled by the getDueNowQuantityOverride() if it's present. Otherwise, the unit amount is scaled by the getQuantity().
    • setCreditedAmount

      public void setCreditedAmount(javax.money.MonetaryAmount creditedAmount)
      Stores the credited portion of the item subtotal, which is based on the getCreditedUnitAmount(). This unit amount is scaled by the getExistingSubscriptionItemQuantity().
    • setPriorUnbilledAmount

      public void setPriorUnbilledAmount(javax.money.MonetaryAmount priorUnbilledAmount)
      Stores the prior unbilled portion of the item subtotal, which is based on the getPriorUnbilledUnitAmount(). This unit amount is scaled by the getExistingSubscriptionItemQuantity().
    • 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