namespace octo_fiesta.Services.Validation;
///
/// Result of a startup validation operation
///
public class ValidationResult
{
///
/// Indicates whether the validation was successful
///
public bool IsValid { get; set; }
///
/// Short status message (e.g., "VALID", "INVALID", "TIMEOUT", "NOT CONFIGURED")
///
public string Status { get; set; } = string.Empty;
///
/// Detailed information about the validation result
///
public string? Details { get; set; }
///
/// Color to use when displaying the status in console
///
public ConsoleColor StatusColor { get; set; } = ConsoleColor.White;
///
/// Additional metadata about the validation
///
public Dictionary Metadata { get; set; } = new();
///
/// Creates a successful validation result
///
public static ValidationResult Success(string details, Dictionary? metadata = null)
{
return new ValidationResult
{
IsValid = true,
Status = "VALID",
StatusColor = ConsoleColor.Green,
Details = details,
Metadata = metadata ?? new()
};
}
///
/// Creates a failed validation result
///
public static ValidationResult Failure(string status, string details, ConsoleColor color = ConsoleColor.Red)
{
return new ValidationResult
{
IsValid = false,
Status = status,
StatusColor = color,
Details = details
};
}
///
/// Creates a not configured validation result
///
public static ValidationResult NotConfigured(string details)
{
return Failure("NOT CONFIGURED", details, ConsoleColor.Red);
}
}