using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;

namespace GeoRitmMover.GeoRitm.Data.EntityConfigurations;
public class SourceSettingEntityConfiguration : IEntityTypeConfiguration<SourceSetting>
{
	public void Configure(EntityTypeBuilder<SourceSetting> builder)
	{
		_ = builder.ToTable("object_settings");

		_ = builder.HasKey(x => new
		{
			x.ObjectId,
			x.SettingsKey,
		});

		_ = builder.Property(x => x.ObjectId)
			.HasColumnName("object_id")
			.IsRequired();

		_ = builder.Property(x => x.SettingsKey)
			.HasColumnName("settings_key")
			.IsRequired();

		_ = builder.Property(x => x.Value)
			.HasColumnName("value");
	}
}
