refactor(arena-colosseum): dedup colosseum_info source-of-truth

/mypage/index data.colosseum_info and /arena_colosseum/{top,get_fee_info}
now both project through ColosseumLobbyInfoBuilder.Build(ColosseumSeasonConfig).
One source of truth for the home-tab gating and the lobby reads — admins
flip the season on by writing to GameConfigs (per the runbook), no second
table to keep in sync.

* New ColosseumLobbyInfoBuilder — static projection from ColosseumSeasonConfig
  to the wire ColosseumLobbyInfo. Replaces ArenaColosseumController's private
  BuildColosseumInfo and MyPageController's BuildColosseumInfo(ColosseumConfig).
* MyPageController reads ColosseumSeasonConfig via IGameConfigService; the
  IGlobalsRepository.GetCurrentColosseum() call goes away.
* MyPageIndexResponse.ColosseumInfo retyped to the new ColosseumLobbyInfo.
* ColosseumSalesPeriodInfo relocated into the ArenaColosseum namespace
  alongside the rest of the family DTOs.
* Drops: Colosseums DB table (migration DropColosseumsTable), ColosseumConfig
  entity, the captured-shape Models.Dtos.ColosseumInfo DTO, ColosseumSeed,
  MyPageGlobalsImporter.ImportColosseumAsync + seed file colosseum.json,
  IGlobalsRepository.GetCurrentColosseum + impl, the two related tests.

Net: home-screen Grand Prix tab now hidden by default because the season
ships with IsColosseumPeriod=false. Full suite: 1345/1345 (was 1347 — the
2 dropped tests covered the now-dead surface).
This commit is contained in:
gamer147
2026-06-13 13:31:03 -04:00
parent 114e3da81f
commit 43a3665775
22 changed files with 4924 additions and 413 deletions

View File

@@ -1,20 +0,0 @@
{
"id": 1,
"colosseum_id": "165",
"colosseum_name": "Rivenbrandt Take Two Cup",
"card_pool_name": "Take Two (DragonbladeRivenbrandt)",
"deck_format": "3",
"start_time": "2026-05-21 06:00:00",
"end_time": "2026-05-25 19:59:59",
"now_round": "1",
"is_display_tips": "0",
"tips_id": "0",
"is_colosseum_period": true,
"is_round_period": true,
"is_normal_two_pick": "1",
"is_special_mode": "10",
"is_all_card_enabled": 0,
"sales_period_info": {
"sales_period_time": "2026-05-25 19:59:59"
}
}

View File

@@ -81,42 +81,6 @@ public class MyPageGlobalsImporter
return seed.Count;
}
public async Task<int> ImportColosseumAsync(SVSimDbContext context, string seedDir)
{
var s = SeedLoader.LoadObject<ColosseumSeed>(Path.Combine(seedDir, "colosseum.json"));
if (s is null)
{
Console.WriteLine("[MyPageGlobalsImporter] No colosseum seed; skipping.");
return 0;
}
var existing = await context.Colosseums.FirstOrDefaultAsync(e => e.Id == 1);
var entry = existing ?? new ColosseumConfig { Id = 1 };
entry.ColosseumId = s.ColosseumId;
entry.ColosseumName = s.ColosseumName;
entry.CardPoolName = s.CardPoolName;
entry.DeckFormat = s.DeckFormat;
entry.StartTime = ImporterBase.ParseWireDateTime(s.StartTime);
entry.EndTime = ImporterBase.ParseWireDateTime(s.EndTime);
entry.NowRound = s.NowRound;
entry.IsDisplayTips = s.IsDisplayTips;
entry.TipsId = s.TipsId;
entry.IsColosseumPeriod = s.IsColosseumPeriod;
entry.IsRoundPeriod = s.IsRoundPeriod;
entry.IsNormalTwoPick = s.IsNormalTwoPick;
entry.IsSpecialMode = s.IsSpecialMode;
entry.IsAllCardEnabled = s.IsAllCardEnabled;
entry.SalesPeriodInfo = s.SalesPeriodInfo.ValueKind == JsonValueKind.Undefined
? "{}"
: JsonSerializer.Serialize(s.SalesPeriodInfo);
if (existing is null) context.Colosseums.Add(entry);
await context.SaveChangesAsync();
Console.WriteLine($"[MyPageGlobalsImporter] Colosseum: {(existing is null ? "+1" : "~1")}");
return 1;
}
public async Task<int> ImportSealedAsync(SVSimDbContext context, string seedDir)
{
var s = SeedLoader.LoadObject<SealedSeasonSeed>(Path.Combine(seedDir, "sealed-season.json"));

View File

@@ -1,24 +0,0 @@
using System.Text.Json;
using System.Text.Json.Serialization;
namespace SVSim.Bootstrap.Models.Seed;
public sealed class ColosseumSeed
{
[JsonPropertyName("id")] public int Id { get; set; } = 1;
[JsonPropertyName("colosseum_id")] public string ColosseumId { get; set; } = "";
[JsonPropertyName("colosseum_name")] public string ColosseumName { get; set; } = "";
[JsonPropertyName("card_pool_name")] public string CardPoolName { get; set; } = "";
[JsonPropertyName("deck_format")] public string DeckFormat { get; set; } = "";
[JsonPropertyName("start_time")] public string StartTime { get; set; } = "";
[JsonPropertyName("end_time")] public string EndTime { get; set; } = "";
[JsonPropertyName("now_round")] public string NowRound { get; set; } = "";
[JsonPropertyName("is_display_tips")] public string IsDisplayTips { get; set; } = "";
[JsonPropertyName("tips_id")] public string TipsId { get; set; } = "";
[JsonPropertyName("is_colosseum_period")] public bool IsColosseumPeriod { get; set; }
[JsonPropertyName("is_round_period")] public bool IsRoundPeriod { get; set; }
[JsonPropertyName("is_normal_two_pick")] public string IsNormalTwoPick { get; set; } = "";
[JsonPropertyName("is_special_mode")] public string IsSpecialMode { get; set; } = "";
[JsonPropertyName("is_all_card_enabled")] public int IsAllCardEnabled { get; set; }
[JsonPropertyName("sales_period_info")] public JsonElement SalesPeriodInfo { get; set; }
}

View File

@@ -114,7 +114,6 @@ public static class Program
var mypage = new MyPageGlobalsImporter();
await mypage.ImportBannersAsync(context, opts.SeedDir);
await mypage.ImportColosseumAsync(context, opts.SeedDir);
await mypage.ImportSealedAsync(context, opts.SeedDir);
await mypage.ImportMasterPointRankingPeriodAsync(context, opts.SeedDir);
await mypage.ImportSpecialDeckFormatsAsync(context, opts.SeedDir);