Refactor FinalizeEnvelopeCommand and handler logic
Simplified the `FinalizeEnvelopeCommand` by removing unused properties (`BurnedAllowed` and `SaveDocResult`) and streamlining its structure. Enhanced the `FinalizeEnvelopeCommandHandler` with additional dependencies (`ILogger` and `IRepository<History>`) for logging and history access. Improved envelope query to include related entities (`Documents.Elements`, `Histories`, and `User`) for comprehensive data processing. Refined validation logic to ensure all receivers have signed the document and added detailed error messages for better user feedback. Updated document processing to save the signed document (`docResult`) directly to the repository. Enhanced notification handling with improved content, error handling, and logging for both receivers and the sender. Removed redundant code and updated `EnvelopeFinalizationWorker` to align with the new command structure. These changes improve maintainability, robustness, and clarity of the envelope finalization process.
This commit is contained in:
@@ -44,9 +44,7 @@ public sealed class EnvelopeFinalizationWorker(
|
||||
{
|
||||
await sender.Send(new FinalizeEnvelopeCommand()
|
||||
{
|
||||
Id = envelopeId,
|
||||
BurnedAllowed = false,
|
||||
SaveDocResult = true,
|
||||
Id = envelopeId
|
||||
}, stoppingToken);
|
||||
}
|
||||
catch(Exception ex)
|
||||
|
||||
Reference in New Issue
Block a user