rename Entities.Signature as DocReceiverElement

This commit is contained in:
2026-06-09 22:52:41 +02:00
parent d59aa6157d
commit cb6dea319b
16 changed files with 40 additions and 40 deletions

View File

@@ -23,7 +23,7 @@ public class MappingProfile : Profile
{
// Entity to DTO mappings
CreateMap<Config, ConfigDto>();
CreateMap<Signature, SignatureDto>();
CreateMap<DocReceiverElement, SignatureDto>();
CreateMap<DocumentStatus, DocumentStatusDto>();
CreateMap<EmailTemplate, EmailTemplateDto>();
CreateMap<Envelope, EnvelopeDto>();
@@ -39,7 +39,7 @@ public class MappingProfile : Profile
// DTO to Entity mappings
CreateMap<ConfigDto, Config>();
CreateMap<SignatureDto, Signature>();
CreateMap<SignatureDto, DocReceiverElement>();
CreateMap<DocumentStatusDto, DocumentStatus>();
CreateMap<EmailTemplateDto, EmailTemplate>();
CreateMap<EnvelopeDto, Envelope>();

View File

@@ -6,6 +6,6 @@ namespace EnvelopeGenerator.Application.Common.Interfaces.Repositories;
///
/// </summary>
[Obsolete("Use IRepository")]
public interface IDocumentReceiverElementRepository : ICRUDRepository<Signature, int>
public interface IDocumentReceiverElementRepository : ICRUDRepository<DocReceiverElement, int>
{
}

View File

@@ -8,6 +8,6 @@ namespace EnvelopeGenerator.Application.Common.Interfaces.Services;
///
/// </summary>
[Obsolete("Use MediatR")]
public interface IDocumentReceiverElementService : IBasicCRUDService<SignatureDto, Signature, int>
public interface IDocumentReceiverElementService : IBasicCRUDService<SignatureDto, DocReceiverElement, int>
{
}

View File

@@ -11,7 +11,7 @@ namespace EnvelopeGenerator.Application.Services;
///
/// </summary>
[Obsolete("Use MediatR")]
public class DocumentReceiverElementService : BasicCRUDService<IDocumentReceiverElementRepository, SignatureDto, Signature, int>, IDocumentReceiverElementService
public class DocumentReceiverElementService : BasicCRUDService<IDocumentReceiverElementRepository, SignatureDto, DocReceiverElement, int>, IDocumentReceiverElementService
{
/// <summary>
///

View File

@@ -164,7 +164,7 @@ Public Class frmFinalizePDF
Return
End If
Dim sigRepo = scope.ServiceProvider.Repository(Of Signature)()
Dim sigRepo = scope.ServiceProvider.Repository(Of DocReceiverElement)()
Dim elements = sigRepo _
.Where(Function(sig) sig.Document.EnvelopeId = envelopeId) _
.Include(Function(sig) sig.Annotations) _

View File

@@ -46,7 +46,7 @@ Namespace Jobs.FinalizeDocument
Return pSourceBuffer
End If
Dim sigRepo = scope.ServiceProvider.Repository(Of Signature)()
Dim sigRepo = scope.ServiceProvider.Repository(Of DocReceiverElement)()
Dim elements = sigRepo _
.Where(Function(sig) sig.Document.EnvelopeId = envelopeId) _
.Include(Function(sig) sig.Annotations) _
@@ -58,7 +58,7 @@ Namespace Jobs.FinalizeDocument
End Using
End Function
Public Function BurnElementAnnotsToPDF(pSourceBuffer As Byte(), elements As List(Of Signature)) As Byte()
Public Function BurnElementAnnotsToPDF(pSourceBuffer As Byte(), elements As List(Of DocReceiverElement)) As Byte()
' Add background
Using doc As Pdf(Of MemoryStream, MemoryStream) = Pdf.FromMemory(pSourceBuffer)
'TODO: take the length from the largest y

View File

@@ -10,8 +10,8 @@ Public Class ElementModel
MyBase.New(pState)
End Sub
Private Function ToElement(pRow As DataRow) As Signature
Return New Signature() With {
Private Function ToElement(pRow As DataRow) As DocReceiverElement
Return New DocReceiverElement() With {
.Id = pRow.ItemEx("GUID", 0),
.DocumentId = pRow.ItemEx("DOCUMENT_ID", 0),
.ReceiverId = pRow.ItemEx("RECEIVER_ID", 0),
@@ -24,7 +24,7 @@ Public Class ElementModel
}
End Function
Private Function ToElements(pTable As DataTable) As List(Of Signature)
Private Function ToElements(pTable As DataTable) As List(Of DocReceiverElement)
Return pTable?.Rows.Cast(Of DataRow).
Select(AddressOf ToElement).
ToList()
@@ -80,7 +80,7 @@ Public Class ElementModel
End Try
End Function
Public Function List(pDocumentId As Integer) As List(Of Signature)
Public Function List(pDocumentId As Integer) As List(Of DocReceiverElement)
Try
Dim oSql = $"SELECT * FROM [dbo].[TBSIG_DOCUMENT_RECEIVER_ELEMENT] WHERE DOCUMENT_ID = {pDocumentId} ORDER BY PAGE ASC"
Dim oTable = Database.GetDatatable(oSql)
@@ -93,7 +93,7 @@ Public Class ElementModel
End Try
End Function
Public Function List(pDocumentId As Integer, pReceiverId As Integer) As List(Of Signature)
Public Function List(pDocumentId As Integer, pReceiverId As Integer) As List(Of DocReceiverElement)
Try
Dim oReceiverConstraint = ""
If pReceiverId > 0 Then
@@ -111,7 +111,7 @@ Public Class ElementModel
End Try
End Function
Public Function Insert(pElement As Signature) As Boolean
Public Function Insert(pElement As DocReceiverElement) As Boolean
Try
Dim oSql = "INSERT INTO [dbo].[TBSIG_DOCUMENT_RECEIVER_ELEMENT]
([DOCUMENT_ID]
@@ -161,7 +161,7 @@ Public Class ElementModel
End Try
End Function
Public Function Update(pElement As Signature) As Boolean
Public Function Update(pElement As DocReceiverElement) As Boolean
Try
Dim oSql = "UPDATE [dbo].[TBSIG_DOCUMENT_RECEIVER_ELEMENT]
SET [POSITION_X] = @POSITION_X
@@ -185,7 +185,7 @@ Public Class ElementModel
End Try
End Function
Private Function GetElementId(pElement As Signature) As Integer
Private Function GetElementId(pElement As DocReceiverElement) As Integer
Try
Return Database.GetScalarValue($"SELECT MAX(GUID) FROM TBSIG_DOCUMENT_RECEIVER_ELEMENT
WHERE DOCUMENT_ID = {pElement.DocumentId} AND RECEIVER_ID = {pElement.ReceiverId}")
@@ -196,7 +196,7 @@ Public Class ElementModel
End Try
End Function
Public Function DeleteElement(pElement As Signature) As Boolean
Public Function DeleteElement(pElement As DocReceiverElement) As Boolean
Try
Dim oSql = $"DELETE FROM TBSIG_DOCUMENT_RECEIVER_ELEMENT WHERE GUID = {pElement.Id}"
Return Database.ExecuteNonQuery(oSql)

View File

@@ -11,9 +11,9 @@ using System.Collections.Generic;
namespace EnvelopeGenerator.Domain.Entities
{
[Table("TBSIG_DOCUMENT_RECEIVER_ELEMENT", Schema = "dbo")]
public class Signature : ISignature, IHasReceiver, IHasAddedWhen, IUpdateAuditable
public class DocReceiverElement : ISignature, IHasReceiver, IHasAddedWhen, IUpdateAuditable
{
public Signature()
public DocReceiverElement()
{
// TODO: * Check the Form App and remove the default value
#if NETFRAMEWORK

View File

@@ -18,7 +18,7 @@ namespace EnvelopeGenerator.Domain.Entities
public Document()
{
#if NETFRAMEWORK
Elements = Enumerable.Empty<Signature>().ToList();
Elements = Enumerable.Empty<DocReceiverElement>().ToList();
#endif
}
@@ -60,7 +60,7 @@ namespace EnvelopeGenerator.Domain.Entities
FileNameOriginal { get; set; }
#endregion
public virtual List<Signature>
public virtual List<DocReceiverElement>
#if nullable
?
#endif

View File

@@ -76,7 +76,7 @@ namespace EnvelopeGenerator.Domain.Entities
ChangedWho { get; set; }
[ForeignKey("ElementId")]
public virtual Signature
public virtual DocReceiverElement
#if nullable
?
#endif

View File

@@ -8,7 +8,7 @@ Public Class FieldEditorController
Inherits BaseController
Private ReadOnly Document As Document
Public Property Elements As New List(Of Signature)
Public Property Elements As New List(Of DocReceiverElement)
Public Class ElementInfo
Public ReceiverId As Integer
@@ -36,7 +36,7 @@ Public Class FieldEditorController
}
End Function
Private Function GetElementByPosition(pAnnotation As AnnotationStickyNote, pPage As Integer, pReceiverId As Integer) As Signature
Private Function GetElementByPosition(pAnnotation As AnnotationStickyNote, pPage As Integer, pReceiverId As Integer) As DocReceiverElement
Dim oElement = Elements.
Where(Function(e)
Return e.Left = CSng(Math.Round(pAnnotation.Left, 5)) And
@@ -47,12 +47,12 @@ Public Class FieldEditorController
Return oElement
End Function
Private Function GetElementByGuid(pGuid As Integer) As Signature
Private Function GetElementByGuid(pGuid As Integer) As DocReceiverElement
Dim oElement = Elements.Where(Function(e) pGuid = e.Id).SingleOrDefault()
Return oElement
End Function
Public Function GetElement(pAnnotation As AnnotationStickyNote) As Signature
Public Function GetElement(pAnnotation As AnnotationStickyNote) As DocReceiverElement
Dim oInfo = GetElementInfo(pAnnotation.Tag)
If oInfo.Guid = -1 Then
@@ -85,7 +85,7 @@ Public Class FieldEditorController
Else
Dim oInfo = GetElementInfo(pAnnotation.Tag)
Elements.Add(New Signature() With {
Elements.Add(New DocReceiverElement() With {
.ElementType = Constants.ElementType.Signature,
.Height = oAnnotationHeight,
.Width = oAnnotationWidth,
@@ -98,7 +98,7 @@ Public Class FieldEditorController
End If
End Sub
Public Function ClearElements(pPage As Integer, pReceiverId As Integer) As IEnumerable(Of Signature)
Public Function ClearElements(pPage As Integer, pReceiverId As Integer) As IEnumerable(Of DocReceiverElement)
Return Elements.
Where(Function(e) e.Page <> pPage And e.ReceiverId <> pReceiverId).
ToList()
@@ -120,7 +120,7 @@ Public Class FieldEditorController
All(Function(pResult) pResult = True)
End Function
Public Function SaveElement(pElement As Signature) As Boolean
Public Function SaveElement(pElement As DocReceiverElement) As Boolean
Try
If pElement.Id > 0 Then
Return ElementModel.Update(pElement)
@@ -134,11 +134,11 @@ Public Class FieldEditorController
End Try
End Function
Public Function DeleteElement(pElement As Signature) As Boolean
Public Function DeleteElement(pElement As DocReceiverElement) As Boolean
Try
' Element aus Datenbank löschen
If ElementModel.DeleteElement(pElement) Then
Dim oElement = New List(Of Signature)() From {pElement}
Dim oElement = New List(Of DocReceiverElement)() From {pElement}
Elements = Elements.Except(oElement).ToList()
Return True
Else

View File

@@ -280,7 +280,7 @@ Partial Public Class frmFieldEditor
End If
End Sub
Private Sub LoadAnnotation(pElement As Signature, pReceiverId As Integer)
Private Sub LoadAnnotation(pElement As DocReceiverElement, pReceiverId As Integer)
Dim oAnnotation As AnnotationStickyNote = Manager.AddStickyNoteAnnot(0, 0, 0, 0, "SIGNATUR")
Dim oPage = pElement.Page
Dim oReceiver = Receivers.Where(Function(r) r.Id = pReceiverId).Single()

View File

@@ -74,14 +74,14 @@ namespace EnvelopeGenerator.Infrastructure
services.AddSQLExecutor<Envelope>();
services.AddSQLExecutor<Receiver>();
services.AddSQLExecutor<Document>();
services.AddSQLExecutor<Signature>();
services.AddSQLExecutor<DocReceiverElement>();
services.AddSQLExecutor<DocumentStatus>();
SetDapperTypeMap<Envelope>();
SetDapperTypeMap<User>();
SetDapperTypeMap<Receiver>();
SetDapperTypeMap<Document>();
SetDapperTypeMap<Signature>();
SetDapperTypeMap<DocReceiverElement>();
SetDapperTypeMap<DocumentStatus>();
services.AddScoped<IEnvelopeExecutor, EnvelopeExecutor>();

View File

@@ -45,7 +45,7 @@ public abstract class EGDbContextBase : DbContext
public DbSet<Envelope> Envelopes { get; set; }
public DbSet<Signature> DocumentReceiverElements { get; set; }
public DbSet<DocReceiverElement> DocumentReceiverElements { get; set; }
public DbSet<ElementAnnotation> DocumentReceiverElementAnnotations { get; set; }
@@ -154,7 +154,7 @@ public abstract class EGDbContextBase : DbContext
#endregion EnvelopeDocument
#region DocumentReceiverElement
modelBuilder.Entity<Signature>()
modelBuilder.Entity<DocReceiverElement>()
.HasOne(dre => dre.Document)
.WithMany(ed => ed.Elements)
.HasForeignKey(dre => dre.DocumentId);
@@ -196,7 +196,7 @@ public abstract class EGDbContextBase : DbContext
#endregion DocumentStatus
#region Annotation
modelBuilder.Entity<Signature>()
modelBuilder.Entity<DocReceiverElement>()
.HasMany(signature => signature.Annotations)
.WithOne(annot => annot.Element)
.HasForeignKey(annot => annot.ElementId);
@@ -217,7 +217,7 @@ public abstract class EGDbContextBase : DbContext
// TODO: call add trigger methods with attributes and reflection
AddTrigger<Config>();
AddTrigger<Signature>();
AddTrigger<DocReceiverElement>();
AddTrigger<DocumentStatus>();
AddTrigger<EmailTemplate>();
AddTrigger<Envelope>();

View File

@@ -6,7 +6,7 @@ using EnvelopeGenerator.Application.Common.Interfaces.Repositories;
namespace EnvelopeGenerator.Infrastructure.Repositories;
[Obsolete("Use IRepository")]
public class DocumentReceiverElementRepository : CRUDRepository<Signature, int, EGDbContext>, IDocumentReceiverElementRepository
public class DocumentReceiverElementRepository : CRUDRepository<DocReceiverElement, int, EGDbContext>, IDocumentReceiverElementRepository
{
public DocumentReceiverElementRepository(EGDbContext dbContext) : base(dbContext, dbContext.DocumentReceiverElements)
{

View File

@@ -5,7 +5,7 @@ using EnvelopeGenerator.Application.Common.Interfaces.Services;
namespace EnvelopeGenerator.Web.Controllers.Test;
[Obsolete("Use MediatR")]
public class TestDocumentReceiverElementController : TestControllerBase<IDocumentReceiverElementService, SignatureDto, Signature, int>
public class TestDocumentReceiverElementController : TestControllerBase<IDocumentReceiverElementService, SignatureDto, DocReceiverElement, int>
{
public TestDocumentReceiverElementController(ILogger<TestDocumentReceiverElementController> logger, IDocumentReceiverElementService service) : base(logger, service)
{