Class PriceSummary

java.lang.Object
com.broadleafcommerce.pricing.domain.PriceSummary
All Implemented Interfaces:
Serializable

public class PriceSummary extends Object implements Serializable
Summarizes price information from a PriceData for a PriceableTarget. This is a DTO used in the PriceInfoService and is not intended to be returned or supplied via APIs.
Since:
Pricing Service 2.1.0, Release Train 2.2.0
Author:
Nathan Moore (nathandmoore)
See Also:
  • Constructor Details

    • PriceSummary

      public PriceSummary()
  • Method Details

    • getPrice

      public javax.money.MonetaryAmount getPrice()
      The one-time price. This is typically used during checkout.
    • getPaymentStrategy

      public String getPaymentStrategy()
      Only relevant for price that came from a specific PriceData.

      Represents the payment strategy, specifically when payment is billed for a recurring price.

      See Also:
      • DefaultPaymentStrategy
    • getPriceDataId

      public String getPriceDataId()
      Id of the specific PriceData that this price came from.

      Only applicable if the price was from a PriceData.

    • getActiveStartDate

      public Instant getActiveStartDate()
      Defines the beginning time for which this price is active.
    • getActiveEndDate

      public Instant getActiveEndDate()
      Defines the ending time for which this price is active
    • getStartingQuantity

      public Integer getStartingQuantity()
      Defines the initial quantity available for this price data before a pricing event such as a flash sale. It only serves an informational purpose.
    • getAvailableQuantity

      public Integer getAvailableQuantity()
      The available quantity that can use this price data. This is used for events such as a flash sale where the sale price is limited to a certain amount of quantity.
    • getRecurringPriceDetail

      public com.broadleafcommerce.pricing.client.domain.RecurringPriceDetail getRecurringPriceDetail()
      Represents the details related to a recurring (or subscription) price include the terms.
    • getUsagePriceDetail

      public com.broadleafcommerce.pricing.client.domain.UsagePriceDetail getUsagePriceDetail()
      Represents the details related to a usage price including the units.
    • getPriority

      public Integer getPriority()
      The relative priority of this price detail vs others that might apply to the same target.
    • getCancellationPolicyRef

      public String getCancellationPolicyRef()
      A reference (typically the Id) of the CancellationPolicy for this priceData that governs how this priceData's subscription would be cancelled.
      Since:
      Pricing Services 2.2.0, Release Train 2.3.0
    • getBackupPriceSummary

      public Optional<PriceSummary> getBackupPriceSummary()
      This field is used for summaries based on a limited quantity PriceData. It allows the system to provide a backup to the front-end to show pricing if the user desires to purchase more quantity than is available at the limited quantity price. For summary objects that do not have a limited quantity, the summary will be stored here for convenience in determining if this PriceSummary might be used as a backup to another limited quantity summary.
    • getPriceData

      public PriceData getPriceData()
      Used to store the price data object used to create this summary if applicable.
    • getPriceDataTiers

      public List<PriceDataTier> getPriceDataTiers()
      Used to store the priceDataTiers relevant for the related target
      Since:
      Pricing Service 2.2.0, Release Train 2.3.0
    • setPrice

      public void setPrice(javax.money.MonetaryAmount price)
      The one-time price. This is typically used during checkout.
    • setPaymentStrategy

      public void setPaymentStrategy(String paymentStrategy)
      Only relevant for price that came from a specific PriceData.

      Represents the payment strategy, specifically when payment is billed for a recurring price.

      See Also:
      • DefaultPaymentStrategy
    • setPriceDataId

      public void setPriceDataId(String priceDataId)
      Id of the specific PriceData that this price came from.

      Only applicable if the price was from a PriceData.

    • setActiveStartDate

      public void setActiveStartDate(Instant activeStartDate)
      Defines the beginning time for which this price is active.
    • setActiveEndDate

      public void setActiveEndDate(Instant activeEndDate)
      Defines the ending time for which this price is active
    • setStartingQuantity

      public void setStartingQuantity(Integer startingQuantity)
      Defines the initial quantity available for this price data before a pricing event such as a flash sale. It only serves an informational purpose.
    • setAvailableQuantity

      public void setAvailableQuantity(Integer availableQuantity)
      The available quantity that can use this price data. This is used for events such as a flash sale where the sale price is limited to a certain amount of quantity.
    • setRecurringPriceDetail

      public void setRecurringPriceDetail(com.broadleafcommerce.pricing.client.domain.RecurringPriceDetail recurringPriceDetail)
      Represents the details related to a recurring (or subscription) price include the terms.
    • setUsagePriceDetail

      public void setUsagePriceDetail(com.broadleafcommerce.pricing.client.domain.UsagePriceDetail usagePriceDetail)
      Represents the details related to a usage price including the units.
    • setPriority

      public void setPriority(Integer priority)
      The relative priority of this price detail vs others that might apply to the same target.
    • setCancellationPolicyRef

      public void setCancellationPolicyRef(String cancellationPolicyRef)
      A reference (typically the Id) of the CancellationPolicy for this priceData that governs how this priceData's subscription would be cancelled.
      Since:
      Pricing Services 2.2.0, Release Train 2.3.0
    • setBackupPriceSummary

      public void setBackupPriceSummary(Optional<PriceSummary> backupPriceSummary)
      This field is used for summaries based on a limited quantity PriceData. It allows the system to provide a backup to the front-end to show pricing if the user desires to purchase more quantity than is available at the limited quantity price. For summary objects that do not have a limited quantity, the summary will be stored here for convenience in determining if this PriceSummary might be used as a backup to another limited quantity summary.
    • setPriceData

      public void setPriceData(PriceData priceData)
      Used to store the price data object used to create this summary if applicable.
    • setPriceDataTiers

      public void setPriceDataTiers(List<PriceDataTier> priceDataTiers)
      Used to store the priceDataTiers relevant for the related target
      Since:
      Pricing Service 2.2.0, Release Train 2.3.0
    • 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