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.
This commit is contained in:
2026-04-15 12:57:13 +02:00
parent ba8ab28b03
commit bdf273c8e1

View File

@@ -18,6 +18,16 @@ namespace ReC.Application.RecActions.Commands;
public record InvokeRecActionViewCommand : IRequest public record InvokeRecActionViewCommand : IRequest
{ {
public RecActionViewDto Action { get; set; } = null!; 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( public class InvokeRecActionViewCommandHandler(
@@ -150,7 +160,8 @@ public class InvokeRecActionViewCommandHandler(
Header = JsonSerializer.Serialize(resHeaders, options: new() { WriteIndented = false }), Header = JsonSerializer.Serialize(resHeaders, options: new() { WriteIndented = false }),
Body = resBody, Body = resBody,
Info = (short)response.StatusCode, Info = (short)response.StatusCode,
Type = ResultType.Main Type = ResultType.Main,
References = request.References
}, cancel); }, cancel);
} }
catch(Exception ex) catch(Exception ex)
@@ -160,7 +171,8 @@ public class InvokeRecActionViewCommandHandler(
Status = RecStatus.Error, Status = RecStatus.Error,
ActionId = action.Id, ActionId = action.Id,
Error = ex.ToString(), Error = ex.ToString(),
Type = ResultType.Main Type = ResultType.Main,
References = request.References
}, cancel); }, cancel);
if (action.ErrorAction == ErrorAction.Stop) if (action.ErrorAction == ErrorAction.Stop)