Class Subscription
java.lang.Object
com.broadleafcommerce.orderoperation.domain.subscription.Subscription
- All Implemented Interfaces:
com.broadleafcommerce.money.CurrencyConsumer,Serializable,javax.money.CurrencySupplier
public class Subscription
extends Object
implements javax.money.CurrencySupplier, com.broadleafcommerce.money.CurrencyConsumer, Serializable
This is a domain representing a user's subscription to a service or a good. The particular line
items of the subscription are contained in
SubscriptionItem objects, while any price
changes would be held by adjustments. Changes to a subscription's
status should be followed by a SubscriptionStatusAudit to track them.- Since:
- Order Operation Service 2.2.0, Release Train 2.3.0
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAttribute(String name, Object value) Takes in any additional attributes passed in the request not matching any defined properties.protected booleanbooleanAlternate reference to the user.Type of the alternative user referenceReturn any additional attributes passed in the request not matching any defined properties.Map holding any additional attributes passed in the request not matching any defined properties.A reference of the CancellationPolicy that governs how this subscription would be cancelled.com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextStateA subset ofTrackinginformation to expose the context state for this object.Date this subscription was created.javax.money.CurrencyUnitCurrency of this subscriptionThe end of term date for this subscription.A reference to the workflow used to fulfill the creation of, & modifications to, this subscription.getId()Miscellaneous internal attributes for this subscription.The batch id of the last billing job run for this subscriptionThe most current status of the last billing event for this subscriptionLast date this that the Billing Job succeeded billing this subscriptiongetName()Name of this subscriptionNext date this subscription will be billedThe next period this subscription will cover.Date when the next status should beginReason for the update to the next statusIf this subscription was upgraded or downgraded, holds the reference to the subscription replacing this oneDeclares that payments made against a subscription are going towards the goods/services rendered in the previous vs current period.intThe frequency with which the recurring price should be charged., e.g., a value of 1 combined withperiodTypeof MONTH would indicate to a subscription service that the price should be charged every 1 month.List tracking the Subscription's periods.The period type for the price, e.g.References an identifier of a PaymentAccount that is considered preferred for this subscription.The bill date for the previous periodDate this subscription will or did continue.Reference to the item id for which this subscription was provisionType of the item for which this subscription was provisionedThe secondary source to reference, e.g, an Order Item on an Order.The type of the secondary source to reference, e.g, an Order Item on an Order.Multi-tenancy supportThe start of term date for this subscription.Adjustments for this subscription.Next status for this subscriptionThis field shows from which process or user action this subscription originated.This field shows the identifier of the process or user action this subscription originated.Current status of this subscriptionThe length of the terms, e.g., if this is 36 andtermDurationTypeis MONTHS, then the user should be billed for 36 months.The term duration type, e.g.Reference to the user to whom this subscription belongsType of user owning this subscriptionThe version of this subscription.inthashCode()booleanWhether this subscription automatically renews at the end of the current subscription term.booleanWhether this subscription is being cancelled due to a chargebackbooleanWhether the system has outstanding entitlements to grant on this subscriptionvoidsetAlternateUserRef(String alternateUserRef) Alternate reference to the user.voidsetAlternateUserRefType(String alternateUserRefType) Type of the alternative user referencevoidsetAttributes(Map<String, Object> attributes) Map holding any additional attributes passed in the request not matching any defined properties.voidsetAutoRenewalEnabled(boolean autoRenewalEnabled) Whether this subscription automatically renews at the end of the current subscription term.voidsetCancellationPolicyRef(String cancellationPolicyRef) A reference of the CancellationPolicy that governs how this subscription would be cancelled.voidsetChargeback(boolean chargeback) Whether this subscription is being cancelled due to a chargebackvoidsetContextState(com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextState contextState) A subset ofTrackinginformation to expose the context state for this object.voidsetCreatedDate(Date createdDate) Date this subscription was created.voidsetCurrency(javax.money.CurrencyUnit currency) Currency of this subscriptionvoidsetCurrencyCode(String currencyCode) voidsetEndOfTermDate(Instant endOfTermDate) The end of term date for this subscription.voidsetFulfillmentWorkflow(String fulfillmentWorkflow) A reference to the workflow used to fulfill the creation of, & modifications to, this subscription.voidvoidsetInternalAttributes(Map<String, Object> internalAttributes) Miscellaneous internal attributes for this subscription.voidsetLastBillingBatchId(String lastBillingBatchId) The batch id of the last billing job run for this subscriptionvoidsetLastBillingOperationStatus(String lastBillingOperationStatus) The most current status of the last billing event for this subscriptionvoidsetLastBillingSuccessDate(Date lastBillingSuccessDate) Last date this that the Billing Job succeeded billing this subscriptionvoidName of this subscriptionvoidsetNeedGrantEntitlements(boolean needGrantEntitlements) Whether the system has outstanding entitlements to grant on this subscriptionvoidsetNextBillDate(Date nextBillDate) Next date this subscription will be billedvoidsetNextPeriod(Integer nextPeriod) The next period this subscription will cover.voidsetNextStatusChangeDate(Date nextStatusChangeDate) Date when the next status should beginvoidsetNextStatusChangeReason(String nextStatusChangeReason) Reason for the update to the next statusvoidsetNextSubscription(String nextSubscription) If this subscription was upgraded or downgraded, holds the reference to the subscription replacing this onevoidsetPaymentStrategy(String paymentStrategy) Declares that payments made against a subscription are going towards the goods/services rendered in the previous vs current period.voidsetPeriodFrequency(int periodFrequency) The frequency with which the recurring price should be charged., e.g., a value of 1 combined withperiodTypeof MONTH would indicate to a subscription service that the price should be charged every 1 month.voidsetPeriods(List<SubscriptionPeriod> periods) List tracking the Subscription's periods.voidsetPeriodType(String periodType) The period type for the price, e.g.voidsetPreferredPaymentAccountId(String preferredPaymentAccountId) References an identifier of a PaymentAccount that is considered preferred for this subscription.voidsetPriorBillDate(Date priorBillDate) The bill date for the previous periodvoidsetResumeDate(Date resumeDate) Date this subscription will or did continue.voidsetRootItemRef(String rootItemRef) Reference to the item id for which this subscription was provisionvoidsetRootItemRefType(String rootItemRefType) Type of the item for which this subscription was provisionedvoidsetSecondarySourceRef(String secondarySourceRef) The secondary source to reference, e.g, an Order Item on an Order.voidsetSecondarySourceType(String secondarySourceType) The type of the secondary source to reference, e.g, an Order Item on an Order.voidsetSiteIdentifier(String siteIdentifier) Multi-tenancy supportvoidsetStartOfTermDate(Instant startOfTermDate) The start of term date for this subscription.voidsetSubscriptionAdjustments(List<SubscriptionAdjustment> subscriptionAdjustments) Adjustments for this subscription.voidsetSubscriptionNextStatus(String subscriptionNextStatus) Next status for this subscriptionvoidsetSubscriptionSource(String subscriptionSource) This field shows from which process or user action this subscription originated.voidsetSubscriptionSourceRef(String subscriptionSourceRef) This field shows the identifier of the process or user action this subscription originated.voidsetSubscriptionStatus(String subscriptionStatus) Current status of this subscriptionvoidsetTermDurationLength(Integer termDurationLength) The length of the terms, e.g., if this is 36 andtermDurationTypeis MONTHS, then the user should be billed for 36 months.voidsetTermDurationType(String termDurationType) The term duration type, e.g.voidsetUserRef(String userRef) Reference to the user to whom this subscription belongsvoidsetUserRefType(String userRefType) Type of user owning this subscriptionvoidsetVersion(Integer version) The version of this subscription.toString()
-
Constructor Details
-
Subscription
public Subscription()
-
-
Method Details
-
setCurrencyCode
-
addAttribute
Takes in any additional attributes passed in the request not matching any defined properties.- Parameters:
name- Name of the additional attributevalue- Value of the additional attribute
-
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.
-
getId
-
getName
Name of this subscription -
getSubscriptionStatus
Current status of this subscription- See Also:
-
getSubscriptionNextStatus
Next status for this subscription- See Also:
-
getNextStatusChangeDate
Date when the next status should begin- See Also:
-
subscriptionNextStatus
-
getNextStatusChangeReason
Reason for the update to the next status- See Also:
-
subscriptionNextStatus
-
getResumeDate
Date this subscription will or did continue. This is likely to be used only after a subscription was paused or stopped. -
getRootItemRefType
Type of the item for which this subscription was provisioned -
getRootItemRef
Reference to the item id for which this subscription was provision -
getUserRefType
Type of user owning this subscription- See Also:
-
DefaultUserTypes
-
getUserRef
Reference to the user to whom this subscription belongs -
getAlternateUserRefType
Type of the alternative user reference- See Also:
-
DefaultUserTypes
-
getAlternateUserRef
Alternate reference to the user. Useful for third-party authentication system identifiers -
getSubscriptionSource
This field shows from which process or user action this subscription originated.- See Also:
-
subscriptionSourceRefDefaultSubscriptionSourceType
-
getSubscriptionSourceRef
This field shows the identifier of the process or user action this subscription originated.- See Also:
-
subscriptionSource
-
getSecondarySourceType
The type of the secondary source to reference, e.g, an Order Item on an Order. Optional.- See Also:
-
secondarySourceRefDefaultSubscriptionSourceType
-
getSecondarySourceRef
The secondary source to reference, e.g, an Order Item on an Order. Optional.- See Also:
-
secondarySourceType
-
getSiteIdentifier
Multi-tenancy support -
getPeriodFrequency
public int getPeriodFrequency()The frequency with which the recurring price should be charged., e.g., a value of 1 combined withperiodTypeof MONTH would indicate to a subscription service that the price should be charged every 1 month.- See Also:
-
periodType
-
getPeriodType
The period type for the price, e.g. MONTHLY, QUARTERLY, ANNUALLY- See Also:
-
periodFrequency
-
getPaymentStrategy
Declares that payments made against a subscription are going towards the goods/services rendered in the previous vs current period.- See Also:
-
getPriorBillDate
The bill date for the previous period -
getNextBillDate
Next date this subscription will be billed -
getPreferredPaymentAccountId
References an identifier of a PaymentAccount that is considered preferred for this subscription. -
getCurrency
public javax.money.CurrencyUnit getCurrency()Currency of this subscription- Specified by:
getCurrencyin interfacejavax.money.CurrencySupplier
-
getNextSubscription
If this subscription was upgraded or downgraded, holds the reference to the subscription replacing this one -
getLastBillingBatchId
The batch id of the last billing job run for this subscription -
getLastBillingOperationStatus
The most current status of the last billing event for this subscription -
getLastBillingSuccessDate
Last date this that the Billing Job succeeded billing this subscription -
getCreatedDate
Date this subscription was created. This field should not be updated or set by a request. -
isChargeback
public boolean isChargeback()Whether this subscription is being cancelled due to a chargeback -
getNextPeriod
The next period this subscription will cover. This value is related to 'beginPeriod' and 'endPeriod' fields ofSubscriptionAdjustmentandSubscriptionItemAdjustment -
getPeriods
List tracking the Subscription's periods. Typically, this correlates to the set of periods for which a BillingEvent has been created. -
isNeedGrantEntitlements
public boolean isNeedGrantEntitlements()Whether the system has outstanding entitlements to grant on this subscription -
getSubscriptionAdjustments
Adjustments for this subscription. This field is used for creation from an API request and is not persisted with the object -
isAutoRenewalEnabled
public boolean isAutoRenewalEnabled()Whether this subscription automatically renews at the end of the current subscription term. -
getStartOfTermDate
The start of term date for this subscription. -
getEndOfTermDate
The end of term date for this subscription. -
getTermDurationLength
The length of the terms, e.g., if this is 36 andtermDurationTypeis MONTHS, then the user should be billed for 36 months.- See Also:
-
termDurationType
-
getTermDurationType
The term duration type, e.g. DAYS, WEEKS, MONTHS, YEARS.- See Also:
-
termDurationLength
-
getCancellationPolicyRef
A reference of the CancellationPolicy that governs how this subscription would be cancelled. -
getFulfillmentWorkflow
A reference to the workflow used to fulfill the creation of, & modifications to, this subscription. -
getAttributes
Map holding any additional attributes passed in the request not matching any defined properties. -
getInternalAttributes
Miscellaneous internal attributes for this subscription. Distinguished fromgetAttributes()in that this map is used for attributes that assist in the internal working of Broadleaf.- Since:
- Order Operation Service 2.2.0, Release Train 2.3.0
-
getVersion
The version of this subscription. Used for checking if the requested version of the subscription is up-to-date before saving changes. This should never be manually decremented/incremented. -
getContextState
public com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextState getContextState()A subset ofTrackinginformation to expose the context state for this object. -
setId
-
setName
Name of this subscription -
setSubscriptionStatus
Current status of this subscription- See Also:
-
setSubscriptionNextStatus
Next status for this subscription- See Also:
-
setNextStatusChangeDate
Date when the next status should begin- See Also:
-
subscriptionNextStatus
-
setNextStatusChangeReason
Reason for the update to the next status- See Also:
-
subscriptionNextStatus
-
setResumeDate
Date this subscription will or did continue. This is likely to be used only after a subscription was paused or stopped. -
setRootItemRefType
Type of the item for which this subscription was provisioned -
setRootItemRef
Reference to the item id for which this subscription was provision -
setUserRefType
Type of user owning this subscription- See Also:
-
DefaultUserTypes
-
setUserRef
Reference to the user to whom this subscription belongs -
setAlternateUserRefType
Type of the alternative user reference- See Also:
-
DefaultUserTypes
-
setAlternateUserRef
Alternate reference to the user. Useful for third-party authentication system identifiers -
setSubscriptionSource
This field shows from which process or user action this subscription originated.- See Also:
-
subscriptionSourceRefDefaultSubscriptionSourceType
-
setSubscriptionSourceRef
This field shows the identifier of the process or user action this subscription originated.- See Also:
-
subscriptionSource
-
setSecondarySourceType
The type of the secondary source to reference, e.g, an Order Item on an Order. Optional.- See Also:
-
secondarySourceRefDefaultSubscriptionSourceType
-
setSecondarySourceRef
The secondary source to reference, e.g, an Order Item on an Order. Optional.- See Also:
-
secondarySourceType
-
setSiteIdentifier
Multi-tenancy support -
setPeriodFrequency
public void setPeriodFrequency(int periodFrequency) The frequency with which the recurring price should be charged., e.g., a value of 1 combined withperiodTypeof MONTH would indicate to a subscription service that the price should be charged every 1 month.- See Also:
-
periodType
-
setPeriodType
The period type for the price, e.g. MONTHLY, QUARTERLY, ANNUALLY- See Also:
-
periodFrequency
-
setPaymentStrategy
Declares that payments made against a subscription are going towards the goods/services rendered in the previous vs current period.- See Also:
-
setPriorBillDate
The bill date for the previous period -
setNextBillDate
Next date this subscription will be billed -
setPreferredPaymentAccountId
References an identifier of a PaymentAccount that is considered preferred for this subscription. -
setCurrency
public void setCurrency(javax.money.CurrencyUnit currency) Currency of this subscription- Specified by:
setCurrencyin interfacecom.broadleafcommerce.money.CurrencyConsumer
-
setNextSubscription
If this subscription was upgraded or downgraded, holds the reference to the subscription replacing this one -
setLastBillingBatchId
The batch id of the last billing job run for this subscription -
setLastBillingOperationStatus
The most current status of the last billing event for this subscription -
setLastBillingSuccessDate
Last date this that the Billing Job succeeded billing this subscription -
setCreatedDate
Date this subscription was created. This field should not be updated or set by a request. -
setChargeback
public void setChargeback(boolean chargeback) Whether this subscription is being cancelled due to a chargeback -
setNextPeriod
The next period this subscription will cover. This value is related to 'beginPeriod' and 'endPeriod' fields ofSubscriptionAdjustmentandSubscriptionItemAdjustment -
setPeriods
List tracking the Subscription's periods. Typically, this correlates to the set of periods for which a BillingEvent has been created. -
setNeedGrantEntitlements
public void setNeedGrantEntitlements(boolean needGrantEntitlements) Whether the system has outstanding entitlements to grant on this subscription -
setSubscriptionAdjustments
Adjustments for this subscription. This field is used for creation from an API request and is not persisted with the object -
setAutoRenewalEnabled
public void setAutoRenewalEnabled(boolean autoRenewalEnabled) Whether this subscription automatically renews at the end of the current subscription term. -
setStartOfTermDate
The start of term date for this subscription. -
setEndOfTermDate
The end of term date for this subscription. -
setTermDurationLength
The length of the terms, e.g., if this is 36 andtermDurationTypeis MONTHS, then the user should be billed for 36 months.- See Also:
-
termDurationType
-
setTermDurationType
The term duration type, e.g. DAYS, WEEKS, MONTHS, YEARS.- See Also:
-
termDurationLength
-
setCancellationPolicyRef
A reference of the CancellationPolicy that governs how this subscription would be cancelled. -
setFulfillmentWorkflow
A reference to the workflow used to fulfill the creation of, & modifications to, this subscription. -
setAttributes
Map holding any additional attributes passed in the request not matching any defined properties. -
setInternalAttributes
Miscellaneous internal attributes for this subscription. Distinguished fromgetAttributes()in that this map is used for attributes that assist in the internal working of Broadleaf.- Since:
- Order Operation Service 2.2.0, Release Train 2.3.0
-
setVersion
The version of this subscription. Used for checking if the requested version of the subscription is up-to-date before saving changes. This should never be manually decremented/incremented. -
setContextState
public void setContextState(com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextState contextState) A subset ofTrackinginformation to expose the context state for this object. -
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-