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;
|
||||||
using System.ComponentModel.DataAnnotations.Schema;
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
using EnvelopeGenerator.Domain.Constants;
|
using EnvelopeGenerator.Domain.Constants;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
#if NETFRAMEWORK
|
#if NETFRAMEWORK
|
||||||
using System;
|
using System;
|
||||||
@@ -104,20 +105,12 @@ public class Envelope
|
|||||||
[Column("REMINDER_INTERVAL_DAYS")]
|
[Column("REMINDER_INTERVAL_DAYS")]
|
||||||
public int? ReminderIntervalDays { get; set; }
|
public int? ReminderIntervalDays { get; set; }
|
||||||
|
|
||||||
#if NETFRAMEWORK
|
|
||||||
[Column("ENVELOPE_TYPE")]
|
[Column("ENVELOPE_TYPE")]
|
||||||
public int? EnvelopeTypeId { get; set; }
|
public int? EnvelopeTypeId { get; set; }
|
||||||
#elif NET
|
|
||||||
|
|
||||||
private EnvelopeSigningType _signingType = EnvelopeSigningType.WetSignature;
|
[JsonIgnore]
|
||||||
|
[NotMapped]
|
||||||
[Column("ENVELOPE_TYPE")]
|
public bool ReadOnly => EnvelopeTypeId == 2;
|
||||||
public EnvelopeSigningType SigningType
|
|
||||||
{
|
|
||||||
get => _signingType;
|
|
||||||
set => _signingType = value.Normalize();
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
[Column("CERTIFICATION_TYPE")]
|
[Column("CERTIFICATION_TYPE")]
|
||||||
public int? CertificationType { get; set; }
|
public int? CertificationType { get; set; }
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ namespace EnvelopeGenerator.Infrastructure
|
|||||||
public EGDbContext CreateDbContext(string[] args)
|
public EGDbContext CreateDbContext(string[] args)
|
||||||
{
|
{
|
||||||
var config = new ConfigurationBuilder()
|
var config = new ConfigurationBuilder()
|
||||||
.SetBasePath(Directory.GetCurrentDirectory()) // Önemli!
|
.SetBasePath(Directory.GetCurrentDirectory())
|
||||||
.AddJsonFile("appsettings.migration.json")
|
.AddJsonFile("appsettings.migration.json")
|
||||||
.Build();
|
.Build();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user