refactor(BurnPdfCommand): update BurnPdfCommand to use EnvelopeQueryBase and enhance request structure
- Replaced record-based BurnPdfCommand with class-based implementation - Added Envelope property of type EnvelopeQueryBase - Changed parameters to nullable (Document, InstantJSONList) - Added ByCronService flag for cron-based PDF burning control - Updated query logic to use request.Envelope.Id instead of EnvelopeId - Improved code structure for flexibility and service integration
This commit is contained in:
parent
36b03da084
commit
ffffc2d470
@ -11,13 +11,35 @@ using Microsoft.Extensions.Logging;
|
|||||||
using Microsoft.Extensions.Options;
|
using Microsoft.Extensions.Options;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using EnvelopeGenerator.Application.Common.Extensions;
|
using EnvelopeGenerator.Application.Common.Extensions;
|
||||||
|
using EnvelopeGenerator.Application.Common.Query;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Pdf;
|
namespace EnvelopeGenerator.Application.Pdf;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public record BurnPdfCommand(byte[] Document, List<string> InstantJSONList, int EnvelopeId) : IRequest<byte[]>;
|
public record BurnPdfCommand : IRequest<byte[]?>
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public EnvelopeQueryBase? Envelope { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public byte[]? Document { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public List<string>? InstantJSONList { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public bool ByCronService { get; set; } = true;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
@ -59,7 +81,7 @@ public class BurnPdfCommandHandler : IRequestHandler<BurnPdfCommand, byte[]>
|
|||||||
{
|
{
|
||||||
// read the elements of envelope with their annotations
|
// read the elements of envelope with their annotations
|
||||||
var elements = await _signRepo
|
var elements = await _signRepo
|
||||||
.Where(sig => sig.Document.EnvelopeId == request.EnvelopeId)
|
.Where(sig => sig.Document.EnvelopeId == request.Envelope.Id)
|
||||||
.Include(sig => sig.Annotations)
|
.Include(sig => sig.Annotations)
|
||||||
.ToListAsync(cancel);
|
.ToListAsync(cancel);
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user