[Feature] Support for multiple subscription tiers (#3036)
This commit is contained in:
@@ -23,6 +23,11 @@ public interface ISubscription : ISnowflakeEntity
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
IReadOnlyCollection<ulong> EntitlementIds { get; }
|
IReadOnlyCollection<ulong> EntitlementIds { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the SKUs that this user will be subscribed to at renewal.
|
||||||
|
/// </summary>
|
||||||
|
IReadOnlyCollection<ulong> RenewalSKUIds { get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the start of the current subscription period.
|
/// Gets the start of the current subscription period.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -17,6 +17,9 @@ internal class Subscription
|
|||||||
[JsonProperty("entitlement_ids")]
|
[JsonProperty("entitlement_ids")]
|
||||||
public ulong[] EntitlementIds { get; set; }
|
public ulong[] EntitlementIds { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("renewal_sku_ids")]
|
||||||
|
public ulong[] RenewalSKUIds { get; set; }
|
||||||
|
|
||||||
[JsonProperty("current_period_start")]
|
[JsonProperty("current_period_start")]
|
||||||
public DateTimeOffset CurrentPeriodStart { get; set; }
|
public DateTimeOffset CurrentPeriodStart { get; set; }
|
||||||
|
|
||||||
|
|||||||
@@ -21,6 +21,9 @@ public class RestSubscription : RestEntity<ulong>, ISubscription
|
|||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public IReadOnlyCollection<ulong> EntitlementIds { get; private set; }
|
public IReadOnlyCollection<ulong> EntitlementIds { get; private set; }
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public IReadOnlyCollection<ulong> RenewalSKUIds { get; private set; }
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public DateTimeOffset CurrentPeriodStart { get; private set; }
|
public DateTimeOffset CurrentPeriodStart { get; private set; }
|
||||||
|
|
||||||
@@ -52,6 +55,7 @@ public class RestSubscription : RestEntity<ulong>, ISubscription
|
|||||||
UserId = model.UserId;
|
UserId = model.UserId;
|
||||||
SKUIds = model.SKUIds.ToImmutableArray();
|
SKUIds = model.SKUIds.ToImmutableArray();
|
||||||
EntitlementIds = model.EntitlementIds.ToImmutableArray();
|
EntitlementIds = model.EntitlementIds.ToImmutableArray();
|
||||||
|
RenewalSKUIds = model.RenewalSKUIds?.ToImmutableArray() ?? [];
|
||||||
CurrentPeriodStart = model.CurrentPeriodStart;
|
CurrentPeriodStart = model.CurrentPeriodStart;
|
||||||
CurrentPeriodEnd = model.CurrentPeriodEnd;
|
CurrentPeriodEnd = model.CurrentPeriodEnd;
|
||||||
Status = model.Status;
|
Status = model.Status;
|
||||||
|
|||||||
@@ -21,6 +21,9 @@ public class SocketSubscription : SocketEntity<ulong>, ISubscription
|
|||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public IReadOnlyCollection<ulong> EntitlementIds { get; private set; }
|
public IReadOnlyCollection<ulong> EntitlementIds { get; private set; }
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public IReadOnlyCollection<ulong> RenewalSKUIds { get; private set; }
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public DateTimeOffset CurrentPeriodStart { get; private set; }
|
public DateTimeOffset CurrentPeriodStart { get; private set; }
|
||||||
|
|
||||||
@@ -52,6 +55,7 @@ public class SocketSubscription : SocketEntity<ulong>, ISubscription
|
|||||||
UserId = model.UserId;
|
UserId = model.UserId;
|
||||||
SKUIds = model.SKUIds.ToImmutableArray();
|
SKUIds = model.SKUIds.ToImmutableArray();
|
||||||
EntitlementIds = model.EntitlementIds.ToImmutableArray();
|
EntitlementIds = model.EntitlementIds.ToImmutableArray();
|
||||||
|
RenewalSKUIds = model.RenewalSKUIds?.ToImmutableArray() ?? [];
|
||||||
CurrentPeriodStart = model.CurrentPeriodStart;
|
CurrentPeriodStart = model.CurrentPeriodStart;
|
||||||
CurrentPeriodEnd = model.CurrentPeriodEnd;
|
CurrentPeriodEnd = model.CurrentPeriodEnd;
|
||||||
Status = model.Status;
|
Status = model.Status;
|
||||||
|
|||||||
Reference in New Issue
Block a user