using Domain.Entities.Stocks; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata.Builders; namespace Infrastructure.Persistence.Configurations.Stocks; public sealed class DisclosureConfiguration : IEntityTypeConfiguration { public void Configure(EntityTypeBuilder builder) { builder.ToTable(nameof(Disclosure), t => t.HasComment("전자공시(DART) 공시 목록 (OpenDART list.json)")); builder.HasKey(x => x.ID); builder.HasIndex(x => x.RceptNo).IsUnique(); builder.HasIndex(x => new { x.StockCode, x.RceptDt }).IsDescending(false, true); builder.HasIndex(x => x.RceptDt).IsDescending(); builder.Property(x => x.RceptNo).HasMaxLength(14).IsRequired().HasComment("접수번호 (rcept_no, 14자리)"); builder.Property(x => x.CorpCode).HasMaxLength(8).IsRequired().HasComment("고유번호 (corp_code, 8자리)"); builder.Property(x => x.CorpName).HasMaxLength(150).IsRequired().HasComment("법인명 (corp_name)"); builder.Property(x => x.StockCode).HasMaxLength(6).HasComment("종목코드 (stock_code, 6자리) — 비상장이면 null"); builder.Property(x => x.CorpCls).HasMaxLength(1).IsRequired().HasComment("법인구분 (corp_cls, Y유가/K코스닥/N코넥스/E기타)"); builder.Property(x => x.ReportNm).HasMaxLength(400).IsRequired().HasComment("보고서명 (report_nm)"); builder.Property(x => x.FlrNm).HasMaxLength(150).IsRequired().HasComment("공시 제출인명 (flr_nm)"); builder.Property(x => x.RceptDt).HasComment("접수일자 (rcept_dt)"); builder.Property(x => x.Rm).HasMaxLength(100).HasComment("비고 (rm)"); } }