From 7495e062a9ac4a629f5a505793e0234c8d0220c1 Mon Sep 17 00:00:00 2001 From: TekH Date: Mon, 19 Jan 2026 16:50:02 +0100 Subject: [PATCH] Remove EnvelopeSigningType enum and update envelope logic Removed EnvelopeSigningType enum and related normalization logic. Added a ReadOnly property to Envelope that uses EnvelopeTypeId to determine read-only status. Envelope type handling now relies on EnvelopeTypeId (int?) instead of the enum. --- .../Constants/EnvelopeSigningType.cs | 14 -------------- EnvelopeGenerator.Domain/Entities/Envelope.cs | 15 ++++----------- .../EGDbContextFactory.cs | 2 +- 3 files changed, 5 insertions(+), 26 deletions(-) delete mode 100644 EnvelopeGenerator.Domain/Constants/EnvelopeSigningType.cs diff --git a/EnvelopeGenerator.Domain/Constants/EnvelopeSigningType.cs b/EnvelopeGenerator.Domain/Constants/EnvelopeSigningType.cs deleted file mode 100644 index c1994e70..00000000 --- a/EnvelopeGenerator.Domain/Constants/EnvelopeSigningType.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace EnvelopeGenerator.Domain.Constants -{ - public enum EnvelopeSigningType - { - WetSignature = 1, - ReadAndSign = 2 - } - - public static class EnvelopeSigningTypeExtensions - { - public static EnvelopeSigningType Normalize(this EnvelopeSigningType value) => - value == EnvelopeSigningType.ReadAndSign ? EnvelopeSigningType.ReadAndSign : EnvelopeSigningType.WetSignature; - } -} \ No newline at end of file diff --git a/EnvelopeGenerator.Domain/Entities/Envelope.cs b/EnvelopeGenerator.Domain/Entities/Envelope.cs index 5247c114..94e3b6c1 100644 --- a/EnvelopeGenerator.Domain/Entities/Envelope.cs +++ b/EnvelopeGenerator.Domain/Entities/Envelope.cs @@ -2,6 +2,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using EnvelopeGenerator.Domain.Constants; +using Newtonsoft.Json; #if NETFRAMEWORK using System; @@ -104,20 +105,12 @@ public class Envelope [Column("REMINDER_INTERVAL_DAYS")] public int? ReminderIntervalDays { get; set; } -#if NETFRAMEWORK [Column("ENVELOPE_TYPE")] public int? EnvelopeTypeId { get; set; } -#elif NET - - private EnvelopeSigningType _signingType = EnvelopeSigningType.WetSignature; - [Column("ENVELOPE_TYPE")] - public EnvelopeSigningType SigningType - { - get => _signingType; - set => _signingType = value.Normalize(); - } -#endif + [JsonIgnore] + [NotMapped] + public bool ReadOnly => EnvelopeTypeId == 2; [Column("CERTIFICATION_TYPE")] public int? CertificationType { get; set; } diff --git a/EnvelopeGenerator.Infrastructure/EGDbContextFactory.cs b/EnvelopeGenerator.Infrastructure/EGDbContextFactory.cs index 59a9aa6a..fea2b764 100644 --- a/EnvelopeGenerator.Infrastructure/EGDbContextFactory.cs +++ b/EnvelopeGenerator.Infrastructure/EGDbContextFactory.cs @@ -12,7 +12,7 @@ namespace EnvelopeGenerator.Infrastructure public EGDbContext CreateDbContext(string[] args) { var config = new ConfigurationBuilder() - .SetBasePath(Directory.GetCurrentDirectory()) // Önemli! + .SetBasePath(Directory.GetCurrentDirectory()) .AddJsonFile("appsettings.migration.json") .Build();