using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Net.Mail;
using AyCode.Interfaces.Messages;

namespace AyCode.Entities.Messages;

[Table("EmailRecipient")]
public abstract class AcEmailRecipient<TEmailMessage> : IAcEmailRecipient<TEmailMessage> where TEmailMessage : IAcEmailMessageBase
{
    protected AcEmailRecipient()
    {
    }

    protected AcEmailRecipient(Guid id, Guid recipientId, Guid emailMessageId, string emailAddress) : this()
    {
        Id = id;
        RecipientId = recipientId;
        EmailMessageId = emailMessageId;
        EmailAddress = emailAddress;
    }

    [Key, DatabaseGenerated(DatabaseGeneratedOption.None)]
    public Guid Id { get; set; }

    public Guid RecipientId { get; set; }
    public Guid EmailMessageId { get; set; }
    public string EmailAddress { get; set; }
    public bool IsReaded { get; set; }

    public virtual TEmailMessage EmailMessage { get; set; }

    public DateTime Created { get; set; }
    public DateTime Modified { get; set; }
}