Add envelope history tracking and receiver signing status

Added a `Histories` property to `EnvelopeDto` to track envelope
history entries for actions like `DocumentSigned` and
`EnvelopeOpened`. Introduced a computed `Signed` property in
`EnvelopeReceiverDto` to determine if a receiver has signed the
envelope based on the history. Updated `using` directives to
support these changes.
This commit is contained in:
2026-06-25 14:43:09 +02:00
parent de9c9da176
commit 85a0736106
2 changed files with 16 additions and 0 deletions

View File

@@ -1,5 +1,6 @@
using DigitalData.EmailProfilerDispatcher.Abstraction.Attributes;
using EnvelopeGenerator.Application.Common.Dto.Receiver;
using EnvelopeGenerator.Domain.Constants;
namespace EnvelopeGenerator.Application.Common.Dto.EnvelopeReceiver;
@@ -73,4 +74,13 @@ public record EnvelopeReceiverDto
///
/// </summary>
public bool HasPhoneNumber { get; init; }
/// <summary>
/// Indicates whether this receiver has signed the envelope.
/// Checks if there is a DocumentSigned history entry for this receiver in the envelope's history.
/// </summary>
public bool Signed => Envelope?.Histories?.Any(h =>
h.Receiver?.Id == ReceiverId &&
h.Status == EnvelopeStatus.DocumentSigned
) ?? false;
}