| 123456789101112131415161718192021 |
- using Domain.Entities.Stocks;
- using Microsoft.EntityFrameworkCore;
- using Microsoft.EntityFrameworkCore.Metadata.Builders;
- namespace Infrastructure.Persistence.Configurations.Stocks;
- public sealed class MacroIndicatorConfiguration : IEntityTypeConfiguration<MacroIndicator>
- {
- public void Configure(EntityTypeBuilder<MacroIndicator> builder)
- {
- builder.ToTable(nameof(MacroIndicator), t => t.HasComment("거시경제지표 시계열 (KOSIS 국가통계포털 OpenAPI 수집)"));
- builder.HasKey(x => x.ID);
- builder.HasIndex(x => new { x.Code, x.Period }).IsUnique();
- builder.Property(x => x.Code).HasMaxLength(40).IsRequired().HasComment("지표 내부코드 (config Code)");
- builder.Property(x => x.Name).HasMaxLength(100).IsRequired().HasComment("지표 표시명");
- builder.Property(x => x.Period).HasMaxLength(8).IsRequired().HasComment("수록 시점 (PRD_DE — 월 YYYYMM / 분기 YYYYQ / 연 YYYY)");
- builder.Property(x => x.Value).HasPrecision(18, 4).HasComment("수치 (DT)");
- builder.Property(x => x.Unit).HasMaxLength(40).HasComment("단위 (UNIT_NM)");
- }
- }
|