using Microsoft.EntityFrameworkCore;
using Monitoring.Core.Domain.CheckListManagement;

namespace Monitoring.Infrastructure.Data.Configurations;

public class CheckListTemplateConfiguration : IEntityTypeConfiguration<CheckListTemplate>
{
	public void Configure(
		Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder<CheckListTemplate> builder
	)
	{
		_ = builder.HasKey(x => x.Id);
		_ = builder.Property(x => x.Id).IsRequired().HasConversion(x => x.Value, x => new(x));

		_ = builder.Property(x => x.Type).IsRequired();
	}
}
