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

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

		_ = builder.HasKey(x => x.Id);
		_ = builder.Property(x => x.Id)
			.HasColumnName("id")
			.IsRequired();

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

		_ = builder.Property(x => x.FileName)
			.HasColumnName("file_name");

		_ = builder.Property(x => x.MimeType)
			.HasColumnName("mime_type")
			.IsRequired();

		_ = builder.Property(x => x.Caption)
			.HasColumnName("caption");

		_ = builder.Property(x => x.Payload)
			.HasColumnName("payload")
			.IsRequired();
	}
}
