namespace Hc900Crawler.Core.Application.DTOs;

/// <summary>
/// SQL 검증 결과 record
/// </summary>
public record ValidationResult(
    bool                  IsValid,
    ValidationFailReason? Reason  = null,
    string?               Message = null)
{
    public static ValidationResult Ok()
        => new(true);

    public static ValidationResult Fail(ValidationFailReason reason, string message)
        => new(false, reason, message);

    public void Deconstruct(out bool ok, out string? error)
    {
        ok    = IsValid;
        error = Message;
    }
}
