refactor(EnvelopeStatus): umbenennen in EnvelopeReceiver
This commit is contained in:
parent
806b990556
commit
79204d4f6d
@ -1,4 +1,4 @@
|
|||||||
Public Class EnvelopeResponse
|
Public Class EnvelopeReceiver
|
||||||
Public Property Envelope As Envelope
|
Public Property Envelope As Envelope
|
||||||
Public Property Receiver As Receiver
|
Public Property Receiver As Receiver
|
||||||
End Class
|
End Class
|
||||||
@ -285,7 +285,7 @@
|
|||||||
<Compile Include="Entities\EnvelopeDocumentElement.vb" />
|
<Compile Include="Entities\EnvelopeDocumentElement.vb" />
|
||||||
<Compile Include="Entities\EnvelopeHistoryEntry.vb" />
|
<Compile Include="Entities\EnvelopeHistoryEntry.vb" />
|
||||||
<Compile Include="Entities\Receiver.vb" />
|
<Compile Include="Entities\Receiver.vb" />
|
||||||
<Compile Include="Entities\EnvelopeResponse.vb" />
|
<Compile Include="Entities\EnvelopeReceiver.vb" />
|
||||||
<Compile Include="Entities\EnvelopeType.vb" />
|
<Compile Include="Entities\EnvelopeType.vb" />
|
||||||
<Compile Include="Entities\State.vb" />
|
<Compile Include="Entities\State.vb" />
|
||||||
<Compile Include="Helpers.vb" />
|
<Compile Include="Helpers.vb" />
|
||||||
|
|||||||
@ -30,7 +30,7 @@ namespace EnvelopeGenerator.Web.Controllers
|
|||||||
{
|
{
|
||||||
// Validate Envelope Key and load envelope
|
// Validate Envelope Key and load envelope
|
||||||
envelopeService.EnsureValidEnvelopeKey(envelopeKey);
|
envelopeService.EnsureValidEnvelopeKey(envelopeKey);
|
||||||
EnvelopeResponse response = await envelopeService.LoadEnvelope(envelopeKey);
|
EnvelopeReceiver response = await envelopeService.LoadEnvelope(envelopeKey);
|
||||||
|
|
||||||
// Load document info
|
// Load document info
|
||||||
var document = await envelopeService.GetDocument(index, envelopeKey);
|
var document = await envelopeService.GetDocument(index, envelopeKey);
|
||||||
@ -61,7 +61,7 @@ namespace EnvelopeGenerator.Web.Controllers
|
|||||||
|
|
||||||
// Validate Envelope Key and load envelope
|
// Validate Envelope Key and load envelope
|
||||||
envelopeService.EnsureValidEnvelopeKey(envelopeKey);
|
envelopeService.EnsureValidEnvelopeKey(envelopeKey);
|
||||||
EnvelopeResponse response = await envelopeService.LoadEnvelope(envelopeKey);
|
EnvelopeReceiver response = await envelopeService.LoadEnvelope(envelopeKey);
|
||||||
|
|
||||||
actionService?.OpenEnvelope(response.Envelope, response.Receiver);
|
actionService?.OpenEnvelope(response.Envelope, response.Receiver);
|
||||||
|
|
||||||
|
|||||||
@ -47,7 +47,7 @@ namespace EnvelopeGenerator.Web.Controllers
|
|||||||
// Validate Envelope Key and load envelope
|
// Validate Envelope Key and load envelope
|
||||||
envelopeService.EnsureValidEnvelopeKey(envelopeKey);
|
envelopeService.EnsureValidEnvelopeKey(envelopeKey);
|
||||||
|
|
||||||
EnvelopeResponse response = await envelopeService.LoadEnvelope(envelopeKey);
|
EnvelopeReceiver response = await envelopeService.LoadEnvelope(envelopeKey);
|
||||||
|
|
||||||
if (envelopeService.ReceiverAlreadySigned(response.Envelope, response.Receiver.Id) == true)
|
if (envelopeService.ReceiverAlreadySigned(response.Envelope, response.Receiver.Id) == true)
|
||||||
{
|
{
|
||||||
@ -79,7 +79,7 @@ namespace EnvelopeGenerator.Web.Controllers
|
|||||||
|
|
||||||
// Validate Envelope Key and load envelope
|
// Validate Envelope Key and load envelope
|
||||||
envelopeService.EnsureValidEnvelopeKey(envelopeKey);
|
envelopeService.EnsureValidEnvelopeKey(envelopeKey);
|
||||||
EnvelopeResponse response = await envelopeService.LoadEnvelope(envelopeKey);
|
EnvelopeReceiver response = await envelopeService.LoadEnvelope(envelopeKey);
|
||||||
|
|
||||||
// Again check if receiver has already signed
|
// Again check if receiver has already signed
|
||||||
if (envelopeService.ReceiverAlreadySigned(response.Envelope, response.Receiver.Id) == true)
|
if (envelopeService.ReceiverAlreadySigned(response.Envelope, response.Receiver.Id) == true)
|
||||||
|
|||||||
@ -106,7 +106,7 @@ public class HomeController : ViewControllerBase
|
|||||||
|
|
||||||
var er = er_res.Data;
|
var er = er_res.Data;
|
||||||
|
|
||||||
EnvelopeResponse response = await envelopeOldService.LoadEnvelope(envelopeReceiverId);
|
EnvelopeReceiver response = await envelopeOldService.LoadEnvelope(envelopeReceiverId);
|
||||||
|
|
||||||
bool accessCodeAlreadyRequested = await _historyService.AccessCodeAlreadyRequested(envelopeId: er.Envelope!.Id, userReference: er.Receiver!.EmailAddress);
|
bool accessCodeAlreadyRequested = await _historyService.AccessCodeAlreadyRequested(envelopeId: er.Envelope!.Id, userReference: er.Receiver!.EmailAddress);
|
||||||
if (!accessCodeAlreadyRequested)
|
if (!accessCodeAlreadyRequested)
|
||||||
@ -182,7 +182,7 @@ public class HomeController : ViewControllerBase
|
|||||||
_logger.LogInformation("Envelope UUID: [{uuid}]\nReceiver Signature: [{signature}]", uuid, signature);
|
_logger.LogInformation("Envelope UUID: [{uuid}]\nReceiver Signature: [{signature}]", uuid, signature);
|
||||||
|
|
||||||
//check access code
|
//check access code
|
||||||
EnvelopeResponse response = await envelopeOldService.LoadEnvelope(envelopeReceiverId);
|
EnvelopeReceiver response = await envelopeOldService.LoadEnvelope(envelopeReceiverId);
|
||||||
|
|
||||||
//check rejection
|
//check rejection
|
||||||
var rejRcvrs = await _historyService.ReadRejectingReceivers(er.Envelope!.Id);
|
var rejRcvrs = await _historyService.ReadRejectingReceivers(er.Envelope!.Id);
|
||||||
@ -342,7 +342,7 @@ public class HomeController : ViewControllerBase
|
|||||||
_logger.LogInformation("Envelope UUID: [{uuid}]\nReceiver Signature: [{signature}]", uuid, signature);
|
_logger.LogInformation("Envelope UUID: [{uuid}]\nReceiver Signature: [{signature}]", uuid, signature);
|
||||||
|
|
||||||
//check access code
|
//check access code
|
||||||
EnvelopeResponse response = await envelopeOldService.LoadEnvelope(envelopeReceiverId);
|
EnvelopeReceiver response = await envelopeOldService.LoadEnvelope(envelopeReceiverId);
|
||||||
|
|
||||||
var er_secret_res = await _envRcvService.ReadWithSecretByUuidSignatureAsync(uuid: uuid, signature: signature);
|
var er_secret_res = await _envRcvService.ReadWithSecretByUuidSignatureAsync(uuid: uuid, signature: signature);
|
||||||
|
|
||||||
@ -407,20 +407,20 @@ public class HomeController : ViewControllerBase
|
|||||||
{
|
{
|
||||||
envelopeReceiverId = _sanitizer.Sanitize(envelopeReceiverId);
|
envelopeReceiverId = _sanitizer.Sanitize(envelopeReceiverId);
|
||||||
return await _envRcvService.IsExisting(envelopeReceiverId: envelopeReceiverId).ThenAsync(
|
return await _envRcvService.IsExisting(envelopeReceiverId: envelopeReceiverId).ThenAsync(
|
||||||
SuccessAsync: async isExisting =>
|
SuccessAsync: (Func<bool, Task<IActionResult>>)(async isExisting =>
|
||||||
{
|
{
|
||||||
if(!isExisting)
|
if(!isExisting)
|
||||||
return this.ViewEnvelopeNotFound();
|
return this.ViewEnvelopeNotFound();
|
||||||
|
|
||||||
EnvelopeResponse response = await envelopeOldService.LoadEnvelope(envelopeReceiverId);
|
Common.EnvelopeReceiver response = await envelopeOldService.LoadEnvelope(envelopeReceiverId);
|
||||||
if (!envelopeOldService.ReceiverAlreadySigned(response.Envelope, response.Receiver.Id))
|
if (!envelopeOldService.ReceiverAlreadySigned((Envelope)response.Envelope, (int)response.Receiver.Id))
|
||||||
return Redirect($"/EnvelopeKey/{envelopeReceiverId}/Locked");
|
return base.Redirect($"/EnvelopeKey/{envelopeReceiverId}/Locked");
|
||||||
|
|
||||||
await HttpContext.SignOutAsync(CookieAuthenticationDefaults.AuthenticationScheme);
|
await HttpContext.SignOutAsync(CookieAuthenticationDefaults.AuthenticationScheme);
|
||||||
ViewData["UserCulture"] = _cultures[UserLanguage];
|
ViewData["UserCulture"] = _cultures[UserLanguage];
|
||||||
ViewData["EnvelopeKey"] = envelopeReceiverId;
|
ViewData["EnvelopeKey"] = envelopeReceiverId;
|
||||||
return View();
|
return base.View();
|
||||||
},
|
}),
|
||||||
Fail: IActionResult (messages, notices) =>
|
Fail: IActionResult (messages, notices) =>
|
||||||
{
|
{
|
||||||
_logger.LogNotice(notices);
|
_logger.LogNotice(notices);
|
||||||
@ -500,7 +500,7 @@ public class HomeController : ViewControllerBase
|
|||||||
{
|
{
|
||||||
var envelopeKey = (er.Envelope!.Uuid, er.Receiver!.Signature).EncodeEnvelopeReceiverId();
|
var envelopeKey = (er.Envelope!.Uuid, er.Receiver!.Signature).EncodeEnvelopeReceiverId();
|
||||||
|
|
||||||
EnvelopeResponse response = await envelopeOldService.LoadEnvelope(envelopeKey);
|
EnvelopeReceiver response = await envelopeOldService.LoadEnvelope(envelopeKey);
|
||||||
|
|
||||||
//TODO: implement multi-threading to history process (Task)
|
//TODO: implement multi-threading to history process (Task)
|
||||||
var hist_res = await _historyService.RecordAsync((int)erro.EnvelopeId, erro.AddedWho, EnvelopeStatus.EnvelopeViewed);
|
var hist_res = await _historyService.RecordAsync((int)erro.EnvelopeId, erro.AddedWho, EnvelopeStatus.EnvelopeViewed);
|
||||||
|
|||||||
@ -48,7 +48,7 @@ namespace EnvelopeGenerator.Web.Services
|
|||||||
throw new ArgumentNullException("ReceiverSignature");
|
throw new ArgumentNullException("ReceiverSignature");
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<EnvelopeResponse> LoadEnvelope(string pEnvelopeKey)
|
public async Task<EnvelopeReceiver> LoadEnvelope(string pEnvelopeKey)
|
||||||
{
|
{
|
||||||
_logger.LogInformation("Loading Envelope by Key [{0}]", pEnvelopeKey);
|
_logger.LogInformation("Loading Envelope by Key [{0}]", pEnvelopeKey);
|
||||||
|
|
||||||
@ -152,7 +152,7 @@ namespace EnvelopeGenerator.Web.Services
|
|||||||
|
|
||||||
public async Task<EnvelopeDocument> GetDocument(int documentId, string envelopeKey)
|
public async Task<EnvelopeDocument> GetDocument(int documentId, string envelopeKey)
|
||||||
{
|
{
|
||||||
EnvelopeResponse response = await LoadEnvelope(envelopeKey);
|
EnvelopeReceiver response = await LoadEnvelope(envelopeKey);
|
||||||
|
|
||||||
_logger.LogInformation("Loading document for Id [{0}]", documentId);
|
_logger.LogInformation("Loading document for Id [{0}]", documentId);
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user