Commit Graph

23 Commits

Author SHA1 Message Date
c7fe3f0b9c Mark PsPdfKitAnnotation as obsolete
Added an [Obsolete] attribute to the PsPdfKitAnnotation property
in the DocSignedNotification class, indicating that the PSPDFKit
library is deprecated.

Reorganized using directives in DocumentReceiverElementService.cs
to improve consistency and maintain code readability.
2026-06-09 19:04:55 +02:00
e0cab3f965 Mark PSPDFKit-related code as obsolete
Added `[Obsolete]` attributes to classes, methods, and properties related to the deprecated PSPDFKit library and notifications.

- Marked `AnnotationHandler`, `DocStatusHandler`, `AnnotationBehavior`, and `DocStatusBehavior` as obsolete.
- Marked `Handle` methods in `DocStatusHandler` and `DocStatusBehavior` as obsolete.
- Marked `PsPdfKitAnnotation` property in `SignCommand` as obsolete.
- Marked `CreateOrUpdate` method in `AnnotationController` as obsolete.
- Added `Handle` methods in `DocStatusHandler` and `DocStatusBehavior` to send `CreateDocStatusCommand`.
- Updated `AnnotationController` dependencies to include `EnvelopeGenerator.Application.Common.Dto`.

These changes indicate a transition to `Signature.Commands.SignCommand` and deprecate PSPDFKit-related functionality.
2026-06-09 18:45:51 +02:00
fceb266630 Deprecate DocSignedNotification and cleanup annotations
Marked `DocSignedNotification` as `[Obsolete]` with a note to use `Signature.Commands.SignCommand` instead. Removed the `PsPdfKitAnnotation` record and its associated `using` directives from `DocSignedNotification.cs`.

Added missing `using EnvelopeGenerator.Application.Common.Dto;` to `AnnotationHandler.cs` and `DocStatusHandler.cs` to ensure proper DTO support.
2026-06-09 18:22:43 +02:00
cd077aa1bd 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`.
2026-06-09 16:34:49 +02:00
49ac35153e 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.
2026-06-09 15:39:41 +02:00
0341505f8d Merge branch 'origin/bugfix/history-inconsistency' 2026-03-06 10:15:22 +01:00
08299451bb Customize email placeholders by envelope action type
Added logic to set email template placeholders based on whether the envelope requires "Read and Confirm" or "Sign" actions. Placeholders such as [SIGNATURE_TYPE], [DOCUMENT_PROCESS], [FINAL_STATUS], [FINAL_ACTION], [REJECTED_BY_OTHERS], and [RECEIVER_ACTION] are now dynamically set to reflect the correct process and status, improving the accuracy and clarity of notification emails.
2026-03-04 16:19:33 +01:00
f9b1e583df Remove SaveDocStatusCommand and always create doc status
Removed SaveDocStatusCommand and its handler, eliminating logic for updating existing document statuses. DocStatusHandler now always sends CreateDocStatusCommand with simplified parameters when handling DocSignedNotification. This change ensures a new document status is always created instead of updating existing ones.
2026-02-27 11:31:41 +01:00
5c675be0ed Add type check to Handle method in AnnotationHandler
Refactored the Handle method to include a type check for PsPdfKitAnnotation before creating an annotation. This prevents errors when the notification does not contain the expected annotation type.
2026-01-20 13:57:52 +01:00
58164be640 Handle missing PsPdfKitAnnotation with blank JSON
Refactored DocStatusHandler to assign a blank JSON object ("{}")
to the Value property when PsPdfKitAnnotation is not present or
not of the expected type, preventing potential runtime errors.
2026-01-20 13:57:43 +01:00
a639377195 Make PsPdfKitAnnotation property and param nullable
Changed PsPdfKitAnnotation in DocSignedNotification to be nullable, removing the need for the null-forgiving operator. Updated ToDocSignedNotification to accept a nullable PsPdfKitAnnotation, ensuring consistency and allowing for cases where the annotation may be absent.
2026-01-20 13:57:29 +01:00
0e7b120ded refactor(Entities.Annotation): rename it to ElementAnnotation to prevent name conflicts. 2025-10-23 10:51:19 +02:00
f3af30c67d feat(DocSignedNotificationExtensions): add PublishSafely extension for DocSignedNotification
- Introduced PublishSafely method to safely publish DocSignedNotification events.
- Added fallback logic to publish RemoveSignatureNotification when publishing fails.
- Added missing using directive for RemoveSignatureNotification namespace.
2025-10-22 13:10:38 +02:00
8ae0f79365 refactor(AnnotationDto): split AnnotationDto into AnnotationCreateDto and AnnotationDto
- Introduced AnnotationCreateDto for creation-specific properties
- AnnotationDto now inherits from AnnotationCreateDto and includes Id, AddedWhen, ChangedWhen, and ChangedWho
- Added Type property to AnnotationCreateDto
 - remove CreateAnnotationCommand
2025-10-21 11:42:01 +02:00
0ca54fe1fe feat(DocSignedNotification): replace Annotations with PsPdfKitAnnotation in DocSignedNotification
- Introduced new record `PsPdfKitAnnotation` to encapsulate both Instant and Structured annotation data
- Updated `DocSignedNotification` to use `PsPdfKitAnnotation` instead of `ExpandoObject Annotations`
- Modified extension methods to accept and map `PsPdfKitAnnotation`
- Added reference to `EnvelopeGenerator.Application.Annotations.Commands` for `CreateAnnotationCommand`
2025-10-21 10:11:36 +02:00
26bdb0806d feat(MappingProfile): add AutoMapper profile for CreateAnnotationCommand to Annotation 2025-10-21 09:09:56 +02:00
16e5d5c692 feat(AnnotationHandler): add handler for DocSignedNotification to create annotations
- Implemented AnnotationHandler to process DocSignedNotification events
- Sends CreateAnnotationCommand via MediatR with envelope, receiver, and annotations data
2025-10-16 14:28:25 +02:00
e88bd55198 refactor(AnnotationHandler): rename as DocStatusHandler 2025-10-16 10:18:32 +02:00
ccc4e948f3 feat(TestBase): seed real email templates in TestBase setup
- Added `RealEmailTemplates` property with predefined email templates.
- Populated the repository with these templates in the `Setup` method.
- Ensures tests have consistent, realistic email data available.
2025-09-15 12:44:36 +02:00
95b54fa1f1 feat(JsonExtensions): create to be able to make fluent Json serilization 2025-09-10 15:55:56 +02:00
e990a466aa refactor(AnnotationHandler): update to use System.Text.Json.JsonSerializer 2025-09-10 15:38:05 +02:00
6b89b9bbf2 refactor(ModifyDocStatusCommandBase): add EnvelopeId and ReceiverId properties 2025-09-09 23:15:19 +02:00
895eb8977e refactor(Notifications): move to Common 2025-09-09 18:24:42 +02:00