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
{
    class TitleMapping : IEntityTypeConfiguration<Title>
    {
        public void Configure(EntityTypeBuilder<Title> builder)
        {
            builder.ToTable("Titles");

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

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

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

            builder.HasData(new Title(1, "Keiner"));
            builder.HasData(new Title(2, "Herr"));
            builder.HasData(new Title(3, "Frau"));
            builder.HasData(new Title(4, "Firma"));
            builder.HasData(new Title(5, "Familie"));
            builder.HasData(new Title(6, "Eheleute"));
            builder.HasData(new Title(7, "Herr und Frau"));
            builder.HasData(new Title(8, "Prof."));
            builder.HasData(new Title(9, "Dr."));
            builder.HasData(new Title(10, "Dr. med."));
            builder.HasData(new Title(11, "Prof. Dr."));
            builder.HasData(new Title(12, "Prof. Dr. med."));
        }
    }
}
