using static PostFundManagement.Domain.Extensions.Constants; namespace PostFundManagement.Domain.Entities; [EntityTypeConfiguration] public sealed class AuditLog : Models.AuditLog; public sealed class AuditLogConfiguration : IEntityTypeConfiguration { public void Configure(EntityTypeBuilder builder) { builder.ToTable(nameof(AuditLog).Pluralize()); builder.HasKey(pk => pk.Id); builder.Property(f => f.TenantId).IsRequired(false); builder.Property(f => f.EntityName).IsRequired().HasMaxLength(LabelLength); builder.Property(f => f.EntityId).IsRequired(); builder.Property(f => f.Action).IsRequired().HasMaxLength(ShortLabelLength); builder.Property(f => f.Changes).IsRequired(false).HasColumnType("jsonb"); builder.Property(f => f.PerformedBy).IsRequired(); builder.Property(f => f.Timestamp).IsRequired().HasDefaultValueSql("now()"); } }