Files
2026-08-05 21:15:15 +03:00

34 lines
953 B
C#

using Chat.Domain.Enums;
using System;
namespace Chat.Domain.Entities;
/// <summary>
/// Represents a user's presence status and connection information for real-time features.
/// </summary>
public class UserPresence
{
/// <summary>
/// Primary key - the unique identifier of the user.
/// </summary>
public Guid UserId { get; set; }
/// <summary>
/// The current status of the user (Online, Offline, Away).
/// </summary>
public UserStatus Status { get; set; } = UserStatus.Offline;
/// <summary>
/// Date and time when the user was last seen.
/// </summary>
public DateTime LastSeenAt { get; set; } = DateTime.UtcNow;
/// <summary>
/// SignalR connection ID for real-time messaging. Can be null if the user is not connected.
/// </summary>
public string? ConnectionId { get; set; }
// Navigation property (to User entity when it exists)
// public User User { get; set; }
}