From c422de445d1f94e263e6095d7a7fe81439ffaa16 Mon Sep 17 00:00:00 2001 From: TekH Date: Fri, 12 Dec 2025 13:04:23 +0100 Subject: [PATCH] Refactor ErrorAction to use enum for type safety Changed RecActionDto.ErrorAction from string to ErrorAction enum, updating all related logic to use enum values instead of strings. Added necessary using directives. This improves type safety, reduces risk of typos, and enhances maintainability. --- src/ReC.Application/Common/Dto/RecActionDto.cs | 7 +++++-- .../RecActions/Commands/InvokeBatchRecActionsCommand.cs | 5 +++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/ReC.Application/Common/Dto/RecActionDto.cs b/src/ReC.Application/Common/Dto/RecActionDto.cs index 93e2d3d..4395e59 100644 --- a/src/ReC.Application/Common/Dto/RecActionDto.cs +++ b/src/ReC.Application/Common/Dto/RecActionDto.cs @@ -1,4 +1,7 @@ -namespace ReC.Application.Common.Dto; +using ReC.Application.Common.Constants; +using ReC.Domain.Constants; + +namespace ReC.Application.Common.Dto; public record RecActionDto { @@ -62,7 +65,7 @@ public record RecActionDto public string? PostprocessingQuery { get; init; } - public string? ErrorAction { get; init; } + public ErrorAction ErrorAction { get; init; } public UriBuilder ToEndpointUriBuilder() { diff --git a/src/ReC.Application/RecActions/Commands/InvokeBatchRecActionsCommand.cs b/src/ReC.Application/RecActions/Commands/InvokeBatchRecActionsCommand.cs index fbf58d7..51d8765 100644 --- a/src/ReC.Application/RecActions/Commands/InvokeBatchRecActionsCommand.cs +++ b/src/ReC.Application/RecActions/Commands/InvokeBatchRecActionsCommand.cs @@ -1,5 +1,6 @@ using MediatR; using ReC.Application.RecActions.Queries; +using ReC.Domain.Constants; namespace ReC.Application.RecActions.Commands; @@ -21,9 +22,9 @@ public class InvokeRecActionsCommandHandler(ISender sender) : IRequestHandler