using System.ComponentModel.DataAnnotations;
namespace LittleShop.DTOs;
///
/// Input for discovering a remote TeleBot instance
///
public class RemoteBotDiscoveryDto
{
[Required]
[StringLength(255)]
public string IpAddress { get; set; } = string.Empty;
[Range(1, 65535)]
public int Port { get; set; } = 5010;
}
///
/// Response from TeleBot's discovery probe endpoint
///
public class DiscoveryProbeResponse
{
public string InstanceId { get; set; } = string.Empty;
public string Name { get; set; } = string.Empty;
public string Version { get; set; } = string.Empty;
public string Status { get; set; } = string.Empty;
public bool HasToken { get; set; }
public bool IsConfigured { get; set; }
public bool IsInitialized { get; set; }
public string? TelegramUsername { get; set; }
public DateTime Timestamp { get; set; }
}
///
/// Input for registering a discovered remote bot
///
public class RemoteBotRegistrationDto
{
[Required]
[StringLength(255)]
public string IpAddress { get; set; } = string.Empty;
[Range(1, 65535)]
public int Port { get; set; } = 5010;
[Required]
[StringLength(100)]
public string Name { get; set; } = string.Empty;
[StringLength(500)]
public string Description { get; set; } = string.Empty;
[StringLength(50)]
public string PersonalityName { get; set; } = string.Empty;
///
/// Instance ID from the discovery probe response
///
public string? RemoteInstanceId { get; set; }
}
///
/// Input for configuring a remote bot with Telegram credentials
///
public class RemoteBotConfigureDto
{
[Required]
public Guid BotId { get; set; }
[Required]
public string BotToken { get; set; } = string.Empty;
public Dictionary? Settings { get; set; }
}
///
/// Result of a discovery probe operation
///
public class DiscoveryResult
{
public bool Success { get; set; }
public string Message { get; set; } = string.Empty;
public DiscoveryProbeResponse? ProbeResponse { get; set; }
}
///
/// Result of initializing a remote bot
///
public class InitializeResult
{
public bool Success { get; set; }
public string Message { get; set; } = string.Empty;
public string? InstanceId { get; set; }
}
///
/// Result of configuring a remote bot
///
public class ConfigureResult
{
public bool Success { get; set; }
public string Message { get; set; } = string.Empty;
public string? TelegramUsername { get; set; }
public string? TelegramDisplayName { get; set; }
public string? TelegramId { get; set; }
}
///
/// View model for the discovery wizard
///
public class DiscoveryWizardViewModel
{
// Step 1: Discovery
public string IpAddress { get; set; } = string.Empty;
public int Port { get; set; } = 5010;
// Step 2: Registration (populated after probe)
public DiscoveryProbeResponse? ProbeResponse { get; set; }
public string BotName { get; set; } = string.Empty;
public string Description { get; set; } = string.Empty;
public string PersonalityName { get; set; } = string.Empty;
// Step 3: Configuration (populated after registration)
public Guid? BotId { get; set; }
public string? BotKey { get; set; }
public string BotToken { get; set; } = string.Empty;
// Step tracking
public int CurrentStep { get; set; } = 1;
public string? ErrorMessage { get; set; }
public string? SuccessMessage { get; set; }
}
///
/// Discovery status constants
///
public static class DiscoveryStatus
{
public const string Local = "Local";
public const string AwaitingDiscovery = "AwaitingDiscovery";
public const string Discovered = "Discovered";
public const string Initialized = "Initialized";
public const string Configured = "Configured";
public const string Offline = "Offline";
public const string Error = "Error";
}
///
/// Result of a bot control action (start/stop/restart)
///
public class BotControlResult
{
public bool Success { get; set; }
public string Message { get; set; } = string.Empty;
///
/// Current bot status after the action
///
public string Status { get; set; } = string.Empty;
///
/// Whether Telegram polling is currently running
///
public bool IsRunning { get; set; }
}