using ClaudeDo.Data.Models;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;

namespace ClaudeDo.Data.Configuration;

public class DailyNoteEntityConfiguration : IEntityTypeConfiguration<DailyNoteEntity>
{
    public void Configure(EntityTypeBuilder<DailyNoteEntity> builder)
    {
        builder.ToTable("daily_notes");
        builder.HasKey(n => n.Id);
        builder.Property(n => n.Id).HasColumnName("id").ValueGeneratedNever();
        builder.Property(n => n.Date).HasColumnName("note_date").IsRequired();
        builder.Property(n => n.Text).HasColumnName("text").IsRequired();
        builder.Property(n => n.SortOrder).HasColumnName("sort_order").IsRequired();
        builder.Property(n => n.FromAgent).HasColumnName("from_agent").IsRequired();
        builder.Property(n => n.CreatedAt).HasColumnName("created_at").IsRequired();
        builder.HasIndex(n => n.Date);
    }
}
