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 ThreeParameterNode3 : INode
{
    [NodeField(FieldDirection.Parameter)] public NodeField<int?> Parameter1 { get; set; } = null!;

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

    [NodeField(FieldDirection.Parameter, "pp3")]
    [HasLengthBetween(7, 15)]
    public NodeField<string> Parameter3 { get; set; } = null!;

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

    internal static NodeDescriptor GetDescriptor()
    {
        return new NodeDescriptor(nameof(ThreeParameterNode3), false, typeof(ThreeParameterNode3).FullName!,
            typeof(ThreeParameterNode3).FullName!,
            [
                new NodeFieldDescriptor(nameof(Parameter1), nameof(Parameter1), typeof(int).FullName!, true, false,
                    false,
                    FieldDirection.Parameter, null),
                new NodeFieldDescriptor(nameof(Parameter2), nameof(Parameter2), typeof(int).FullName!, false, true,
                    false,
                    FieldDirection.Parameter, null),
                new NodeFieldDescriptor(nameof(Parameter3), "pp3", typeof(string).FullName!, false, false, false,
                    FieldDirection.Parameter,
                    new NodeFieldDescriptor.NodeFieldMetaData(false, stringMinLength: 7, stringMaxLength: 15))
            ], true, null);
    }
}