ForeignCustodyNationConfiguration.cs 1.3 KB

123456789101112131415161718192021
  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 ForeignCustodyNationConfiguration : IEntityTypeConfiguration<ForeignCustodyNation>
  6. {
  7. public void Configure(EntityTypeBuilder<ForeignCustodyNation> builder)
  8. {
  9. builder.ToTable(nameof(ForeignCustodyNation), t => t.HasComment("SEIBro 국가별 외화증권 보관현황 (getNationFrsecCusInfo) — KSD 보관 외화증권 보관금액(USD), 국가×종목구분별. 서학개미 추이 소스"));
  10. builder.HasKey(x => x.ID);
  11. builder.HasIndex(x => new { x.StdDt, x.NationCd, x.SecnTpcd }).IsUnique();
  12. builder.HasIndex(x => new { x.NationCd, x.StdDt });
  13. builder.Property(x => x.StdDt).IsRequired().HasComment("기준일자 (STD_DT, 스탬핑)");
  14. builder.Property(x => x.NationCd).HasMaxLength(2).IsRequired().HasComment("국가코드 (NATION_CD, 스탬핑) — US/JP/HK/CN/E1 등 43종");
  15. builder.Property(x => x.SecnTpcd).HasMaxLength(2).IsRequired().HasComment("종목구분코드 (SECN_TPCD) — 71외화주식~78외화수익증권");
  16. builder.Property(x => x.FrsecCusAmt).HasColumnType("decimal(24,2)").HasComment("외화증권보관금액 (FRSEC_CUS_AMT) — USD");
  17. }
  18. }