namespace StellaOps.Feedser.Source.Vndr.Chromium.Internal;

public sealed record ChromiumFeedEntry(
    string EntryId,
    string PostId,
    string Title,
    Uri DetailUri,
    DateTimeOffset Published,
    DateTimeOffset? Updated,
    string? Summary,
    IReadOnlyCollection<string> Categories)
{
    public bool IsSecurityUpdate()
    {
        if (Categories.Count > 0 && Categories.Contains("Stable updates", StringComparer.OrdinalIgnoreCase))
        {
            return true;
        }

        return Title.Contains("Stable Channel Update", StringComparison.OrdinalIgnoreCase)
            || Title.Contains("Extended Stable", StringComparison.OrdinalIgnoreCase)
            || Title.Contains("Stable Channel Desktop", StringComparison.OrdinalIgnoreCase);
    }
}
