using System;
using System.Collections.Generic;
using System.Data.Entity.ModelConfiguration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using GreenTree.Nachtragsmanagement.Core.Domain.Misc;

namespace GreenTree.Nachtragsmanagement.Data.Mapping.Misc
{
    public class MailNotificationMap : EntityTypeConfiguration<MailNotification>
    {
        public MailNotificationMap()
        {
            ToTable("MailNotification");

            HasKey(m => m.Id);

            Property(m => m.CronExpression);
            Property(m => m.NotificationPluginSystemName);
            Property(m => m.NotificationJobSystemName);

            HasMany(m => m.Users)
                .WithMany(u => u.MailNotifications)
                .Map(m => m.ToTable("UserMailNotifications"));
        }
    }
}
