initial commit

This commit is contained in:
2026-07-21 14:28:43 +07:00
commit 01107db6fd
995 changed files with 75124 additions and 0 deletions
@@ -0,0 +1,44 @@
using Indotalent.Data.Entities;
using Indotalent.Shared.Consts;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace Indotalent.Infrastructure.Database.MsSQL.Configuration;
public class PurchaseOrderConfiguration : IEntityTypeConfiguration<PurchaseOrder>
{
public void Configure(EntityTypeBuilder<PurchaseOrder> builder)
{
builder.Property(e => e.AutoNumber)
.HasMaxLength(GlobalConsts.StringLengthShort);
builder.Property(e => e.Description)
.HasMaxLength(GlobalConsts.StringLengthMedium);
builder.Property(e => e.VendorId)
.HasMaxLength(GlobalConsts.StringLengthId);
builder.Property(e => e.TaxId)
.HasMaxLength(GlobalConsts.StringLengthId);
builder.HasOne(e => e.Vendor)
.WithMany()
.HasForeignKey(e => e.VendorId)
.OnDelete(DeleteBehavior.NoAction);
builder.HasOne(e => e.Tax)
.WithMany()
.HasForeignKey(e => e.TaxId)
.OnDelete(DeleteBehavior.NoAction);
builder.HasMany(e => e.PurchaseOrderItemList)
.WithOne(e => e.PurchaseOrder)
.HasForeignKey(e => e.PurchaseOrderId)
.OnDelete(DeleteBehavior.NoAction);
builder.HasIndex(e => e.AutoNumber).IsUnique();
builder.HasIndex(e => e.OrderDate);
builder.HasIndex(e => e.VendorId);
builder.HasIndex(e => e.TaxId);
}
}