using Indotalent.Data.Entities; using Indotalent.Shared.Consts; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata.Builders; namespace Indotalent.Infrastructure.Database.MsSQL.Configuration; public class AutoNumberSequenceConfiguration : IEntityTypeConfiguration { public void Configure(EntityTypeBuilder builder) { builder.Property(e => e.EntityName) .HasMaxLength(GlobalConsts.StringLengthShort); builder.Property(e => e.PrefixTemplate) .HasMaxLength(GlobalConsts.StringLengthShort); builder.Property(e => e.SuffixTemplate) .HasMaxLength(GlobalConsts.StringLengthShort); builder.HasIndex(e => new { e.TenantId, e.EntityName, e.Year, e.Month }) .IsUnique(); } }