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.
93 lines
2.1 KiB
C#
93 lines
2.1 KiB
C#
using System;
|
|
using EnvelopeGenerator.Domain.Interfaces;
|
|
using System.ComponentModel.DataAnnotations;
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
|
|
using EnvelopeGenerator.Domain.Interfaces.Auditing;
|
|
#if NETFRAMEWORK
|
|
using System.Drawing;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
#endif
|
|
|
|
namespace EnvelopeGenerator.Domain.Entities
|
|
{
|
|
[Table("TBSIG_ENVELOPE_DOCUMENT", Schema = "dbo")]
|
|
public class Document : IDocument, IHasEnvelope, IHasAddedWhen
|
|
{
|
|
public Document()
|
|
{
|
|
#if NETFRAMEWORK
|
|
Elements = Enumerable.Empty<DocReceiverElement>().ToList();
|
|
#endif
|
|
}
|
|
|
|
[Key]
|
|
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
|
[Column("GUID")]
|
|
public int Id { get; set; }
|
|
|
|
[Required]
|
|
[Column("ENVELOPE_ID")]
|
|
public int EnvelopeId { get; set; }
|
|
#if NETFRAMEWORK
|
|
= 0;
|
|
#endif
|
|
|
|
[Required]
|
|
[Column("ADDED_WHEN", TypeName = "datetime")]
|
|
public DateTime AddedWhen { get; set; }
|
|
|
|
[Column("BYTE_DATA", TypeName = "varbinary(max)")]
|
|
public byte[]
|
|
#if nullable
|
|
?
|
|
#endif
|
|
ByteData { get; set; }
|
|
|
|
#region File
|
|
[Column("FILENAME", TypeName = "nvarchar(256)")]
|
|
public string Filename { get; set; }
|
|
|
|
[Column("FILEPATH", TypeName = "nvarchar(256)")]
|
|
public string Filepath { get; set; }
|
|
|
|
[Column("FILENAME_ORIGINAL", TypeName = "nvarchar(256)")]
|
|
public string
|
|
#if nullable
|
|
?
|
|
#endif
|
|
FileNameOriginal { get; set; }
|
|
#endregion
|
|
|
|
public virtual List<DocReceiverElement>
|
|
#if nullable
|
|
?
|
|
#endif
|
|
Elements { get; set; }
|
|
|
|
public IEnumerable<IDocReceiverElement>
|
|
#if nullable
|
|
?
|
|
#endif
|
|
ElementsBase => Elements;
|
|
|
|
[ForeignKey("EnvelopeId")]
|
|
public virtual Envelope
|
|
#if nullable
|
|
?
|
|
#endif
|
|
Envelope { get; set; }
|
|
|
|
#if NETFRAMEWORK
|
|
[NotMapped]
|
|
public bool IsTempFile { get; set; }
|
|
|
|
[NotMapped]
|
|
public Bitmap Thumbnail { get; set; }
|
|
|
|
[NotMapped]
|
|
public int PageCount { get; set; }
|
|
#endif
|
|
}
|
|
} |