using static AgroBase.Models.Enums; namespace OperationControl.Models { public enum SeveridadeAlerta { Info, Warning, Error, Critical } public class AlertaModel { public string Rover_ID { get; set; } public SeveridadeAlerta Severidade { get; set; } public T_Code Modulo { get; set; } // ex: "DIR", "SEN", "MOV" public string? Mod_ID { get; set; } // ID public string Mensagem { get; set; } // texto principal public DateTime Timestamp { get; set; } // opcional: hora do evento // Campo calculado para título (ex: "DIR — Falha no encoder") public string Titulo { get { string mod = Mod_ID != null && Mod_ID != S_Code.sMOD.ToString() ? $"{Modulo} ({Mod_ID})" : Modulo.ToString(); return $"[{Rover_ID}] {mod} — {ResumoSeveridade}"; } } // Ícone simples só pra dar cara public string Icone => Severidade switch { SeveridadeAlerta.Warning => "⚠️", SeveridadeAlerta.Error => "🛑", SeveridadeAlerta.Critical => "🚨", _ => "ℹ️" }; public string ResumoSeveridade => Severidade switch { SeveridadeAlerta.Warning => "Alerta", SeveridadeAlerta.Error => "Falha", SeveridadeAlerta.Critical => "Crítico", _ => "Info" }; } }