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:
2026-11-26 17:08:28 +01:00
parent 67faa441b8
commit 98ef8005f0
2 changed files with 63 additions and 35 deletions

View File

@@ -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)