From b83607d9168352d726063b2e674d7eff7fa6c411 Mon Sep 17 00:00:00 2001 From: Developer 02 Date: Thu, 22 May 2025 15:37:41 +0200 Subject: [PATCH] =?UTF-8?q?refactor(Domain.Entities.EnvelopeType):=20Aktua?= =?UTF-8?q?lisiert,=20um=20Common.Entities.EnvelopeType=20zu=20enthalten.?= =?UTF-8?q?=20-=20Ge=C3=A4ndert=20CertificationType,=20FinalEmailToCreator?= =?UTF-8?q?=20und=20FinalEmailToReceivers=20verwenden=20nun=20Enum-Typen?= =?UTF-8?q?=20von=20Constants=20-=20Standardwerte=20f=C3=BCr=20einige=20Ei?= =?UTF-8?q?genschaften=20hinzugef=C3=BCgt,=20um=20eine=20sicherere=20Initi?= =?UTF-8?q?alisierung=20zu=20gew=C3=A4hrleisten=20-=20Einf=C3=BChrung=20vo?= =?UTF-8?q?n=20NotMapped-Eigenschaften=20(TFA=5FEnabled,=20ExpiresWhen,=20?= =?UTF-8?q?ExpiresWarningWhen,=20ExpiresWhenDays,=20ExpiresWarningWhenDays?= =?UTF-8?q?)=20f=C3=BCr=20zus=C3=A4tzliche=20Gesch=C3=A4ftslogik=20ohne=20?= =?UTF-8?q?Datenbank-Mapping=20-=20ToString()=20=C3=BCberschrieben,=20um?= =?UTF-8?q?=20den=20Titel=20zur=20einfacheren=20Fehlersuche=20und=20Anzeig?= =?UTF-8?q?e=20zur=C3=BCckzugeben?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Entities/EnvelopeType.cs | 42 +++++++++++++++---- 1 file changed, 35 insertions(+), 7 deletions(-) diff --git a/EnvelopeGenerator.Domain/Entities/EnvelopeType.cs b/EnvelopeGenerator.Domain/Entities/EnvelopeType.cs index 8c1004d3..8ad0604b 100644 --- a/EnvelopeGenerator.Domain/Entities/EnvelopeType.cs +++ b/EnvelopeGenerator.Domain/Entities/EnvelopeType.cs @@ -12,7 +12,7 @@ namespace EnvelopeGenerator.Domain.Entities [Key] [DatabaseGenerated(DatabaseGeneratedOption.Identity)] [Column("GUID")] - public int Id { get; set; } + public int Id { get; set; } = 0; [Required] [Column("TITLE", TypeName = "nvarchar(128)")] @@ -25,16 +25,16 @@ namespace EnvelopeGenerator.Domain.Entities public int ExpiresDays { get; set; } [Column("CERTIFICATION_TYPE")] - public int CertificationType { get; set; } + public Constants.CertificationType CertificationType { get; set; } = Constants.CertificationType.AdvancedElectronicSignature; [Column("USE_ACCESS_CODE")] public bool UseAccessCode { get; set; } [Column("FINAL_EMAIL_TO_CREATOR")] - public int FinalEmailToCreator { get; set; } + public Constants.FinalEmailType FinalEmailToCreator { get; set; } [Column("FINAL_EMAIL_TO_RECEIVERS")] - public int FinalEmailToReceivers { get; set; } + public Constants.FinalEmailType FinalEmailToReceivers { get; set; } [Required] [Column("ADDED_WHEN", TypeName = "datetime")] @@ -47,15 +47,43 @@ namespace EnvelopeGenerator.Domain.Entities public int ExpiresWarningDays { get; set; } [Column("SEND_REMINDER_EMAILS")] - public bool SendReminderEmails { get; set; } + public bool SendReminderEmails { get; set; } = false; [Column("FIRST_REMINDER_DAYS")] - public int FirstReminderDays { get; set; } + public int FirstReminderDays { get; set; } = 0; [Column("REMINDER_INTERVAL_DAYS")] - public int ReminderIntervalDays { get; set; } + public int ReminderIntervalDays { get; set; } = 0; [Column("CONTRACT_TYPE")] public int ContractType { get; set; } + + [NotMapped] + public bool TFA_Enabled { get; set; } = false; + + [NotMapped] + public DateTime ExpiresWhen { get; set; } + + [NotMapped] + public DateTime ExpiresWarningWhen { get; set; } + + [NotMapped] + public int ExpiresWhenDays + { + get => ExpiresDays; + set => ExpiresDays = value; + } + + [NotMapped] + public int ExpiresWarningWhenDays + { + get => ExpiresWarningDays; + set => ExpiresWarningDays = value; + } + + public override string ToString() + { + return Title; + } } } \ No newline at end of file