ConvertibleBondTargetConfiguration.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 ConvertibleBondTargetConfiguration : IEntityTypeConfiguration<ConvertibleBondTarget>
  6. {
  7. public void Configure(EntityTypeBuilder<ConvertibleBondTarget> builder)
  8. {
  9. builder.ToTable(nameof(ConvertibleBondTarget), t => t.HasComment("SEIBro 주식관련사채 행사대상 주식정보 (getXrcStkStatInfo) — CB/BW/EB 행사대상·행사가·행사비율. rolling per-채권ISIN. 필드 매핑은 스펙 기준(빈 샘플)"));
  10. builder.HasKey(x => x.ID);
  11. builder.HasIndex(x => new { x.BondIsin, x.XrcStkIsin }).IsUnique();
  12. builder.HasIndex(x => x.XrcStkIsin);
  13. builder.Property(x => x.BondIsin).HasMaxLength(12).IsFixedLength().IsRequired().HasComment("채권 종목번호 (BOND_ISIN)");
  14. builder.Property(x => x.BondSecnNm).HasMaxLength(100).HasComment("채권 종목명 (BOND_SECN_NM)");
  15. builder.Property(x => x.BondKindNm).HasMaxLength(10).HasComment("채권종류코드 (BOND_KIND_NM) — EB/CB/BW");
  16. builder.Property(x => x.XrcStkIsin).HasMaxLength(12).IsFixedLength().IsRequired().HasComment("행사주식종목번호 (XRC_STK_ISIN)");
  17. builder.Property(x => x.StkSecnNm).HasMaxLength(100).HasComment("주식 종목명 (STK_SECN_NM)");
  18. builder.Property(x => x.WrtbIsin).HasMaxLength(12).HasComment("신주인수권증권종목번호 (WRTB_ISIN)");
  19. builder.Property(x => x.WrtbSecnNm).HasMaxLength(100).HasComment("신주인수권증권명 (WRTB_SECN_NM)");
  20. // 스펙 XRC_RATIO NUMBER(20,10)/XRC_PRICE NUMBER(17,7) — decimal(28,10) 로 안전 설정
  21. builder.Property(x => x.XrcRatio).HasPrecision(28, 10).HasComment("행사비율 (XRC_RATIO)");
  22. builder.Property(x => x.XrcPrice).HasPrecision(28, 10).HasComment("행사가격 (XRC_PRICE)");
  23. builder.Property(x => x.SetaccEndtermLimitDays).HasComment("결산기말제한일수 (SETACC_ENDTERM_LIMIT_DAYS)");
  24. builder.Property(x => x.NewstkAllocDdBfLimitDays).HasComment("신주배정일전제한일수 (NEWSTK_ALOC_DD_BF_LIMIT_DAYS)");
  25. builder.Property(x => x.DmanLimitRsnContent).HasMaxLength(500).HasComment("청구제한사유내용 (DMAN_LIMIT_RSN_CONTENT)");
  26. }
  27. }