astral-api/Astral.Core/Entities/UserPresence.cs

95 lines
2.2 KiB
C#
Raw Normal View History

2024-12-15 17:06:14 +01:00
// <copyright file="UserPresence.cs" company="alveus.dev">
// Copyright (c) alveus.dev. All rights reserved. Licensed under the MIT License.
// </copyright>
using Astral.Core.Attributes.EntityAnnotation;
using Astral.Core.Constants;
namespace Astral.Core.Entities;
/// <summary>
/// User presence entity.
/// </summary>
[TableMapping("userPresence")]
public class UserPresence
{
/// <summary>
/// The user id this belongs to.
/// </summary>
[PrimaryKey]
[ColumnMapping("id")]
public Guid Id { get; set; }
/// <summary>
/// When the entity was created.
/// </summary>
[ColumnMapping("createdAt")]
public DateTime CreatedAt { get; set; }
/// <summary>
/// When the entity was last updated.
/// </summary>
[ColumnMapping("updatedAt")]
public DateTime UpdatedAt { get; set; }
/// <summary>
/// True if connected.
/// </summary>
[ColumnMapping("connected")]
public bool? Connected { get; set; }
/// <summary>
/// Current domain id.
/// </summary>
[ColumnMapping("domainId")]
public Guid? DomainId { get; set; }
/// <summary>
/// Current place id.
/// </summary>
[ColumnMapping("placeId")]
public Guid? PlaceId { get; set; }
/// <summary>
/// Current network address.
/// </summary>
[ColumnMapping("networkAddress")]
public string NetworkAddress { get; set; }
/// <summary>
/// Current network port.
/// </summary>
[ColumnMapping("networkPort")]
public int? NetworkPort { get; set; }
/// <summary>
/// Current public key.
/// </summary>
[ColumnMapping("publicKey")]
public string PublicKey { get; set; }
/// <summary>
/// Current path.
/// </summary>
[ColumnMapping("path")]
public string Path { get; set; }
/// <summary>
/// Last heartbeat received.
/// </summary>
[ColumnMapping("lastHeartbeat")]
public DateTime LastHeartbeat { get; set; }
/// <summary>
/// Node id.
/// </summary>
[ColumnMapping("nodeId")]
public Guid? NodeId { get; set; }
/// <summary>
/// Discoverability.
/// </summary>
[ColumnMapping("availability")]
public Discoverability Availability { get; set; }
}