feat(packs): add PackDraw* tables and IsEnabled column

Three new EF entities and a migration:
- PackDrawConfigEntry (per-pack: animation rate, has-bonus flag, special-kind label)
- PackDrawSlotRateEntry (pack/slot/tier -> rate, unique index)
- PackDrawCardWeightEntry (per-card-rate facts incl rate-less rows)

DrawSlot {General, Eighth, Bonus} and DrawTier {Bronze, Silver, Gold, Legendary, Special}.
Special collapses leader_card and limited_time_leader (verified mutually exclusive per pack).

IsEnabled column on PackConfigEntry — admin gate for synthesized stubs, distinct from
the wire-mirror IsHide.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
gamer147
2026-05-30 21:40:50 -04:00
parent f754ef1ad3
commit b78d7d6cbe
10 changed files with 4247 additions and 0 deletions

View File

@@ -68,6 +68,9 @@ public class SVSimDbContext : DbContext
public DbSet<SpecialDeckFormatEntry> SpecialDeckFormats => Set<SpecialDeckFormatEntry>();
public DbSet<PaymentItemEntry> PaymentItems => Set<PaymentItemEntry>();
public DbSet<PackConfigEntry> Packs => Set<PackConfigEntry>();
public DbSet<PackDrawConfigEntry> PackDrawConfigs => Set<PackDrawConfigEntry>();
public DbSet<PackDrawSlotRateEntry> PackDrawSlotRates => Set<PackDrawSlotRateEntry>();
public DbSet<PackDrawCardWeightEntry> PackDrawCardWeights => Set<PackDrawCardWeightEntry>();
public DbSet<BuildDeckSeriesEntry> BuildDeckSeries => Set<BuildDeckSeriesEntry>();
public DbSet<BuildDeckProductEntry> BuildDeckProducts => Set<BuildDeckProductEntry>();
public DbSet<StoryDeckEntry> StoryDecks => Set<StoryDeckEntry>();
@@ -146,6 +149,15 @@ public class SVSimDbContext : DbContext
modelBuilder.Entity<PackConfigEntry>().OwnsMany(p => p.ChildGachas);
modelBuilder.Entity<PackConfigEntry>().OwnsMany(p => p.Banners);
modelBuilder.Entity<PackDrawSlotRateEntry>(e =>
{
e.HasIndex(x => new { x.PackId, x.Slot, x.Tier }).IsUnique();
});
modelBuilder.Entity<PackDrawCardWeightEntry>(e =>
{
e.HasIndex(x => new { x.PackId, x.Slot, x.Tier });
});
modelBuilder.Entity<Viewer>().OwnsMany(v => v.PackOpenCounts);
// OwnedCardEntry and OwnedItemEntry use composite PK (ViewerId, Id) where Id is auto-