using System.ComponentModel.DataAnnotations;
using NodePipeline.Abstractions.Attributes;
using NodePipeline.Abstractions.Interfaces.Nodes;
using NodePipeline.Abstractions.Models;
using NodePipeline.Engine.CodeGeneration.Abstractions.Models;

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

public class ThreePortNode2 : INode
{
    [NodeField(FieldDirection.Input)]
    [Required]
    public NodeField<int> Input1 { get; set; } = null!;

    [NodeField(FieldDirection.Input)]
    [DisallowNullableOutput]
    public NodeField<string> Input2 { get; set; } = null!;

    [NodeField(FieldDirection.Output, "out")]
    public NodeField<bool> Output1 { get; set; } = null!;

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

    internal static NodeDescriptor GetDescriptor()
    {
        return new NodeDescriptor(nameof(ThreePortNode), false, typeof(ThreePortNode).FullName!,
            typeof(ThreePortNode).FullName!,
            [
                new NodeFieldDescriptor(nameof(Input1), nameof(Input1), typeof(int).FullName!, false, false, false,
                    FieldDirection.Input, new NodeFieldDescriptor.NodeFieldMetaData(true)),
                new NodeFieldDescriptor(nameof(Input2), nameof(Input2), typeof(string).FullName!, false, true, false,
                    FieldDirection.Input, new NodeFieldDescriptor.NodeFieldMetaData(false, true)),
                new NodeFieldDescriptor(nameof(Output1), "out", typeof(bool).FullName!, false, false, false,
                    FieldDirection.Output, null)
            ], true, null);
    }
}