Stable multitenancy

This commit is contained in:
2026-09-24 10:25:07 +02:00
parent ef134a5b3c
commit 8e0c099867
54 changed files with 8900 additions and 603 deletions
+8 -7
View File
@@ -1,7 +1,8 @@
using PostFundManagement.Domain.Abstractions;
namespace PostFundManagement.Domain.Entities;
[EntityTypeConfiguration<AwardConfiguration, Award>]
public class Award : Models.Award
public class Award : Models.Award, ITenantEntity
{
public virtual User? Creator { get; set; }
@@ -41,7 +42,7 @@ public sealed class AwardConfiguration : IEntityTypeConfiguration<Award>
builder.Property(f => f.Amount).IsRequired().HasPrecision(18, 2);
builder.HasOne(f => f.Tenant)
.WithMany(f => f.Awards)
.WithMany()
.HasForeignKey(fk => fk.TenantId)
.IsRequired()
.OnDelete(DeleteBehavior.Restrict);
@@ -77,9 +78,9 @@ public sealed class AwardConfiguration : IEntityTypeConfiguration<Award>
.OnDelete(DeleteBehavior.NoAction);
builder.HasOne(f => f.Approver)
.WithMany()
.HasForeignKey(fk => fk.ApprovedBy)
.IsRequired(false)
.OnDelete(DeleteBehavior.NoAction);
.WithMany()
.HasForeignKey(fk => fk.ApprovedBy)
.IsRequired(false)
.OnDelete(DeleteBehavior.NoAction);
}
}