namespace CartWise.Domain.Entities;

public class ProductCategory
{
    public Guid ProductCategoryId { get; private set; }

    public string Name { get; private set; } = null!;

    public Guid? ParentCategoryId { get; private set; }

    private ProductCategory()
    {
    }

    public ProductCategory(string name, Guid? parentCategoryId = null)
    {
        if (string.IsNullOrWhiteSpace(name))
        {
            throw new ArgumentException("Category name is required.", nameof(name));
        }

        ProductCategoryId = Guid.NewGuid();
        Name = name.Trim();
        ParentCategoryId = parentCategoryId;
    }
}
