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) — 특정 외화종목(ISIN) 보유금액(USD)·보유수량. ForeignIsins seed 시 활성")); builder.HasKey(x => x.ID); builder.HasIndex(x => new { x.StdDt, x.Isin }).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).HasComment("국가코드 (NATION_CD)"); builder.Property(x => x.SecnTpcd).HasMaxLength(2).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)"); } }