public async Task <IActionResult> AprovarAtasPostAsync(Guid id, Guid ataId) { var reuniao = await ObterReuniaoAsync(id); var command = new AprovarAtaDeReuniaoCommand() { Reuniao = reuniao, AtaId = ataId }; await mediator.Send(command); return(NoContent()); }
public async Task <Unit> Handle(AprovarAtaDeReuniaoCommand request, CancellationToken cancellationToken) { if (request.Reuniao.Ata == null) { throw new AtaDeReuniaoAindaNaoGeradaException(); } if (request.Reuniao.Ata.Id != request.AtaId) { throw new AtaDeReuniaoInvalidaException(); } request.Reuniao.Ata.Aprovar(userPrincipalBuilder.UserPrincipal.UserName); return(await ProcederComAAtualizacaoDaReuniaoAsync(request.Reuniao)); }