using Domain.Entities.Stocks; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata.Builders; namespace Infrastructure.Persistence.Configurations.Stocks; public sealed class SeibroFetchMarkerConfiguration : IEntityTypeConfiguration { public void Configure(EntityTypeBuilder builder) { builder.ToTable(nameof(SeibroFetchMarker), t => t.HasComment("SEIBro per-키 rolling 조회 시도 마커 (0행 포함) — 리뷰 결함 #1: 정상 0행 재수집·starvation 해소용")); builder.HasKey(x => x.ID); builder.HasIndex(x => new { x.JobKey, x.EntityKey }).IsUnique(); builder.HasIndex(x => new { x.JobKey, x.LastCheckedAt }); builder.Property(x => x.JobKey).HasMaxLength(40).IsRequired().HasComment("수집 job 식별자"); builder.Property(x => x.EntityKey).HasMaxLength(60).IsRequired().HasComment("대상 키 (ISIN·회사번호 등, 복합키는 구분자 결합)"); builder.Property(x => x.LastCheckedAt).IsRequired().HasComment("마지막 조회 시도 시각 (UTC, 0행 포함)"); } }