using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using SolutionErp.Domain.Office;

namespace SolutionErp.Infrastructure.Persistence.Configurations;

// EF Mig 36 G-O2 (S36) — Phòng họp catalog. Standalone no FK.
// Mirror LeaveType pattern (no HasQueryFilter — handler explicit Where(!IsDeleted)).
public class MeetingRoomConfiguration : IEntityTypeConfiguration<MeetingRoom>
{
    public void Configure(EntityTypeBuilder<MeetingRoom> e)
    {
        e.ToTable("MeetingRooms");

        e.Property(x => x.Code).HasMaxLength(20).IsRequired();
        e.Property(x => x.Name).HasMaxLength(200).IsRequired();
        e.Property(x => x.Location).HasMaxLength(200);
        e.Property(x => x.Equipment).HasMaxLength(500);

        e.HasIndex(x => x.Code).IsUnique();
    }
}
