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

36 lines
1.6 KiB
C#

using _0_Framework.InfraStructure;
using Company.Domain.RollCallAgg;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace CompanyManagment.EFCore.Mapping;
public class RollCallMapping : IEntityTypeConfiguration<RollCall>
{
public void Configure(EntityTypeBuilder<RollCall> builder)
{
builder.ToTable("RollCall");
builder.HasKey(x => x.id);
builder.Property(x => x.EmployeeId);
builder.Property(x => x.WorkshopId);
builder.Property(x => x.EmployeeFullName).HasMaxLength(100);
builder.Property(x => x.StartDate).IsRequired(false);
builder.Property(x => x.EndDate).IsRequired(false);
builder.Property(x => x.Year);
builder.Property(x => x.Month);
builder.Property(x => x.RollCallModifyType).HasConversion<string>().HasMaxLength(50);
builder.Property(x => x.ShiftDate);
builder.Property(x => x.BreakTimeSpan).HasTimeSpanConversion();
builder.Property(x => x.NightWorkTimeSpan).HasTimeSpanConversion();
builder.Property(x => x.FridayWorkTimeSpan).HasTimeSpanConversion();
builder.Property(x => x.ShiftDurationTimeSpan).HasTimeSpanConversion();
builder.Property(x => x.LateEntryDuration).HasTimeSpanConversion();
builder.Property(x => x.EarlyEntryDuration).HasTimeSpanConversion();
builder.Property(x => x.LateExitDuration).HasTimeSpanConversion();
builder.Property(x => x.EarlyExitDuration).HasTimeSpanConversion();
builder.Property(x => x.ShiftType).HasConversion<string>().HasMaxLength(22);
}
}