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

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

    [NodeField(FieldDirection.Parameter, "p3")]
    public NodeField<Enum2> 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(Enum1).FullName!, true, false,
                    true,
                    FieldDirection.Parameter, null),
                new NodeFieldDescriptor(nameof(Parameter2), nameof(Parameter2), typeof(Enum1).FullName!, false, false,
                    true,
                    FieldDirection.Parameter, new NodeFieldDescriptor.NodeFieldMetaData(true)),
                new NodeFieldDescriptor(nameof(Parameter3), "p3", typeof(Enum2).FullName!, false, false, true,
                    FieldDirection.Parameter, null)
            ], true, null);
    }
}