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.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -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; }
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user