From 0f927a3dd1d63c740587fc00960e32ec8b58c17b Mon Sep 17 00:00:00 2001 From: Toastie Date: Wed, 26 Jun 2024 21:01:23 +1200 Subject: [PATCH] Updated Db files --- src/EllieBot/Db/EllieContext.cs | 12 -------- .../Db/Models/anti/AntiRaidSetting.cs | 1 - src/EllieBot/Db/Models/support/PatronQuota.cs | 30 ++----------------- 3 files changed, 3 insertions(+), 40 deletions(-) diff --git a/src/EllieBot/Db/EllieContext.cs b/src/EllieBot/Db/EllieContext.cs index 263963b..2ca114e 100644 --- a/src/EllieBot/Db/EllieContext.cs +++ b/src/EllieBot/Db/EllieContext.cs @@ -53,8 +53,6 @@ public abstract class EllieContext : DbContext public DbSet Patrons { get; set; } - public DbSet PatronQuotas { get; set; } - public DbSet StreamOnlineMessages { get; set; } public DbSet StickyRoles { get; set; } @@ -597,16 +595,6 @@ public abstract class EllieContext : DbContext }); // quotes are per user id - modelBuilder.Entity(pq => - { - pq.HasIndex(x => x.UserId).IsUnique(false); - pq.HasKey(x => new - { - x.UserId, - x.FeatureType, - x.Feature - }); - }); #endregion diff --git a/src/EllieBot/Db/Models/anti/AntiRaidSetting.cs b/src/EllieBot/Db/Models/anti/AntiRaidSetting.cs index b5e5f67..351d194 100644 --- a/src/EllieBot/Db/Models/anti/AntiRaidSetting.cs +++ b/src/EllieBot/Db/Models/anti/AntiRaidSetting.cs @@ -3,7 +3,6 @@ using System.ComponentModel.DataAnnotations.Schema; namespace EllieBot.Db.Models; - public class AntiRaidSetting : DbEntity { public int GuildConfigId { get; set; } diff --git a/src/EllieBot/Db/Models/support/PatronQuota.cs b/src/EllieBot/Db/Models/support/PatronQuota.cs index 1ebd2fd..688d005 100644 --- a/src/EllieBot/Db/Models/support/PatronQuota.cs +++ b/src/EllieBot/Db/Models/support/PatronQuota.cs @@ -1,41 +1,17 @@ #nullable disable namespace EllieBot.Db.Models; -/// -/// Contains data about usage of Patron-Only commands per user -/// in order to provide support for quota limitations -/// (allow user x who is pledging amount y to use the specified command only -/// x amount of times in the specified time period) -/// -public class PatronQuota -{ - public ulong UserId { get; set; } - public FeatureType FeatureType { get; set; } - public string Feature { get; set; } - public uint HourlyCount { get; set; } - public uint DailyCount { get; set; } - public uint MonthlyCount { get; set; } -} - -public enum FeatureType -{ - Command, - Group, - Module, - Limit -} - public class PatronUser { public string UniquePlatformUserId { get; set; } public ulong UserId { get; set; } public int AmountCents { get; set; } - + public DateTime LastCharge { get; set; } - + // Date Only component public DateTime ValidThru { get; set; } - + public PatronUser Clone() => new PatronUser() {