Refaktorierung: Hauptentität auf EnvelopeReceiver geändert; Endlosschleifen-Bug behoben

- HomeController und ShowEnvelopeView aktualisiert.
- Endlosschleifenproblem zwischen Envelope und EnvelopeReceiver gelöst.
- Anpassungen an Envelope, EnvelopeDTO, EnvelopeRepository und EnvelopeService vorgenommen.
This commit is contained in:
Developer 02
2024-05-03 14:00:58 +02:00
parent eb096cb201
commit 9620cb7189
9 changed files with 22 additions and 35 deletions

View File

@@ -17,16 +17,16 @@ namespace EnvelopeGenerator.Web.Controllers.Test
public override Task<IActionResult> GetAll() => base.GetAll();
[HttpGet]
public async Task<IActionResult> GetAll([FromQuery] string? envelopeKey = default, [FromQuery] bool withDocuments = false, [FromQuery] bool withEnvelopeReceivers = false, [FromQuery] bool withHistory = false, [FromQuery] bool withDocumentReceiverElement = false, [FromQuery] bool withUser = false, [FromQuery] bool withAll = true)
public async Task<IActionResult> GetAll([FromQuery] string? envelopeKey = default, [FromQuery] bool withDocuments = false, [FromQuery] bool withHistory = false, [FromQuery] bool withDocumentReceiverElement = false, [FromQuery] bool withUser = false, [FromQuery] bool withAll = true)
{
if(envelopeKey is not null)
{
var decoded = envelopeKey.DecodeEnvelopeReceiverId();
(var uuid, var signature) = envelopeKey.DecodeEnvelopeReceiverId();
if (uuid is null)
return BadRequest("UUID is null");
var envlopeServiceResult = await _service.ReadByUuidAsync(
uuid: decoded.EnvelopeUuid,
signature: decoded.ReceiverSignature,
withDocuments: withDocuments, withEnvelopeReceivers: withEnvelopeReceivers, withHistory: withHistory, withDocumentReceiverElement:withDocumentReceiverElement, withUser:withUser, withAll:withAll);
uuid: uuid,
withDocuments: withDocuments, withHistory: withHistory, withDocumentReceiverElement:withDocumentReceiverElement, withUser:withUser, withAll:withAll);
if (envlopeServiceResult.IsSuccess)
{
@@ -35,7 +35,7 @@ namespace EnvelopeGenerator.Web.Controllers.Test
return NotFound();
}
var result = await _service.ReadAllWithAsync(documents: withDocuments, envelopeReceivers: withEnvelopeReceivers, history: withHistory);
var result = await _service.ReadAllWithAsync(documents: withDocuments, history: withHistory);
if (result.IsSuccess)
{
return Ok(result);