using System.Collections.Generic;

// ReSharper disable UnusedAutoPropertyAccessor.Global

namespace NodePipeline.Abstractions.Models.Validation;

/// <summary>
///     Result of node validation
/// </summary>
/// <param name="result"></param>
/// <param name="errorMessage"></param>
/// <param name="parameterResults"></param>
/// <param name="portResults"></param>
public class NodeValidationResult(
    ValidationResult result,
    string? errorMessage,
    IReadOnlyDictionary<string, List<NodeFieldValidationResult>> parameterResults,
    IReadOnlyDictionary<string, List<NodeFieldValidationResult>> portResults)
{
    /// <summary>
    ///     Validation result
    /// </summary>
    public ValidationResult Result { get; } = result;

    /// <summary>
    ///     Validation error message
    /// </summary>
    public string? ErrorMessage { get; } = errorMessage;

    /// <summary>
    ///     Node parameters results
    /// </summary>
    public IReadOnlyDictionary<string, List<NodeFieldValidationResult>> ParameterResults { get; } = parameterResults;

    /// <summary>
    ///     Node ports results
    /// </summary>
    public IReadOnlyDictionary<string, List<NodeFieldValidationResult>> PortResults { get; } = portResults;
}