Ejemplo n.º 1
0
        public async Task <IActionResult> CadastrarCliente([FromBody] CadastrarClienteViewModel cliente)
        {
            var consultorId = string.IsNullOrWhiteSpace(_user?.ConsultorId) ? (Guid?)null : Guid.Parse(_user.ConsultorId);

            var response = await _clienteAppService.CadastrarCliente(cliente.Cpf, cliente.NomeCompleto, cliente.DataNascimento, cliente.Email,
                                                                     cliente.TelefoneFixo, cliente.TelefoneCelular, consultorId,
                                                                     cliente.InssNumeroBeneficio, cliente.InssSalario, cliente.InssEspecie, cliente.OutrosDiaPagamento);

            return(Response(response));
        }
Ejemplo n.º 2
0
        public IActionResult CadastrarCliente(ClienteCadastroViewModel clienteViewModel)
        {
            var retorno = clienteAppService.CadastrarCliente(clienteViewModel);

            if (retorno <= 0)
            {
                return(NotFound());
            }

            return(Ok(retorno));
        }
Ejemplo n.º 3
0
        public async Task <IActionResult> CadastrarCliente([FromBody] CadastrarClienteCommand command)
        {
            var cliente = await _clienteAppService.CadastrarCliente(command);

            if (cliente == null)
            {
                return(BadRequest("Erro ao cadastrar cliente."));
            }

            return(Created(string.Empty, cliente));
        }