using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using UniVerse.Domain.Entities;

namespace UniVerse.Infrastructure.Data.Configurations;

public class ReviewPromptSettingConfiguration : IEntityTypeConfiguration<ReviewPromptSetting>
{
    public void Configure(EntityTypeBuilder<ReviewPromptSetting> builder)
    {
        builder.ToTable("review_prompt_settings");

        builder.HasKey(setting => setting.Id);
        builder.Property(setting => setting.Id)
            .HasColumnName("id")
            .ValueGeneratedNever();
        builder.Property(setting => setting.Prompt)
            .HasColumnName("prompt")
            .IsRequired();
        builder.Property(setting => setting.CreatedAt)
            .HasColumnName("created_at")
            .HasDefaultValueSql("NOW()");
        builder.Property(setting => setting.UpdatedAt)
            .HasColumnName("updated_at")
            .HasDefaultValueSql("NOW()");
    }
}
