SecuritiesLendingConfiguration.cs 2.3 KB

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