feat(AddReportBehavior): add conditional history creation based on Debug flag in AddReportBehavior

This commit is contained in:
Developer 02
2025-11-11 13:08:34 +01:00
parent 35b7b1a080
commit e6285f13f7
3 changed files with 24 additions and 13 deletions

View File

@@ -32,12 +32,13 @@ public class AddReportBehavior : IPipelineBehavior<BurnPdfCommand, byte[]>
var docResult = await next(cancel);
var base64 = Convert.ToBase64String(docResult);
await _sender.Send(new CreateHistoryCommand()
{
EnvelopeId = request.EnvelopeId,
UserReference = "System",
Status = EnvelopeStatus.EnvelopeReportCreated,
}, cancel);
if (!request.Debug)
await _sender.Send(new CreateHistoryCommand()
{
EnvelopeId = request.EnvelopeId,
UserReference = "System",
Status = EnvelopeStatus.EnvelopeReportCreated,
}, cancel);
return docResult;
}