Files
SVSimServer/SVSim.Bootstrap/Importers/GlobalsImporter.cs
gamer147 d14a0be2c8 refactor(bootstrap): finalize load-index migration; GlobalsImporter is now a stub
Stage 9C of the bootstrap-seed-refactor:

- Add 6 seed DTOs for the card-id-keyed load-index tables (SpotCard,
  ReprintedCard, UnlimitedRestriction, LoadingExclusionCard, MaintenanceCard,
  FeatureMaintenance).
- Add CardListsImporter: idempotent upsert of the 6 tables, sharing one
  Cards FK set for orphan-warning. FeatureMaintenances clear-and-rewrites
  (synthetic ordinal Id; no natural key).
- Add RotationFlagUpdater: reads RotationConfig.RotationCardSetIds from the
  GameConfigs section (populated by RotationConfigImporter) and flips
  CardSet.IsInRotation to match.
- Add RotationConfig.RotationCardSetIds list property + wire it through
  RotationConfigImporter. No migration needed (sections are JSON blobs).
- RotationConfigImporter: use legacy local-kind DateTime parse for schedule
  windows so the JSON round-trip stays byte-equivalent to GlobalsImporter.
- Strip GlobalsImporter down to a no-op stub (Task 10 will delete it).
- Wire all 9 new importers into Program.cs and SVSimTestFactory.SeedGlobalsAsync,
  in the order RotationConfigImporter -> ... -> CardListsImporter -> RotationFlagUpdater.
- Delete prod-captures/load-index-2026-05-23.json.
- Add CardListsImporterTests covering each sub-table, idempotency,
  empty-seed handling, orphan-warning, and the clear-and-rewrite path.

Tests: 391 passing (382 baseline + 9 new).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-26 15:46:36 -04:00

23 lines
886 B
C#

using SVSim.Database;
namespace SVSim.Bootstrap.Importers;
/// <summary>
/// Stub remaining after Stage 9C: the entire load-index → DB pipeline has been replaced by
/// per-domain importers in this folder (RotationConfigImporter, MyRotationImporter,
/// AvatarAbilityImporter, ArenaSeasonImporter, BattlePassImporter, DailyLoginBonusImporter,
/// PreReleaseInfoImporter, CardListsImporter, RotationFlagUpdater). Task 10 will delete this
/// class entirely; until then this stub keeps existing call sites compiling.
/// </summary>
public class GlobalsImporter
{
public Task<int> ImportAllAsync(SVSimDbContext context, string capturesDir)
{
// All work migrated to per-domain importers wired in Program.cs and
// SVSimTestFactory.SeedGlobalsAsync. Intentionally a no-op.
_ = context;
_ = capturesDir;
return Task.FromResult(0);
}
}