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

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

		_ = 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.Time)
			.HasColumnName("action_ts");

		_ = builder.Property(x => x.UserId)
			.HasColumnName("user_id")
			.IsRequired();

		_ = builder.Property(x => x.Comment)
			.HasColumnName("comment");
	}
}
