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

@@ -25,22 +25,6 @@ public class MyPageGlobalsImporterTests
Assert.That(count, Is.GreaterThan(0), "seed must contain banners");
}
[Test]
public async Task Imports_colosseum_singleton()
{
using var factory = new SVSimTestFactory();
using var scope = factory.Services.CreateScope();
var db = scope.ServiceProvider.GetRequiredService<SVSimDbContext>();
var importer = new MyPageGlobalsImporter();
await importer.ImportColosseumAsync(db, SeedDir);
var row = await db.Colosseums.FirstOrDefaultAsync(e => e.Id == 1);
Assert.That(row, Is.Not.Null);
Assert.That(row!.Id, Is.EqualTo(1));
Assert.That(row.ColosseumId, Is.Not.Empty);
}
[Test]
public async Task Imports_sealed_singleton()
{
@@ -145,14 +129,10 @@ public class MyPageGlobalsImporterTests
var db = scope.ServiceProvider.GetRequiredService<SVSimDbContext>();
var importer = new MyPageGlobalsImporter();
await importer.ImportColosseumAsync(db, SeedDir);
await importer.ImportSealedAsync(db, SeedDir);
await importer.ImportColosseumAsync(db, SeedDir);
await importer.ImportSealedAsync(db, SeedDir);
Assert.That(await db.Colosseums.CountAsync(), Is.EqualTo(1),
"Colosseum singleton must remain a single row on re-run");
Assert.That(await db.SealedSeasons.CountAsync(), Is.EqualTo(1),
"SealedSeason singleton must remain a single row on re-run");
}

View File

@@ -286,7 +286,6 @@ internal class SVSimTestFactory : WebApplicationFactory<Program>
var mypage = new MyPageGlobalsImporter();
await mypage.ImportBannersAsync(ctx, seedDir);
await mypage.ImportColosseumAsync(ctx, seedDir);
await mypage.ImportSealedAsync(ctx, seedDir);
await mypage.ImportMasterPointRankingPeriodAsync(ctx, seedDir);
await mypage.ImportSpecialDeckFormatsAsync(ctx, seedDir);

View File

@@ -151,17 +151,6 @@ public class GlobalsRepositoryTests
Assert.That(banners[0].Click, Is.EqualTo("account_transition_with_two"));
}
[Test]
public async Task GetCurrentColosseum_returns_singleton_with_name()
{
var (factory, repo) = await SetupAsync();
using var _ = factory;
var col = await repo.GetCurrentColosseum();
Assert.That(col, Is.Not.Null);
Assert.That(col!.ColosseumName, Is.EqualTo("Rivenbrandt Take Two Cup"));
Assert.That(col.ColosseumId, Is.EqualTo("165"));
}
[Test]
public async Task GetCurrentSealedSeason_returns_singleton_with_pack_info()
{