using EnvelopeGenerator.Application.Common.Dto; using EnvelopeGenerator.Application.Common.Dto.EnvelopeReceiver; using EnvelopeGenerator.Application.Common.Extensions; using EnvelopeGenerator.Application.Common.Notifications.RemoveSignature; using EnvelopeGenerator.Domain.Constants; using MediatR; using System.Dynamic; namespace EnvelopeGenerator.Application.Common.Notifications.DocSigned; /// /// /// /// /// public record PsPdfKitAnnotation(ExpandoObject Instant, IEnumerable Structured); /// /// Notification raised when a document is signed by a receiver. /// public record DocSignedNotification : INotification, ISendMailNotification { /// /// The envelope receiver information. /// public required EnvelopeReceiverDto EnvelopeReceiver { get; init; } /// /// The PSPDFKit annotation data. /// public PsPdfKitAnnotation? PsPdfKitAnnotation { get; init; } /// /// Gets the email template type. /// public EmailTemplateType TemplateType => EmailTemplateType.DocumentSigned; /// /// Gets the email address of the receiver. /// public string EmailAddress => EnvelopeReceiver.Receiver?.EmailAddress ?? throw new InvalidOperationException($"Receiver is null." + $"DocSignedNotification:\n{this.ToJson(Format.Json.ForDiagnostics)}"); }