Refactor enum usage in codebase
Updated references from `Constants` to direct usage of `EnvelopeStatus` and `EmailTemplateType` enums. This change enhances code readability and reduces dependency on the `Constants` class. Modified properties and parameters across command classes, DTOs, repositories, and services to use the enums directly. Updated `ModifyDocStatusCommandBase`, `EnvelopeHistoryDto`, and `ResetEmailTemplateCommand` for improved clarity. Consistent updates across multiple files indicate a systematic refactoring aimed at streamlining the codebase and improving maintainability. Comments and documentation have also been revised to reflect these changes.
This commit is contained in:
@@ -8,7 +8,7 @@ Public Class ReportItem
|
||||
Public Property EnvelopeTitle As String
|
||||
Public Property EnvelopeSubject As String
|
||||
|
||||
Public Property ItemStatus As Constants.EnvelopeStatus
|
||||
Public Property ItemStatus As EnvelopeStatus
|
||||
Public ReadOnly Property ItemStatusTranslated As String
|
||||
Get
|
||||
Dim oStatus = ItemStatus.ToString()
|
||||
|
||||
@@ -5,7 +5,7 @@ Public Class EmailData
|
||||
Public Property EmailAdress As String = ""
|
||||
Public Property EmailSubject As String = ""
|
||||
Public Property EmailBody As String = ""
|
||||
Public Property EmailType As Constants.EnvelopeStatus = Constants.EnvelopeStatus.Invalid
|
||||
Public Property EmailType As EnvelopeStatus = EnvelopeStatus.Invalid
|
||||
Public Property ReferenceID As Integer = 0
|
||||
Public Property ReferenceString As String = ""
|
||||
|
||||
@@ -29,7 +29,7 @@ Public Class EmailData
|
||||
''' <param name="pEnvelope"></param>
|
||||
''' <param name="pReceiver"></param>
|
||||
''' <param name="pStatus"></param>
|
||||
Public Sub New(pEnvelope As Entities.Envelope, pReceiver As ReceiverVM, pStatus As Constants.EnvelopeStatus)
|
||||
Public Sub New(pEnvelope As Entities.Envelope, pReceiver As ReceiverVM, pStatus As EnvelopeStatus)
|
||||
EmailAdress = pReceiver.EmailAddress
|
||||
EmailSubject = String.Empty
|
||||
EmailType = pStatus
|
||||
@@ -65,7 +65,7 @@ Public Class EmailData
|
||||
''' </summary>
|
||||
''' <param name="pEnvelope"></param>
|
||||
''' <param name="pStatus"></param>
|
||||
Public Sub New(pEnvelope As Entities.Envelope, pStatus As Constants.EnvelopeStatus)
|
||||
Public Sub New(pEnvelope As Entities.Envelope, pStatus As EnvelopeStatus)
|
||||
EmailAdress = pEnvelope.User.Email
|
||||
EmailSubject = String.Empty
|
||||
EmailType = pStatus
|
||||
|
||||
@@ -148,7 +148,7 @@ Public Class EnvelopeModel
|
||||
Dim oCommand As New SqlCommand(oSql)
|
||||
'oCommand.Parameters.Add("MESSAGE", SqlDbType.NVarChar).Value = String.Empty
|
||||
'oCommand.Parameters.Add("UUID", SqlDbType.NVarChar).Value = pEnvelope.Uuid
|
||||
'oCommand.Parameters.Add("STATUS", SqlDbType.Int).Value = Constants.EnvelopeStatus.EnvelopeCreated
|
||||
'oCommand.Parameters.Add("STATUS", SqlDbType.Int).Value = EnvelopeStatus.EnvelopeCreated
|
||||
'oCommand.Parameters.Add("USER_ID", SqlDbType.Int).Value = pEnvelope.UserId
|
||||
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ Public Class HistoryModel
|
||||
End Function
|
||||
|
||||
Public Function HasReceiverSigned(pEnvelopeId As Integer, pReceiverId As Integer) As Boolean
|
||||
Dim oEnvelopeSigned As Integer = Domain.Constants.EnvelopeStatus.DocumentSigned
|
||||
Dim oEnvelopeSigned As Integer = Domain.EnvelopeStatus.DocumentSigned
|
||||
Dim oSql = $"SELECT COUNT(T.GUID)
|
||||
FROM TBSIG_ENVELOPE_HISTORY T
|
||||
JOIN TBSIG_RECEIVER T2 ON T.USER_REFERENCE = T2.EMAIL_ADDRESS
|
||||
|
||||
@@ -17,7 +17,7 @@ Public Class EmailService
|
||||
|
||||
Public Function SendEnvelopeDeletedEmail(pEnvelope As Envelope, pReceiver As ReceiverVM, pReason As String) As Boolean
|
||||
Logger.Debug("SendEnvelopeDeletedEmail - Creating email data object...")
|
||||
Dim oEmailData As New EmailData(pEnvelope, pReceiver, Domain.Constants.EnvelopeStatus.MessageDeletionSent) With
|
||||
Dim oEmailData As New EmailData(pEnvelope, pReceiver, Domain.EnvelopeStatus.MessageDeletionSent) With
|
||||
{
|
||||
.SignatureLink = "",
|
||||
.ADDED_WHO_PROCESS = pEnvelope.CURRENT_WORK_APP
|
||||
@@ -35,7 +35,7 @@ Public Class EmailService
|
||||
|
||||
Public Function SendDocumentReceivedEmail(pEnvelope As Envelope, pReceiver As ReceiverVM) As Boolean
|
||||
Logger.Debug("Creating email data object.")
|
||||
Dim oEmailData As New EmailData(pEnvelope, pReceiver, Domain.Constants.EnvelopeStatus.MessageInvitationSent) With
|
||||
Dim oEmailData As New EmailData(pEnvelope, pReceiver, Domain.EnvelopeStatus.MessageInvitationSent) With
|
||||
{
|
||||
.SignatureLink = Helpers.GetEnvelopeURL(State.DbConfig.SignatureHost, pEnvelope.Uuid, pReceiver.Signature),
|
||||
.ADDED_WHO_PROCESS = pEnvelope.CURRENT_WORK_APP
|
||||
@@ -55,7 +55,7 @@ Public Class EmailService
|
||||
Logger.Debug($"State.DbConfig.SignatureHost: {State.DbConfig.SignatureHost}")
|
||||
Logger.Debug($" pEnvelope.Uuid: {pEnvelope.Uuid}")
|
||||
Logger.Debug($" pReceiver.Signature: {pReceiver.Signature}")
|
||||
Dim oEmailData As New EmailData(pEnvelope, pReceiver, Domain.Constants.EnvelopeStatus.MessageInvitationSent) With
|
||||
Dim oEmailData As New EmailData(pEnvelope, pReceiver, Domain.EnvelopeStatus.MessageInvitationSent) With
|
||||
{
|
||||
.SignatureLink = Helpers.GetEnvelopeURL(State.DbConfig.SignatureHost, pEnvelope.Uuid, pReceiver.Signature),
|
||||
.ADDED_WHO_PROCESS = pEnvelope.CURRENT_WORK_APP
|
||||
@@ -69,7 +69,7 @@ Public Class EmailService
|
||||
Logger.Debug($"State.DbConfig.SignatureHost: {State.DbConfig.SignatureHost}")
|
||||
Logger.Debug($" pEnvelope.Uuid: {pEnvelope.Uuid}")
|
||||
Logger.Debug($" pReceiver.Signature: {pReceiver.Signature}")
|
||||
Dim oEmailData As New EmailData(pEnvelope, pReceiver, Domain.Constants.EnvelopeStatus.MessageAccessCodeSent) With
|
||||
Dim oEmailData As New EmailData(pEnvelope, pReceiver, Domain.EnvelopeStatus.MessageAccessCodeSent) With
|
||||
{
|
||||
.SignatureLink = Helpers.GetEnvelopeURL(State.DbConfig.SignatureHost, pEnvelope.Uuid, pReceiver.Signature),
|
||||
.ADDED_WHO_PROCESS = pEnvelope.CURRENT_WORK_APP
|
||||
@@ -87,7 +87,7 @@ Public Class EmailService
|
||||
|
||||
Public Function SendSignedEmail(pEnvelope As Envelope, pReceiver As ReceiverVM) As Boolean
|
||||
Logger.Debug("Creating email data object.")
|
||||
Dim oEmailData = New EmailData(pEnvelope, pReceiver, Domain.Constants.EnvelopeStatus.MessageConfirmationSent) With
|
||||
Dim oEmailData = New EmailData(pEnvelope, pReceiver, Domain.EnvelopeStatus.MessageConfirmationSent) With
|
||||
{
|
||||
.SignatureLink = ""
|
||||
}
|
||||
@@ -104,7 +104,7 @@ Public Class EmailService
|
||||
|
||||
Public Function SendDocumentCompletedEmailToReceiver(pEnvelope As Envelope, pReceiver As ReceiverVM) As Boolean ', pAttachment As String
|
||||
Logger.Debug("Creating email data object.")
|
||||
Dim oEmailData = New EmailData(pEnvelope, pReceiver, Domain.Constants.EnvelopeStatus.MessageCompletionSent) With
|
||||
Dim oEmailData = New EmailData(pEnvelope, pReceiver, Domain.EnvelopeStatus.MessageCompletionSent) With
|
||||
{
|
||||
.SignatureLink = "",
|
||||
.ATT1_RELATED_ID = pEnvelope.Id,
|
||||
@@ -125,7 +125,7 @@ Public Class EmailService
|
||||
|
||||
Public Function SendDocumentCompletedEmailToCreator(pEnvelope As Envelope) As Boolean ', pAttachment As String
|
||||
Logger.Debug("Creating email data object.")
|
||||
Dim oEmailData = New EmailData(pEnvelope, Domain.Constants.EnvelopeStatus.MessageCompletionSent) With
|
||||
Dim oEmailData = New EmailData(pEnvelope, Domain.EnvelopeStatus.MessageCompletionSent) With
|
||||
{
|
||||
.SignatureLink = "",
|
||||
.ATT1_RELATED_ID = pEnvelope.Id,
|
||||
|
||||
Reference in New Issue
Block a user