Files
pfm/PostFundManagement.Domain/Entities/AuditLog.cs
T
2026-10-22 12:31:37 +02:00

24 lines
994 B
C#

namespace PostFundManagement.Domain.Entities;
[EntityTypeConfiguration<AuditLogConfiguration, AuditLog>]
public sealed class AuditLog : Models.AuditLog;
public sealed class AuditLogConfiguration : IEntityTypeConfiguration<AuditLog>
{
public void Configure(EntityTypeBuilder<AuditLog> 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);
builder.Property(f => f.PerformedBy).IsRequired();
builder.Property(f => f.Timestamp).IsRequired().HasDefaultValueSql("now()");
builder.Property(f => f.Error).IsRequired(false);
builder.Ignore(f => f.IsError);
}
}