ForeignSettlementSecurityConfiguration.cs 1.7 KB

123456789101112131415161718192021222324
  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 ForeignSettlementSecurityConfiguration : IEntityTypeConfiguration<ForeignSettlementSecurity>
  6. {
  7. public void Configure(EntityTypeBuilder<ForeignSettlementSecurity> builder)
  8. {
  9. builder.ToTable(nameof(ForeignSettlementSecurity), t => t.HasComment("SEIBro 종목별 외화증권 결제현황 (getSecnFrsecSetlInfo) — 특정 외화종목(ISIN) 매수/매도 결제신청수량·금액(USD). PROC_DT=T+1 반영"));
  10. builder.HasKey(x => x.ID);
  11. builder.HasIndex(x => new { x.ProcDt, x.Isin, x.IntlBizCacd }).IsUnique();
  12. builder.HasIndex(x => new { x.Isin, x.ProcDt });
  13. builder.Property(x => x.ProcDt).IsRequired().HasComment("결제처리일 (PROC_DT, 스탬핑, 한국시간) — 미국시간 T일 결제는 T+1 반영");
  14. builder.Property(x => x.Isin).HasMaxLength(12).IsRequired().HasComment("종목코드 (ISIN, 스탬핑)");
  15. builder.Property(x => x.IntlBizCacd).HasMaxLength(4).IsRequired().HasComment("국제업무분류코드 (INTL_BIZ_CACD) — 1110매수 1120매도");
  16. builder.Property(x => x.NationCd).HasMaxLength(2).HasComment("국가코드 (NATION_CD)");
  17. builder.Property(x => x.SecnTpcd).HasMaxLength(2).HasComment("종목구분코드 (SECN_TPCD) — 71외화주식~78외화수익증권");
  18. builder.Property(x => x.SetlAskQty).HasColumnType("decimal(28,6)").HasComment("결제신청수량 (SETL_ASK_QTY) — 주식:주, 채권:액면금액");
  19. builder.Property(x => x.SetlAmt).HasColumnType("decimal(24,2)").HasComment("결제금액 (SETL_AMT) — USD");
  20. }
  21. }