Implemented audit logging and automated logging

This commit is contained in:
2026-09-23 05:33:16 +02:00
parent 717b891554
commit ef134a5b3c
18 changed files with 250 additions and 38 deletions
@@ -0,0 +1,4 @@
namespace PostFundManagement.Domain.Attributes;
[AttributeUsage(AttributeTargets.Method, Inherited = false, AllowMultiple = false)]
public sealed class LogAttribute : Attribute;
+1 -1
View File
@@ -41,7 +41,7 @@ public sealed class AwardConfiguration : IEntityTypeConfiguration<Award>
builder.Property(f => f.Amount).IsRequired().HasPrecision(18, 2);
builder.HasOne(f => f.Tenant)
.WithMany()
.WithMany(f => f.Awards)
.HasForeignKey(fk => fk.TenantId)
.IsRequired()
.OnDelete(DeleteBehavior.Restrict);
@@ -32,7 +32,7 @@ public sealed class PortfolioConfiguration : IEntityTypeConfiguration<Portfolio>
builder.Property(f => f.Description).IsRequired(false).HasMaxLength(TextLength);
builder.HasOne(f => f.Tenant)
.WithMany()
.WithMany(f => f.Portfolios)
.HasForeignKey(fk => fk.TenantId)
.IsRequired()
.OnDelete(DeleteBehavior.Restrict);
@@ -41,7 +41,7 @@ public sealed class ProgrammeConfiguration : IEntityTypeConfiguration<Programme>
.HasSentinel(ApprovalStatus.Pending);
builder.HasOne(f => f.Tenant)
.WithMany()
.WithMany(f => f.Programmes)
.HasForeignKey(fk => fk.TenantId)
.IsRequired()
.OnDelete(DeleteBehavior.NoAction);
@@ -41,7 +41,7 @@ public sealed class ProjectConfiguration : IEntityTypeConfiguration<Project>
.HasSentinel(ApprovalStatus.Pending);
builder.HasOne(f => f.Tenant)
.WithMany()
.WithMany(f => f.Projects)
.HasForeignKey(fk => fk.TenantId)
.IsRequired()
.OnDelete(DeleteBehavior.Restrict);
@@ -8,6 +8,14 @@ public class Tenant : Models.Tenant
public virtual User? Creator { get; set; }
public virtual User? Updator { get; set; }
public ICollection<Award> Awards { get; set; } = [];
public ICollection<Project> Projects { get; set; } = [];
public ICollection<Programme> Programmes { get; set; } = [];
public ICollection<Portfolio> Portfolios { get; set; } = [];
}
public sealed class TenantConfiguration : IEntityTypeConfiguration<Tenant>