From da1b05347e014224a6e06d8bc838c4449f64811c Mon Sep 17 00:00:00 2001 From: TekH Date: Fri, 12 Dec 2025 01:32:09 +0100 Subject: [PATCH] Add Status and Message to CreateOutResCommand CreateOutResCommand now includes optional Status and Message properties to capture additional result details. The HTTP response status code is recorded in Status when creating an output result in InvokeRecActionCommandHandler. --- .../OutResults/Commands/CreateOutResCommand.cs | 4 ++++ .../RecActions/Commands/InvokeRecActionCommand.cs | 3 +++ 2 files changed, 7 insertions(+) diff --git a/src/ReC.Application/OutResults/Commands/CreateOutResCommand.cs b/src/ReC.Application/OutResults/Commands/CreateOutResCommand.cs index 034bafd..73de95e 100644 --- a/src/ReC.Application/OutResults/Commands/CreateOutResCommand.cs +++ b/src/ReC.Application/OutResults/Commands/CreateOutResCommand.cs @@ -8,6 +8,10 @@ public class CreateOutResCommand : IRequest { public required long ActionId { get; set; } + public short? Status { get; set; } + + public string? Message { get; set; } + public string? Header { get; set; } public string? Body { get; set; } diff --git a/src/ReC.Application/RecActions/Commands/InvokeRecActionCommand.cs b/src/ReC.Application/RecActions/Commands/InvokeRecActionCommand.cs index 7b1934f..98b9b06 100644 --- a/src/ReC.Application/RecActions/Commands/InvokeRecActionCommand.cs +++ b/src/ReC.Application/RecActions/Commands/InvokeRecActionCommand.cs @@ -54,8 +54,11 @@ public class InvokeRecActionCommandHandler( var resBody = await response.Content.ReadAsStringAsync(cancel); var resHeaders = response.Headers.ToDictionary(); + var statusCode = (short)response.StatusCode; + await sender.Send(new CreateOutResCommand { + Status = statusCode, ActionId = action.Id, Header = JsonSerializer.Serialize(resHeaders, options: new() { WriteIndented = false }), Body = resBody,