Refactor AnnotationController and DocSignedNotification

Refactored `AnnotationController` to simplify `DocSignedNotification` creation and improve error handling. Replaced the `ToDocSignedNotification` extension method with direct instantiation of `DocSignedNotification`. Introduced a `try-catch` block to handle exceptions during notification publishing, ensuring a `RemoveSignatureNotification` is sent on failure.

Removed `ToDocSignedNotification` and `PublishSafely` extension methods, as their functionality was inlined into the controller. Updated tests to reflect these changes. Simplified the `DocSignedNotification` class by removing redundant methods.

Improved maintainability and clarity by reducing dependencies on extension methods and handling exceptions explicitly.
This commit is contained in:
2026-06-09 15:39:41 +02:00
parent 91a563d995
commit 49ac35153e
4 changed files with 37 additions and 59 deletions

View File

@@ -53,7 +53,7 @@ public class DocSignedNotificationTests : TestBase
var annots = Services.GetRequiredService<PsPdfKitAnnotation>();
var docSignedNtf = envRcvDto.ToDocSignedNotification(annots);
var docSignedNtf = new DocSignedNotification(envRcvDto) { PsPdfKitAnnotation = annots };
var sendSignedMailHandler = Host.Services.GetRequiredService<SendSignedMailHandler>();