refactor(Envelope): Envelope-Entitätseigenschaften für NET/NETFRAMEWORK nullfähig und bedingt machen

- Mehrere DateTime- und int-Eigenschaften in nullfähige Typen geändert
- Bedingte Kompilierung für Message, Title, ContractTypeTranslated und StatusTranslated angewendet
- Einige Standardwerte entfernt, um die Kompatibilität mit verschiedenen Frameworks zu verbessern
- Flexibilität der Entitätszuordnung für Envelope verbessert
This commit is contained in:
tekh 2025-08-19 11:12:41 +02:00
parent e095074c22
commit 4201f7820a
2 changed files with 30 additions and 14 deletions

View File

@ -37,34 +37,46 @@ namespace EnvelopeGenerator.Domain.Entities
// TODO: * Check the Form App and remove the default value
[Column("MESSAGE", TypeName = "nvarchar(max)")]
public string Message { get; set; } = My.Resources.Envelope.Please_read_and_sign_this_document;
public string Message { get; set; }
#if NETFRAMEWORK
= My.Resources.Envelope.Please_read_and_sign_this_document;
#endif
[Column("EXPIRES_WHEN", TypeName = "datetime")]
public DateTime ExpiresWhen { get; set; }
public DateTime? ExpiresWhen { get; set; }
[Column("EXPIRES_WARNING_WHEN", TypeName = "datetime")]
public DateTime ExpiresWarningWhen { get; set; }
public DateTime? ExpiresWarningWhen { get; set; }
[Required]
[Column("ADDED_WHEN", TypeName = "datetime")]
public DateTime AddedWhen { get; set; }
[Column("CHANGED_WHEN", TypeName = "datetime")]
public DateTime ChangedWhen { get; set; }
public DateTime? ChangedWhen { get; set; }
// TODO: * Check the Form App and remove the default value
[Column("TITLE", TypeName = "nvarchar(128)")]
public string Title { get; set; } = string.Empty;
public string
#if NET
?
#endif
Title { get; set; }
#if NETFRAMEWORK
= string.Empty;
#endif
[Column("COMMENT", TypeName = "nvarchar(128)")]
public string Comment { get; set; } = string.Empty;
[Column("CONTRACT_TYPE")]
public int ContractType { get; set; }
public int? ContractType { get; set; }
// TODO: * Check the Form App and remove the default value
#if NETFRAMEWORK
[NotMapped]
public string ContractTypeTranslated => My.Resources.Model.ResourceManager.GetString(ContractType.ToString());
#endif
// TODO: * Check the Form App and remove the default value
[Column("LANGUAGE", TypeName = "nvarchar(5)")]
@ -76,34 +88,34 @@ namespace EnvelopeGenerator.Domain.Entities
// TODO: * Check the Form App and remove the default value
[Column("FIRST_REMINDER_DAYS")]
public int FirstReminderDays { get; set; } = 0;
public int? FirstReminderDays { get; set; } = 0;
// TODO: * Check the Form App and remove the default value
[Column("REMINDER_INTERVAL_DAYS")]
public int ReminderIntervalDays { get; set; } = 0;
public int? ReminderIntervalDays { get; set; } = 0;
[Column("ENVELOPE_TYPE")]
public int EnvelopeTypeId { get; set; }
public int? EnvelopeTypeId { get; set; }
// TODO: * Check the Form App and remove the default value
[Column("CERTIFICATION_TYPE")]
public int CertificationType { get; set; } = (int)Constants.CertificationType.AdvancedElectronicSignature;
public int? CertificationType { get; set; } = (int)Constants.CertificationType.AdvancedElectronicSignature;
// TODO: * Check the Form App and remove the default value
[Column("USE_ACCESS_CODE")]
public bool UseAccessCode { get; set; } = false;
[Column("FINAL_EMAIL_TO_CREATOR")]
public int FinalEmailToCreator { get; set; }
public int? FinalEmailToCreator { get; set; }
[Column("FINAL_EMAIL_TO_RECEIVERS")]
public int FinalEmailToReceivers { get; set; }
public int? FinalEmailToReceivers { get; set; }
[Column("EXPIRES_WHEN_DAYS")]
public int ExpiresWhenDays { get; set; }
public int? ExpiresWhenDays { get; set; }
[Column("EXPIRES_WARNING_WHEN_DAYS")]
public int ExpiresWarningWhenDays { get; set; }
public int? ExpiresWarningWhenDays { get; set; }
// TODO: * Check the Form App and remove the default value
[Column("TFA_ENABLED", TypeName = "bit")]
@ -128,8 +140,10 @@ namespace EnvelopeGenerator.Domain.Entities
[NotMapped]
public bool IsAlreadySent => Status > (int)Constants.EnvelopeStatus.EnvelopeSaved;
#if NETFRAMEWORK
[NotMapped]
public string StatusTranslated => My.Resources.Model.ResourceManager.GetString(((Constants.EnvelopeStatus)Status).ToString());
#endif
[NotMapped]
public bool TFA_Enabled { get; set; } = false;

View File

@ -42,7 +42,9 @@ namespace EnvelopeGenerator.Domain.Entities
public virtual Receiver Receiver { get; set; }
#if NETFRAMEWORK
[NotMapped]
public string StatusTranslated => My.Resources.Model.ResourceManager.GetString(Status.ToString());
#endif
}
}