namespace PowderCoating.Core.Entities;

/// <summary>
/// Platform-wide audit trail. Not a BaseEntity — no soft delete, no tenant filter.
/// </summary>
public class AuditLog
{
    public long Id { get; set; }

    // Who
    public string? UserId { get; set; }
    public string UserName { get; set; } = "System";
    public int? CompanyId { get; set; }
    public string? CompanyName { get; set; }

    // What
    public string Action { get; set; } = string.Empty;      // Created | Updated | Deleted | Restored | Login | ManualChange
    public string EntityType { get; set; } = string.Empty;  // Customer | Job | Quote | …
    public string? EntityId { get; set; }
    public string? EntityDescription { get; set; }          // Human-readable label (e.g. "JOB-2501-0042")

    // Change detail (JSON)
    public string? OldValues { get; set; }
    public string? NewValues { get; set; }

    // Context
    public string? IpAddress { get; set; }
    public DateTime Timestamp { get; set; } = DateTime.UtcNow;
}
