Implemented audit logging
This commit is contained in:
@@ -17,5 +17,7 @@ public sealed class AuditLogConfiguration : IEntityTypeConfiguration<AuditLog>
|
||||
builder.Property(f => f.Changes).IsRequired(false);
|
||||
builder.Property(f => f.PerformedBy).IsRequired();
|
||||
builder.Property(f => f.Timestamp).IsRequired().HasDefaultValueSql("now()");
|
||||
builder.Property(f => f.Error).IsRequired(false);
|
||||
builder.Ignore(f => f.IsError);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,7 +65,8 @@ public static class Mappers
|
||||
EntityId = entity.EntityId,
|
||||
EntityName = entity.EntityName,
|
||||
PerformedBy = entity.PerformedBy,
|
||||
Timestamp = entity.Timestamp
|
||||
Timestamp = entity.Timestamp,
|
||||
Error = entity.Error
|
||||
};
|
||||
|
||||
public static Award Map(this Entities.Award entity) => new()
|
||||
@@ -398,4 +399,4 @@ public static class Mappers
|
||||
Role = entity.Role,
|
||||
IdNumber = entity.IdNumber
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,4 +17,8 @@ public class AuditLog
|
||||
public Guid PerformedBy { get; set; }
|
||||
|
||||
public DateTime Timestamp { get; set; }
|
||||
}
|
||||
|
||||
public string? Error { get; set; }
|
||||
|
||||
public bool IsError => !string.IsNullOrWhiteSpace(Error);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user