using Orleans;
using static Managing.Common.Enums;
namespace Managing.Application.Abstractions.Grains;
///
/// A small serializable class to store bot metadata.
/// This is a very lean object, perfect for fast storage and retrieval.
///
[GenerateSerializer]
public class BotRegistryEntry
{
///
/// The unique identifier of the bot
///
[Id(0)]
public Guid Identifier { get; set; }
///
/// The unique identifier of the user who owns the bot
///
[Id(1)]
public int UserId { get; set; }
///
/// The current operational status of the bot
///
[Id(2)]
public BotStatus Status { get; set; }
///
/// When the bot was registered in the registry
///
[Id(3)]
public DateTime RegisteredAt { get; set; } = DateTime.UtcNow;
///
/// When the bot status was last updated
///
[Id(4)]
public DateTime LastStatusUpdate { get; set; } = DateTime.UtcNow;
public BotRegistryEntry()
{
}
public BotRegistryEntry(Guid identifier, int userId, BotStatus status = BotStatus.Saved)
{
Identifier = identifier;
UserId = userId;
Status = status;
RegisteredAt = DateTime.UtcNow;
LastStatusUpdate = DateTime.UtcNow;
}
}