namespace DeepDrftModels.DTOs;

/// <summary>
/// Cross-project release filter contract for the paged release read surface. Threaded alongside
/// (never inside) the external <c>PagingParameters&lt;T&gt;</c>, which cannot carry a where-clause,
/// and beside the medium filter (a separate enum param, not a free-text field). Mirrors
/// <see cref="TrackFilter"/> for the release-cardinal browse path. An instance with all properties
/// null is equivalent to no filter — see <see cref="IsEmpty"/>.
/// </summary>
public class ReleaseFilter
{
    /// <summary>Free-text, case-insensitive LIKE across the release Title and Artist.</summary>
    public string? SearchText { get; set; }

    /// <summary>Exact genre match.</summary>
    public string? Genre { get; set; }

    /// <summary>
    /// True when no predicate is set. An empty filter must produce identical results to a null
    /// filter, so callers collapse it to null before querying.
    /// </summary>
    public bool IsEmpty =>
        string.IsNullOrWhiteSpace(SearchText)
        && string.IsNullOrWhiteSpace(Genre);
}
