This commit is contained in:
Jonathan Jenne
2023-11-30 14:00:30 +01:00
parent 1b88a6cff7
commit c2de72be74
25 changed files with 875 additions and 148 deletions

View File

@@ -7,12 +7,12 @@ namespace EnvelopeGenerator.Web.Controllers
public class EnvelopeController : BaseController
{
private readonly EnvelopeService envelopeService;
private readonly EmailService emailService;
private readonly ActionService actionService;
public EnvelopeController(DatabaseService database, LoggingService logging, EnvelopeService envelope) : base(database, logging)
{
envelopeService = envelope;
emailService = new(state);
actionService = database.Services?.actionService;
}
[HttpGet]
@@ -52,17 +52,19 @@ namespace EnvelopeGenerator.Web.Controllers
string annotationData = await envelopeService.EnsureValidAnnotationData(Request);
envelopeService.InsertDocumentStatus(new DocumentStatus()
{
EnvelopeId = response.Envelope.Id,
ReceiverId = response.Receiver.Id,
Value = annotationData,
Status = Common.Constants.DocumentStatus.Signed
});
//envelopeService.InsertDocumentStatus(new DocumentStatus()
//{
// EnvelopeId = response.Envelope.Id,
// ReceiverId = response.Receiver.Id,
// Value = annotationData,
// Status = Common.Constants.DocumentStatus.Signed
//});
envelopeService.InsertHistoryEntrySigned(response);
//envelopeService.InsertHistoryEntrySigned(response);
emailService.SendSignedEmail(response.Receiver.Id, response.Envelope.Id);
//emailService.SendSignedEmail(response.Receiver.Id, response.Envelope.Id);
var signResult = actionService?.SignEnvelope(response.Envelope, response.Receiver.Id);
return Ok();
}