using System;
using System.Collections.Generic;

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

public sealed record MsrcAdvisoryDto
{
    public string AdvisoryId { get; init; } = string.Empty;

    public string Title { get; init; } = string.Empty;

    public string? Description { get; init; }

    public string? Severity { get; init; }

    public DateTimeOffset? ReleaseDate { get; init; }

    public DateTimeOffset? LastModifiedDate { get; init; }

    public IReadOnlyList<string> CveIds { get; init; } = Array.Empty<string>();

    public IReadOnlyList<string> KbIds { get; init; } = Array.Empty<string>();

    public IReadOnlyList<MsrcAdvisoryThreat> Threats { get; init; } = Array.Empty<MsrcAdvisoryThreat>();

    public IReadOnlyList<MsrcAdvisoryRemediation> Remediations { get; init; } = Array.Empty<MsrcAdvisoryRemediation>();

    public IReadOnlyList<MsrcAdvisoryProduct> Products { get; init; } = Array.Empty<MsrcAdvisoryProduct>();

    public double? CvssBaseScore { get; init; }

    public string? CvssVector { get; init; }

    public string? ReleaseNoteUrl { get; init; }

    public string? CvrfUrl { get; init; }
}

public sealed record MsrcAdvisoryThreat(string Type, string? Description, string? Severity);

public sealed record MsrcAdvisoryRemediation(string Type, string? Description, string? Url, string? Kb);

public sealed record MsrcAdvisoryProduct(
    string Identifier,
    string? ProductName,
    string? Platform,
    string? Architecture,
    string? BuildNumber,
    string? Cpe);
