namespace NetinaShop.Domain.Entities.ProductCategories;

public partial class ProductCategory
{
    public static ProductCategory Create(string name, string description,bool isMain)
    {
        return new ProductCategory(name, description, isMain);
    }

    public void SetParent(Guid parentId)
    {
        ParentId = parentId;
    }

    public ProductCategoryStorageFile AddFile(string name, string fileLocation, string fileName, bool isHeader, bool isPrimary, StorageFileType fileType)
    {
        var file = ProductCategoryStorageFile.Create(name, fileLocation, fileName, isHeader, isPrimary, fileType, this.Id);
        Files.Add(file);
        return file;
    }
}

public partial class ProductCategoryStorageFile
{
    public static ProductCategoryStorageFile Create(string name, string fileLocation, string fileName, bool isHeader, bool isPrimary, StorageFileType fileType, Guid categoryId)
    {
        return new ProductCategoryStorageFile(name, fileLocation, fileName, isHeader, isPrimary, fileType, categoryId);
    }
}