From 75a2fca8bb05d92e3dbb1190c29668647ec00af4 Mon Sep 17 00:00:00 2001 From: gamer147 Date: Fri, 29 May 2026 10:25:03 -0400 Subject: [PATCH] feat(db): StoryDeckEntry presentation table + StoryDeckKind enum Co-Authored-By: Claude Sonnet 4.6 --- SVSim.Database/Enums/StoryDeckKind.cs | 11 ++++++++++ SVSim.Database/Models/StoryDeckEntry.cs | 28 +++++++++++++++++++++++++ SVSim.Database/SVSimDbContext.cs | 1 + 3 files changed, 40 insertions(+) create mode 100644 SVSim.Database/Enums/StoryDeckKind.cs create mode 100644 SVSim.Database/Models/StoryDeckEntry.cs diff --git a/SVSim.Database/Enums/StoryDeckKind.cs b/SVSim.Database/Enums/StoryDeckKind.cs new file mode 100644 index 0000000..b5eef1b --- /dev/null +++ b/SVSim.Database/Enums/StoryDeckKind.cs @@ -0,0 +1,11 @@ +namespace SVSim.Database.Enums; + +/// +/// Which story deck-select group a prebuilt deck belongs to. Build = the named story decks +/// (build_deck_list); Trial = archetype trial decks (trial_deck_list). Stored as int. +/// +public enum StoryDeckKind +{ + Build = 0, + Trial = 1, +} diff --git a/SVSim.Database/Models/StoryDeckEntry.cs b/SVSim.Database/Models/StoryDeckEntry.cs new file mode 100644 index 0000000..c37b1dd --- /dev/null +++ b/SVSim.Database/Models/StoryDeckEntry.cs @@ -0,0 +1,28 @@ +using SVSim.Database.Common; +using SVSim.Database.Enums; + +namespace SVSim.Database.Models; + +/// +/// Presentation metadata for a story-mode prebuilt/trial deck, as surfaced under +/// main_story/get_deck_list's build_deck_list / trial_deck_list. PK (DeckNo) equals the deck's +/// wire deck_no, which also equals BuildDeckProductEntry.Id — the 40-card list is read from that +/// product (single source of truth), NOT stored here. Sourced from +/// data_dumps/traffic_prod_trial_decks.ndjson via seeds/story-decks.json. +/// +public class StoryDeckEntry : BaseEntity +{ + public int DeckNo { get => Id; set => Id = value; } // == BuildDeckProductEntry.Id + + public StoryDeckKind Kind { get; set; } + public int ClassId { get; set; } + public string DeckName { get; set; } = string.Empty; + public int SleeveId { get; set; } + public int LeaderSkinId { get; set; } + public int IsRecommend { get; set; } + public int OrderNum { get; set; } + public int EntryNo { get; set; } + + /// Trial decks carry a deck_format on the wire; build decks do not (null). + public int? DeckFormat { get; set; } +} diff --git a/SVSim.Database/SVSimDbContext.cs b/SVSim.Database/SVSimDbContext.cs index b2e5a7b..2e9502e 100644 --- a/SVSim.Database/SVSimDbContext.cs +++ b/SVSim.Database/SVSimDbContext.cs @@ -70,6 +70,7 @@ public class SVSimDbContext : DbContext public DbSet Packs => Set(); public DbSet BuildDeckSeries => Set(); public DbSet BuildDeckProducts => Set(); + public DbSet StoryDecks => Set(); public DbSet SleeveShopSeries => Set(); public DbSet SleeveShopProducts => Set(); public DbSet ItemPurchaseCatalog => Set();