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:
2026-06-09 16:34:49 +02:00
parent 49ac35153e
commit cd077aa1bd
7 changed files with 27 additions and 23 deletions

View File

@@ -72,7 +72,7 @@ public class AnnotationController : ControllerBase
var envelopeReceiverDto = await _mediator.ReadEnvelopeReceiverAsync(uuid, signature, cancel);
var docSignedNotification = envelopeReceiverDto is not null
? new DocSignedNotification(envelopeReceiverDto) { PsPdfKitAnnotation = psPdfKitAnnotation }
? new DocSignedNotification { EnvelopeReceiver = envelopeReceiverDto, PsPdfKitAnnotation = psPdfKitAnnotation }
: throw new NotFoundException("Envelope receiver is not found.");
try
@@ -83,8 +83,8 @@ public class AnnotationController : ControllerBase
{
await _mediator.Publish(new RemoveSignatureNotification()
{
EnvelopeId = docSignedNotification.EnvelopeId,
ReceiverId = docSignedNotification.ReceiverId
EnvelopeId = docSignedNotification.EnvelopeReceiver.EnvelopeId,
ReceiverId = docSignedNotification.EnvelopeReceiver.ReceiverId
}, cancel);
throw;
}