using APT.Infrastructure.EF.Map;
using APT.BaseData.Domain.Entities.FM;
using Microsoft.EntityFrameworkCore.Metadata.Builders;

namespace APT.BaseData.Data.Mapping.FM
{
	public class FMWorkStageCalendarMap : APTEntityBaseMap<T_FM_WORKSTAGE_CALENDAR>
	{
		public override void Configure(EntityTypeBuilder<T_FM_WORKSTAGE_CALENDAR> builder)
		{
			base.Configure(builder);

			builder.HasOne(t => t.Nav_Class).WithMany()
				.HasForeignKey(t => t.CLASS_ID);

			builder.HasOne(t => t.Nav_Workstage).WithMany()
				.HasForeignKey(t => t.WORKSTAGE_ID);

			builder.Ignore(t => t.TmpTime);
		} 
	}
}
