feat(ReceiverVM): add From method to be able to generate from EnvelopeReceiver
This commit is contained in:
parent
9045655262
commit
0f27600c5b
@ -1,8 +1,5 @@
|
|||||||
Imports System.Data.SqlClient
|
Imports System.Data.SqlClient
|
||||||
Imports System.Net.Mail
|
|
||||||
Imports DevExpress.DataProcessing
|
|
||||||
Imports DigitalData.Modules.Base
|
Imports DigitalData.Modules.Base
|
||||||
Imports EnvelopeGenerator.CommonServices.EnvelopeGenerator.Domain.Entities
|
|
||||||
Imports EnvelopeGenerator.Domain.Constants
|
Imports EnvelopeGenerator.Domain.Constants
|
||||||
Imports EnvelopeGenerator.Domain.Entities
|
Imports EnvelopeGenerator.Domain.Entities
|
||||||
|
|
||||||
|
|||||||
@ -2,13 +2,32 @@
|
|||||||
Imports EnvelopeGenerator.Domain
|
Imports EnvelopeGenerator.Domain
|
||||||
Imports EnvelopeGenerator.Domain.Entities
|
Imports EnvelopeGenerator.Domain.Entities
|
||||||
|
|
||||||
Namespace EnvelopeGenerator.Domain.Entities
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' Handles the combination of the envelope and receiver for common services and submodules as a view model.
|
''' Handles the combination of the envelope and receiver for common services and submodules as a view model.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public Class ReceiverVM
|
Public Class ReceiverVM
|
||||||
Inherits EnvelopeReceiver
|
Inherits EnvelopeReceiver
|
||||||
|
|
||||||
|
Public Shared Function From(source As EnvelopeReceiver) As ReceiverVM
|
||||||
|
Return New ReceiverVM() With {
|
||||||
|
.EnvelopeId = source.EnvelopeId,
|
||||||
|
.ReceiverId = source.ReceiverId,
|
||||||
|
.Sequence = source.Sequence,
|
||||||
|
.Name = source.Name,
|
||||||
|
.JobTitle = source.JobTitle,
|
||||||
|
.CompanyName = source.CompanyName,
|
||||||
|
.PrivateMessage = source.PrivateMessage,
|
||||||
|
.AccessCode = source.AccessCode,
|
||||||
|
.AddedWhen = source.AddedWhen,
|
||||||
|
.ChangedWhen = source.ChangedWhen,
|
||||||
|
.PhoneNumber = source.PhoneNumber,
|
||||||
|
.Company = source.Company,
|
||||||
|
.Status = source.Status,
|
||||||
|
.Envelope = source.Envelope,
|
||||||
|
.Receiver = source.Receiver
|
||||||
|
}
|
||||||
|
End Function
|
||||||
|
|
||||||
Private ReadOnly Property SReceiver As Receiver
|
Private ReadOnly Property SReceiver As Receiver
|
||||||
Get
|
Get
|
||||||
If Receiver Is Nothing Then
|
If Receiver Is Nothing Then
|
||||||
@ -99,5 +118,3 @@ Namespace EnvelopeGenerator.Domain.Entities
|
|||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
End Class
|
End Class
|
||||||
|
|
||||||
End Namespace
|
|
||||||
|
|||||||
@ -97,7 +97,7 @@ public class EnvelopeController : BaseController
|
|||||||
Status = Constants.DocumentStatus.Signed
|
Status = Constants.DocumentStatus.Signed
|
||||||
});
|
});
|
||||||
|
|
||||||
var signResult = actionService?.SignEnvelope(response.Envelope, response.Receiver);
|
var signResult = actionService?.SignEnvelope(response.Envelope, ReceiverVM.From(response));
|
||||||
|
|
||||||
return Ok(new object());
|
return Ok(new object());
|
||||||
}
|
}
|
||||||
|
|||||||
@ -82,7 +82,7 @@ public class EnvelopeOldService
|
|||||||
|
|
||||||
_logger.LogInformation("Envelope receivers found: [{0}]", envelope.Receivers.Count);
|
_logger.LogInformation("Envelope receivers found: [{0}]", envelope.Receivers.Count);
|
||||||
|
|
||||||
Receiver? receiver = envelope.Receivers.Where(r => r.Id == receiverId).SingleOrDefault();
|
Receiver? receiver = envelope.Receivers.Where(r => r.ReceiverId == receiverId).SingleOrDefault()?.Receiver;
|
||||||
|
|
||||||
if (receiver == null)
|
if (receiver == null)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -9,7 +9,7 @@
|
|||||||
string encodeEnvelopeKey(Envelope envelope)
|
string encodeEnvelopeKey(Envelope envelope)
|
||||||
{
|
{
|
||||||
var receiver = envelope.Receivers.First();
|
var receiver = envelope.Receivers.First();
|
||||||
return Helpers.EncodeEnvelopeReceiverId(envelope.Uuid, receiver.Signature);
|
return Helpers.EncodeEnvelopeReceiverId(envelope.Uuid, receiver.Receiver.Signature);
|
||||||
}
|
}
|
||||||
|
|
||||||
IEnumerable<IGrouping<EnvelopeStatus, Envelope>> groupEnvelopes(List<Envelope> envelopes)
|
IEnumerable<IGrouping<EnvelopeStatus, Envelope>> groupEnvelopes(List<Envelope> envelopes)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user