using MongoDB.Bson.Serialization.Attributes;

namespace StellaOps.Scanner.Storage.Catalog;

public enum LinkSourceType
{
    Image,
    Layer,
}

[BsonIgnoreExtraElements]
public sealed class LinkDocument
{
    [BsonId]
    public string Id { get; set; } = string.Empty;

    [BsonElement("fromType")]
    public LinkSourceType FromType { get; set; }
        = LinkSourceType.Image;

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

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

    [BsonElement("createdAt")]
    public DateTime CreatedAtUtc { get; set; }
        = DateTime.UtcNow;
}
