using System.ComponentModel.DataAnnotations;
namespace DorkNet.Server.Data.Entities;
///
/// One historical version of an . Each
/// time the creator uploads a new SpawnableTemplateData blob via
/// POST api/inventions/v3/addversion, we snapshot the prior
/// blob name into a new row here so the watch's "version history"
/// tab and `GET api/inventions/v1/versions?inventionId=X` can list
/// them. Indexed on (InventionId, VersionNumber DESC) for the
/// common "show me the version list" query.
///
public class InventionVersionEntity
{
public long Id { get; set; }
public long InventionId { get; set; }
/// Mirrors InventionVersion.ReplicationId — opaque
/// GUID the client uses to deduplicate spawns of this specific
/// version across rooms.
[MaxLength(64)]
public string ReplicationId { get; set; } = string.Empty;
/// 1-based version index. Auto-assigned to
/// max(VersionNumber) + 1 on insert.
public int VersionNumber { get; set; }
[MaxLength(128)]
public string BlobName { get; set; } = string.Empty;
/// Tokens it costs to spawn this version of the
/// invention (decompiled wire field
/// InventionVersion.InstantiationCost).
public int InstantiationCost { get; set; } = 0;
/// Watt budget the creation consumes
/// (InventionVersion.LightsCost).
public int LightsCost { get; set; } = 0;
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
}