using Domain.Entities.Stocks; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata.Builders; namespace Infrastructure.Persistence.Configurations.Stocks; public sealed class ForeignCustodySecurityConfiguration : IEntityTypeConfiguration { public void Configure(EntityTypeBuilder builder) { builder.ToTable(nameof(ForeignCustodySecurity), t => t.HasComment("SEIBro 종목별 외화증권 보관현황 (getSecnFrsecCusInfo) — 종목당 국가별 복수 행. UQ(StdDt,Isin,NationCd,SecnTpcd) (리뷰 결함 #3). ForeignIsins seed 시 활성")); builder.HasKey(x => x.ID); builder.HasIndex(x => new { x.StdDt, x.Isin, x.NationCd, x.SecnTpcd }).IsUnique(); builder.HasIndex(x => new { x.Isin, x.StdDt }); builder.Property(x => x.StdDt).IsRequired().HasComment("기준일자 (STD_DT, 스탬핑)"); builder.Property(x => x.Isin).HasMaxLength(12).IsRequired().HasComment("종목코드 (ISIN, 스탬핑)"); builder.Property(x => x.NationCd).HasMaxLength(2).IsRequired().HasComment("국가코드 (NATION_CD) — 자연키(종목당 국가별 복수 행)"); builder.Property(x => x.SecnTpcd).HasMaxLength(2).IsRequired().HasComment("종목구분코드 (SECN_TPCD) — 71외화주식~78외화수익증권. 자연키"); builder.Property(x => x.FrsecTotHoldAmt).HasColumnType("decimal(24,2)").HasComment("외화증권보유금액 (FRSEC_TOT_HOLD_AMT) — USD"); builder.Property(x => x.FrsecTotHoldQty).HasColumnType("decimal(28,6)").HasComment("외화증권총보유수량 (FRSEC_TOT_HOLD_QTY)"); } }