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

namespace Integrations.Data.Configurations;
internal sealed class AdemcoSettingsConfiguration : IEntityTypeConfiguration<AdemcoSettings>
{
	public void Configure(EntityTypeBuilder<AdemcoSettings> builder)
	{
		builder.Property(x => x.Port)
			.IsRequired();

		builder.HasOne(x => x.Module)
			.WithOne(x => x.Ademco)
			.HasForeignKey<AdemcoSettings>(x => x.ModuleId)
			.IsRequired();
	}
}
