public async Task <IActionResult> PostExtendedArrangementData([FromRoute] long applicationNumber, [FromRoute] int arrangementRequestId, [FromBody] Offer.API.Application.Commands.ArrangementRequests.PutExtendedPartyCommand command) { command.ApplicationNumber = applicationNumber; command.ArrangementRequestId = arrangementRequestId; var postExtendedDataCommand = new IdentifiedCommand <Offer.API.Application.Commands.ArrangementRequests.PutExtendedPartyCommand, CommandStatus>(command, new Guid()); CommandStatus commandResult = await _mediator.Send(postExtendedDataCommand); if (commandResult.CommandResult.Equals(StandardCommandResult.OK)) { return(Ok()); } else if (commandResult.CommandResult.Equals(StandardCommandResult.NOT_FOUND)) { return(BadRequest()); } else if (commandResult.CommandResult.Equals(StandardCommandResult.BAD_REQUEST)) { return(BadRequest()); } else if (commandResult.Equals(StandardCommandResult.INTERNAL_ERROR)) { _logger.LogError(commandResult.Exception, "An error occurred while putting extended sections to arrangement request"); return(StatusCode(500)); } else { _logger.LogError("An unknown error occurred while putting extended sections to arrangement request"); return(StatusCode(500)); } }
public async Task <IActionResult> PatchInvolvedParty([FromRoute] long applicationNumber, [FromRoute] int partyId, [FromBody] PatchInvolvedPartyCommand command) { command.ApplicationNumber = applicationNumber; command.PartyId = partyId; var patchDataCompleteness = new IdentifiedCommand <PatchInvolvedPartyCommand, CommandStatus>(command, new Guid()); CommandStatus commandResult = await _mediator.Send(patchDataCompleteness); if (commandResult.CommandResult.Equals(StandardCommandResult.OK)) { return(Ok()); } else if (commandResult.CommandResult.Equals(StandardCommandResult.BAD_REQUEST)) { return(BadRequest()); } else if (commandResult.CommandResult.Equals(StandardCommandResult.NOT_FOUND)) { return(BadRequest()); } else if (commandResult.Equals(StandardCommandResult.INTERNAL_ERROR)) { _logger.LogError(commandResult.Exception, "An error occurred while patching data completeness to party"); return(StatusCode(500)); } else { _logger.LogError("An unknown error occurred while patching data completeness to party"); return(StatusCode(500)); } }