mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-04 21:16:49 +00:00
feat: premium ID changes
Some checks failed
Build and push Docker image / .net docker build (push) Has been cancelled
.net checks / run .net tests (push) Has been cancelled
.net checks / dotnet-format (push) Has been cancelled
Build and push Rust service Docker images / rust docker build (push) Has been cancelled
rust checks / cargo fmt (push) Has been cancelled
Some checks failed
Build and push Docker image / .net docker build (push) Has been cancelled
.net checks / run .net tests (push) Has been cancelled
.net checks / dotnet-format (push) Has been cancelled
Build and push Rust service Docker images / rust docker build (push) Has been cancelled
rust checks / cargo fmt (push) Has been cancelled
This commit is contained in:
parent
41f8beb2aa
commit
24b6b0d455
16 changed files with 306 additions and 3 deletions
15
PluralKit.Core/Models/HidChangelog.cs
Normal file
15
PluralKit.Core/Models/HidChangelog.cs
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
using Newtonsoft.Json.Linq;
|
||||
using NodaTime;
|
||||
|
||||
namespace PluralKit.Core;
|
||||
|
||||
public class HidChangelog
|
||||
{
|
||||
public int Id { get; }
|
||||
public SystemId System { get; }
|
||||
public ulong DiscordUid { get; }
|
||||
public string HidType { get; }
|
||||
public string HidOld { get; }
|
||||
public string HidNew { get; }
|
||||
public Instant Created { get; }
|
||||
}
|
||||
|
|
@ -28,6 +28,7 @@ public class SystemConfigPatch: PatchObject
|
|||
public Partial<SystemConfig.ProxySwitchAction> ProxySwitch { get; set; }
|
||||
public Partial<bool> PremiumLifetime { get; set; }
|
||||
public Partial<Instant?> PremiumUntil { get; set; }
|
||||
public Partial<int?> PremiumIdChangesRemaining { get; set; }
|
||||
|
||||
public override Query Apply(Query q) => q.ApplyPatch(wrapper => wrapper
|
||||
.With("ui_tz", UiTz)
|
||||
|
|
@ -49,6 +50,7 @@ public class SystemConfigPatch: PatchObject
|
|||
.With("name_format", NameFormat)
|
||||
.With("premium_lifetime", PremiumLifetime)
|
||||
.With("premium_until", PremiumUntil)
|
||||
.With("premium_id_changes_remaining", PremiumIdChangesRemaining)
|
||||
);
|
||||
|
||||
public new void AssertIsValid()
|
||||
|
|
@ -128,6 +130,9 @@ public class SystemConfigPatch: PatchObject
|
|||
if (PremiumUntil.IsPresent)
|
||||
o.Add("premium_until", PremiumUntil.Value?.FormatExport());
|
||||
|
||||
if (PremiumIdChangesRemaining.IsPresent)
|
||||
o.Add("premium_id_changes_remaining", PremiumIdChangesRemaining.Value);
|
||||
|
||||
return o;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ public class SystemConfig
|
|||
|
||||
public bool PremiumLifetime { get; }
|
||||
public Instant? PremiumUntil { get; }
|
||||
public int? PremiumIdChangesRemaining { get; }
|
||||
|
||||
public enum HidPadFormat
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue