public async Task <ISaida> CadastrarLancamento([FromBody, SwaggerParameter("Informações de cadastro do lançamento.", Required = true)] CadastrarLancamentoViewModel model)
        {
            var cadastrarEntrada = new CadastrarLancamentoEntrada(
                base.ObterIdUsuarioClaim(),
                model.IdConta.Value,
                model.IdCategoria.Value,
                model.Data.Value,
                model.Valor.Value,
                model.IdPessoa,
                null,
                model.Observacao);

            return(await _lancamentoServico.CadastrarLancamento(cadastrarEntrada));
        }
Beispiel #2
0
        public async Task <IActionResult> CadastrarLancamento([FromBody, SwaggerParameter("Informações de cadastro do lançamento.", Required = true)] LancamentoViewModel model)
        {
            var entrada = new LancamentoEntrada(
                base.ObterIdUsuarioClaim(),
                model.IdConta.Value,
                model.IdCategoria.Value,
                model.Data.Value,
                model.Valor.Value,
                model.QuantidadeAcoes,
                model.IdPessoa,
                null,
                model.Observacao);

            return(new ApiResult(await _lancamentoServico.CadastrarLancamento(entrada)));
        }