using Domain.Entities.Stocks; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata.Builders; namespace Infrastructure.Persistence.Configurations.Stocks; public sealed class StockBoardStatsConfiguration : IEntityTypeConfiguration { public void Configure(EntityTypeBuilder builder) { builder.ToTable(nameof(StockBoardStats), t => t.HasComment("종목 가상보드 통계 (글/댓글 수)")); builder.HasKey(x => x.StockCode); builder.Property(x => x.StockCode).HasMaxLength(6).IsFixedLength().IsRequired().HasComment("종목 단축코드 (PK)"); builder.Property(x => x.Posts).IsRequired().HasComment("게시글 수"); builder.Property(x => x.Comments).IsRequired().HasComment("댓글 수"); builder.Property(x => x.LastPostAt).HasComment("마지막 글 작성 일시"); builder.Property(x => x.UpdatedAt).IsRequired().HasComment("갱신 일시"); } }