public async Task <bool> Executar(FiltroRelatorioPlanoAulaDto filtro) { var usuarioLogado = await mediator.Send(new ObterUsuarioLogadoQuery()); filtro.Usuario = usuarioLogado; if (usuarioLogado == null) { throw new NegocioException("Não foi possível identificar o usuário"); } await mediator.Send(new ValidaSeExistePlanoAulaPorIdQuery(filtro.PlanoAulaId)); return(await mediator.Send(new GerarRelatorioCommand(TipoRelatorio.PlanoAula, filtro, usuarioLogado))); }
public async Task <IActionResult> PlanoAula([FromBody] FiltroRelatorioPlanoAulaDto filtro, [FromServices] IRelatorioPlanoAulaUseCase useCase) { return(Ok(await useCase.Executar(filtro))); }