using System; namespace DiunaBI.Domain.Entities; public enum RecordChangeType { Created = 1, Updated = 2, Deleted = 3 } public class RecordHistory { public Guid Id { get; set; } // Reference to the original record public Guid RecordId { get; set; } public Guid LayerId { get; set; } // When and who public DateTime ChangedAt { get; set; } public Guid ChangedById { get; set; } public User? ChangedBy { get; set; } // Type of change public RecordChangeType ChangeType { get; set; } // Snapshot of record state at this point public string Code { get; set; } = string.Empty; public string? Desc1 { get; set; } // Comma-separated list of fields that changed (e.g., "Code,Desc1") public string? ChangedFields { get; set; } // JSON object with detailed changes: {"Code": {"old": "A", "new": "B"}} public string? ChangesSummary { get; set; } }