Introduced a new pipeline behavior class `EnvelopeReceiverResolutionBehavior` to resolve and validate the `EnvelopeReceiver` during the signing process.
- Added necessary `using` directives for dependencies such as `AutoMapper`, `MediatR`, and `IRepository`.
- Implemented the `Handle` method to query the database for `EnvelopeReceiver` if not provided in the `SignCommand` request.
- Throws a `NotFoundException` if the `EnvelopeReceiver` is not found.
- Maps the retrieved entity to a DTO and sets it in the request.
- Ensures the behavior executes before other signing process behaviors.
Refactored the `SignCommand` class to inherit from `EnvelopeReceiverQueryBase` and introduced a private backing field `_envelopeReceiver` for better encapsulation. Added an internal method `SetEnvelopeReceiver` to manage the envelope receiver data. Updated the `EnvelopeReceiver` property to use the backing field and removed the `required` modifier for more controlled initialization.
Clarified comments in `SignCommandHandler` to emphasize that all processing is handled by pipeline behaviors, leaving the handler intentionally empty. Made minor adjustments to comments for improved clarity and consistency.
Removed the `EmailAddress` property from the `SignCommand` class, which previously retrieved the receiver's email address and threw an exception if the receiver was null. This change eliminates reliance on `EnvelopeReceiver`.
Removed the `ToJson` extension method usage and the associated `using EnvelopeGenerator.Application.Common.Extensions;` directive, as well as the unused `using EnvelopeGenerator.Domain.Constants;` directive.
Marked the `PsPdfKitAnnotation` property as `[Obsolete]`, directing users to use `Signature.Commands.SignCommand` instead, signaling a transition to a newer implementation.
Updated the `EmailAddress` and `ReferenceString` properties
of the `EmailOut` object in `SendSignedMailBehavior` to use
`request.EnvelopeReceiver.Receiver!.EmailAddress` instead of
`request.EmailAddress`. This ensures the values are derived
from the `EnvelopeReceiver.Receiver` object for improved
accuracy and consistency.
Updated the `Handle` method in multiple classes implementing
`IPipelineBehavior<SignCommand, Unit>` to pass the `cancellationToken`
parameter to the `next()` method. This change ensures consistent
propagation of the `cancellationToken` through the pipeline, enabling
proper handling of cancellation requests during asynchronous operations.
Modified files:
- AnnotationBehavior.cs
- DocStatusBehavior.cs
- HistoryBehavior.cs
- SendSignedMailBehavior.cs
The `PsPdfKitAnnotation` property in the `SignCommand` class has been marked as `[Obsolete]` with a deprecation message suggesting the use of `Signature.Commands.SignCommand` instead.
The `TemplateType` property, which returned the `EmailTemplateType.DocumentSigned` value, has been removed from the `SignCommand` class.
Updated namespaces from `Signature` to `Signatures` for consistency and clarity across the application. Simplified pipeline behavior registrations in `DependencyInjection.cs` by using shorter references. Added `Microsoft.Extensions.Configuration` to `DependencyInjection.cs` to support configuration functionality. Ensured all references to `SignCommand` and related behaviors align with the new namespace structure.