Class SubscriptionCreationRequest

java.lang.Object
com.broadleafcommerce.subscriptionoperation.web.domain.SubscriptionCreationRequest
All Implemented Interfaces:
Serializable

public class SubscriptionCreationRequest extends Object implements Serializable
A request DTO that stores fields necessary for creating a Subscription and its items. Adjustments may also be created with this request
See Also:
  • Constructor Details

    • SubscriptionCreationRequest

      public SubscriptionCreationRequest(String name, String subscriptionStatus, String subscriptionNextStatus, Date nextStatusChangeDate, String nextStatusChangeReason, String userRefType, String userRef, String alternateUserRefType, String alternateUserRef, String subscriptionSource, String subscriptionSourceRef, String secondarySourceType, String secondarySourceRef, String billingFrequency, Integer periodFrequency, String periodType, String paymentStrategy, Date nextBillDate, String preferredPaymentAccountId, String rootItemRefType, String rootItemRef, List<SubscriptionItemCreationRequest> itemCreationRequests, List<SubscriptionAdjustment> subscriptionAdjustments, javax.money.CurrencyUnit currency, boolean needGrantEntitlements, boolean autoRenewalEnabled, Instant endOfTermDate, Integer termDurationLength, String termDurationType, Map<String,Object> additionalAttributes)
      Deprecated.
      in favor of periodType & periodFrequency
      Creates a new SubscriptionCreationRequest instance.
      Parameters:
      name - Name of this subscription
      subscriptionStatus - Current status of this subscription
      subscriptionNextStatus - Next status for this subscription
      nextStatusChangeDate - Date when the next status should begin
      nextStatusChangeReason - Reason for the update to the next status
      userRefType - Type of user owning this subscription
      userRef - Reference to the user to whom this subscription belongs
      alternateUserRefType - Type of the alternative user reference
      alternateUserRef - Alternate reference to the user. Useful for third-party authentication system identifiers
      subscriptionSource - This field shows from which process or user action this subscription originated.
      subscriptionSourceRef - This field shows the identifier of the process or user action this subscription originated.
      secondarySourceType - The type of the secondary source to reference, e.g, an Order Item on an Order. Optional.
      secondarySourceRef - The secondary source to reference, e.g, an Order Item on an Order. Optional.
      billingFrequency - Frequency of billing for this subscription
      periodFrequency - The frequency with which the recurring price should be charged., e.g., a value of 1 combined with periodType of MONTH would indicate to a subscription service that the price should be charged every 1 month.
      periodType - The period type for the price, e.g. MONTHLY, QUARTERLY, ANNUALLY
      paymentStrategy - Declares that payments made against a subscription are going towards the goods/services rendered in the previous vs current period.
      nextBillDate - Next date this subscription will be billed
      preferredPaymentAccountId - References an identifier of a BillingServices PaymentAccount that is considered preferred for this subscription.
      rootItemRefType - Type of the item for which this subscription was provisioned
      rootItemRef - Reference to the item id for which this subscription was provision
      itemCreationRequests -
      subscriptionAdjustments - Adjustments for this subscription. This field is used for creation from an API request and is not persisted with the object
      currency - Currency of this subscription
      needGrantEntitlements - Whether the system has outstanding entitlements to grant for this subscription
      autoRenewalEnabled - Whether this subscription automatically renews at the end of the current subscription term.
      endOfTermDate - The end of term date for this subscription.
      termDurationLength - The length of the terms, e.g., if this is 36 and termDurationType is MONTHS, then the user should be billed for 36 months.
      termDurationType - The term duration type, e.g. DAYS, WEEKS, MONTHS, YEARS.
      additionalAttributes - Miscellaneous attributes that can be set to this request in order to inform business logic for adding a Subscription.
      See Also:
    • SubscriptionCreationRequest

      public SubscriptionCreationRequest()
  • Method Details

    • getName

      public String getName()
      Name of this subscription
    • getSubscriptionStatus

      public String getSubscriptionStatus()
      Current status of this subscription
      See Also:
    • getSubscriptionNextStatus

      public String getSubscriptionNextStatus()
      Next status for this subscription
      See Also:
    • getNextStatusChangeDate

      public Date getNextStatusChangeDate()
      Date when the next status should begin
      See Also:
      • subscriptionNextStatus
    • getNextStatusChangeReason

      public String getNextStatusChangeReason()
      Reason for the update to the next status
      See Also:
      • subscriptionNextStatus
    • getUserRefType

      public String getUserRefType()
      Type of user owning this subscription
      See Also:
    • getUserRef

      public String getUserRef()
      Reference to the user to whom this subscription belongs
    • getAlternateUserRefType

      public String getAlternateUserRefType()
      Type of the alternative user reference
      See Also:
    • getAlternateUserRef

      public String getAlternateUserRef()
      Alternate reference to the user. Useful for third-party authentication system identifiers
    • getSubscriptionSource

      public String getSubscriptionSource()
      This field shows from which process or user action this subscription originated.
      See Also:
    • getSubscriptionSourceRef

      public String getSubscriptionSourceRef()
      This field shows the identifier of the process or user action this subscription originated.
      See Also:
      • subscriptionSource
    • getSecondarySourceType

      public String getSecondarySourceType()
      The type of the secondary source to reference, e.g, an Order Item on an Order. Optional.
      See Also:
    • getSecondarySourceRef

      public String getSecondarySourceRef()
      The secondary source to reference, e.g, an Order Item on an Order. Optional.
      See Also:
      • secondarySourceType
    • getBillingFrequency

      @Deprecated public String getBillingFrequency()
      Deprecated.
      in favor of periodType & periodFrequency
      Frequency of billing for this subscription
    • getPeriodFrequency

      public Integer getPeriodFrequency()
      The frequency with which the recurring price should be charged., e.g., a value of 1 combined with periodType of MONTH would indicate to a subscription service that the price should be charged every 1 month.
      See Also:
      • periodType
    • getPeriodType

      public String getPeriodType()
      The period type for the price, e.g. MONTHLY, QUARTERLY, ANNUALLY
      See Also:
      • periodFrequency
    • getPaymentStrategy

      public String getPaymentStrategy()
      Declares that payments made against a subscription are going towards the goods/services rendered in the previous vs current period.
    • getNextBillDate

      public Date getNextBillDate()
      Next date this subscription will be billed
    • getPreferredPaymentAccountId

      public String getPreferredPaymentAccountId()
      References an identifier of a BillingServices PaymentAccount that is considered preferred for this subscription.
    • getRootItemRefType

      public String getRootItemRefType()
      Type of the item for which this subscription was provisioned
    • getRootItemRef

      public String getRootItemRef()
      Reference to the item id for which this subscription was provision
    • getItemCreationRequests

      public List<SubscriptionItemCreationRequest> getItemCreationRequests()
    • getSubscriptionAdjustments

      public List<SubscriptionAdjustment> getSubscriptionAdjustments()
      Adjustments for this subscription. This field is used for creation from an API request and is not persisted with the object
    • getCurrency

      public javax.money.CurrencyUnit getCurrency()
      Currency of this subscription
    • isNeedGrantEntitlements

      public boolean isNeedGrantEntitlements()
      Whether the system has outstanding entitlements to grant for this subscription
    • isAutoRenewalEnabled

      public boolean isAutoRenewalEnabled()
      Whether this subscription automatically renews at the end of the current subscription term.
    • getEndOfTermDate

      public Instant getEndOfTermDate()
      The end of term date for this subscription.
    • getTermDurationLength

      public Integer getTermDurationLength()
      The length of the terms, e.g., if this is 36 and termDurationType is MONTHS, then the user should be billed for 36 months.
      See Also:
      • termDurationType
    • getTermDurationType

      public String getTermDurationType()
      The term duration type, e.g. DAYS, WEEKS, MONTHS, YEARS.
      See Also:
      • termDurationLength
    • getAdditionalAttributes

      public Map<String,Object> getAdditionalAttributes()
      Miscellaneous attributes that can be set to this request in order to inform business logic for adding a Subscription.
    • setName

      public void setName(String name)
      Name of this subscription
    • setSubscriptionStatus

      public void setSubscriptionStatus(String subscriptionStatus)
      Current status of this subscription
      See Also:
    • setSubscriptionNextStatus

      public void setSubscriptionNextStatus(String subscriptionNextStatus)
      Next status for this subscription
      See Also:
    • setNextStatusChangeDate

      public void setNextStatusChangeDate(Date nextStatusChangeDate)
      Date when the next status should begin
      See Also:
      • subscriptionNextStatus
    • setNextStatusChangeReason

      public void setNextStatusChangeReason(String nextStatusChangeReason)
      Reason for the update to the next status
      See Also:
      • subscriptionNextStatus
    • setUserRefType

      public void setUserRefType(String userRefType)
      Type of user owning this subscription
      See Also:
    • setUserRef

      public void setUserRef(String userRef)
      Reference to the user to whom this subscription belongs
    • setAlternateUserRefType

      public void setAlternateUserRefType(String alternateUserRefType)
      Type of the alternative user reference
      See Also:
    • setAlternateUserRef

      public void setAlternateUserRef(String alternateUserRef)
      Alternate reference to the user. Useful for third-party authentication system identifiers
    • setSubscriptionSource

      public void setSubscriptionSource(String subscriptionSource)
      This field shows from which process or user action this subscription originated.
      See Also:
    • setSubscriptionSourceRef

      public void setSubscriptionSourceRef(String subscriptionSourceRef)
      This field shows the identifier of the process or user action this subscription originated.
      See Also:
      • subscriptionSource
    • setSecondarySourceType

      public void setSecondarySourceType(String secondarySourceType)
      The type of the secondary source to reference, e.g, an Order Item on an Order. Optional.
      See Also:
    • setSecondarySourceRef

      public void setSecondarySourceRef(String secondarySourceRef)
      The secondary source to reference, e.g, an Order Item on an Order. Optional.
      See Also:
      • secondarySourceType
    • setBillingFrequency

      @Deprecated public void setBillingFrequency(String billingFrequency)
      Deprecated.
      in favor of periodType & periodFrequency
      Frequency of billing for this subscription
    • setPeriodFrequency

      public void setPeriodFrequency(Integer periodFrequency)
      The frequency with which the recurring price should be charged., e.g., a value of 1 combined with periodType of MONTH would indicate to a subscription service that the price should be charged every 1 month.
      See Also:
      • periodType
    • setPeriodType

      public void setPeriodType(String periodType)
      The period type for the price, e.g. MONTHLY, QUARTERLY, ANNUALLY
      See Also:
      • periodFrequency
    • setPaymentStrategy

      public void setPaymentStrategy(String paymentStrategy)
      Declares that payments made against a subscription are going towards the goods/services rendered in the previous vs current period.
    • setNextBillDate

      public void setNextBillDate(Date nextBillDate)
      Next date this subscription will be billed
    • setPreferredPaymentAccountId

      public void setPreferredPaymentAccountId(String preferredPaymentAccountId)
      References an identifier of a BillingServices PaymentAccount that is considered preferred for this subscription.
    • setRootItemRefType

      public void setRootItemRefType(String rootItemRefType)
      Type of the item for which this subscription was provisioned
    • setRootItemRef

      public void setRootItemRef(String rootItemRef)
      Reference to the item id for which this subscription was provision
    • setItemCreationRequests

      public void setItemCreationRequests(List<SubscriptionItemCreationRequest> itemCreationRequests)
    • setSubscriptionAdjustments

      public void setSubscriptionAdjustments(List<SubscriptionAdjustment> subscriptionAdjustments)
      Adjustments for this subscription. This field is used for creation from an API request and is not persisted with the object
    • setCurrency

      public void setCurrency(javax.money.CurrencyUnit currency)
      Currency of this subscription
    • setNeedGrantEntitlements

      public void setNeedGrantEntitlements(boolean needGrantEntitlements)
      Whether the system has outstanding entitlements to grant for this subscription
    • setAutoRenewalEnabled

      public void setAutoRenewalEnabled(boolean autoRenewalEnabled)
      Whether this subscription automatically renews at the end of the current subscription term.
    • setEndOfTermDate

      public void setEndOfTermDate(Instant endOfTermDate)
      The end of term date for this subscription.
    • setTermDurationLength

      public void setTermDurationLength(Integer termDurationLength)
      The length of the terms, e.g., if this is 36 and termDurationType is MONTHS, then the user should be billed for 36 months.
      See Also:
      • termDurationType
    • setTermDurationType

      public void setTermDurationType(String termDurationType)
      The term duration type, e.g. DAYS, WEEKS, MONTHS, YEARS.
      See Also:
      • termDurationLength
    • setAdditionalAttributes

      public void setAdditionalAttributes(Map<String,Object> additionalAttributes)
      Miscellaneous attributes that can be set to this request in order to inform business logic for adding a Subscription.
    • 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