namespace ScadaLink.Commons.Entities.Audit;

public class AuditLogEntry
{
    public int Id { get; set; }
    public string User { get; set; }
    public string Action { get; set; }
    public string EntityType { get; set; }
    public string EntityId { get; set; }
    public string EntityName { get; set; }
    public string? AfterStateJson { get; set; }
    public DateTimeOffset Timestamp { get; set; }

    public AuditLogEntry(string user, string action, string entityType, string entityId, string entityName)
    {
        User = user ?? throw new ArgumentNullException(nameof(user));
        Action = action ?? throw new ArgumentNullException(nameof(action));
        EntityType = entityType ?? throw new ArgumentNullException(nameof(entityType));
        EntityId = entityId ?? throw new ArgumentNullException(nameof(entityId));
        EntityName = entityName ?? throw new ArgumentNullException(nameof(entityName));
    }
}
