namespace PlotLine.Models;

public static class WordCompanionPresenceStatuses
{
    public const string Connecting = "Connecting";
    public const string Connected = "Connected";
    public const string Offline = "Offline";
}

public sealed class WordCompanionPresenceRegistration
{
    public int? UserID { get; init; }
    public string? CompanionVersion { get; init; }
    public string? MachineName { get; init; }
    public bool DocumentOpen { get; init; }
    public string? CurrentDocumentName { get; init; }
    public int? LinkedProjectID { get; init; }
    public int? LinkedBookID { get; init; }
}

public sealed class WordCompanionPresenceHeartbeat
{
    public string? CompanionVersion { get; init; }
    public string? MachineName { get; init; }
    public bool DocumentOpen { get; init; }
    public string? CurrentDocumentName { get; init; }
    public int? LinkedProjectID { get; init; }
    public int? LinkedBookID { get; init; }
}

public sealed class WordCompanionPresenceStatus
{
    public int UserID { get; init; }
    public bool IsConnected { get; init; }
    public string Status { get; init; } = WordCompanionPresenceStatuses.Offline;
    public string? CompanionVersion { get; init; }
    public string? MachineName { get; init; }
    public bool DocumentOpen { get; init; }
    public string? CurrentDocumentName { get; init; }
    public int? LinkedProjectID { get; init; }
    public int? LinkedBookID { get; init; }
    public DateTime? ConnectedUtc { get; init; }
    public DateTime? LastHeartbeatUtc { get; init; }
}
