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

namespace ClaudeDo.Data.Filtering.Filters;

/// <summary>
/// Filter for a smart list keyed off a boolean/nullable task flag
/// (My Day, Important, Planned). Counts only non-done matches.
/// </summary>
public sealed class SmartFlagFilter(string id, Func<TaskEntity, bool> flag) : ITaskListFilter
{
    public string Id => id;
    public bool Matches(TaskEntity t) => flag(t);
    public bool ShouldCount(TaskEntity t) => flag(t) && t.Status != TaskStatus.Done;
    public bool MatchesAsContext(TaskEntity t, IReadOnlyList<TaskEntity> all) => false;
}
