using ClaudeDo.Data.Models;
using TaskStatus = ClaudeDo.Data.Models.TaskStatus;

namespace ClaudeDo.Data.Filtering.Filters;

/// <summary>
/// Filter for any user-defined list. Constructed on demand from the list id —
/// one instance per list.
/// </summary>
public sealed class UserListFilter : ITaskListFilter
{
    private readonly string _listId;

    public UserListFilter(string listId)
    {
        _listId = listId;
        Id = $"user:{listId}";
    }

    public string Id { get; }
    public bool Matches(TaskEntity t) => t.ListId == _listId;
    public bool ShouldCount(TaskEntity t) => t.ListId == _listId && t.Status != TaskStatus.Done;
    public bool MatchesAsContext(TaskEntity t, IReadOnlyList<TaskEntity> all) => false;
}
