namespace DorkNet.Server.Data.Entities;
///
/// One row per (Room, Player) recording the player's visit history
/// to that room. Backs the proper RoomEntity.VisitorCount
/// (count of unique players who've visited) vs VisitCount
/// (total joins, including the same player multiple times) split
/// the official Rec.Net stats column distinguishes.
///
/// Upserted by GoToController on every POST /goto/room
/// so the per-room "who's been here, when" history is queryable for
/// the Hot-rooms ranking + admin diagnostics.
///
public class RoomVisitEntity
{
public long Id { get; set; }
public long RoomId { get; set; }
public long PlayerId { get; set; }
/// Set once on the player's first visit; immutable after.
/// Used to decide whether to bump RoomEntity.VisitorCount.
public DateTime FirstVisitAt { get; set; } = DateTime.UtcNow;
/// Updated on every visit. Drives "recent visitors"
/// queries.
public DateTime LastVisitAt { get; set; } = DateTime.UtcNow;
/// Per-player visit count (this player visited this room
/// N times). Sum across all rows = RoomEntity.VisitCount.
public int VisitCount { get; set; } = 0;
}