Refactor constant references across multiple files
Updated import statements and changed references from `Domain.Constants` to `Value` in `APIEnvelopeJob.vb`, `FinalizeDocumentJob.vb`, `HistoryModel.vb`, `EmailService.vb`, and job scheduling files. This standardizes constant access and improves code maintainability and readability.
This commit is contained in:
parent
dc723d9f02
commit
f699e5a9aa
@ -5,6 +5,7 @@ Imports Quartz
|
||||
Imports System.Security.Cryptography
|
||||
Imports DevExpress.DataProcessing
|
||||
Imports EnvelopeGenerator.Domain.Entities
|
||||
Imports EnvelopeGenerator.Domain.Constants
|
||||
|
||||
Namespace Jobs
|
||||
Public Class APIEnvelopeJob
|
||||
@ -33,7 +34,7 @@ Namespace Jobs
|
||||
End Class
|
||||
|
||||
Public Function Execute(pContext As IJobExecutionContext) As Task Implements IJob.Execute
|
||||
LogConfig = pContext.MergedJobDataMap.Item(Domain.Constants.LOGCONFIG)
|
||||
LogConfig = pContext.MergedJobDataMap.Item(Value.LOGCONFIG)
|
||||
Logger = LogConfig.GetLogger()
|
||||
myTempFiles = New TempFiles(LogConfig)
|
||||
myTempFiles.Create()
|
||||
@ -173,7 +174,7 @@ Namespace Jobs
|
||||
ActionService = New ActionService(pState, Database)
|
||||
End Sub
|
||||
Private Function GetDatabase(pContext As IJobExecutionContext, pLogConfig As LogConfig) As MSSQLServer
|
||||
Dim oConnectionString As String = pContext.MergedJobDataMap.Item(Domain.Constants.DATABASE)
|
||||
Dim oConnectionString As String = pContext.MergedJobDataMap.Item(Value.DATABASE)
|
||||
Dim Database = New MSSQLServer(pLogConfig, MSSQLServer.DecryptConnectionString(oConnectionString))
|
||||
|
||||
Return Database
|
||||
|
||||
@ -48,8 +48,8 @@ Namespace Jobs
|
||||
End Class
|
||||
|
||||
Public Function Execute(pContext As IJobExecutionContext) As Task Implements IJob.Execute
|
||||
Dim oGdPictureKey As String = pContext.MergedJobDataMap.Item(Domain.Constants.GDPICTURE)
|
||||
LogConfig = pContext.MergedJobDataMap.Item(Domain.Constants.LOGCONFIG)
|
||||
Dim oGdPictureKey As String = pContext.MergedJobDataMap.Item(Value.GDPICTURE)
|
||||
LogConfig = pContext.MergedJobDataMap.Item(Value.LOGCONFIG)
|
||||
Logger = LogConfig.GetLogger()
|
||||
myTempFiles = New TempFiles(LogConfig)
|
||||
myTempFiles.Create()
|
||||
@ -75,7 +75,7 @@ Namespace Jobs
|
||||
InitializeServices(oState)
|
||||
|
||||
Logger.Debug("Loading PDFBurner..")
|
||||
Dim pdfBurnerParams As PDFBurnerParams = pContext.MergedJobDataMap.Item(PDF_BURNER_PARAMS)
|
||||
Dim pdfBurnerParams As PDFBurnerParams = pContext.MergedJobDataMap.Item(Value.PDF_BURNER_PARAMS)
|
||||
PDFBurner = New PDFBurner(LogConfig, oGdPictureKey, pdfBurnerParams)
|
||||
|
||||
Logger.Debug("Loading PDFMerger..")
|
||||
@ -440,7 +440,7 @@ Namespace Jobs
|
||||
End Sub
|
||||
|
||||
Private Function GetDatabase(pContext As IJobExecutionContext, pLogConfig As LogConfig) As MSSQLServer
|
||||
Dim oConnectionString As String = pContext.MergedJobDataMap.Item(Domain.Constants.DATABASE)
|
||||
Dim oConnectionString As String = pContext.MergedJobDataMap.Item(Value.DATABASE)
|
||||
Dim Database = New MSSQLServer(pLogConfig, MSSQLServer.DecryptConnectionString(oConnectionString))
|
||||
|
||||
Return Database
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
Imports System.Data.SqlClient
|
||||
Imports DigitalData.Modules.Base
|
||||
Imports EnvelopeGenerator.Domain.Constants
|
||||
Imports EnvelopeGenerator.Domain.Entities
|
||||
|
||||
Public Class HistoryModel
|
||||
@ -28,7 +29,7 @@ Public Class HistoryModel
|
||||
End Function
|
||||
|
||||
Public Function HasReceiverSigned(pEnvelopeId As Integer, pReceiverId As Integer) As Boolean
|
||||
Dim oEnvelopeSigned As Integer = Domain.EnvelopeStatus.DocumentSigned
|
||||
Dim oEnvelopeSigned As Integer = EnvelopeStatus.DocumentSigned
|
||||
Dim oSql = $"SELECT COUNT(T.GUID)
|
||||
FROM TBSIG_ENVELOPE_HISTORY T
|
||||
JOIN TBSIG_RECEIVER T2 ON T.USER_REFERENCE = T2.EMAIL_ADDRESS
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
Imports DigitalData.Modules.Logging
|
||||
Imports EnvelopeGenerator.CommonServices.EnvelopeGenerator.Domain.Entities
|
||||
Imports EnvelopeGenerator.Domain.Constants
|
||||
Imports EnvelopeGenerator.Domain.Entities
|
||||
|
||||
Public Class EmailService
|
||||
@ -17,7 +18,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.EnvelopeStatus.MessageDeletionSent) With
|
||||
Dim oEmailData As New EmailData(pEnvelope, pReceiver, EnvelopeStatus.MessageDeletionSent) With
|
||||
{
|
||||
.SignatureLink = "",
|
||||
.ADDED_WHO_PROCESS = pEnvelope.CURRENT_WORK_APP
|
||||
@ -35,7 +36,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.EnvelopeStatus.MessageInvitationSent) With
|
||||
Dim oEmailData As New EmailData(pEnvelope, pReceiver, EnvelopeStatus.MessageInvitationSent) With
|
||||
{
|
||||
.SignatureLink = Helpers.GetEnvelopeURL(State.DbConfig.SignatureHost, pEnvelope.Uuid, pReceiver.Signature),
|
||||
.ADDED_WHO_PROCESS = pEnvelope.CURRENT_WORK_APP
|
||||
@ -55,7 +56,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.EnvelopeStatus.MessageInvitationSent) With
|
||||
Dim oEmailData As New EmailData(pEnvelope, pReceiver, EnvelopeStatus.MessageInvitationSent) With
|
||||
{
|
||||
.SignatureLink = Helpers.GetEnvelopeURL(State.DbConfig.SignatureHost, pEnvelope.Uuid, pReceiver.Signature),
|
||||
.ADDED_WHO_PROCESS = pEnvelope.CURRENT_WORK_APP
|
||||
@ -69,7 +70,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.EnvelopeStatus.MessageAccessCodeSent) With
|
||||
Dim oEmailData As New EmailData(pEnvelope, pReceiver, EnvelopeStatus.MessageAccessCodeSent) With
|
||||
{
|
||||
.SignatureLink = Helpers.GetEnvelopeURL(State.DbConfig.SignatureHost, pEnvelope.Uuid, pReceiver.Signature),
|
||||
.ADDED_WHO_PROCESS = pEnvelope.CURRENT_WORK_APP
|
||||
@ -87,7 +88,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.EnvelopeStatus.MessageConfirmationSent) With
|
||||
Dim oEmailData = New EmailData(pEnvelope, pReceiver, EnvelopeStatus.MessageConfirmationSent) With
|
||||
{
|
||||
.SignatureLink = ""
|
||||
}
|
||||
@ -104,7 +105,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.EnvelopeStatus.MessageCompletionSent) With
|
||||
Dim oEmailData = New EmailData(pEnvelope, pReceiver, EnvelopeStatus.MessageCompletionSent) With
|
||||
{
|
||||
.SignatureLink = "",
|
||||
.ATT1_RELATED_ID = pEnvelope.Id,
|
||||
@ -125,7 +126,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.EnvelopeStatus.MessageCompletionSent) With
|
||||
Dim oEmailData = New EmailData(pEnvelope, EnvelopeStatus.MessageCompletionSent) With
|
||||
{
|
||||
.SignatureLink = "",
|
||||
.ATT1_RELATED_ID = pEnvelope.Id,
|
||||
|
||||
@ -28,8 +28,8 @@ Public Class Scheduler_Envelopetask_API
|
||||
BuildScheduler()
|
||||
Dim oJobKey = New JobKey(JobName)
|
||||
Dim oJobData = New JobDataMap() From {
|
||||
{Domain.Constants.LOGCONFIG, LogConfig},
|
||||
{Domain.Constants.DATABASE, ConnectionString}
|
||||
{Value.LOGCONFIG, LogConfig},
|
||||
{Value.DATABASE, ConnectionString}
|
||||
}
|
||||
|
||||
Logger.Debug("Initialized Job [{0}]", JobName)
|
||||
|
||||
@ -37,9 +37,9 @@ Public Class Scheduler_FinishEnvelope
|
||||
|
||||
Dim oJobKey = New JobKey(JobName)
|
||||
Dim oJobData = New JobDataMap() From {
|
||||
{Domain.Constants.GDPICTURE, LicenseKey},
|
||||
{Domain.Constants.LOGCONFIG, LogConfig},
|
||||
{Domain.Constants.DATABASE, ConnectionString},
|
||||
{Value.GDPICTURE, LicenseKey},
|
||||
{Value.LOGCONFIG, LogConfig},
|
||||
{Value.DATABASE, ConnectionString},
|
||||
{Domain.Constants.PDF_BURNER_PARAMS, _pdfBurnerParams}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user