using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata.Builders; using SportsDivision.Domain.Entities; namespace SportsDivision.Infrastructure.Data.Configurations; public class TournamentConfiguration : IEntityTypeConfiguration { public void Configure(EntityTypeBuilder builder) { builder.HasKey(t => t.TournamentId); builder.Property(t => t.Name).IsRequired().HasMaxLength(200); builder.Property(t => t.Status).HasConversion().HasMaxLength(20); builder.Property(t => t.SchoolLevel).HasConversion().HasMaxLength(20); builder.HasOne(t => t.Zone).WithMany().HasForeignKey(t => t.ZoneId).OnDelete(DeleteBehavior.SetNull); } }