ConvertibleExerciseConfiguration.cs 2.1 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 ConvertibleExerciseConfiguration : IEntityTypeConfiguration<ConvertibleExercise>
  6. {
  7. public void Configure(EntityTypeBuilder<ConvertibleExercise> builder)
  8. {
  9. builder.ToTable(nameof(ConvertibleExercise), t => t.HasComment("SEIBro 주식관련사채 행사내역 (getXrcStkOptionXrcInfo) — CB/BW/EB 권리행사. 날짜 스윕(권리행사일) window delete+insert. 필드 매핑은 스펙 기준(빈 샘플)"));
  10. builder.HasKey(x => x.ID);
  11. builder.HasIndex(x => x.RgtStdDt);
  12. builder.HasIndex(x => x.BondIsin);
  13. builder.HasIndex(x => x.XrcStkIsin);
  14. builder.Property(x => x.BondIsin).HasMaxLength(12).IsFixedLength().IsRequired().HasComment("채권 종목코드 (BOND_ISIN)");
  15. builder.Property(x => x.BondKorSecnNm).HasMaxLength(100).HasComment("채권 한글종목명 (BOND_KOR_SECN_NM)");
  16. builder.Property(x => x.BondKindNm).HasMaxLength(10).HasComment("채권종류코드 (BOND_KIND_NM) — EB/CB/BW");
  17. builder.Property(x => x.XrcStkIsin).HasMaxLength(12).HasComment("행사주식 종목코드 (XRC_STK_ISIN)");
  18. builder.Property(x => x.StkKorSecnNm).HasMaxLength(100).HasComment("행사주식명 (STK_KOR_SECN_NM)");
  19. builder.Property(x => x.RgtStdDt).IsRequired().HasComment("권리행사일 (RGT_STD_DT)");
  20. builder.Property(x => x.XrcPossBeginDt).HasComment("행사시작일 (XRC_POSS_BEGIN_DT)");
  21. builder.Property(x => x.XrcPossExpryDt).HasComment("행사종료일 (XRC_POSS_EXPRY_DT)");
  22. // 스펙 XRC_AMT/XRC_QTY/XRC_PRICE NUMBER(17,7) — decimal(28,10) 로 안전 설정
  23. builder.Property(x => x.XrcAmt).HasPrecision(28, 10).HasComment("행사금액 (XRC_AMT)");
  24. builder.Property(x => x.XrcQty).HasPrecision(28, 10).HasComment("행사주수 (XRC_QTY)");
  25. builder.Property(x => x.XrcPrice).HasPrecision(28, 10).HasComment("행사가격 (XRC_PRICE)");
  26. builder.Property(x => x.ListDt).HasComment("주식상장일 (LIST_DT)");
  27. }
  28. }