[Fix] Entitlements starts_at is nullable (#3034)

* i wonder if it was just as simple as that

* nope

* nope x2

* nope x3
This commit is contained in:
Mihail Gribkov
2024-12-02 01:59:21 +03:00
committed by GitHub
parent 93229f6d2e
commit d5879c861a
3 changed files with 3 additions and 7 deletions

View File

@@ -27,7 +27,7 @@ internal class Entitlement
public Optional<bool> IsConsumed { get; set; }
[JsonProperty("starts_at")]
public Optional<DateTimeOffset> StartsAt { get; set; }
public DateTimeOffset? StartsAt { get; set; }
[JsonProperty("ends_at")]
public Optional<DateTimeOffset?> EndsAt { get; set; }

View File

@@ -56,9 +56,7 @@ public class RestEntitlement : RestEntity<ulong>, IEntitlement
ApplicationId = model.ApplicationId;
Type = model.Type;
IsConsumed = model.IsConsumed.GetValueOrDefault(false);
StartsAt = model.StartsAt.IsSpecified
? model.StartsAt.Value
: null;
StartsAt = model.StartsAt;
EndsAt = model.EndsAt.IsSpecified
? model.EndsAt.Value
: null;

View File

@@ -68,9 +68,7 @@ public class SocketEntitlement : SocketEntity<ulong>, IEntitlement
ApplicationId = model.ApplicationId;
Type = model.Type;
IsConsumed = model.IsConsumed.GetValueOrDefault(false);
StartsAt = model.StartsAt.IsSpecified
? model.StartsAt.Value
: null;
StartsAt = model.StartsAt;
EndsAt = model.EndsAt.IsSpecified
? model.EndsAt.Value
: null;