Files
Backend-Api/CompanyManagment.EFCore/Mapping/InstitutionContractMapping.cs

49 lines
2.2 KiB
C#

using Company.Domain.InstitutionContractAgg;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace CompanyManagment.EFCore.Mapping;
public class InstitutionContractMapping : IEntityTypeConfiguration<InstitutionContract>
{
public void Configure(EntityTypeBuilder<InstitutionContract> builder)
{
builder.ToTable("InstitutionContracts");
builder.HasKey(x => x.id);
builder.Property(x => x.ContractNo).HasMaxLength(40);
builder.Property(x => x.RepresentativeName).HasMaxLength(80);
builder.Property(x => x.ContractingPartyName).HasMaxLength(80);
builder.Property(x => x.ContractDateFa).HasMaxLength(10);
builder.Property(x => x.ContractStartFa).HasMaxLength(10);
builder.Property(x => x.ContractEndFa).HasMaxLength(10);
builder.Property(x => x.State).HasMaxLength(20);
builder.Property(x => x.City).HasMaxLength(30);
builder.Property(x => x.Address).HasMaxLength(250);
builder.Property(x => x.WorkshopManualCount).HasMaxLength(5);
builder.Property(x => x.EmployeeManualCount).HasMaxLength(10);
builder.Property(x => x.IsActiveString).HasMaxLength(5);
builder.Property(x => x.Description).HasMaxLength(10000);
builder.Property(x => x.Signature).HasMaxLength(1);
builder.Property(x => x.OfficialCompany).HasMaxLength(12);
builder.Property(x => x.TypeOfContract).HasMaxLength(30);
builder.Property(x => x.HasValueAddedTax).HasMaxLength(10);
builder.Property(x => x.VerifyCode).HasMaxLength(20);
builder.Property(x => x.VerifierFullName).HasMaxLength(100);
builder.Property(x => x.VerifierPhoneNumber).HasMaxLength(20);
builder.Property(x => x.VerificationStatus).HasConversion<string>().HasMaxLength(122);
builder.HasMany(x => x.Installments)
.WithOne(x => x.InstitutionContract)
.HasForeignKey(x => x.InstitutionContractId);
builder.HasMany(x => x.ContactInfoList)
.WithOne(x => x.InstitutionContracts)
.HasForeignKey(x => x.InstitutionContractId);
builder.HasMany(x => x.Amendments).WithOne(x => x.InstitutionContract)
.HasForeignKey(x => x.InstitutionContractId);
}
}