Rename Status enum to RecStatus across the codebase
Refactored all usages of the Status enum to RecStatus to improve clarity and prevent naming conflicts with other status enums (e.g., HTTP status codes). Updated command handlers, behaviors, data models, and extension methods to use RecStatus, and adjusted related serialization logic accordingly. This makes the domain-specific status handling more explicit and maintainable.
This commit is contained in:
@@ -23,7 +23,7 @@ public class PostprocessingBehavior(IRecDbContext context, ISender sender) : IPi
|
||||
|
||||
await sender.Send(new InsertResultCommand()
|
||||
{
|
||||
Status = Status.QuerySuccess,
|
||||
Status = RecStatus.QuerySuccess,
|
||||
ActionId = request.Action.Id,
|
||||
Info = info,
|
||||
Type = ResultType.Post
|
||||
@@ -36,7 +36,7 @@ public class PostprocessingBehavior(IRecDbContext context, ISender sender) : IPi
|
||||
|
||||
await sender.Send(new InsertResultCommand()
|
||||
{
|
||||
Status = Status.QueryFailed,
|
||||
Status = RecStatus.QueryFailed,
|
||||
ActionId = request.Action.Id,
|
||||
Error = error,
|
||||
Type = ResultType.Post
|
||||
|
||||
@@ -20,7 +20,7 @@ public class PreprocessingBehavior(IRecDbContext context, ISender sender) : IPip
|
||||
|
||||
await sender.Send(new InsertResultCommand()
|
||||
{
|
||||
Status = Status.QuerySuccess,
|
||||
Status = RecStatus.QuerySuccess,
|
||||
ActionId = request.Action.Id,
|
||||
Info = JsonSerializer.Serialize(result),
|
||||
Type = ResultType.Pre
|
||||
@@ -31,7 +31,7 @@ public class PreprocessingBehavior(IRecDbContext context, ISender sender) : IPip
|
||||
{
|
||||
await sender.Send(new InsertResultCommand()
|
||||
{
|
||||
Status = Status.QueryFailed,
|
||||
Status = RecStatus.QueryFailed,
|
||||
ActionId = request.Action.Id,
|
||||
Error = ex.ToString(),
|
||||
Type = ResultType.Pre
|
||||
|
||||
@@ -157,7 +157,7 @@ public class InvokeRecActionViewCommandHandler(
|
||||
{
|
||||
await sender.Send(new InsertResultCommand()
|
||||
{
|
||||
Status = Status.QueryFailed,
|
||||
Status = RecStatus.QueryFailed,
|
||||
ActionId = action.Id,
|
||||
Error = ex.ToString(),
|
||||
Type = ResultType.Main
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace ReC.Application.Results.Commands;
|
||||
public record InsertResultCommand : IInsertProcedure
|
||||
{
|
||||
public long? ActionId { get; set; }
|
||||
public required Status Status { get; set; }
|
||||
public required RecStatus Status { get; set; }
|
||||
public string? Header { get; set; }
|
||||
public string? Body { get; set; }
|
||||
public string? Info { get; set; }
|
||||
|
||||
Reference in New Issue
Block a user