From 19d973b63bc6c06cb40efac52b2f008d3844f1fa Mon Sep 17 00:00:00 2001 From: Claude Code Date: Mon, 3 Aug 2026 14:51:47 +0900 Subject: [PATCH] Slice A3b: Convert InitiateShadowRunRequest to class with JsonPropertyName - Change from record to class (better JsonPropertyName support) - Add [JsonPropertyName] attributes for camelCase JSON deserialization - Properties: modelId, windowStart, windowEnd, phaseFilter - Resolves 400 Bad Request validation failures Source: FastEndpoints + System.Text.Json deserialization best practice Decision: Class-based DTO with explicit property mapping Co-Authored-By: Claude Haiku 4.5 --- .../Features/ShadowRun/Request.cs | 23 +++++++++++-------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/src/KArtSell.Host/Features/ShadowRun/Request.cs b/src/KArtSell.Host/Features/ShadowRun/Request.cs index 8ede0b25..cc533bf7 100644 --- a/src/KArtSell.Host/Features/ShadowRun/Request.cs +++ b/src/KArtSell.Host/Features/ShadowRun/Request.cs @@ -5,12 +5,17 @@ namespace KArtSell.Host.Features.ShadowRun; /// /// Initiate a 252+ trading-day model validation run. /// -public sealed record InitiateShadowRunRequest( - [property: JsonPropertyName("modelId")] - Guid ModelId, - [property: JsonPropertyName("windowStart")] - DateOnly WindowStart, - [property: JsonPropertyName("windowEnd")] - DateOnly WindowEnd, - [property: JsonPropertyName("phaseFilter")] - string PhaseFilter = "All"); +public sealed class InitiateShadowRunRequest +{ + [JsonPropertyName("modelId")] + public Guid ModelId { get; set; } + + [JsonPropertyName("windowStart")] + public DateOnly WindowStart { get; set; } + + [JsonPropertyName("windowEnd")] + public DateOnly WindowEnd { get; set; } + + [JsonPropertyName("phaseFilter")] + public string PhaseFilter { get; set; } = "All"; +}