BondIndexDailyPriceConfiguration.cs 2.3 KB

12345678910111213141516171819202122232425262728293031
  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 BondIndexDailyPriceConfiguration : IEntityTypeConfiguration<BondIndexDailyPrice>
  6. {
  7. public void Configure(EntityTypeBuilder<BondIndexDailyPrice> builder)
  8. {
  9. builder.ToTable(nameof(BondIndexDailyPrice), t => t.HasComment("채권지수 일별시세 (KRX OpenAPI idx/bon_dd_trd)"));
  10. builder.HasKey(x => x.ID);
  11. builder.HasIndex(x => new { x.GroupName, x.TradeDate }).IsUnique();
  12. builder.HasIndex(x => x.TradeDate);
  13. builder.Property(x => x.GroupName).HasMaxLength(100).IsRequired().HasComment("채권지수 그룹명 (BND_IDX_GRP_NM)");
  14. builder.Property(x => x.TotalEarningIndex).HasPrecision(18, 4).HasComment("총수익지수 (TOT_EARNG_IDX)");
  15. builder.Property(x => x.TotalEarningChange).HasPrecision(18, 4).HasComment("총수익지수 전일 대비");
  16. builder.Property(x => x.NetPriceIndex).HasPrecision(18, 4).HasComment("순가격지수 (NETPRC_IDX)");
  17. builder.Property(x => x.NetPriceChange).HasPrecision(18, 4).HasComment("순가격지수 전일 대비");
  18. builder.Property(x => x.ZeroReinvestIndex).HasPrecision(18, 4).HasComment("제로재투자지수 (ZERO_REINVST_IDX)");
  19. builder.Property(x => x.ZeroReinvestChange).HasPrecision(18, 4).HasComment("제로재투자지수 전일 대비");
  20. builder.Property(x => x.CallReinvestIndex).HasPrecision(18, 4).HasComment("Call재투자지수 (CALL_REINVST_IDX)");
  21. builder.Property(x => x.CallReinvestChange).HasPrecision(18, 4).HasComment("Call재투자지수 전일 대비");
  22. builder.Property(x => x.MarketPriceIndex).HasPrecision(18, 4).HasComment("시장가격지수 (MKT_PRC_IDX)");
  23. builder.Property(x => x.MarketPriceChange).HasPrecision(18, 4).HasComment("시장가격지수 전일 대비");
  24. builder.Property(x => x.AvgDuration).HasPrecision(18, 4).HasComment("평균 듀레이션 (AVG_DURATION)");
  25. builder.Property(x => x.AvgConvexity).HasPrecision(18, 4).HasComment("평균 컨벡시티 (AVG_CONVEXITY_PRC)");
  26. builder.Property(x => x.AvgYield).HasPrecision(18, 4).HasComment("평균 만기수익률 YTM (BND_IDX_AVG_YD)");
  27. }
  28. }