using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata.Builders; using ScadaLink.Commons.Entities.Audit; namespace ScadaLink.ConfigurationDatabase.Configurations; public class AuditLogEntryConfiguration : IEntityTypeConfiguration { public void Configure(EntityTypeBuilder builder) { builder.HasKey(a => a.Id); builder.Property(a => a.User) .IsRequired() .HasMaxLength(200); builder.Property(a => a.Action) .IsRequired() .HasMaxLength(100); builder.Property(a => a.EntityType) .IsRequired() .HasMaxLength(200); builder.Property(a => a.EntityId) .IsRequired() .HasMaxLength(200); builder.Property(a => a.EntityName) .IsRequired() .HasMaxLength(200); // Indexes for common query patterns builder.HasIndex(a => a.Timestamp); builder.HasIndex(a => a.User); builder.HasIndex(a => a.EntityType); builder.HasIndex(a => a.EntityId); builder.HasIndex(a => a.Action); } }