using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace RobotNet10.MapManager.Data;
///
/// Layout version entity - Version history for each layout
/// Maps to VDMA LIF: layouts[].layoutVersion
///
[Table("LayoutVersions")]
public class LayoutVersion
{
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public Guid Id { get; set; }
///
/// Parent layout reference
///
[Required]
public Guid LayoutId { get; set; }
///
/// Version number (VDMA LIF: layoutVersion)
/// Suggested: "1", "2", "3" or "1.0", "1.1"
///
[Required]
[StringLength(32)]
public string Version { get; set; } = string.Empty;
///
/// Version description (VDMA LIF: layoutDescription)
///
public string? LayoutDescription { get; set; }
///
/// Creator of this version
///
[StringLength(256)]
public string? CreatedBy { get; set; }
///
/// Creation date
///
[Required]
public DateTime CreatedDate { get; set; } = DateTime.UtcNow;
///
/// Is this the active version?
/// Only ONE version can be active per layout
/// Active version is READ-ONLY
///
[Required]
public bool IsActive { get; set; } = true;
// Navigation properties
[ForeignKey(nameof(LayoutId))]
public virtual Layout Layout { get; set; } = null!;
public virtual ICollection Levels { get; set; } = new List();
}