- Added `UnstructuredAnnotations` property to handle annotations without structured IDs - Changed default `hasStructuredID` to `False`, set to `True` only after successful parsing - Updated `AddInstantJSONAnnotationToPDF` to process annotations directly instead of grouping by receiver - Simplified logic for reversing annotations and applying seal positioning
40 lines
1.2 KiB
C#
40 lines
1.2 KiB
C#
using DigitalData.Core.Abstraction.Application.Repository;
|
|
using EnvelopeGenerator.Application.Common.Extensions;
|
|
using EnvelopeGenerator.Application.Histories.Commands;
|
|
using EnvelopeGenerator.Domain.Constants;
|
|
using MediatR;
|
|
using Newtonsoft.Json;
|
|
|
|
namespace EnvelopeGenerator.Application.Common.Notifications.RemoveSignature.Handlers;
|
|
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
public class RemoveHistoryHandler : INotificationHandler<RemoveSignatureNotification>
|
|
{
|
|
private readonly IRepository<Domain.Entities.History> _repo;
|
|
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
/// <param name="repository"></param>
|
|
public RemoveHistoryHandler(IRepository<Domain.Entities.History> repository)
|
|
{
|
|
_repo = repository;
|
|
}
|
|
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
/// <param name="notification"></param>
|
|
/// <param name="cancel"></param>
|
|
/// <returns></returns>
|
|
public async Task Handle(RemoveSignatureNotification notification, CancellationToken cancel)
|
|
{
|
|
await _repo.DeleteAsync(hists
|
|
=> hists
|
|
.Where(hist => hist.Envelope!.Uuid == notification.EnvelopeUuid)
|
|
.Where(hist => hist.Status == EnvelopeStatus.DocumentSigned),
|
|
cancel);
|
|
}
|
|
} |