namespace BackOffice.Services.Blog;

public interface IBlogCategoryService
{
    Task<BlogCategoryListResultDto> GetAllAsync(BlogCategoryFilterDto filter);
    Task<List<BlogCategoryItemDto>> GetActiveAsync();
    Task<BlogCategoryItemDto?> GetByIdAsync(long id);
    Task<long> CreateAsync(BlogCategoryEditDto dto);
    Task UpdateAsync(long id, BlogCategoryEditDto dto);
    Task DeleteAsync(long id);
}

public class BlogCategoryFilterDto
{
    public int PageNumber { get; set; } = 1;
    public int PageSize { get; set; } = 20;
    public string? SearchTerm { get; set; }
}

public class BlogCategoryListResultDto
{
    public List<BlogCategoryItemDto> Items { get; set; } = new();
    public int TotalCount { get; set; }
}

public class BlogCategoryItemDto
{
    public long Id { get; set; }
    public string Title { get; set; } = string.Empty;
    public string Slug { get; set; } = string.Empty;
    public string? Description { get; set; }
    public string? IconName { get; set; }
    public int SortOrder { get; set; }
    public bool IsActive { get; set; }
    public int PostCount { get; set; }
}

public class BlogCategoryEditDto
{
    public string Title { get; set; } = string.Empty;
    public string Slug { get; set; } = string.Empty;
    public string? Description { get; set; }
    public string? IconName { get; set; }
    public int SortOrder { get; set; }
    public bool IsActive { get; set; } = true;
}
