using GreenTree.Strohrmann.ERP.Core.Domain.Business;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using System;
using System.Collections.Generic;
using System.Text;

namespace GreenTree.Strohrmann.ERP.Domain.Model.Business
{
    public class EmployeeDegreeMapping : IEntityTypeConfiguration<EmployeeDegree>
    {
        public void Configure(EntityTypeBuilder<EmployeeDegree> builder)
        {
            builder.ToTable("EmployeeDegrees");

            builder.HasKey(u => u.Id);

            builder.Property(u => u.Id)
                .ValueGeneratedOnAdd();

            builder.Property(u => u.Name)
                .IsRequired();

            builder.Property(u => u.Value)
                .IsRequired();

            builder.Property(u => u.Order)
                .IsRequired();

            builder.HasData(
                new EmployeeDegree(1, "Meister", 60m, 3),
                new EmployeeDegree(2, "Geselle", 30m, 2),
                new EmployeeDegree(3, "Aushilfe", 15m, 1));
        }
    }
}
