refactor(EnvelopeHistory): rename as History

This commit is contained in:
tekh 2025-09-09 18:57:38 +02:00
parent ae669d05e7
commit e8f2c868b1
26 changed files with 65 additions and 65 deletions

View File

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

View File

@ -52,7 +52,7 @@ public record CreateHistoryCommand : EnvelopeReceiverQueryBase, IRequest<Envelop
/// </summary> /// </summary>
public class CreateHistoryCommandHandler : IRequestHandler<CreateHistoryCommand, EnvelopeHistoryDto?> public class CreateHistoryCommandHandler : IRequestHandler<CreateHistoryCommand, EnvelopeHistoryDto?>
{ {
private readonly IRepository<EnvelopeHistory> _repo; private readonly IRepository<History> _repo;
private readonly IRepository<EnvelopeReceiver> _erRepo; private readonly IRepository<EnvelopeReceiver> _erRepo;
@ -64,7 +64,7 @@ public class CreateHistoryCommandHandler : IRequestHandler<CreateHistoryCommand,
/// <param name="repo"></param> /// <param name="repo"></param>
/// <param name="erRepo"></param> /// <param name="erRepo"></param>
/// <param name="mapper"></param> /// <param name="mapper"></param>
public CreateHistoryCommandHandler(IRepository<EnvelopeHistory> repo, IRepository<EnvelopeReceiver> erRepo, IMapper mapper) public CreateHistoryCommandHandler(IRepository<History> repo, IRepository<EnvelopeReceiver> erRepo, IMapper mapper)
{ {
_repo = repo; _repo = repo;
_erRepo = erRepo; _erRepo = erRepo;

View File

@ -14,7 +14,7 @@ public class MappingProfile: Profile
/// </summary> /// </summary>
public MappingProfile() public MappingProfile()
{ {
CreateMap<CreateHistoryCommand, EnvelopeHistory>() CreateMap<CreateHistoryCommand, History>()
.ForMember(dest => dest.Envelope, opt => opt.Ignore()) .ForMember(dest => dest.Envelope, opt => opt.Ignore())
.ForMember(dest => dest.Sender, opt => opt.Ignore()) .ForMember(dest => dest.Sender, opt => opt.Ignore())
.ForMember(dest => dest.Receiver, opt => opt.Ignore()); .ForMember(dest => dest.Receiver, opt => opt.Ignore());

View File

@ -13,7 +13,7 @@ namespace EnvelopeGenerator.Application.Histories.Queries;
/// </summary> /// </summary>
public class ReadHistoryQueryHandler : IRequestHandler<ReadHistoryQuery, IEnumerable<EnvelopeHistoryDto>> public class ReadHistoryQueryHandler : IRequestHandler<ReadHistoryQuery, IEnumerable<EnvelopeHistoryDto>>
{ {
private readonly IRepository<EnvelopeHistory> _repo; private readonly IRepository<History> _repo;
private readonly IMapper _mapper; private readonly IMapper _mapper;
@ -22,7 +22,7 @@ public class ReadHistoryQueryHandler : IRequestHandler<ReadHistoryQuery, IEnumer
/// </summary> /// </summary>
/// <param name="repo"></param> /// <param name="repo"></param>
/// <param name="mapper"></param> /// <param name="mapper"></param>
public ReadHistoryQueryHandler(IRepository<EnvelopeHistory> repo, IMapper mapper) public ReadHistoryQueryHandler(IRepository<History> repo, IMapper mapper)
{ {
_repo = repo; _repo = repo;
_mapper = mapper; _mapper = mapper;

View File

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

View File

@ -8,7 +8,7 @@ namespace EnvelopeGenerator.Application.Interfaces.Repositories;
/// ///
/// </summary> /// </summary>
[Obsolete("Use IRepository")] [Obsolete("Use IRepository")]
public interface IEnvelopeHistoryRepository : ICRUDRepository<EnvelopeHistory, long> public interface IEnvelopeHistoryRepository : ICRUDRepository<History, long>
{ {
/// <summary> /// <summary>
/// ///
@ -28,5 +28,5 @@ public interface IEnvelopeHistoryRepository : ICRUDRepository<EnvelopeHistory, l
/// <param name="withSender"></param> /// <param name="withSender"></param>
/// <param name="withReceiver"></param> /// <param name="withReceiver"></param>
/// <returns></returns> /// <returns></returns>
Task<IEnumerable<EnvelopeHistory>> ReadAsync(int? envelopeId = null, string? userReference = null, EnvelopeStatus? status = null, bool withSender = false, bool withReceiver = false); Task<IEnumerable<History>> ReadAsync(int? envelopeId = null, string? userReference = null, EnvelopeStatus? status = null, bool withSender = false, bool withReceiver = false);
} }

View File

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

View File

@ -11,7 +11,7 @@ namespace EnvelopeGenerator.Application.Interfaces.Services;
/// ///
/// </summary> /// </summary>
[Obsolete("Use MediatR")] [Obsolete("Use MediatR")]
public interface IEnvelopeHistoryService : ICRUDService<EnvelopeHistoryCreateDto, EnvelopeHistoryDto, EnvelopeHistory, long> public interface IEnvelopeHistoryService : ICRUDService<EnvelopeHistoryCreateDto, EnvelopeHistoryDto, History, long>
{ {
/// <summary> /// <summary>
/// ///

View File

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

View File

@ -14,7 +14,7 @@ namespace EnvelopeGenerator.Application.Services;
/// ///
/// </summary> /// </summary>
[Obsolete("Use MediatR")] [Obsolete("Use MediatR")]
public class EnvelopeHistoryService : CRUDService<IEnvelopeHistoryRepository, EnvelopeHistoryCreateDto, EnvelopeHistoryDto, EnvelopeHistory, long>, IEnvelopeHistoryService public class EnvelopeHistoryService : CRUDService<IEnvelopeHistoryRepository, EnvelopeHistoryCreateDto, EnvelopeHistoryDto, History, long>, IEnvelopeHistoryService
{ {
/// <summary> /// <summary>
/// ///

View File

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

View File

@ -10,8 +10,8 @@ Public Class HistoryModel
MyBase.New(pState) MyBase.New(pState)
End Sub End Sub
Private Function ToEnvelopeHistoryEntry(pRow As DataRow) As EnvelopeHistory Private Function ToEnvelopeHistoryEntry(pRow As DataRow) As History
Return New EnvelopeHistory() With { Return New History() With {
.ActionDate = pRow.ItemEx(Of Date)("ACTION_DATE", Nothing), .ActionDate = pRow.ItemEx(Of Date)("ACTION_DATE", Nothing),
.EnvelopeId = pRow.Item("ENVELOPE_ID"), .EnvelopeId = pRow.Item("ENVELOPE_ID"),
.Status = pRow.Item("STATUS"), .Status = pRow.Item("STATUS"),
@ -19,7 +19,7 @@ Public Class HistoryModel
} }
End Function End Function
Public Function List(pEnvelopeId As Integer) As List(Of EnvelopeHistory) Public Function List(pEnvelopeId As Integer) As List(Of History)
Dim oSql = $"SELECT * FROM TBSIG_ENVELOPE_HISTORY WHERE ENVELOPE_ID = {pEnvelopeId} AND ACTION_DATE IS NOT NULL ORDER BY GUID DESC" Dim oSql = $"SELECT * FROM TBSIG_ENVELOPE_HISTORY WHERE ENVELOPE_ID = {pEnvelopeId} AND ACTION_DATE IS NOT NULL ORDER BY GUID DESC"
Dim oTable = Database.GetDatatable(oSql) Dim oTable = Database.GetDatatable(oSql)
Return oTable?.Rows. Return oTable?.Rows.
@ -41,7 +41,7 @@ Public Class HistoryModel
Return oRowCount > 0 Return oRowCount > 0
End Function End Function
Public Function Insert(pHistory As EnvelopeHistory) As Boolean Public Function Insert(pHistory As History) As Boolean
Try Try
Dim oSql = "INSERT INTO [dbo].[TBSIG_ENVELOPE_HISTORY] " Dim oSql = "INSERT INTO [dbo].[TBSIG_ENVELOPE_HISTORY] "
oSql += " ([ENVELOPE_ID] " oSql += " ([ENVELOPE_ID] "

View File

@ -18,7 +18,7 @@ Public Class HistoryService
End Sub End Sub
Public Function SetEnvelopeStatus(pEnvelope As Envelope, pStatus As EnvelopeStatus, pUserReference As String) As Boolean Public Function SetEnvelopeStatus(pEnvelope As Envelope, pStatus As EnvelopeStatus, pUserReference As String) As Boolean
Dim oResult = HistoryModel.Insert(New EnvelopeHistory() With { Dim oResult = HistoryModel.Insert(New History() With {
.EnvelopeId = pEnvelope.Id, .EnvelopeId = pEnvelope.Id,
.ActionDate = Now(), .ActionDate = Now(),
.Status = pStatus, .Status = pStatus,

View File

@ -19,7 +19,7 @@ public class Document
public Document() public Document()
{ {
#if NETFRAMEWORK #if NETFRAMEWORK
Elements = Enumerable.Empty<DocumentReceiverElement>().ToList(); Elements = Enumerable.Empty<Signature>().ToList();
#endif #endif
} }
@ -35,7 +35,7 @@ public class Document
[Column("BYTE_DATA", TypeName = "varbinary(max)")] [Column("BYTE_DATA", TypeName = "varbinary(max)")]
public byte[] ByteData { get; set; } public byte[] ByteData { get; set; }
public List<DocumentReceiverElement> Elements { get; set; } public List<Signature> Elements { get; set; }
// TODO: * Check the Form App and remove the default value // TODO: * Check the Form App and remove the default value
[NotMapped] [NotMapped]

View File

@ -36,7 +36,7 @@ public class Envelope
CertificationType = (int)Constants.CertificationType.AdvancedElectronicSignature; CertificationType = (int)Constants.CertificationType.AdvancedElectronicSignature;
UseAccessCode = false; UseAccessCode = false;
Documents = Enumerable.Empty<Document>().ToList(); Documents = Enumerable.Empty<Document>().ToList();
Histories = Enumerable.Empty<EnvelopeHistory>().ToList(); Histories = Enumerable.Empty<History>().ToList();
EnvelopeReceivers = Enumerable.Empty<EnvelopeReceiver>().ToList(); EnvelopeReceivers = Enumerable.Empty<EnvelopeReceiver>().ToList();
#endif #endif
} }
@ -164,7 +164,7 @@ public class Envelope
#endif #endif
Documents { get; set; } Documents { get; set; }
public List<EnvelopeHistory> public List<History>
#if NET #if NET
? ?
#endif #endif

View File

@ -17,7 +17,7 @@ namespace EnvelopeGenerator.Domain.Entities
#endif #endif
[Table("TBSIG_ENVELOPE_HISTORY", Schema = "dbo")] [Table("TBSIG_ENVELOPE_HISTORY", Schema = "dbo")]
public class EnvelopeHistory : IHasEnvelope, IHasReceiver public class History : IHasEnvelope, IHasReceiver
{ {
[Key] [Key]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)] [DatabaseGenerated(DatabaseGeneratedOption.Identity)]

View File

@ -13,9 +13,9 @@ namespace EnvelopeGenerator.Domain.Entities
#endif #endif
[Table("TBSIG_DOCUMENT_RECEIVER_ELEMENT", Schema = "dbo")] [Table("TBSIG_DOCUMENT_RECEIVER_ELEMENT", Schema = "dbo")]
public class DocumentReceiverElement public class Signature
{ {
public DocumentReceiverElement() public Signature()
{ {
// TODO: * Check the Form App and remove the default value // TODO: * Check the Form App and remove the default value
#if NETFRAMEWORK #if NETFRAMEWORK

View File

@ -76,7 +76,7 @@ Public Class EnvelopeEditorController
If EnvelopeModel.Insert(oEnvelope) Then If EnvelopeModel.Insert(oEnvelope) Then
Dim newHistoryEntry As New EnvelopeHistory With { Dim newHistoryEntry As New History With {
.EnvelopeId = oEnvelope.Id, .EnvelopeId = oEnvelope.Id,
.Status = EnvelopeStatus.EnvelopeCreated, .Status = EnvelopeStatus.EnvelopeCreated,
.UserReference = oEnvelope.User.Email .UserReference = oEnvelope.User.Email

View File

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

View File

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

View File

@ -234,7 +234,7 @@ public class EnvelopeReceiverController : ControllerBase
SELECT @OUT_SUCCESS as [@OUT_SUCCESS];"; SELECT @OUT_SUCCESS as [@OUT_SUCCESS];";
foreach (var rcv in res.SentReceiver) foreach (var rcv in res.SentReceiver)
foreach (var sign in request.Receivers.Where(r => r.EmailAddress == rcv.EmailAddress).FirstOrDefault()?.Signatures ?? Enumerable.Empty<Signature>()) foreach (var sign in request.Receivers.Where(r => r.EmailAddress == rcv.EmailAddress).FirstOrDefault()?.Signatures ?? Enumerable.Empty<Application.EnvelopeReceivers.Commands.Signature>())
{ {
using SqlConnection conn = new(_cnnStr); using SqlConnection conn = new(_cnnStr);
conn.Open(); conn.Open();

View File

@ -57,13 +57,13 @@ public static class DIExtensions
services.AddDbRepository<EGDbContext, User>(context => context.Users).UseAutoMapper(); services.AddDbRepository<EGDbContext, User>(context => context.Users).UseAutoMapper();
services.AddDbRepository<EGDbContext, Config>(context => context.Configs).UseAutoMapper(); services.AddDbRepository<EGDbContext, Config>(context => context.Configs).UseAutoMapper();
services.AddDbRepository<EGDbContext, DocumentReceiverElement>(context => context.DocumentReceiverElements).UseAutoMapper(); services.AddDbRepository<EGDbContext, Signature>(context => context.DocumentReceiverElements).UseAutoMapper();
services.AddDbRepository<EGDbContext, Document>(context => context.EnvelopeDocument).UseAutoMapper(); services.AddDbRepository<EGDbContext, Document>(context => context.EnvelopeDocument).UseAutoMapper();
services.AddDbRepository<EGDbContext, DocumentStatus>(context => context.DocumentStatus).UseAutoMapper(); services.AddDbRepository<EGDbContext, DocumentStatus>(context => context.DocumentStatus).UseAutoMapper();
services.AddDbRepository<EGDbContext, EmailTemplate>(context => context.EmailTemplate).UseAutoMapper(); services.AddDbRepository<EGDbContext, EmailTemplate>(context => context.EmailTemplate).UseAutoMapper();
services.AddDbRepository<EGDbContext, EmailOut>(context => context.EMailOuts).UseAutoMapper(); services.AddDbRepository<EGDbContext, EmailOut>(context => context.EMailOuts).UseAutoMapper();
services.AddDbRepository<EGDbContext, Envelope>(context => context.Envelopes).UseAutoMapper(); services.AddDbRepository<EGDbContext, Envelope>(context => context.Envelopes).UseAutoMapper();
services.AddDbRepository<EGDbContext, EnvelopeHistory>(context => context.EnvelopeHistories).UseAutoMapper(); services.AddDbRepository<EGDbContext, History>(context => context.EnvelopeHistories).UseAutoMapper();
services.AddDbRepository<EGDbContext, EnvelopeReceiver>(context => context.EnvelopeReceivers).UseAutoMapper(); services.AddDbRepository<EGDbContext, EnvelopeReceiver>(context => context.EnvelopeReceivers).UseAutoMapper();
services.AddDbRepository<EGDbContext, EnvelopeType>(context => context.EnvelopeTypes).UseAutoMapper(); services.AddDbRepository<EGDbContext, EnvelopeType>(context => context.EnvelopeTypes).UseAutoMapper();
services.AddDbRepository<EGDbContext, Receiver>(context => context.Receivers).UseAutoMapper(); services.AddDbRepository<EGDbContext, Receiver>(context => context.Receivers).UseAutoMapper();
@ -72,14 +72,14 @@ public static class DIExtensions
services.AddSQLExecutor<Envelope>(); services.AddSQLExecutor<Envelope>();
services.AddSQLExecutor<Receiver>(); services.AddSQLExecutor<Receiver>();
services.AddSQLExecutor<Document>(); services.AddSQLExecutor<Document>();
services.AddSQLExecutor<DocumentReceiverElement>(); services.AddSQLExecutor<Signature>();
services.AddSQLExecutor<DocumentStatus>(); services.AddSQLExecutor<DocumentStatus>();
SetDapperTypeMap<Envelope>(); SetDapperTypeMap<Envelope>();
SetDapperTypeMap<User>(); SetDapperTypeMap<User>();
SetDapperTypeMap<Receiver>(); SetDapperTypeMap<Receiver>();
SetDapperTypeMap<Document>(); SetDapperTypeMap<Document>();
SetDapperTypeMap<DocumentReceiverElement>(); SetDapperTypeMap<Signature>();
SetDapperTypeMap<DocumentStatus>(); SetDapperTypeMap<DocumentStatus>();
services.AddScoped<IEnvelopeExecutor, EnvelopeExecutor>(); services.AddScoped<IEnvelopeExecutor, EnvelopeExecutor>();

View File

@ -23,7 +23,7 @@ public class EGDbContext : DbContext, IUserManagerDbContext, IMailDbContext
public DbSet<Envelope> Envelopes { get; set; } public DbSet<Envelope> Envelopes { get; set; }
public DbSet<DocumentReceiverElement> DocumentReceiverElements { get; set; } public DbSet<Signature> DocumentReceiverElements { get; set; }
public DbSet<DocumentStatus> DocumentStatus { get; set; } public DbSet<DocumentStatus> DocumentStatus { get; set; }
@ -31,7 +31,7 @@ public class EGDbContext : DbContext, IUserManagerDbContext, IMailDbContext
public DbSet<Document> EnvelopeDocument { get; set; } public DbSet<Document> EnvelopeDocument { get; set; }
public DbSet<EnvelopeHistory> EnvelopeHistories { get; set; } public DbSet<History> EnvelopeHistories { get; set; }
public DbSet<EnvelopeType> EnvelopeTypes { get; set; } public DbSet<EnvelopeType> EnvelopeTypes { get; set; }
@ -69,10 +69,10 @@ public class EGDbContext : DbContext, IUserManagerDbContext, IMailDbContext
Configs = Set<Config>(); Configs = Set<Config>();
EnvelopeReceivers = Set<EnvelopeReceiver>(); EnvelopeReceivers = Set<EnvelopeReceiver>();
Envelopes = Set<Envelope>(); Envelopes = Set<Envelope>();
DocumentReceiverElements = Set<DocumentReceiverElement>(); DocumentReceiverElements = Set<Signature>();
DocumentStatus = Set<DocumentStatus>(); DocumentStatus = Set<DocumentStatus>();
EnvelopeDocument = Set<Document>(); EnvelopeDocument = Set<Document>();
EnvelopeHistories = Set<EnvelopeHistory>(); EnvelopeHistories = Set<History>();
EnvelopeTypes = Set<EnvelopeType>(); EnvelopeTypes = Set<EnvelopeType>();
Receivers = Set<Receiver>(); Receivers = Set<Receiver>();
@ -139,7 +139,7 @@ public class EGDbContext : DbContext, IUserManagerDbContext, IMailDbContext
#endregion EnvelopeDocument #endregion EnvelopeDocument
#region DocumentReceiverElement #region DocumentReceiverElement
modelBuilder.Entity<DocumentReceiverElement>() modelBuilder.Entity<Signature>()
.HasOne(dre => dre.Document) .HasOne(dre => dre.Document)
.WithMany(ed => ed.Elements) .WithMany(ed => ed.Elements)
.HasForeignKey(dre => dre.DocumentId); .HasForeignKey(dre => dre.DocumentId);
@ -147,13 +147,13 @@ public class EGDbContext : DbContext, IUserManagerDbContext, IMailDbContext
if (!IsMigration) if (!IsMigration)
{ {
modelBuilder.Entity<EnvelopeHistory>() modelBuilder.Entity<History>()
.HasOne(eh => eh.Receiver) .HasOne(eh => eh.Receiver)
.WithMany() .WithMany()
.HasForeignKey(eh => eh.UserReference) .HasForeignKey(eh => eh.UserReference)
.HasPrincipalKey(e => e.EmailAddress); .HasPrincipalKey(e => e.EmailAddress);
modelBuilder.Entity<EnvelopeHistory>() modelBuilder.Entity<History>()
.HasOne(eh => eh.Sender) .HasOne(eh => eh.Sender)
.WithMany() .WithMany()
.HasForeignKey(eh => eh.UserReference) .HasForeignKey(eh => eh.UserReference)
@ -193,12 +193,12 @@ public class EGDbContext : DbContext, IUserManagerDbContext, IMailDbContext
// TODO: call add trigger methods with attributes and reflection // TODO: call add trigger methods with attributes and reflection
AddTrigger<Config>(); AddTrigger<Config>();
AddTrigger<DocumentReceiverElement>(); AddTrigger<Signature>();
AddTrigger<DocumentStatus>(); AddTrigger<DocumentStatus>();
AddTrigger<EmailTemplate>(); AddTrigger<EmailTemplate>();
AddTrigger<Envelope>(); AddTrigger<Envelope>();
AddTrigger<Document>(); AddTrigger<Document>();
AddTrigger<EnvelopeHistory>(); AddTrigger<History>();
AddTrigger<EnvelopeReceiver>(); AddTrigger<EnvelopeReceiver>();
AddTrigger<EnvelopeReceiverReadOnly>(); AddTrigger<EnvelopeReceiverReadOnly>();
AddTrigger<EnvelopeType>(); AddTrigger<EnvelopeType>();

View File

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

View File

@ -7,13 +7,13 @@ using EnvelopeGenerator.Domain.Constants;
namespace EnvelopeGenerator.Infrastructure.Repositories; namespace EnvelopeGenerator.Infrastructure.Repositories;
[Obsolete("Use TempRepo")] [Obsolete("Use TempRepo")]
public class EnvelopeHistoryRepository : CRUDRepository<EnvelopeHistory, long, EGDbContext>, IEnvelopeHistoryRepository public class EnvelopeHistoryRepository : CRUDRepository<History, long, EGDbContext>, IEnvelopeHistoryRepository
{ {
public EnvelopeHistoryRepository(EGDbContext dbContext) : base(dbContext, dbContext.EnvelopeHistories) public EnvelopeHistoryRepository(EGDbContext dbContext) : base(dbContext, dbContext.EnvelopeHistories)
{ {
} }
private IQueryable<EnvelopeHistory> By(int? envelopeId = null, string? userReference = null, EnvelopeStatus? status = null, bool withSender = false, bool withReceiver = false) private IQueryable<History> By(int? envelopeId = null, string? userReference = null, EnvelopeStatus? status = null, bool withSender = false, bool withReceiver = false)
{ {
var query = _dbSet.AsNoTracking(); var query = _dbSet.AsNoTracking();
@ -40,7 +40,7 @@ public class EnvelopeHistoryRepository : CRUDRepository<EnvelopeHistory, long, E
userReference: userReference, userReference: userReference,
status: status).CountAsync(); status: status).CountAsync();
public async Task<IEnumerable<EnvelopeHistory>> ReadAsync(int? envelopeId = null, string? userReference = null, EnvelopeStatus? status = null, bool withSender = false, bool withReceiver = false) public async Task<IEnumerable<History>> ReadAsync(int? envelopeId = null, string? userReference = null, EnvelopeStatus? status = null, bool withSender = false, bool withReceiver = false)
=> await By( => await By(
envelopeId: envelopeId, envelopeId: envelopeId,
userReference: userReference, userReference: userReference,

View File

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