Final cleanup of the bootstrap-seed refactor (Task 10 of 10): - Delete the GlobalsImporter no-op stub and its two remaining call sites (Program.cs and SVSimTestFactory.cs). All work has moved to per-domain importers since Task 9. - Drop the --captures CLI flag and CapturesDir / shippedCaptures plumbing from Program.cs (BootstrapOptions, ParseArgs, PrintUsage). Bootstrap input is now cards.json + reference CSVs + per-table seed JSON; no more prod-captures directory. - Shrink ImporterBase from 141 to 23 lines: LoadCapture, Serialize, Upsert<T,TKey>, GetInt/GetString/GetBool/GetLong/GetULong all had zero callers after the seed migration. Only ParseWireDateTime survives (still used by PaymentItemImporter and MyPageGlobalsImporter for prod-shaped timestamp strings). - Remove the prod-captures Content Include glob from SVSim.Bootstrap.csproj and both prod-captures globs (production + test-fixture overlay) from SVSim.UnitTests.csproj. Test fixtures now overlay production seeds at Data/seeds/ via the Task 7 layout exclusively. Build clean; 391/391 unit tests passing. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
24 lines
1018 B
C#
24 lines
1018 B
C#
namespace SVSim.Bootstrap.Importers;
|
|
|
|
/// <summary>
|
|
/// Tiny shared helper for content importers. Capture parsing has moved out of the bootstrap
|
|
/// project entirely (extractors under <c>data_dumps/extract/</c> emit per-table seed JSON);
|
|
/// only the wire-date normaliser stays here because several seed-driven importers still need
|
|
/// to canonicalise prod-shaped timestamp strings.
|
|
/// </summary>
|
|
public static class ImporterBase
|
|
{
|
|
/// <summary>Parse a wire date that may be ISO ("2026-05-23T..."), space-separated ("2026-05-23 16:32:31"), or empty.</summary>
|
|
public static DateTime ParseWireDateTime(string? s)
|
|
{
|
|
if (string.IsNullOrWhiteSpace(s)) return DateTime.MinValue;
|
|
if (DateTime.TryParse(s, System.Globalization.CultureInfo.InvariantCulture,
|
|
System.Globalization.DateTimeStyles.AssumeUniversal | System.Globalization.DateTimeStyles.AdjustToUniversal,
|
|
out var dt))
|
|
{
|
|
return dt;
|
|
}
|
|
return DateTime.MinValue;
|
|
}
|
|
}
|