diff --git a/src/Infrastructure/TakeoutSaaS.Infrastructure/App/Persistence/TakeoutAppDbContext.cs b/src/Infrastructure/TakeoutSaaS.Infrastructure/App/Persistence/TakeoutAppDbContext.cs index 96e904c..122de84 100644 --- a/src/Infrastructure/TakeoutSaaS.Infrastructure/App/Persistence/TakeoutAppDbContext.cs +++ b/src/Infrastructure/TakeoutSaaS.Infrastructure/App/Persistence/TakeoutAppDbContext.cs @@ -385,6 +385,8 @@ public class TakeoutAppDbContext( ConfigureTenantBillingStatement(modelBuilder.Entity()); ConfigureTenantSubscriptionHistory(modelBuilder.Entity()); ConfigureTenantPayment(modelBuilder.Entity()); + ConfigureTenantReviewClaim(modelBuilder.Entity()); + ConfigureTenantAuditLog(modelBuilder.Entity()); ConfigureMerchant(modelBuilder.Entity()); ConfigureStore(modelBuilder.Entity()); ConfigureMerchantDocument(modelBuilder.Entity()); @@ -595,6 +597,35 @@ public class TakeoutAppDbContext( builder.HasIndex(x => x.TenantId); } + private static void ConfigureTenantReviewClaim(EntityTypeBuilder builder) + { + builder.ToTable("tenant_review_claims"); + builder.HasKey(x => x.Id); + builder.Property(x => x.TenantId).IsRequired(); + builder.Property(x => x.ClaimedBy).IsRequired(); + builder.Property(x => x.ClaimedByName).HasMaxLength(128).IsRequired(); + builder.Property(x => x.ClaimedAt).IsRequired(); + builder.Property(x => x.ReleasedAt); + builder.HasIndex(x => x.TenantId); + builder.HasIndex(x => x.ClaimedBy); + } + + private static void ConfigureTenantAuditLog(EntityTypeBuilder builder) + { + builder.ToTable("tenant_audit_logs"); + builder.HasKey(x => x.Id); + builder.Property(x => x.TenantId).IsRequired(); + builder.Property(x => x.Action).HasConversion(); + builder.Property(x => x.Title).HasMaxLength(128).IsRequired(); + builder.Property(x => x.Description).HasMaxLength(512); + builder.Property(x => x.OperatorId); + builder.Property(x => x.OperatorName).HasMaxLength(128); + builder.Property(x => x.PreviousStatus).HasConversion(); + builder.Property(x => x.CurrentStatus).HasConversion(); + builder.HasIndex(x => x.TenantId); + builder.HasIndex(x => new { x.TenantId, x.CreatedAt }); + } + private static void ConfigureMerchant(EntityTypeBuilder builder) { builder.ToTable("merchants");