public IActionResult PagarConsulta([FromBody] PagarConsultaViewModel viewModel) { if (!ModelState.IsValid) { return(Ok(new ResponseHelper("VIEW MODEL INVALIDA", false, null))); } try { var result = _consultaAppService.PagarConsulta(viewModel); return(Ok(new ResponseHelper("CONSULTA CADASTRADA COM SUCESSO", true, result))); } catch (Exception e) { return(Ok(new ResponseHelper(e.Message, false, e.InnerException))); } }
public ConsultaPagaViewModel PagarConsulta(PagarConsultaViewModel viewModel) { return(_mapper.Map <ConsultaPagaViewModel>(_consultaService.PagarConsulta(viewModel.Id, _mapper.Map <IEnumerable <Pagamento> >(viewModel.Pagamentos)))); }