astral-api/Astral.Core/Entities/UserPresence.cs
Mike 81aa0ec1c0
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/pr/woodpecker Pipeline was successful
WIP heartbeat and user presence
2024-12-15 16:06:14 +00:00

94 lines
2.2 KiB
C#

// <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; }
}