namespace BackOffice.Services.Tag;

public interface ITagService
{
    Task<TagListResultDto> GetTagsAsync(TagFilterDto filter);
    Task<TagDetailsDto?> GetByIdAsync(long id);
    Task<long> CreateAsync(TagEditDto dto);
    Task UpdateAsync(long id, TagEditDto dto);
    Task DeleteAsync(long id);
    Task AssignToProductAsync(long productId, long tagId);
    Task<List<ProductTagViewDto>> GetProductTagsAsync(long productId);
    Task RemoveProductTagAsync(long productTagId);
}

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

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

public class TagListItemDto
{
    public long Id { get; set; }
    public string Name { get; set; } = string.Empty;
    public string Title { get; set; } = string.Empty;
    public string? Description { get; set; }
    public bool IsActive { get; set; }
    public int SortOrder { get; set; }
}

public class TagDetailsDto : TagListItemDto
{
}

public class TagEditDto
{
    public string Name { get; set; } = string.Empty;
    public string Title { get; set; } = string.Empty;
    public string? Description { get; set; }
    public bool IsActive { get; set; } = true;
    public int SortOrder { get; set; }
}

public class ProductTagViewDto
{
    public long ProductTagId { get; set; }
    public long TagId { get; set; }
    public string TagTitle { get; set; } = string.Empty;
}

