refactor(bootstrap): migrate basic puzzles to seed files
Replaces GlobalsImporter's ImportPuzzleGroups/Puzzles/Missions methods (plus the DeriveTargetPuzzleGroupId regex helper) with a dedicated PuzzleImporter that reads three flat seed JSONs (puzzle-groups, puzzles, puzzle-missions) produced by the Python extractor. Groups run before puzzles to satisfy the FK; missions upsert by sequential id. Wired into Program.cs and SVSimTestFactory after PaymentItemImporter so existing GlobalsImporterPuzzleTests continue to pass unchanged via SeedGlobalsAsync. The original prod-capture JSONs are deleted now that the seeds are authoritative. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
14
SVSim.Bootstrap/Models/Seed/PuzzleGroupSeed.cs
Normal file
14
SVSim.Bootstrap/Models/Seed/PuzzleGroupSeed.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace SVSim.Bootstrap.Models.Seed;
|
||||
|
||||
public sealed class PuzzleGroupSeed
|
||||
{
|
||||
[JsonPropertyName("id")] public int Id { get; set; }
|
||||
[JsonPropertyName("basic_title_text_id")] public string BasicTitleTextId { get; set; } = "";
|
||||
[JsonPropertyName("puzzle_chara_id")] public int PuzzleCharaId { get; set; }
|
||||
[JsonPropertyName("chara_id")] public int CharaId { get; set; }
|
||||
[JsonPropertyName("sort_type")] public int SortType { get; set; }
|
||||
[JsonPropertyName("difficulty_name_list")] public JsonElement DifficultyNameList { get; set; }
|
||||
}
|
||||
17
SVSim.Bootstrap/Models/Seed/PuzzleMissionSeed.cs
Normal file
17
SVSim.Bootstrap/Models/Seed/PuzzleMissionSeed.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace SVSim.Bootstrap.Models.Seed;
|
||||
|
||||
public sealed class PuzzleMissionSeed
|
||||
{
|
||||
[JsonPropertyName("id")] public int Id { get; set; }
|
||||
[JsonPropertyName("mission_name")] public string MissionName { get; set; } = "";
|
||||
[JsonPropertyName("achieved_message")] public string AchievedMessage { get; set; } = "";
|
||||
[JsonPropertyName("require_number")] public int RequireNumber { get; set; }
|
||||
[JsonPropertyName("campaign_commence_time")] public long CampaignCommenceTime { get; set; }
|
||||
[JsonPropertyName("order_id")] public int OrderId { get; set; }
|
||||
[JsonPropertyName("reward_type")] public int RewardType { get; set; }
|
||||
[JsonPropertyName("reward_detail_id")] public long RewardDetailId { get; set; }
|
||||
[JsonPropertyName("reward_number")] public int RewardNumber { get; set; }
|
||||
[JsonPropertyName("target_puzzle_group_id")] public int? TargetPuzzleGroupId { get; set; }
|
||||
}
|
||||
13
SVSim.Bootstrap/Models/Seed/PuzzleSeed.cs
Normal file
13
SVSim.Bootstrap/Models/Seed/PuzzleSeed.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace SVSim.Bootstrap.Models.Seed;
|
||||
|
||||
public sealed class PuzzleSeed
|
||||
{
|
||||
[JsonPropertyName("id")] public int Id { get; set; }
|
||||
[JsonPropertyName("group_id")] public int GroupId { get; set; }
|
||||
[JsonPropertyName("puzzle_difficulty")] public int PuzzleDifficulty { get; set; }
|
||||
[JsonPropertyName("is_additional")] public bool IsAdditional { get; set; }
|
||||
[JsonPropertyName("is_playable")] public bool IsPlayable { get; set; }
|
||||
[JsonPropertyName("release_condition_text_id")] public string ReleaseConditionTextId { get; set; } = "";
|
||||
}
|
||||
Reference in New Issue
Block a user