Add e-signature support and improve PDF signing process

Introduced `ESignParams` for configurable e-signature settings,
including `ApplicationName` and `DefaultReason`. Updated
`DocReceiverElementDto` and `PdfSignOptionsDto` to support
new properties. Registered `ESignParams` in DI container.

Refactored `SignPdfByElementCommand` to include new fields
and improved error handling. Added `SignPdfByEnvelopeReceiverCommand`
to enable signing documents for envelope receivers.

Replaced DevExpress with PdfSharp for PDF rendering in
`ReceiverSignedPage.razor`, improving layout and flexibility.
Enhanced `PdfSignatureController` with a new endpoint for
signing documents by envelope key.

Added `DataIntegrityException` for better error handling.
Updated `appsettings.json` with `ESignParams` configuration.
This commit is contained in:
2026-10-20 17:04:15 +02:00
parent e729adb441
commit b9cd629766
11 changed files with 327 additions and 96 deletions

View File

@@ -0,0 +1,17 @@
namespace EnvelopeGenerator.Application.Common.Configurations;
/// <summary>
///
/// </summary>
public class ESignParams
{
/// <summary>
///
/// </summary>
public required string ApplicationName { get; set; }
/// <summary>
///
/// </summary>
public string DefaultReason { get; set; } = string.Empty;
}

View File

@@ -1,8 +1,10 @@
using EnvelopeGenerator.Domain.Constants;
using EnvelopeGenerator.Application.Common.Dto.Receiver;
using EnvelopeGenerator.Domain.Constants;
using EnvelopeGenerator.Domain.Interfaces;
namespace EnvelopeGenerator.Application.Common.Dto;
// TODO: Add the “Reason” property and integrate with UI and the digital signature process.
/// <summary>
/// Data Transfer Object representing a positioned element assigned to a document receiver.
/// </summary>
@@ -28,6 +30,11 @@ public class DocReceiverElementDto : IDocReceiverElement, ISignatureInkPayload
/// </summary>
public int ReceiverId { get; set; }
/// <summary>
///
/// </summary>
public virtual ReceiverDto? Receiver { get; set; }
/// <summary>
/// Gets or sets the type of the element.
/// </summary>

View File

@@ -30,12 +30,12 @@ public sealed record PdfSignOptionsDto
/// <summary>
///
/// </summary>
public string Email { get; set; } = null!;
public string? Email { get; set; }
/// <summary>
///
/// </summary>
public string Phone { get; set; } = null!;
public string? Phone { get; set; }
/// <summary>
///