using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace FutureMailAPI.Models
{
    public class ReceivedMail
    {
        [Key]
        public int Id { get; set; }
        
        [Required]
        public int SentMailId { get; set; }
        
        [Required]
        public int RecipientId { get; set; }
        
        // 接收时间
        public DateTime ReceivedAt { get; set; } = DateTime.UtcNow;
        
        // 是否已读
        public bool IsRead { get; set; } = false;
        
        // 阅读时间
        public DateTime? ReadAt { get; set; }
        
        // 是否已回复
        public bool IsReplied { get; set; } = false;
        
        // 回复邮件ID
        public int? ReplyMailId { get; set; }
        
        // 导航属性
        [ForeignKey("SentMailId")]
        public virtual SentMail SentMail { get; set; } = null!;
        
        [ForeignKey("RecipientId")]
        public virtual User Recipient { get; set; } = null!;
    }
}