Deck list work

This commit is contained in:
gamer147
2026-05-23 19:57:34 -04:00
parent 66184b3685
commit d3b2970e11
41 changed files with 70683 additions and 81 deletions

View File

@@ -0,0 +1,26 @@
using System.Text.Json;
using System.Text.Json.Serialization;
namespace SVSim.EmulatedEntrypoint.Infrastructure;
/// <summary>
/// Shared System.Text.Json options for deserializing jsonb-passthrough columns into typed DTOs.
///
/// The prod-captured globals JSON was seeded with snake_case_lower keys (see SVSim.Bootstrap
/// GlobalsImporter — jsonb columns store the original capture verbatim). Deserialize-back must
/// use the same naming policy so e.g. `card_pool_name` maps onto `CardPoolName`.
///
/// AllowReadingFromString handles prod's PHP-backend convention of emitting numeric values
/// as JSON strings (e.g. `"ability_id": "1"`). Numeric-typed DTO properties accept those.
///
/// Used by LoadController and MyPageController (and any other controller that reads jsonb).
/// </summary>
public static class JsonbReadOptions
{
public static readonly JsonSerializerOptions Instance = new()
{
PropertyNamingPolicy = JsonNamingPolicy.SnakeCaseLower,
PropertyNameCaseInsensitive = false,
NumberHandling = JsonNumberHandling.AllowReadingFromString,
};
}