diff --git a/EnvelopeGenerator.Application/Common/Dto/MappingProfile.cs b/EnvelopeGenerator.Application/Common/Dto/MappingProfile.cs index 8397770a..3c6f7b33 100644 --- a/EnvelopeGenerator.Application/Common/Dto/MappingProfile.cs +++ b/EnvelopeGenerator.Application/Common/Dto/MappingProfile.cs @@ -40,6 +40,7 @@ public class MappingProfile : Profile // DTO to Entity mappings CreateMap(); CreateMap(); + CreateMap().MapChangedWhen(); CreateMap(); CreateMap(); CreateMap(); diff --git a/EnvelopeGenerator.Application/Common/Dto/Signature.cs b/EnvelopeGenerator.Application/Common/Dto/Signature.cs new file mode 100644 index 00000000..2462c628 --- /dev/null +++ b/EnvelopeGenerator.Application/Common/Dto/Signature.cs @@ -0,0 +1,65 @@ +namespace EnvelopeGenerator.Application.Common.Dto; + +/// +/// Represents a captured signature with metadata created by the receiver in the signature popup. +/// This model holds the signature image (as base64 data URL) along with signer information +/// used for rendering applied signatures on the PDF canvas. +/// +/// +/// Used in: EnvelopeViewer.razor signature popup workflow +///
+/// Creation: User draws/types/uploads signature and fills required fields +///
+public sealed record Signature +{ + /// + /// TBDD_DOCUMENT_RECEIVER_ELEMENT.ID - identifies the specific signature field on the PDF page. + /// + public required int ElementId { get; init; } + + /// + /// Base64-encoded data URL of the signature image. + ///
+ /// Format: data:image/png;base64,iVBORw0KG... + ///
+ /// Source: Canvas.toDataURL() from signature pad (draw/text/image tabs) + ///
+ /// Usage: Set as img.src in applied signature overlay + ///
+ public required string DataUrl { get; init; } + + /// + /// Full name of the signer (first and last name). + ///
+ /// Required: Yes (validated in popup) + ///
+ /// Example: "Max Mustermann" + ///
+ public required string FullName { get; init; } + + private readonly string? _position = null; + + /// + /// Job title or position of the signer. + ///
+ /// Required: No (optional field) + ///
+ /// Example: "Geschäftsführer" or empty string + ///
+ public string? Position + { + get => _position; + init => _position = string.IsNullOrWhiteSpace(value) ? value : null; + } + + /// + /// Location/place where the signature was created. + ///
+ /// Required: Yes (validated in popup) + ///
+ /// Display: Shown with current date in German format (dd.MM.yyyy) + ///
+ /// Example: "Berlin" ? rendered as "Berlin, 26.01.2025" + ///
+ public required string Place { get; init; } +} \ No newline at end of file diff --git a/EnvelopeGenerator.Application/DocReceiverElements/Commands/SigningCommand.cs b/EnvelopeGenerator.Application/DocReceiverElements/Commands/SigningCommand.cs index 6d1e56fd..1354b7b9 100644 --- a/EnvelopeGenerator.Application/DocReceiverElements/Commands/SigningCommand.cs +++ b/EnvelopeGenerator.Application/DocReceiverElements/Commands/SigningCommand.cs @@ -5,70 +5,6 @@ using EnvelopeGenerator.Application.Common.Query; namespace EnvelopeGenerator.Application.DocReceiverElements.Commands; -/// -/// Represents a captured signature with metadata created by the receiver in the signature popup. -/// This model holds the signature image (as base64 data URL) along with signer information -/// used for rendering applied signatures on the PDF canvas. -/// -/// -/// Used in: EnvelopeViewer.razor signature popup workflow -///
-/// Creation: User draws/types/uploads signature and fills required fields -///
-public sealed record SignatureDto -{ - /// - /// TBDD_DOCUMENT_RECEIVER_ELEMENT.ID - identifies the specific signature field on the PDF page. - /// - public required int ElementId { get; init; } - - /// - /// Base64-encoded data URL of the signature image. - ///
- /// Format: data:image/png;base64,iVBORw0KG... - ///
- /// Source: Canvas.toDataURL() from signature pad (draw/text/image tabs) - ///
- /// Usage: Set as img.src in applied signature overlay - ///
- public required string DataUrl { get; init; } - - /// - /// Full name of the signer (first and last name). - ///
- /// Required: Yes (validated in popup) - ///
- /// Example: "Max Mustermann" - ///
- public required string FullName { get; init; } - - private readonly string? _position = null; - - /// - /// Job title or position of the signer. - ///
- /// Required: No (optional field) - ///
- /// Example: "Geschäftsführer" or empty string - ///
- public string? Position - { - get => _position; - init => _position = string.IsNullOrWhiteSpace(value) ? value : null; - } - - /// - /// Location/place where the signature was created. - ///
- /// Required: Yes (validated in popup) - ///
- /// Display: Shown with current date in German format (dd.MM.yyyy) - ///
- /// Example: "Berlin" ? rendered as "Berlin, 26.01.2025" - ///
- public required string Place { get; init; } -} - /// /// Command to sign a document by a receiver. /// @@ -99,7 +35,7 @@ public record SigningCommand : EnvelopeReceiverQueryBase, IRequest /// /// /// - public IEnumerable? Signatures { get; init; } + public IEnumerable? Signatures { get; init; } } /// diff --git a/EnvelopeGenerator.Application/DocReceiverElements/MappingProfile.cs b/EnvelopeGenerator.Application/DocReceiverElements/MappingProfile.cs deleted file mode 100644 index 84f5c83b..00000000 --- a/EnvelopeGenerator.Application/DocReceiverElements/MappingProfile.cs +++ /dev/null @@ -1,19 +0,0 @@ -using AutoMapper; -using EnvelopeGenerator.Application.DocReceiverElements.Commands; -using EnvelopeGenerator.Domain.Entities; - -namespace EnvelopeGenerator.Application.DocReceiverElements; - -/// -/// -/// -public class MappingProfile : Profile -{ - /// - /// - /// - public MappingProfile() - { - CreateMap(); - } -} \ No newline at end of file