initial commit
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
using Indotalent.Data.Entities;
|
||||
using Indotalent.Shared.Consts;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
|
||||
namespace Indotalent.Infrastructure.Database.MsSQL.Configuration;
|
||||
|
||||
public class PayrollDetailConfiguration : IEntityTypeConfiguration<PayrollDetail>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<PayrollDetail> builder)
|
||||
{
|
||||
builder.Property(e => e.PayrollProcessId)
|
||||
.HasMaxLength(GlobalConsts.StringLengthId);
|
||||
|
||||
builder.Property(e => e.EmployeeId)
|
||||
.HasMaxLength(GlobalConsts.StringLengthId);
|
||||
|
||||
builder.Property(e => e.EmployeeCode)
|
||||
.HasMaxLength(GlobalConsts.StringLengthShort);
|
||||
|
||||
builder.Property(e => e.EmployeeName)
|
||||
.HasMaxLength(GlobalConsts.StringLengthShort);
|
||||
|
||||
builder.HasOne(e => e.PayrollProcess)
|
||||
.WithMany()
|
||||
.HasForeignKey(e => e.PayrollProcessId)
|
||||
.OnDelete(DeleteBehavior.NoAction);
|
||||
|
||||
builder.HasOne(e => e.Employee)
|
||||
.WithMany()
|
||||
.HasForeignKey(e => e.EmployeeId)
|
||||
.OnDelete(DeleteBehavior.NoAction);
|
||||
|
||||
builder.HasIndex(e => e.EmployeeCode);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user