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

namespace SolutionErp.Infrastructure.Persistence.Configurations;

// EF Mig 34 — Sequence table cho MaNhanVien. PK Prefix string.
// Mirror ContractCodeSequenceConfiguration pattern.
public class EmployeeCodeSequenceConfiguration : IEntityTypeConfiguration<EmployeeCodeSequence>
{
    public void Configure(EntityTypeBuilder<EmployeeCodeSequence> e)
    {
        e.ToTable("EmployeeCodeSequences");

        e.HasKey(x => x.Prefix);
        e.Property(x => x.Prefix).HasMaxLength(50);
    }
}
