using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; namespace Data.SeaHavenIndustries { /// /// A single-use registration invite for one pending team member. Only hashes of /// the invite token and of the email confirmation code are stored. /// public class TeamMemberInvite { public int Id { get; set; } [Required] [MaxLength(450)] public string UserId { get; set; } = string.Empty; [ForeignKey(nameof(UserId))] public virtual ApplicationUser? User { get; set; } /// Lowercase hex SHA-256 of the raw invite token. [Required] [MaxLength(64)] public string TokenHash { get; set; } = string.Empty; public DateTime CreatedAt { get; set; } public DateTime ExpiresAt { get; set; } public DateTime? UsedAt { get; set; } public DateTime? RevokedAt { get; set; } /// Lowercase hex SHA-256 of the salt followed by the confirmation code. [MaxLength(64)] public string? CodeHash { get; set; } [MaxLength(32)] public string? CodeSalt { get; set; } public DateTime? CodeExpiresAt { get; set; } public int CodeFailedAttempts { get; set; } public DateTime? CodeSentAt { get; set; } public int CodeSendCount { get; set; } public DateTime? EmailConfirmedAt { get; set; } } }