using System.ComponentModel.DataAnnotations.Schema; namespace Distribution.Models { /// One row per physical serial-tracked unit. Quantity is always 1. public class ItemSerialNumber : Template { public Guid FK_ItemId { get; set; } [ForeignKey("FK_ItemId")] public Item Item { get; set; } public string SerialNumber { get; set; } public SerialStatus Status { get; set; } = SerialStatus.InStock; public Guid? CurrentLocationId { get; set; } public LocationType? CurrentLocationType { get; set; } public DateTime ReceivedAt { get; set; } /// Snapshotted at receipt when Item.AllowCustomWarrantyPeriod is true; otherwise null and the system default applies when the warranty starts. public int? WarrantyPeriodDaysOverride { get; set; } /// Set when the serial is sold/delivered: sale date + (override ?? system default). Null while in stock or if Item.HasWarranty is false. public DateTime? WarrantyExpiresAt { get; set; } } }