Files
hamkadr/src/JobsMedical.Web/Models/Visitor.cs
T

24 lines
917 B
C#
Raw Normal View History

using System.ComponentModel.DataAnnotations;
namespace JobsMedical.Web.Models;
/// <summary>
/// An anonymous visitor, identified by a cookie before they ever log in. This lets us track
/// interest and personalize from the very first visit; once the person logs in we link the
/// Visitor to their <see cref="User"/> and keep all the behavioral history.
/// </summary>
public class Visitor
{
[MaxLength(36)]
public string Id { get; set; } = ""; // GUID string stored in the hk_vid cookie
public int? UserId { get; set; } // set after login (history carries over)
public User? User { get; set; }
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
public DateTime LastSeenAt { get; set; } = DateTime.UtcNow;
public UserPreferences? Preferences { get; set; }
public ICollection<InterestEvent> Events { get; set; } = new List<InterestEvent>();
}