namespace ZB.MOM.WW.OtOpcUa.Configuration.LocalCache;

/// <summary>
///     A self-contained snapshot of one generation — enough to rebuild the address space on a node
///     that has lost DB connectivity. The payload is the JSON-serialized <c>sp_GetGenerationContent</c>
///     result; the local cache doesn't inspect the shape, it just round-trips bytes.
/// </summary>
public sealed class GenerationSnapshot
{
    /// <summary>Gets or sets the auto-generated LiteDB ID.</summary>
    public int Id { get; set; } // LiteDB auto-ID
    /// <summary>Gets or sets the cluster identifier.</summary>
    public required string ClusterId { get; set; }
    /// <summary>Gets or sets the generation identifier.</summary>
    public required long GenerationId { get; set; }
    /// <summary>Gets or sets the time this snapshot was cached.</summary>
    public required DateTime CachedAt { get; set; }
    /// <summary>Gets or sets the JSON-serialized payload content.</summary>
    public required string PayloadJson { get; set; }
}
