Files
SVSimServer/SVSim.Bootstrap/Models/Seed/RotationConfigSeed.cs
gamer147 87d0001569 refactor(bootstrap): add 7 load-index importers (excluding card lists)
Stage 9B of the bootstrap-seed-refactor: add per-domain importer classes
that consume the load-index seed split produced in Stage 9A.

New importers (each in its own file under SVSim.Bootstrap/Importers/):
- RotationConfigImporter: writes Rotation/Challenge/MyRotationSchedule
  GameConfig sections (atomic UpsertSection<T> pattern, copied private-static
  from GlobalsImporter so this importer stands alone post-9C).
- MyRotationImporter: settings + abilities (extractor pre-joins on rotation_id).
- AvatarAbilityImporter: per-leader_skin_id ability rows.
- ArenaSeasonImporter: singleton (Id=1) Take Two arena season.
- BattlePassImporter: per-level reward blobs.
- DailyLoginBonusImporter: per-bonus-id campaign blobs.
- PreReleaseInfoImporter: singleton (Id=1) pre-release window.

Seed DTOs under SVSim.Bootstrap/Models/Seed/ mirror the seed JSON via
[JsonPropertyName] snake_case. Raw-JSON columns (reward_data, format_info,
etc.) use JsonElement on the seed and JsonSerializer.Serialize in the
importer.

Tests: 7 new happy-path tests in LoadIndexImporterTests.cs (idempotency
covered by BattlePass spot-check). Full suite: 382/382 passing (375 + 7).

NOT modifying in this stage: GlobalsImporter.cs (Stage 9C strips the old
methods), Program.cs (Stage 9C wires up all 9 importers), SVSimTestFactory
(Stage 9C). Double-writing on bootstrap is expected and OK during 9B.
2026-05-26 15:29:57 -04:00

42 lines
1.9 KiB
C#

using System.Text.Json.Serialization;
namespace SVSim.Bootstrap.Models.Seed;
/// <summary>
/// Mirrors <c>seeds/rotation-config.json</c>. Drives the Rotation <c>GameConfigSection</c>.
/// Note: <c>rotation_card_set_ids</c> is the rotation CardSet flag list — consumed by
/// RotationFlagUpdater in Stage 9C, not by RotationConfigImporter.
/// </summary>
public sealed class RotationConfigSeed
{
[JsonPropertyName("ts_rotation_id")] public string TsRotationId { get; set; } = "";
[JsonPropertyName("is_battle_pass_period")] public bool IsBattlePassPeriod { get; set; }
[JsonPropertyName("is_beginner_mission")] public bool IsBeginnerMission { get; set; }
[JsonPropertyName("card_set_id_for_resource_dl_view")] public int CardSetIdForResourceDlView { get; set; }
[JsonPropertyName("rotation_card_set_ids")] public List<int> RotationCardSetIds { get; set; } = new();
}
/// <summary>Mirrors <c>seeds/challenge-config.json</c>. Drives the Challenge <c>GameConfigSection</c>.</summary>
public sealed class ChallengeConfigSeed
{
[JsonPropertyName("use_two_pick_premium_card")] public bool UseTwoPickPremiumCard { get; set; }
[JsonPropertyName("two_pick_sleeve_id")] public long TwoPickSleeveId { get; set; }
}
/// <summary>
/// Mirrors <c>seeds/my-rotation-schedule.json</c>. Drives the MyRotationSchedule
/// <c>GameConfigSection</c>. The extractor pre-joins <c>gathering</c> and <c>free_battle</c>
/// from <c>my_rotation_info.schedules</c> into two top-level fields.
/// </summary>
public sealed class MyRotationScheduleSeed
{
[JsonPropertyName("gathering")] public ScheduleWindowSeed? Gathering { get; set; }
[JsonPropertyName("free_battle")] public ScheduleWindowSeed? FreeBattle { get; set; }
}
public sealed class ScheduleWindowSeed
{
[JsonPropertyName("begin")] public string Begin { get; set; } = "";
[JsonPropertyName("end")] public string End { get; set; } = "";
}