feat(HomeController): Historischer Prozess zum Speichern von Umschlägen hinzugefügt, die unter dem Endpunkt EnvelopeReceiverReadOnly angezeigt werden.
This commit is contained in:
@@ -11,12 +11,12 @@ using EnvelopeGenerator.Extensions;
|
|||||||
using Microsoft.Extensions.Localization;
|
using Microsoft.Extensions.Localization;
|
||||||
using DigitalData.Core.DTO;
|
using DigitalData.Core.DTO;
|
||||||
using Microsoft.AspNetCore.Localization;
|
using Microsoft.AspNetCore.Localization;
|
||||||
using System.Text.Encodings.Web;
|
|
||||||
using EnvelopeGenerator.Web.Models;
|
using EnvelopeGenerator.Web.Models;
|
||||||
using EnvelopeGenerator.Application.Resources;
|
using EnvelopeGenerator.Application.Resources;
|
||||||
using EnvelopeGenerator.Application.DTOs.EnvelopeReceiver;
|
using EnvelopeGenerator.Application.DTOs.EnvelopeReceiver;
|
||||||
using static EnvelopeGenerator.Common.Constants;
|
using static EnvelopeGenerator.Common.Constants;
|
||||||
using Ganss.Xss;
|
using Ganss.Xss;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Web.Controllers
|
namespace EnvelopeGenerator.Web.Controllers
|
||||||
{
|
{
|
||||||
@@ -340,6 +340,16 @@ namespace EnvelopeGenerator.Web.Controllers
|
|||||||
|
|
||||||
EnvelopeResponse response = await envelopeOldService.LoadEnvelope(envelopeKey);
|
EnvelopeResponse response = await envelopeOldService.LoadEnvelope(envelopeKey);
|
||||||
|
|
||||||
|
//TODO: implement multi-threading to history process (Task)
|
||||||
|
var hist_res = await _historyService.RecordAsync((int)erro.EnvelopeId, erro.AddedWho, EnvelopeStatus.EnvelopeViewed);
|
||||||
|
if (hist_res.IsFailed)
|
||||||
|
{
|
||||||
|
_logger.LogError(
|
||||||
|
"Although the envelope was sent as read-only, the EnvelopeShared hisotry could not be saved. ReadOnly-key: {readOnlyKey}\nEnvelope Receiver:\n{envelopeReceiver}",
|
||||||
|
readOnlyKey, JsonConvert.SerializeObject(er));
|
||||||
|
_logger.LogNotice(hist_res.Notices);
|
||||||
|
}
|
||||||
|
|
||||||
if (response.Envelope.Documents.Count > 0)
|
if (response.Envelope.Documents.Count > 0)
|
||||||
{
|
{
|
||||||
var document = await envelopeOldService.GetDocument(response.Envelope.Documents[0].Id, envelopeKey);
|
var document = await envelopeOldService.GetDocument(response.Envelope.Documents[0].Id, envelopeKey);
|
||||||
|
|||||||
@@ -80,9 +80,9 @@ namespace EnvelopeGenerator.Web.Controllers
|
|||||||
//send email two receiver
|
//send email two receiver
|
||||||
return await _mailService.SendAsync(new_erro).ThenAsync<int, IActionResult>(SuccessAsync: async res =>
|
return await _mailService.SendAsync(new_erro).ThenAsync<int, IActionResult>(SuccessAsync: async res =>
|
||||||
{
|
{
|
||||||
|
//TODO: implement multi-threading to history process (Task)
|
||||||
//TODO: remove casting after change the id type
|
//TODO: remove casting after change the id type
|
||||||
var hist_res = await _histService.RecordAsync((int) createDto.EnvelopeId, createDto.AddedWho, Common.Constants.EnvelopeStatus.EnvelopeShared);
|
var hist_res = await _histService.RecordAsync((int) createDto.EnvelopeId, createDto.AddedWho, Common.Constants.EnvelopeStatus.EnvelopeShared);
|
||||||
|
|
||||||
if (hist_res.IsFailed)
|
if (hist_res.IsFailed)
|
||||||
{
|
{
|
||||||
_logger.LogError("Although the envelope was sent as read-only, the EnvelopeShared hisotry could not be saved. Create DTO:\n{createDto}", JsonConvert.SerializeObject(createDto));
|
_logger.LogError("Although the envelope was sent as read-only, the EnvelopeShared hisotry could not be saved. Create DTO:\n{createDto}", JsonConvert.SerializeObject(createDto));
|
||||||
|
|||||||
Reference in New Issue
Block a user