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>
This commit is contained in:
gamer147
2026-05-26 15:46:36 -04:00
parent 87d0001569
commit d14a0be2c8
15 changed files with 550 additions and 15057 deletions

View File

@@ -1,7 +1,8 @@
namespace SVSim.Database.Models.Config;
/// <summary>
/// Time-varying season/rotation state, populated by GlobalsImporter from prod captures.
/// Time-varying season/rotation state, populated by RotationConfigImporter from seed files.
/// <see cref="RotationCardSetIds"/> drives <c>CardSet.IsInRotation</c> via RotationFlagUpdater.
/// </summary>
[ConfigSection("Rotation")]
public class RotationConfig
@@ -10,6 +11,7 @@ public class RotationConfig
public bool IsBattlePassPeriod { get; set; }
public bool IsBeginnerMission { get; set; }
public int CardSetIdForResourceDlView { get; set; }
public List<int> RotationCardSetIds { get; set; } = new();
public static RotationConfig ShippedDefaults() => new();
}