Removed the `EmailAddress` property from the `SignCommand` class, which previously retrieved the receiver's email address and threw an exception if the receiver was null. This change eliminates reliance on `EnvelopeReceiver`. Removed the `ToJson` extension method usage and the associated `using EnvelopeGenerator.Application.Common.Extensions;` directive, as well as the unused `using EnvelopeGenerator.Domain.Constants;` directive. Marked the `PsPdfKitAnnotation` property as `[Obsolete]`, directing users to use `Signature.Commands.SignCommand` instead, signaling a transition to a newer implementation.
39 lines
1.2 KiB
C#
39 lines
1.2 KiB
C#
using MediatR;
|
|
using EnvelopeGenerator.Application.Common.Dto;
|
|
using EnvelopeGenerator.Application.Common.Dto.EnvelopeReceiver;
|
|
|
|
namespace EnvelopeGenerator.Application.Signatures.Commands;
|
|
|
|
/// <summary>
|
|
/// Command to sign a document by a receiver.
|
|
/// </summary>
|
|
public record SignCommand : IRequest
|
|
{
|
|
/// <summary>
|
|
/// The envelope receiver information.
|
|
/// </summary>
|
|
public required EnvelopeReceiverDto EnvelopeReceiver { get; init; }
|
|
|
|
/// <summary>
|
|
/// The PSPDFKit annotation data.
|
|
/// </summary>
|
|
[Obsolete("This notification is deprecated. Use Signature.Commands.SignCommand instead.")]
|
|
public PsPdfKitAnnotation? PsPdfKitAnnotation { get; init; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// Handles the sign command. The actual work is done by SignCommandBehavior pipeline.
|
|
/// </summary>
|
|
public class SignCommandHandler : IRequestHandler<SignCommand>
|
|
{
|
|
/// <summary>
|
|
/// Executes the signing command. Pipeline behaviors handle the actual processing.
|
|
/// </summary>
|
|
/// <param name="request"></param>
|
|
/// <param name="cancellationToken"></param>
|
|
/// <returns></returns>
|
|
public Task Handle(SignCommand request, CancellationToken cancellationToken = default)
|
|
{
|
|
return Task.CompletedTask;
|
|
}
|
|
} |