fix(Receiver): Entfernen Sie unnötige Eigenschaften und/oder verschieben Sie sie nach EnvelopeReceiver.

This commit is contained in:
tekh 2025-08-21 11:54:47 +02:00
parent 305422688e
commit e877000b14
3 changed files with 49 additions and 55 deletions

View File

@ -161,9 +161,9 @@ public class Envelope
// TODO: * Check the Form App and remove the default value
[NotMapped]
public List<Receiver> Receivers { get; set; } = Enumerable.Empty<Receiver>().ToList();
public List<EnvelopeReceiver> Receivers { get; set; } = Enumerable.Empty<EnvelopeReceiver>().ToList();
#if NETFRAMEWORK
//#if NETFRAMEWORK
/// <summary>
/// Validates whether the receiver and document data are complete.
/// </summary>
@ -182,7 +182,7 @@ public class Envelope
return errors;
}
#endif
//#endif
}
#if NETFRAMEWORK

View File

@ -1,5 +1,6 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Drawing;
#if NETFRAMEWORK
using System;
#endif
@ -14,6 +15,13 @@ namespace EnvelopeGenerator.Domain.Entities
[Table("TBSIG_ENVELOPE_RECEIVER", Schema = "dbo")]
public class EnvelopeReceiver
{
public EnvelopeReceiver()
{
#if NETFRAMEWORK
Company = string.Empty;
#endif
}
[Column("ENVELOPE_ID")]
public int EnvelopeId { get; set; }
@ -62,6 +70,44 @@ public class EnvelopeReceiver
[ForeignKey("ReceiverId")]
public Receiver Receiver { get; set; }
[Column("COMPANY_NAME")]
public string
#if NET
?
#endif
Company { get; set; }
#region Model of old serice
[NotMapped]
public DateTime SignedDate { get; set; } = DateTime.MinValue;
[NotMapped]
public Constants.ReceiverStatus Status { get; set; }
[NotMapped]
public Constants.ColorType ColorType { get; set; }
[NotMapped]
public bool HasId => Id.Item1 > 0 && Id.Item2 > 0;
[NotMapped]
public bool HasEmailAndName =>
!string.IsNullOrWhiteSpace(Receiver.EmailAddress) &&
!string.IsNullOrWhiteSpace(Name);
[NotMapped]
public string SignedDateDisplayValue =>
SignedDate == DateTime.MinValue ? "-" : SignedDate.ToString("G");
[NotMapped]
public Color Color => ColorType.ToColor();
public string GetSignature()
{
return Receiver.EmailAddress.ToUpperInvariant().GetChecksum();
}
#endregion
}
#if NETFRAMEWORK

View File

@ -41,58 +41,6 @@ public class Receiver
public DateTime? TfaRegDeadline { get; set; }
public List<EnvelopeReceiver> EnvelopeReceivers { get; set; }
#if NETFRAMEWORK
[NotMapped]
public string Name { get; set; }
[NotMapped]
public string Company { get; set; } = string.Empty;
[NotMapped]
public string JobTitle { get; set; } = string.Empty;
[NotMapped]
public string PhoneNumber { get; set; } = string.Empty;
[NotMapped]
public string AccessCode { get; set; } = string.Empty;
[NotMapped]
public string PrivateMessage { get; set; } = string.Empty;
[NotMapped]
public int Sequence { get; set; } = 0;
[NotMapped]
public DateTime SignedDate { get; set; } = DateTime.MinValue;
[NotMapped]
public Constants.ReceiverStatus Status { get; set; }
[NotMapped]
public Constants.ColorType ColorType { get; set; }
[NotMapped]
public bool HasId => Id > 0;
[NotMapped]
public bool HasEmailAndName =>
!string.IsNullOrWhiteSpace(EmailAddress) &&
!string.IsNullOrWhiteSpace(Name);
[NotMapped]
public string SignedDateDisplayValue =>
SignedDate == DateTime.MinValue ? "-" : SignedDate.ToString("G");
[NotMapped]
public Color Color => ColorType.ToColor();
public string GetSignature()
{
return EmailAddress.ToUpperInvariant().GetChecksum();
}
#endif
}
#if NETFRAMEWORK