using Domain.Entities.Developers; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata.Builders; namespace Infrastructure.Persistence.Configurations.Developers; public class NiceAuthSessionConfiguration : IEntityTypeConfiguration { public void Configure(EntityTypeBuilder builder) { builder.HasOne(x => x.Developer).WithMany().HasForeignKey(x => x.DeveloperID).OnDelete(DeleteBehavior.Cascade); builder.HasIndex(x => x.SessionToken).IsUnique(); builder.HasIndex(x => new { x.DeveloperID, x.CreatedAt }); builder.HasIndex(x => x.Status); builder.ToTable(nameof(NiceAuthSession), x => x.HasComment("NICE 통합인증 1회 진행 세션")); builder.HasKey(x => x.ID); builder.Property(x => x.SessionToken).HasMaxLength(40).IsRequired(); builder.Property(x => x.RequestNo).HasMaxLength(50).IsRequired(); builder.Property(x => x.TransactionID).HasMaxLength(100).IsRequired(); builder.Property(x => x.WebTransactionID).HasMaxLength(100); builder.Property(x => x.Ticket).HasMaxLength(200).IsRequired(); builder.Property(x => x.Iterators).IsRequired(); builder.Property(x => x.Status).HasConversion().IsRequired(); builder.Property(x => x.FailReason).HasMaxLength(200); builder.Property(x => x.CreatedAt).IsRequired(); builder.Property(x => x.ExpiresAt).IsRequired(); } }