using System; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; namespace Model { /// /// Caches AI trajectory analysis results per user. /// Re-analyzed only when new responses are submitted. /// public class UserTrajectoryCache { public int Id { get; set; } /// /// The user's email — used as the lookup key /// [Required] [MaxLength(256)] public string UserEmail { get; set; } = string.Empty; /// /// How many responses were included in this analysis /// public int AnalyzedResponseCount { get; set; } /// /// Date of the most recent response that was analyzed /// Used to detect new responses /// public DateTime LastResponseDate { get; set; } /// /// The full trajectory analysis result stored as JSON /// [Required] public string TrajectoryJson { get; set; } = string.Empty; /// /// A shorter summary that Claude can use as context /// for incremental updates (when only new responses are sent) /// public string? PreviousSummary { get; set; } public DateTime CreatedAt { get; set; } = DateTime.UtcNow; public DateTime UpdatedAt { get; set; } = DateTime.UtcNow; } }