namespace Netina.Domain.Entities.Products;
[AdaptTwoWays("[name]LDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget | MapType.Projection)]
[AdaptTwoWays("[name]SDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget)]
[AdaptTo("[name]SDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Projection)]
[GenerateMapper]
public partial class Specification : ApiEntity
{
    public Specification()
    {

    }

    public Specification(string title, string detail, string value, bool isFeature, Guid productId, Guid parentId)
    {
        Title = title;
        Detail = detail;
        Value = value;
        IsFeature = isFeature;
        ProductId = productId;
        if (parentId != default)
            ParentId = parentId;
        else
            ParentId = null;
    }
    public string Title { get; internal set; } = string.Empty;
    public string Detail { get; internal set; } = string.Empty;
    public string Value { get; internal set; } = string.Empty;
    public bool IsFeature { get; internal set; }

    public Guid ProductId { get; internal set; }
    public Product? Product { get; internal set; }

    public Guid? ParentId { get; internal set; }
    public Specification? Parent { get; internal set; }

    public List<Specification> Children { get; internal set; } = new();
}