Stable run using Multi tenancy across entire estate

Audit logging and error logging active
This commit is contained in:
2026-09-24 12:00:47 +02:00
parent 8e0c099867
commit 020bdee36f
40 changed files with 11004 additions and 394 deletions
+12 -1
View File
@@ -1,9 +1,13 @@
using PostFundManagement.Domain.Abstractions;
using static PostFundManagement.Domain.Extensions.Constants;
namespace PostFundManagement.Domain.Entities;
public class Outcome : Models.Outcome
[EntityTypeConfiguration<OutcomeConfiguration, Outcome>]
public class Outcome : Models.Outcome, ITenantEntity
{
public virtual Tenant? Tenant { get; set; }
public virtual Beneficiary? Beneficiary { get; set; }
public virtual User? Creator { get; set; }
@@ -16,12 +20,19 @@ public sealed class OutcomeConfiguration : IEntityTypeConfiguration<Outcome>
builder.ToTable(nameof(Outcome).Pluralize());
builder.HasKey(pk => pk.Id);
builder.Property(f => f.TenantId).IsRequired();
builder.Property(f => f.BeneficiaryId).IsRequired();
builder.Property(f => f.CreatedBy).IsRequired();
builder.Property(f => f.CreatedAt).IsRequired().HasDefaultValueSql("now()");
builder.Property(f => f.Name).IsRequired().HasMaxLength(LabelLength);
builder.Property(f => f.Description).IsRequired().HasMaxLength(TextLength);
builder.HasOne(f => f.Tenant)
.WithMany()
.HasForeignKey(fk => fk.TenantId)
.IsRequired()
.OnDelete(DeleteBehavior.NoAction);
builder.HasOne(f => f.Beneficiary)
.WithMany()
.HasForeignKey(fk => fk.BeneficiaryId)