using Domain.Entities.Stocks; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata.Builders; namespace Infrastructure.Persistence.Configurations.Stocks; public sealed class SecuritiesLendingConfiguration : IEntityTypeConfiguration { public void Configure(EntityTypeBuilder builder) { builder.ToTable(nameof(SecuritiesLending), t => t.HasComment("SEIBro 종목별 대차거래 현황 (getSlbDealingByIsin) — 대차잔고·외국인/내국인 대여·차입")); builder.HasKey(x => x.ID); builder.HasIndex(x => new { x.Isin, x.StdDt }).IsUnique(); builder.HasIndex(x => x.StdDt); builder.Property(x => x.Isin).HasMaxLength(12).IsFixedLength().IsRequired().HasComment("종목코드 (ISIN)"); builder.Property(x => x.StdDt).IsRequired().HasComment("기준일 (STD_DT)"); builder.Property(x => x.TotIssuStkqty).HasComment("총발행주식수 (TOT_ISSU_STKQTY)"); builder.Property(x => x.TrQty).HasComment("일일거래량 (TR_QTY)"); builder.Property(x => x.MatcQty).HasComment("대차체결량 (MATC_QTY)"); builder.Property(x => x.RedQty).HasComment("대차상환량 (RED_QTY)"); builder.Property(x => x.SlbTrRemQty).HasComment("대차잔고주수 (SLB_TR_REM_QTY)"); builder.Property(x => x.FrinerLendRemAmt).HasComment("외국인 대여잔고금액 (FRINER_LEND_REM_AMT)"); builder.Property(x => x.FrinerLendRemRatio).HasPrecision(6, 2).HasComment("외국인 대여잔고비율 (FRINER_LEND_REM_RATIO)"); builder.Property(x => x.NativeLendRemAmt).HasComment("내국인 대여잔고금액 (NATIVE_LEND_REM_AMT)"); builder.Property(x => x.NativeLendRemRatio).HasPrecision(6, 2).HasComment("내국인 대여잔고비율 (NATIVE_LEND_REM_RATIO)"); builder.Property(x => x.FrinerBrwRemAmt).HasComment("외국인 차입잔고금액 (FRINER_BRW_REM_AMT)"); builder.Property(x => x.FrinerBrwRemRatio).HasPrecision(6, 2).HasComment("외국인 차입잔고비율 (FRINER_BRW_REM_RATIO)"); builder.Property(x => x.NativeBrwRemAmt).HasComment("내국인 차입잔고금액 (NATIVE_BRW_REM_AMT)"); builder.Property(x => x.NativeBrwRemRatio).HasPrecision(6, 2).HasComment("내국인 차입잔고비율 (NATIVE_BRW_REM_RATIO)"); } }