using System.Diagnostics.CodeAnalysis;
using OliverBooth.Data;
using OliverBooth.Data.Web;
namespace OliverBooth.Services;
///
/// Represents a service which can retrieve tutorial articles.
///
public interface ITutorialService
{
///
/// Gets the articles within a tutorial folder.
///
/// The folder whose articles to retrieve.
/// The visibility to filter by. -1 does not filter.
/// A read-only view of the articles in the folder.
IReadOnlyCollection GetArticles(ITutorialFolder folder, Visibility visibility = Visibility.None);
///
/// Gets the tutorial folders within a specified folder.
///
/// The parent folder.
/// The visibility to filter by. -1 does not filter.
/// A read-only view of the subfolders in the folder.
IReadOnlyCollection GetFolders(ITutorialFolder? parent = null, Visibility visibility = Visibility.None);
///
/// Gets a folder by its ID.
///
/// The ID of the folder to get
///
/// When this method returns, contains the folder whose ID is equal to the ID specified, or
/// if no such folder was found.
///
///
ITutorialFolder? GetFolder(int id);
///
/// Gets a folder by its slug.
///
/// The slug of the folder.
/// The parent folder.
/// The folder.
ITutorialFolder? GetFolder(string? slug, ITutorialFolder? parent = null);
///
/// Gets the full slug of the specified folder.
///
/// The folder whose slug to return.
/// The full slug of the folder.
/// is .
string GetFullSlug(ITutorialFolder folder);
///
/// Gets the full slug of the specified article.
///
/// The article whose slug to return.
/// The full slug of the article.
/// is .
string GetFullSlug(ITutorialArticle article);
///
/// Renders the body of the specified article.
///
/// The article to render.
/// The rendered HTML of the article.
string RenderArticle(ITutorialArticle article);
///
/// Attempts to find an article by its ID.
///
/// The ID of the article.
///
/// When this method returns, contains the article whose ID matches the specified , or
/// if no such article was found.
///
/// if a matching article was found; otherwise, .
bool TryGetArticle(int id, [NotNullWhen(true)] out ITutorialArticle? article);
///
/// Attempts to find an article by its slug.
///
/// The slug of the article.
///
/// When this method returns, contains the article whose slug matches the specified , or
/// if no such article was found.
///
/// if a matching article was found; otherwise, .
bool TryGetArticle(string slug, [NotNullWhen(true)] out ITutorialArticle? article);
}