using NetinaCMS.Domain.Enums;

namespace NetinaCMS.Domain.Entities.Blogs;

public partial class Blog
{
    public static Blog Create(string title, string content, string tags, int readingTime, string summery, bool isSuggested, Guid categoryId)
    {
        return new Blog(title, content, tags, readingTime, summery, isSuggested, categoryId);
    }

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

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

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