Files
Backend-Api/CompanyManagment.EFCore/Mapping/CheckoutMapping.cs
2025-01-04 16:14:10 +03:30

56 lines
2.5 KiB
C#

using Company.Domain.CheckoutAgg;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace CompanyManagment.EFCore.Mapping;
class CheckoutMapping : IEntityTypeConfiguration<Checkout>
{
public void Configure(EntityTypeBuilder<Checkout> builder)
{
builder.ToTable("Checkouts");
builder.HasKey(x => x.id);
builder.Property(x => x.EmployeeFullName).HasMaxLength(50);
builder.Property(x => x.ContractNo).HasMaxLength(50);
builder.Property(x => x.FathersName).HasMaxLength(20);
builder.Property(x => x.NationalCode).HasMaxLength(10);
builder.Property(x => x.DateOfBirth).HasMaxLength(10);
builder.Property(x => x.WorkshopName).HasMaxLength(70);
builder.Property(x => x.Month).HasMaxLength(10);
builder.Property(x => x.Year).HasMaxLength(4);
builder.Property(x => x.SumOfWorkingDays).HasMaxLength(6);
builder.Property(x => x.ArchiveCode).HasMaxLength(15);
builder.Property(x => x.PersonnelCode).HasMaxLength(10);
builder.Property(x => x.TotalClaims).HasMaxLength(25);
builder.Property(x => x.TotalDeductions).HasMaxLength(25);
builder.Property(x => x.IsActiveString).HasMaxLength(10);
builder.Property(x => x.Signature).HasMaxLength(20);
builder.Property(x => x.MarriedAllowance);
builder.Property(x => x.FamilyAllowance);
builder.Property(x => x.HousingAllowance);
builder.Property(x => x.ConsumableItems);
builder.Property(x => x.RewardPay).HasColumnType("float").IsRequired(false);
builder.Property(x => x.LeaveCheckout);
builder.Property(x => x.CreditLeaves);
builder.Property(x => x.AbsencePeriod);
builder.Property(x => x.AverageHoursPerDay);
builder.Property(x => x.HasRollCall);
builder.Property(x => x.OverTimeWorkValue).HasMaxLength(10);
builder.Property(x => x.OverNightWorkValue).HasMaxLength(10);
builder.Property(x => x.FridayWorkValue).HasMaxLength(10);
builder.Property(x => x.RotatingShiftValue).HasMaxLength(10);
builder.Property(x => x.AbsenceValue).HasMaxLength(10);
builder.Property(x => x.TotalDayOfLeaveCompute).HasMaxLength(10);
builder.Property(x => x.TotalDayOfYearsCompute).HasMaxLength(10);
builder.Property(x => x.TotalDayOfBunosesCompute).HasMaxLength(10);
builder.HasOne(x => x.Workshop)
.WithMany(x => x.Checkouts)
.HasForeignKey(x => x.WorkshopId);
}
}