Implemented audit logging

This commit is contained in:
2026-10-22 12:31:37 +02:00
parent 92891438f6
commit 4dd0899209
12 changed files with 3477 additions and 90 deletions
@@ -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
};
}
}
+5 -1
View File
@@ -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);
}