From 858a52b55164bad31d2739e911b3e429e393186c Mon Sep 17 00:00:00 2001 From: Giuliano Paschoalino Date: Mon, 21 Jul 2025 15:39:27 -0300 Subject: [PATCH] =?UTF-8?q?chore:=20Corre=C3=A7=C3=A3o=20de=20l=C3=B3gica?= =?UTF-8?q?=20de=20contagem=20e=20remo=C3=A7=C3=A3o=20de=20usu=C3=A1rio=20?= =?UTF-8?q?de=20testes.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Program.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Program.cs b/Program.cs index 628a66a..55e0c57 100644 --- a/Program.cs +++ b/Program.cs @@ -12,7 +12,7 @@ class Program static bool _stop = false; static bool _isAuthenticated = false; static readonly string _connectionString = "Server=192.168.10.248;Port=5432;Database=pipefy_move_cards;User Id=postgres;Password=gds21;"; - static readonly string _windowsID = "gestao1.3"; // Environment.UserName; + static readonly string _windowsID = Environment.UserName; static readonly List<(string actionId, string actionName)> _actionIds = // Tuplas de IDs e nomes das fases que queremos monitorar [ new ("318642783-318906957", "Agendou reunião 1"), @@ -111,6 +111,7 @@ class Program // Para cada usuário, rodar uma query COUNT(*) e adicionar linha na tabela foreach (var (userId, nome) in _pipeUsers) { + var userRecords = new List(); int count = 0; AnsiConsole.Status() .Spinner(Spinner.Known.Line) @@ -147,7 +148,7 @@ class Program temp.AcaoID = temp.From + "-" + temp.To; temp.Acao = _actionIds.Find(p => p.actionId == temp.AcaoID).actionName; - records.Add(temp); + userRecords.Add(temp); } } //} @@ -158,8 +159,9 @@ class Program // AnsiConsole.MarkupLine($"\n[red]Erro ao consultar {nome}:[/] {ex.Message}"); //} }); - count = records.Where(x => x.MovedAt >= DateTime.Today).ToList().Count; + count = userRecords.Where(x => (x.MovedAt > DateTime.Today && x.FieldID is not null)).ToList().Count; tableContLigacoes.AddRow(nome, userId.ToString(), $"[bold yellow]{count}[/]"); + records.AddRange(userRecords); } var panel = new Panel(new Align(tableContLigacoes, HorizontalAlignment.Center, VerticalAlignment.Top))