public async Task <ICommandResponse> Handle(AtualizarSaldoExtratoCommand command, CancellationToken cancellationToken) { return(await CommandHandlerHelper.ExecuteToResponse(() => { var extrato = extratoService.RetornarExtrato(command.ExtratoId).Result; var evento = new ExtratoSaldoAtualizadoIntegrationEvent(command.ExtratoId, extrato.Saldo); eventBus.PublishEvent(evento); })); }
public async Task <ICommandResponse> Handle(CriarParticipanteCommand command, CancellationToken cancellationToken) { return(await CommandHandlerHelper.ExecuteToResponse( () => participanteService.AdicionarParticipante(command.Id, command.Nome, command.Email))); }
public Task <ICommandResponse> Handle(EfetuarQuebraPontosExtratoCommand command, CancellationToken cancellationToken) { return(CommandHandlerHelper.ExecuteToResponse(() => extratoService.EfetuarQuebraPontos(command.ExtratoId, command.Pontos))); }
public Task <ICommandResponse> Handle(AlterarNomeParticipanteCommand command, CancellationToken cancellationToken) { return(CommandHandlerHelper.ExecuteToResponse(() => participanteService.AlterarNome(command.ParticipanteId, command.Nome))); }
public Task <ICommandResponse> Handle(CriarExtratoCommand command, CancellationToken cancellationToken) { return(CommandHandlerHelper.ExecuteToResponse(() => extratoService.CriarExtrato(command.ExtratoId, command.ParticipanteId))); }