using Domain.Entities.Stocks; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata.Builders; namespace Infrastructure.Persistence.Configurations.Stocks; public sealed class BondMasterConfiguration : IEntityTypeConfiguration { public void Configure(EntityTypeBuilder builder) { builder.ToTable(nameof(BondMaster), t => t.HasComment("SEIBro 채권 종목 정보 (getBondStatInfo) — 만기·표면이자율·옵션·보증·신용등급 4사(KIS/NICE/SCI/KR). 신용등급 유일 소스")); builder.HasKey(x => x.Isin); builder.HasIndex(x => x.IssucoCustno); builder.HasIndex(x => x.XpirDt); builder.Property(x => x.Isin).HasMaxLength(12).HasComment("종목코드 (ISIN)"); builder.Property(x => x.IssucoCustno).HasComment("발행사 번호 (ISSUCO_CUSTNO)"); builder.Property(x => x.KorSecnNm).HasMaxLength(100).HasComment("한글종목명 (KOR_SECN_NM)"); builder.Property(x => x.SecnKacd).HasMaxLength(4).HasComment("종목종류코드 (SECN_KACD)"); builder.Property(x => x.IssuDt).HasComment("발행일자 (ISSU_DT)"); builder.Property(x => x.XpirDt).HasComment("만기일자 (XPIR_DT)"); builder.Property(x => x.IssuCurCd).HasMaxLength(3).HasComment("발행통화코드 (ISSU_CUR_CD)"); builder.Property(x => x.FirstIssuAmt).HasColumnType("decimal(24,4)").HasComment("최초발행금액 (FIRST_ISSU_AMT)"); builder.Property(x => x.IssuRema).HasColumnType("decimal(20,2)").HasComment("발행잔액 (ISSU_REMA)"); builder.Property(x => x.PayinAmt).HasColumnType("decimal(20,2)").HasComment("납입금액 (PAYIN_AMT)"); builder.Property(x => x.CouponRate).HasColumnType("decimal(15,10)").HasComment("표면이자율 (COUPON_RATE)"); builder.Property(x => x.XpiredRate).HasColumnType("decimal(16,10)").HasComment("만기상환율 (XPIRED_RATE)"); builder.Property(x => x.RecuWhcd).HasMaxLength(2).HasComment("모집방법코드 (RECU_WHCD)"); builder.Property(x => x.IssuWhcd).HasMaxLength(1).HasComment("발행방법코드 (ISSU_WHCD)"); builder.Property(x => x.ParticulBondKindTpcd).HasMaxLength(1).HasComment("특이채권종류구분코드 (PARTICUL_BOND_KIND_TPCD)"); builder.Property(x => x.OptionTpcd).HasMaxLength(4).HasComment("옵션구분코드 (OPTION_TPCD)"); builder.Property(x => x.ForcErlyRedYn).HasComment("강제조기상환여부 (FORC_ERLY_RED_YN)"); builder.Property(x => x.MrChgTpcd).HasMaxLength(1).HasComment("금리변동구분코드 (MR_CHG_TPCD)"); builder.Property(x => x.RegiOrgTpcd).HasMaxLength(2).HasComment("등록기관구분코드 (REGI_ORG_TPCD)"); builder.Property(x => x.GrtyTpcd).HasMaxLength(1).HasComment("보증구분코드 (GRTY_TPCD)"); builder.Property(x => x.SignaTpcd).HasMaxLength(1).HasComment("기명구분코드 (SIGNA_TPCD)"); builder.Property(x => x.RankTpcd).HasMaxLength(1).HasComment("순위구분코드 (RANK_TPCD)"); builder.Property(x => x.IntPayWayTpcd).HasMaxLength(1).HasComment("이자지급방법구분코드 (INT_PAY_WAY_TPCD)"); builder.Property(x => x.SintCintTpcd).HasMaxLength(1).HasComment("단리복리구분코드 (SINT_CINT_TPCD)"); builder.Property(x => x.IrateChgTpcd).HasMaxLength(1).HasComment("이자율변동구분코드 (IRATE_CHG_TPCD)"); builder.Property(x => x.XpirGuarPrate).HasColumnType("decimal(15,10)").HasComment("만기보장수익율 (XPIR_GUAR_PRATE)"); builder.Property(x => x.XpirGuarPrateTpcd).HasMaxLength(2).HasComment("만기보장수익율구분코드 (XPIR_GUAR_PRATE_TPCD)"); builder.Property(x => x.PrcpRedWhcd).HasMaxLength(2).HasComment("원금상환방법코드 (PRCP_RED_WHCD)"); builder.Property(x => x.ApliDt).HasComment("상장일 (APLI_DT)"); builder.Property(x => x.DlistDt).HasComment("상장폐지일자 (DLIST_DT)"); builder.Property(x => x.KisValatGrdCd).HasMaxLength(3).HasComment("KIS평가등급코드 (KIS_VALAT_GRD_CD)"); builder.Property(x => x.NiceValatGrdCd).HasMaxLength(3).HasComment("NICE평가등급코드 (NICE_VALAT_GRD_CD)"); builder.Property(x => x.SciValatGrdCd).HasMaxLength(3).HasComment("서울신용평가등급코드 (SCI_VALAT_GRD_CD)"); builder.Property(x => x.KrValatGrdCd).HasMaxLength(3).HasComment("한국기업평가등급코드 (KR_VALAT_GRD_CD)"); builder.Property(x => x.EltscYn).HasComment("전자증권여부 (ELTSC_YN)"); builder.Property(x => x.ExerMbodyTpcd).HasMaxLength(1).HasComment("권리행사주체 (EXER_MBODY_TPCD)"); builder.Property(x => x.IntEstmMannTpcd).HasMaxLength(1).HasComment("이자산정방식 (INT_ESTM_MANN_TPCD)"); } }