From 4201f7820ac25561d8f7e5f0b4e400abaf551bd5 Mon Sep 17 00:00:00 2001 From: TekH Date: Tue, 19 Aug 2025 11:12:41 +0200 Subject: [PATCH] =?UTF-8?q?refactor(Envelope):=20Envelope-Entit=C3=A4tseig?= =?UTF-8?q?enschaften=20f=C3=BCr=20NET/NETFRAMEWORK=20nullf=C3=A4hig=20und?= =?UTF-8?q?=20bedingt=20machen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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 --- EnvelopeGenerator.Domain/Entities/Envelope.cs | 42 ++++++++++++------- .../Entities/EnvelopeHistory.cs | 2 + 2 files changed, 30 insertions(+), 14 deletions(-) diff --git a/EnvelopeGenerator.Domain/Entities/Envelope.cs b/EnvelopeGenerator.Domain/Entities/Envelope.cs index e3637be6..c299529a 100644 --- a/EnvelopeGenerator.Domain/Entities/Envelope.cs +++ b/EnvelopeGenerator.Domain/Entities/Envelope.cs @@ -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; diff --git a/EnvelopeGenerator.Domain/Entities/EnvelopeHistory.cs b/EnvelopeGenerator.Domain/Entities/EnvelopeHistory.cs index b79cc9a5..e0be9122 100644 --- a/EnvelopeGenerator.Domain/Entities/EnvelopeHistory.cs +++ b/EnvelopeGenerator.Domain/Entities/EnvelopeHistory.cs @@ -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 } } \ No newline at end of file