using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata.Builders; using mws.backend.dotnet.domain.Audit; namespace mws.backend.dotnet.infrastructure.Persistence.Configuration; public class LoginLogConfiguration : IEntityTypeConfiguration { public void Configure(EntityTypeBuilder e) { e.ToTable("login_logs"); e.HasKey(x => x.Id); e.Property(x => x.Username).HasMaxLength(100).IsRequired(); e.Property(x => x.FailureReason).HasMaxLength(100); e.Property(x => x.IpAddress).HasMaxLength(45); e.Property(x => x.UserAgent).HasMaxLength(512); e.HasIndex(x => x.CreatedAt); e.HasIndex(x => x.Username); e.HasIndex(x => x.Success); } }