From bdf273c8e15266cfb49078f73eeba79cc53ca8da Mon Sep 17 00:00:00 2001 From: TekH Date: Wed, 15 Apr 2026 12:57:13 +0200 Subject: [PATCH] Add support for references in InvokeRecAction commands Introduced the InvokeReferencesDto record to encapsulate up to five optional reference strings. Updated InvokeRecActionViewCommand to include an optional References property. Modified InvokeRecActionViewCommandHandler to pass these references to InsertResultCommand, ensuring reference data is associated with command execution and results. --- .../Commands/InvokeRecActionViewCommand.cs | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/ReC.Application/RecActions/Commands/InvokeRecActionViewCommand.cs b/src/ReC.Application/RecActions/Commands/InvokeRecActionViewCommand.cs index e58cf35..bea24e6 100644 --- a/src/ReC.Application/RecActions/Commands/InvokeRecActionViewCommand.cs +++ b/src/ReC.Application/RecActions/Commands/InvokeRecActionViewCommand.cs @@ -18,6 +18,16 @@ namespace ReC.Application.RecActions.Commands; public record InvokeRecActionViewCommand : IRequest { public RecActionViewDto Action { get; set; } = null!; + public InvokeReferencesDto? References { get; set; } +} + +public record InvokeReferencesDto +{ + public string? Reference1 { get; init; } + public string? Reference2 { get; init; } + public string? Reference3 { get; init; } + public string? Reference4 { get; init; } + public string? Reference5 { get; init; } } public class InvokeRecActionViewCommandHandler( @@ -150,7 +160,8 @@ public class InvokeRecActionViewCommandHandler( Header = JsonSerializer.Serialize(resHeaders, options: new() { WriteIndented = false }), Body = resBody, Info = (short)response.StatusCode, - Type = ResultType.Main + Type = ResultType.Main, + References = request.References }, cancel); } catch(Exception ex) @@ -160,7 +171,8 @@ public class InvokeRecActionViewCommandHandler( Status = RecStatus.Error, ActionId = action.Id, Error = ex.ToString(), - Type = ResultType.Main + Type = ResultType.Main, + References = request.References }, cancel); if (action.ErrorAction == ErrorAction.Stop)