using System;
using MongoDB.Bson.Serialization.Attributes;

namespace StellaOps.Feedser.Storage.Mongo.Advisories;

[BsonIgnoreExtraElements]
public sealed class NormalizedVersionDocument
{
    [BsonElement("packageId")]
    public string PackageId { get; set; } = string.Empty;

    [BsonElement("packageType")]
    public string PackageType { get; set; } = string.Empty;

    [BsonElement("scheme")]
    public string Scheme { get; set; } = string.Empty;

    [BsonElement("type")]
    public string Type { get; set; } = string.Empty;

    [BsonElement("style")]
    [BsonIgnoreIfNull]
    public string? Style { get; set; }

    [BsonElement("min")]
    [BsonIgnoreIfNull]
    public string? Min { get; set; }

    [BsonElement("minInclusive")]
    [BsonIgnoreIfNull]
    public bool? MinInclusive { get; set; }

    [BsonElement("max")]
    [BsonIgnoreIfNull]
    public string? Max { get; set; }

    [BsonElement("maxInclusive")]
    [BsonIgnoreIfNull]
    public bool? MaxInclusive { get; set; }

    [BsonElement("value")]
    [BsonIgnoreIfNull]
    public string? Value { get; set; }

    [BsonElement("notes")]
    [BsonIgnoreIfNull]
    public string? Notes { get; set; }

    [BsonElement("decisionReason")]
    [BsonIgnoreIfNull]
    public string? DecisionReason { get; set; }

    [BsonElement("constraint")]
    [BsonIgnoreIfNull]
    public string? Constraint { get; set; }

    [BsonElement("source")]
    [BsonIgnoreIfNull]
    public string? Source { get; set; }

    [BsonElement("recordedAt")]
    [BsonIgnoreIfNull]
    public DateTime? RecordedAtUtc { get; set; }
}
