Implemented centralised audit logging

This commit is contained in:
2026-09-21 16:32:56 +02:00
parent 78b03b6996
commit f4024d563a
41 changed files with 5751 additions and 54 deletions
@@ -5,6 +5,8 @@ namespace PostFundManagement.Domain.Entities;
[EntityTypeConfiguration<NotificationConfiguration, Notification>]
public class Notification : Models.Notification
{
public virtual Tenant? Tenant { get; set; }
public virtual Organisation? Organisation { get; set; }
public virtual User? RecipientUser { get; set; }
@@ -22,6 +24,7 @@ public sealed class NotificationConfiguration : IEntityTypeConfiguration<Notific
builder.Property(f => f.SentAt).IsRequired(false);
builder.Property(f => f.Recipient).IsRequired();
builder.Property(f => f.OrganisationId).IsRequired();
builder.Property(f => f.TenantId).IsRequired();
builder.Property(f => f.Platform).IsRequired().HasConversion<int>().HasDefaultValueSql("1")
.HasSentinel(NotificationPlatform.Email);
builder.Property(f => f.Status).IsRequired().HasConversion<int>().HasDefaultValueSql("1")
@@ -31,6 +34,12 @@ public sealed class NotificationConfiguration : IEntityTypeConfiguration<Notific
builder.Property(f => f.Destination).IsRequired().HasMaxLength(LabelLength);
builder.Property(f => f.Error).IsRequired(false);
builder.HasOne(f => f.Tenant)
.WithMany()
.HasForeignKey(fk => fk.TenantId)
.IsRequired()
.OnDelete(DeleteBehavior.Restrict);
builder.HasOne(f => f.Organisation)
.WithMany()
.HasForeignKey(fk => fk.OrganisationId)