using System; namespace FMDAL.DTO.ScanIdentifier { // Confirmed against DB/Migrations/20260719_RAM_Phase2_Schema_SqlServer.sql — MSCANIDENTIFIER. // ENTITYID is deliberately typed as string, not int — it bridges mixed-key-type target tables // (MASSET, MBIN, etc.) via ENTITYTYPE + ENTITYID rather than a hard FK, so it must not be // narrowed to int. DeleteScanIdentifier is a soft end-date (VALIDTO = GETDATE()), never a hard // DELETE — VALIDTO IS NULL is what marks a row "currently active"; TSCANEVENT (Phase 2 // continuation) may reference retired rows. public class ScanIdentifierDTO { public int ScanIdentifierId { get; set; } public byte IdentifierType { get; set; } // (0.RFID_EPC,1.RFID_TID,2.QR,3.BARCODE,4.NFC,5.MANUAL) public string IdentifierValue { get; set; } = string.Empty; public string EntityType { get; set; } = string.Empty; // target table name: MASSET / MBIN / etc. public string EntityId { get; set; } = string.Empty; // generic PK value AS A STRING public byte IsPrimary { get; set; } public DateTime ValidFrom { get; set; } public DateTime? ValidTo { get; set; } // null = currently active public short SortOrder { get; set; } = 9999; public byte Status { get; set; } = 1; public short Version { get; set; } public int CreatedById { get; set; } public DateTime CreatedOn { get; set; } public int ModifiedById { get; set; } public DateTime ModifiedOn { get; set; } public byte SourceType { get; set; } = 5; public int OUId { get; set; } public int TenantId { get; set; } = -1; } }