Updated documentation to include details on the `TBSIG_EMAIL_TEMPLATE` table, its structure, and runtime behavior. Enhanced code by introducing the `IDocument` interface and adding properties/methods to support email templates and document signing workflows. Replaced `int` with the `EnvelopeStatus` enum for improved type safety. Removed unused `Signed` property from `EnvelopeReceiverDto`. Added extension methods for `IDocument` and `IDocReceiverElement` to verify signing status. Updated deployment and troubleshooting guides to highlight email template requirements.
30 lines
763 B
C#
30 lines
763 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
|
|
namespace EnvelopeGenerator.Domain.Interfaces
|
|
{
|
|
public interface IDocument
|
|
{
|
|
IEnumerable<IDocReceiverElement>
|
|
#if nullable
|
|
?
|
|
#endif
|
|
ElementsBase { get; }
|
|
}
|
|
|
|
public static class DocumentExtensions
|
|
{
|
|
public static bool IsSigned<TElement, TElements>(this IDocument document)
|
|
{
|
|
if(document.ElementsBase == null)
|
|
throw new ArgumentNullException(nameof(document.ElementsBase), "Elements collection cannot be null. Please add with Includ()");
|
|
|
|
foreach (var element in document.ElementsBase)
|
|
if (!element.IsSigned())
|
|
return false;
|
|
|
|
return true;
|
|
}
|
|
}
|
|
}
|