BondMasterConfiguration.cs 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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 BondMasterConfiguration : IEntityTypeConfiguration<BondMaster>
  6. {
  7. public void Configure(EntityTypeBuilder<BondMaster> builder)
  8. {
  9. builder.ToTable(nameof(BondMaster), t => t.HasComment("SEIBro 채권 종목 정보 (getBondStatInfo) — 만기·표면이자율·옵션·보증·신용등급 4사(KIS/NICE/SCI/KR). 신용등급 유일 소스"));
  10. builder.HasKey(x => x.Isin);
  11. builder.HasIndex(x => x.IssucoCustno);
  12. builder.HasIndex(x => x.XpirDt);
  13. builder.Property(x => x.Isin).HasMaxLength(12).HasComment("종목코드 (ISIN)");
  14. builder.Property(x => x.IssucoCustno).HasComment("발행사 번호 (ISSUCO_CUSTNO)");
  15. builder.Property(x => x.KorSecnNm).HasMaxLength(100).HasComment("한글종목명 (KOR_SECN_NM)");
  16. builder.Property(x => x.SecnKacd).HasMaxLength(4).HasComment("종목종류코드 (SECN_KACD)");
  17. builder.Property(x => x.IssuDt).HasComment("발행일자 (ISSU_DT)");
  18. builder.Property(x => x.XpirDt).HasComment("만기일자 (XPIR_DT)");
  19. builder.Property(x => x.IssuCurCd).HasMaxLength(3).HasComment("발행통화코드 (ISSU_CUR_CD)");
  20. builder.Property(x => x.FirstIssuAmt).HasColumnType("decimal(24,4)").HasComment("최초발행금액 (FIRST_ISSU_AMT)");
  21. builder.Property(x => x.IssuRema).HasColumnType("decimal(20,2)").HasComment("발행잔액 (ISSU_REMA)");
  22. builder.Property(x => x.PayinAmt).HasColumnType("decimal(20,2)").HasComment("납입금액 (PAYIN_AMT)");
  23. builder.Property(x => x.CouponRate).HasColumnType("decimal(15,10)").HasComment("표면이자율 (COUPON_RATE)");
  24. builder.Property(x => x.XpiredRate).HasColumnType("decimal(16,10)").HasComment("만기상환율 (XPIRED_RATE)");
  25. builder.Property(x => x.RecuWhcd).HasMaxLength(2).HasComment("모집방법코드 (RECU_WHCD)");
  26. builder.Property(x => x.IssuWhcd).HasMaxLength(1).HasComment("발행방법코드 (ISSU_WHCD)");
  27. builder.Property(x => x.ParticulBondKindTpcd).HasMaxLength(1).HasComment("특이채권종류구분코드 (PARTICUL_BOND_KIND_TPCD)");
  28. builder.Property(x => x.OptionTpcd).HasMaxLength(4).HasComment("옵션구분코드 (OPTION_TPCD)");
  29. builder.Property(x => x.ForcErlyRedYn).HasComment("강제조기상환여부 (FORC_ERLY_RED_YN)");
  30. builder.Property(x => x.MrChgTpcd).HasMaxLength(1).HasComment("금리변동구분코드 (MR_CHG_TPCD)");
  31. builder.Property(x => x.RegiOrgTpcd).HasMaxLength(2).HasComment("등록기관구분코드 (REGI_ORG_TPCD)");
  32. builder.Property(x => x.GrtyTpcd).HasMaxLength(1).HasComment("보증구분코드 (GRTY_TPCD)");
  33. builder.Property(x => x.SignaTpcd).HasMaxLength(1).HasComment("기명구분코드 (SIGNA_TPCD)");
  34. builder.Property(x => x.RankTpcd).HasMaxLength(1).HasComment("순위구분코드 (RANK_TPCD)");
  35. builder.Property(x => x.IntPayWayTpcd).HasMaxLength(1).HasComment("이자지급방법구분코드 (INT_PAY_WAY_TPCD)");
  36. builder.Property(x => x.SintCintTpcd).HasMaxLength(1).HasComment("단리복리구분코드 (SINT_CINT_TPCD)");
  37. builder.Property(x => x.IrateChgTpcd).HasMaxLength(1).HasComment("이자율변동구분코드 (IRATE_CHG_TPCD)");
  38. builder.Property(x => x.XpirGuarPrate).HasColumnType("decimal(15,10)").HasComment("만기보장수익율 (XPIR_GUAR_PRATE)");
  39. builder.Property(x => x.XpirGuarPrateTpcd).HasMaxLength(2).HasComment("만기보장수익율구분코드 (XPIR_GUAR_PRATE_TPCD)");
  40. builder.Property(x => x.PrcpRedWhcd).HasMaxLength(2).HasComment("원금상환방법코드 (PRCP_RED_WHCD)");
  41. builder.Property(x => x.ApliDt).HasComment("상장일 (APLI_DT)");
  42. builder.Property(x => x.DlistDt).HasComment("상장폐지일자 (DLIST_DT)");
  43. builder.Property(x => x.KisValatGrdCd).HasMaxLength(3).HasComment("KIS평가등급코드 (KIS_VALAT_GRD_CD)");
  44. builder.Property(x => x.NiceValatGrdCd).HasMaxLength(3).HasComment("NICE평가등급코드 (NICE_VALAT_GRD_CD)");
  45. builder.Property(x => x.SciValatGrdCd).HasMaxLength(3).HasComment("서울신용평가등급코드 (SCI_VALAT_GRD_CD)");
  46. builder.Property(x => x.KrValatGrdCd).HasMaxLength(3).HasComment("한국기업평가등급코드 (KR_VALAT_GRD_CD)");
  47. builder.Property(x => x.EltscYn).HasComment("전자증권여부 (ELTSC_YN)");
  48. builder.Property(x => x.ExerMbodyTpcd).HasMaxLength(1).HasComment("권리행사주체 (EXER_MBODY_TPCD)");
  49. builder.Property(x => x.IntEstmMannTpcd).HasMaxLength(1).HasComment("이자산정방식 (INT_ESTM_MANN_TPCD)");
  50. }
  51. }