using Domain.Entities.Payments.Toss; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata.Builders; namespace Infrastructure.Persistence.Configurations.Payments.Toss; public class TossLogConfiguration : IEntityTypeConfiguration { public void Configure(EntityTypeBuilder builder) { builder.HasOne(x => x.Member).WithMany().HasForeignKey(x => x.MemberID).OnDelete(DeleteBehavior.NoAction); builder.HasIndex(x => x.MemberID); builder.HasIndex(x => x.LogType); builder.HasIndex(x => x.Code); builder.HasIndex(x => x.PaymentKey); builder.HasIndex(x => x.OrderID); builder.ToTable("TossLog", x => x.HasComment("토스페이먼츠 결제 에러/실패/웹훅/대사 로그")); builder.HasKey(x => x.ID); builder.Property(x => x.Code).HasMaxLength(64).IsRequired(); builder.Property(x => x.Message).HasMaxLength(500).IsRequired(); builder.Property(x => x.PaymentKey).HasMaxLength(200); builder.Property(x => x.OrderID).HasMaxLength(64); builder.Property(x => x.ExtraData).HasMaxLength(4000); } }