feat: add premium management admin commands

This commit is contained in:
Iris System 2025-12-27 15:04:31 +13:00
parent 0a474c43eb
commit 59b9b6f6ec
3 changed files with 93 additions and 0 deletions

View file

@ -26,6 +26,8 @@ public class SystemConfigPatch: PatchObject
public Partial<string?> NameFormat { get; set; }
public Partial<SystemConfig.HidPadFormat> HidListPadding { get; set; }
public Partial<SystemConfig.ProxySwitchAction> ProxySwitch { get; set; }
public Partial<bool> PremiumLifetime { get; set; }
public Partial<Instant?> PremiumUntil { get; set; }
public override Query Apply(Query q) => q.ApplyPatch(wrapper => wrapper
.With("ui_tz", UiTz)
@ -45,6 +47,8 @@ public class SystemConfigPatch: PatchObject
.With("card_show_color_hex", CardShowColorHex)
.With("proxy_switch", ProxySwitch)
.With("name_format", NameFormat)
.With("premium_lifetime", PremiumLifetime)
.With("premium_until", PremiumUntil)
);
public new void AssertIsValid()
@ -118,6 +122,12 @@ public class SystemConfigPatch: PatchObject
if (NameFormat.IsPresent)
o.Add("name_format", NameFormat.Value);
if (PremiumLifetime.IsPresent)
o.Add("premium_lifetime", PremiumLifetime.Value);
if (PremiumUntil.IsPresent)
o.Add("premium_until", PremiumUntil.Value?.FormatExport());
return o;
}