Refactor DocSignedNotification for better encapsulation
Refactored `DocSignedNotification` to remove inheritance from `EnvelopeReceiverDto` and introduced a required `EnvelopeReceiver` property. Updated all usages across the codebase to align with the new structure, including controllers, handlers, and tests. - Improved encapsulation and reduced coupling by making dependencies explicit. - Updated `AnnotationController`, `DocStatusHandler`, `HistoryHandler`, and `SendSignedMailHandler` to use the `EnvelopeReceiver` property. - Adjusted `DocSignedNotificationTests` to reflect the new instantiation pattern. - Updated XML documentation and ensured consistent access to `EnvelopeReceiver` properties like `EnvelopeId`, `ReceiverId`, and `EmailAddress`.
This commit is contained in:
@@ -29,13 +29,13 @@ public class HistoryHandler : INotificationHandler<DocSignedNotification>
|
||||
/// <returns></returns>
|
||||
public async Task Handle(DocSignedNotification notification, CancellationToken cancel)
|
||||
{
|
||||
if (notification.Receiver is null)
|
||||
if (notification.EnvelopeReceiver.Receiver is null)
|
||||
throw new InvalidOperationException($"Receiver information is missing in the notification. DocSignedNotification:\n {notification.ToJson(Format.Json.ForDiagnostics)}");
|
||||
|
||||
await _sender.Send(new CreateHistoryCommand()
|
||||
{
|
||||
EnvelopeId = notification.EnvelopeId,
|
||||
UserReference = notification.Receiver.EmailAddress,
|
||||
EnvelopeId = notification.EnvelopeReceiver.EnvelopeId,
|
||||
UserReference = notification.EnvelopeReceiver.Receiver.EmailAddress,
|
||||
Status = EnvelopeStatus.DocumentSigned,
|
||||
}, cancel);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user