using Domain.Entities.Stocks; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata.Builders; namespace Infrastructure.Persistence.Configurations.Stocks; public sealed class ForeignCustodyNationConfiguration : IEntityTypeConfiguration { public void Configure(EntityTypeBuilder builder) { builder.ToTable(nameof(ForeignCustodyNation), t => t.HasComment("SEIBro 국가별 외화증권 보관현황 (getNationFrsecCusInfo) — KSD 보관 외화증권 보관금액(USD), 국가×종목구분별. 서학개미 추이 소스")); builder.HasKey(x => x.ID); builder.HasIndex(x => new { x.StdDt, x.NationCd, x.SecnTpcd }).IsUnique(); builder.HasIndex(x => new { x.NationCd, x.StdDt }); builder.Property(x => x.StdDt).IsRequired().HasComment("기준일자 (STD_DT, 스탬핑)"); builder.Property(x => x.NationCd).HasMaxLength(2).IsRequired().HasComment("국가코드 (NATION_CD, 스탬핑) — US/JP/HK/CN/E1 등 43종"); builder.Property(x => x.SecnTpcd).HasMaxLength(2).IsRequired().HasComment("종목구분코드 (SECN_TPCD) — 71외화주식~78외화수익증권"); builder.Property(x => x.FrsecCusAmt).HasColumnType("decimal(24,2)").HasComment("외화증권보관금액 (FRSEC_CUS_AMT) — USD"); } }