using System.ComponentModel.DataAnnotations;
using NodePipeline.Abstractions.Attributes;
using NodePipeline.Abstractions.Interfaces.Nodes;
using NodePipeline.Abstractions.Models;
using NodePipeline.Engine.CodeGeneration.Abstractions.Models;
using NodePipeline.Engine.Tests.CodeGeneratorTests.Fixtures.TestEnums;

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

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

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

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

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

    internal static NodeDescriptor GetDescriptor()
    {
        return new NodeDescriptor(nameof(NodeWithEnumParameter1), false, typeof(NodeWithEnumParameter1).FullName!,
            typeof(NodeWithEnumParameter1).FullName!,
            [
                new NodeFieldDescriptor(nameof(Parameter1), nameof(Parameter1), typeof(int).FullName!, true, false,
                    false,
                    FieldDirection.Parameter, null),
                new NodeFieldDescriptor(nameof(Parameter2), nameof(Parameter2), typeof(Enum3).FullName!, false, false,
                    true,
                    FieldDirection.Parameter, new NodeFieldDescriptor.NodeFieldMetaData(true)),
                new NodeFieldDescriptor(nameof(Parameter3), "p3abc", typeof(string).FullName!, false, true, false,
                    FieldDirection.Parameter, null)
            ], true, null);
    }
}