initial commit

This commit is contained in:
2026-07-21 14:08:10 +07:00
commit f7cf118326
533 changed files with 41762 additions and 0 deletions
@@ -0,0 +1,41 @@
using Indotalent.Data.Entities;
using Indotalent.Shared.Consts;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace Indotalent.Infrastructure.Database.MsSQL.Configuration;
public class EmployeeIncomeConfiguration : IEntityTypeConfiguration<EmployeeIncome>
{
public void Configure(EntityTypeBuilder<EmployeeIncome> builder)
{
builder.Property(e => e.AutoNumber)
.HasMaxLength(GlobalConsts.StringLengthShort);
builder.Property(e => e.EmployeeId)
.HasMaxLength(GlobalConsts.StringLengthId);
builder.Property(e => e.IncomeId)
.HasMaxLength(GlobalConsts.StringLengthId);
builder.Property(e => e.Description)
.HasMaxLength(GlobalConsts.StringLengthShort);
builder.Property(e => e.Amount)
.HasPrecision(18, 2);
builder.HasIndex(e => e.AutoNumber).IsUnique();
builder.HasIndex(e => e.EmployeeId);
builder.HasIndex(e => e.IncomeId);
builder.HasOne(e => e.Employee)
.WithMany(p => p.EmployeeIncome)
.HasForeignKey(e => e.EmployeeId)
.OnDelete(DeleteBehavior.NoAction);
builder.HasOne(e => e.Income)
.WithMany()
.HasForeignKey(e => e.IncomeId)
.OnDelete(DeleteBehavior.NoAction);
}
}