From 1089304bf11238c5d45ff47eb8f39fd7bcd5ee10 Mon Sep 17 00:00:00 2001 From: TekH Date: Tue, 9 Jun 2026 23:00:11 +0200 Subject: [PATCH] Refactor: Rename SignatureDto to DocReceiverElementDto Renamed `SignatureDto` to `DocReceiverElementDto` across the codebase to better reflect its purpose as a DTO for document receiver elements. Updated all references, including: - `SignatureController.cs`: Changed `doc.Elements` type to `IEnumerable`. - `DocumentDto.cs`: Updated `Elements` property type. - `MappingProfile.cs`: Adjusted mappings for the renamed DTO. - `IDocumentReceiverElementService.cs` and `DocumentReceiverElementService.cs`: Updated interfaces and services to use the new DTO. - `TestDocumentReceiverElementController.cs`: Updated generic type parameters. These changes improve clarity, align naming with the domain model, and ensure consistency throughout the application. --- EnvelopeGenerator.API/Controllers/SignatureController.cs | 2 +- .../Common/Dto/{SignatureDto.cs => DocReceiverElementDto.cs} | 2 +- EnvelopeGenerator.Application/Common/Dto/DocumentDto.cs | 2 +- EnvelopeGenerator.Application/Common/Dto/MappingProfile.cs | 4 ++-- .../Interfaces/Services/IDocumentReceiverElementService.cs | 2 +- .../Services/DocumentReceiverElementService.cs | 2 +- .../Controllers/Test/TestDocumentReceiverElementController.cs | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) rename EnvelopeGenerator.Application/Common/Dto/{SignatureDto.cs => DocReceiverElementDto.cs} (98%) diff --git a/EnvelopeGenerator.API/Controllers/SignatureController.cs b/EnvelopeGenerator.API/Controllers/SignatureController.cs index fcc11fe8..bd3ff352 100644 --- a/EnvelopeGenerator.API/Controllers/SignatureController.cs +++ b/EnvelopeGenerator.API/Controllers/SignatureController.cs @@ -44,7 +44,7 @@ public class SignatureController : ControllerBase var doc = await _mediator.Send(new ReadDocumentQuery() { EnvelopeId = envelopeId }, cancel); - if (doc.Elements is not IEnumerable docSignatures) + if (doc.Elements is not IEnumerable docSignatures) return NotFound("Document is empty."); var rcvSignatures = docSignatures.Where(s => s.ReceiverId == receiverId).ToList(); diff --git a/EnvelopeGenerator.Application/Common/Dto/SignatureDto.cs b/EnvelopeGenerator.Application/Common/Dto/DocReceiverElementDto.cs similarity index 98% rename from EnvelopeGenerator.Application/Common/Dto/SignatureDto.cs rename to EnvelopeGenerator.Application/Common/Dto/DocReceiverElementDto.cs index 976bf994..d24cee32 100644 --- a/EnvelopeGenerator.Application/Common/Dto/SignatureDto.cs +++ b/EnvelopeGenerator.Application/Common/Dto/DocReceiverElementDto.cs @@ -9,7 +9,7 @@ namespace EnvelopeGenerator.Application.Common.Dto; /// Data Transfer Object representing a positioned element assigned to a document receiver. /// [ApiExplorerSettings(IgnoreApi = true)] -public class SignatureDto : IDocReceiverElement +public class DocReceiverElementDto : IDocReceiverElement { /// /// Gets or sets the unique identifier of the element. diff --git a/EnvelopeGenerator.Application/Common/Dto/DocumentDto.cs b/EnvelopeGenerator.Application/Common/Dto/DocumentDto.cs index cdacfc8b..4fa3394e 100644 --- a/EnvelopeGenerator.Application/Common/Dto/DocumentDto.cs +++ b/EnvelopeGenerator.Application/Common/Dto/DocumentDto.cs @@ -31,5 +31,5 @@ public class DocumentDto /// /// Gets or sets the collection of elements associated with the document for receiver interactions, if any. /// - public IEnumerable? Elements { get; set; } + public IEnumerable? Elements { get; set; } } \ No newline at end of file diff --git a/EnvelopeGenerator.Application/Common/Dto/MappingProfile.cs b/EnvelopeGenerator.Application/Common/Dto/MappingProfile.cs index 23c6ab0a..8397770a 100644 --- a/EnvelopeGenerator.Application/Common/Dto/MappingProfile.cs +++ b/EnvelopeGenerator.Application/Common/Dto/MappingProfile.cs @@ -23,7 +23,7 @@ public class MappingProfile : Profile { // Entity to DTO mappings CreateMap(); - CreateMap(); + CreateMap(); CreateMap(); CreateMap(); CreateMap(); @@ -39,7 +39,7 @@ public class MappingProfile : Profile // DTO to Entity mappings CreateMap(); - CreateMap(); + CreateMap(); CreateMap(); CreateMap(); CreateMap(); diff --git a/EnvelopeGenerator.Application/Common/Interfaces/Services/IDocumentReceiverElementService.cs b/EnvelopeGenerator.Application/Common/Interfaces/Services/IDocumentReceiverElementService.cs index 15f54def..bbae058a 100644 --- a/EnvelopeGenerator.Application/Common/Interfaces/Services/IDocumentReceiverElementService.cs +++ b/EnvelopeGenerator.Application/Common/Interfaces/Services/IDocumentReceiverElementService.cs @@ -8,6 +8,6 @@ namespace EnvelopeGenerator.Application.Common.Interfaces.Services; /// /// [Obsolete("Use MediatR")] -public interface IDocumentReceiverElementService : IBasicCRUDService +public interface IDocumentReceiverElementService : IBasicCRUDService { } \ No newline at end of file diff --git a/EnvelopeGenerator.Application/Services/DocumentReceiverElementService.cs b/EnvelopeGenerator.Application/Services/DocumentReceiverElementService.cs index e0e00927..05a775e7 100644 --- a/EnvelopeGenerator.Application/Services/DocumentReceiverElementService.cs +++ b/EnvelopeGenerator.Application/Services/DocumentReceiverElementService.cs @@ -11,7 +11,7 @@ namespace EnvelopeGenerator.Application.Services; /// /// [Obsolete("Use MediatR")] -public class DocumentReceiverElementService : BasicCRUDService, IDocumentReceiverElementService +public class DocumentReceiverElementService : BasicCRUDService, IDocumentReceiverElementService { /// /// diff --git a/EnvelopeGenerator.Web/Controllers/Test/TestDocumentReceiverElementController.cs b/EnvelopeGenerator.Web/Controllers/Test/TestDocumentReceiverElementController.cs index f52073db..804af38e 100644 --- a/EnvelopeGenerator.Web/Controllers/Test/TestDocumentReceiverElementController.cs +++ b/EnvelopeGenerator.Web/Controllers/Test/TestDocumentReceiverElementController.cs @@ -5,7 +5,7 @@ using EnvelopeGenerator.Application.Common.Interfaces.Services; namespace EnvelopeGenerator.Web.Controllers.Test; [Obsolete("Use MediatR")] -public class TestDocumentReceiverElementController : TestControllerBase +public class TestDocumentReceiverElementController : TestControllerBase { public TestDocumentReceiverElementController(ILogger logger, IDocumentReceiverElementService service) : base(logger, service) {