From 606eccb8557b1a896fb4823e68f95cc24ee2d471 Mon Sep 17 00:00:00 2001 From: TekH Date: Mon, 30 Mar 2026 11:11:51 +0200 Subject: [PATCH] Add Status to InsertResultCommand for query outcome reporting Enhance PostprocessingBehavior and PreprocessingBehavior to set the Status property on InsertResultCommand. Status is now set to QuerySuccess on successful execution and QueryFailed on exceptions, improving clarity of query execution results. --- .../Common/Behaviors/InvokeAction/PostprocessingBehavior.cs | 2 ++ .../Common/Behaviors/InvokeAction/PreprocessingBehavior.cs | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/ReC.Application/Common/Behaviors/InvokeAction/PostprocessingBehavior.cs b/src/ReC.Application/Common/Behaviors/InvokeAction/PostprocessingBehavior.cs index bbfcb86..68e60c1 100644 --- a/src/ReC.Application/Common/Behaviors/InvokeAction/PostprocessingBehavior.cs +++ b/src/ReC.Application/Common/Behaviors/InvokeAction/PostprocessingBehavior.cs @@ -23,6 +23,7 @@ public class PostprocessingBehavior(IRecDbContext context, ISender sender) : IPi await sender.Send(new InsertResultCommand() { + Status = Status.QuerySuccess, ActionId = request.Action.Id, Info = info, Type = ResultType.Post @@ -35,6 +36,7 @@ public class PostprocessingBehavior(IRecDbContext context, ISender sender) : IPi await sender.Send(new InsertResultCommand() { + Status = Status.QueryFailed, ActionId = request.Action.Id, Error = error, Type = ResultType.Post diff --git a/src/ReC.Application/Common/Behaviors/InvokeAction/PreprocessingBehavior.cs b/src/ReC.Application/Common/Behaviors/InvokeAction/PreprocessingBehavior.cs index f9d6eff..c857ff9 100644 --- a/src/ReC.Application/Common/Behaviors/InvokeAction/PreprocessingBehavior.cs +++ b/src/ReC.Application/Common/Behaviors/InvokeAction/PreprocessingBehavior.cs @@ -20,6 +20,7 @@ public class PreprocessingBehavior(IRecDbContext context, ISender sender) : IPip await sender.Send(new InsertResultCommand() { + Status = Status.QuerySuccess, ActionId = request.Action.Id, Info = JsonSerializer.Serialize(result), Type = ResultType.Pre @@ -30,6 +31,7 @@ public class PreprocessingBehavior(IRecDbContext context, ISender sender) : IPip { await sender.Send(new InsertResultCommand() { + Status = Status.QueryFailed, ActionId = request.Action.Id, Error = ex.ToString(), Type = ResultType.Pre