using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; namespace Domain.Entities.Donations; public class DonationAlertAttempt { [ForeignKey(nameof(DonationID))] public virtual Donation Donation { get; private set; } = default!; [ForeignKey(nameof(DonationAlertID))] public virtual DonationAlert DonationAlert { get; private set; } = default!; [Key] public int ID { get; private set; } public int DonationID { get; private set; } public int DonationAlertID { get; private set; } public string? IpAddress { get; private set; } public string? UserAgent { get; private set; } public DateTime SentAt { get; private set; } = DateTime.UtcNow; private DonationAlertAttempt() { } public static DonationAlertAttempt Create( int donationID, int donationAlertID, string? ipAddress = null, string? userAgent = null ) { return new DonationAlertAttempt { DonationID = donationID, DonationAlertID = donationAlertID, IpAddress = ipAddress, UserAgent = userAgent }; } }