using NodePipeline.Abstractions.Attributes;
using NodePipeline.Abstractions.Attributes.Validation.NodeField;
using NodePipeline.Abstractions.Interfaces.Nodes;
using NodePipeline.Abstractions.Models;
using NodePipeline.Engine.CodeGeneration.Abstractions.Models;

namespace NodePipeline.Engine.Tests.CodeGeneratorTests.Fixtures.MockNodes;

public class ThreeParameterNode2 : INode
{
    [NodeField(FieldDirection.Parameter)]
    [HasMinValue(2)]
    public NodeField<int?> Parameter1 { get; set; } = null!;

    [NodeField(FieldDirection.Parameter)]
    [HasMaxValue(48)]
    public NodeField<int> Parameter2 { get; set; } = null!;

    [NodeField(FieldDirection.Parameter, "ap3")]
    [HasMinLength(2)]
    public NodeField<string> Parameter3 { get; set; } = null!;

    public void Execute()
    {
        throw new NotImplementedException();
    }

    internal static NodeDescriptor GetDescriptor()
    {
        return new NodeDescriptor(nameof(ThreeParameterNode2), false, typeof(ThreeParameterNode2).FullName!,
            typeof(ThreeParameterNode2).FullName!,
            [
                new NodeFieldDescriptor(nameof(Parameter1), nameof(Parameter1), typeof(int).FullName!, true, false,
                    false,
                    FieldDirection.Parameter, new NodeFieldDescriptor.NodeFieldMetaData(false, numberMinBound: 2)),
                new NodeFieldDescriptor(nameof(Parameter2), nameof(Parameter2), typeof(int).FullName!, false, true,
                    false,
                    FieldDirection.Parameter, new NodeFieldDescriptor.NodeFieldMetaData(false, numberMaxBound: 48)),
                new NodeFieldDescriptor(nameof(Parameter3), "ap3", typeof(string).FullName!, false, false, false,
                    FieldDirection.Parameter, new NodeFieldDescriptor.NodeFieldMetaData(false, stringMinLength: 2))
            ], true, null);
    }
}