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