Store data as JSON in a {mandator}/{year} layout, with startup migration #2

Merged
clayschaad merged 3 commits from json-storage into main 2026-10-22 12:00:17 +00:00
2 changed files with 4 additions and 5 deletions
Showing only changes of commit acf6753d07 - Show all commits

View file

@ -15,7 +15,6 @@ namespace Schaad.Accounting.Repositories
// Human readable: indented, and umlauts/quotes written as-is instead of \u escapes.
WriteIndented = true,
Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping,
PropertyNamingPolicy = JsonNamingPolicy.CamelCase,
PropertyNameCaseInsensitive = true,
DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
};

View file

@ -92,10 +92,10 @@ public class XmlToJsonMigratorTestShould : IDisposable
await sut.MigrateAsync(dataPath);
var json = File.ReadAllText(Path.Combine(dataDir, "Transactions.json"));
json.ShouldContain("\"text\": \"Gebäudeversicherung\"");
json.ShouldContain("\n \"id\": \"t1\"");
json.ShouldNotContain("\"fxRate\": null");
json.ShouldNotContain("readOnly");
json.ShouldContain("\"Text\": \"Gebäudeversicherung\"", Case.Sensitive);
json.ShouldContain("\n \"Id\": \"t1\"", Case.Sensitive);
json.ShouldNotContain("FxRate\": null", Case.Insensitive);
json.ShouldNotContain("ReadOnly", Case.Insensitive);
}
[Fact]