using Deal.Contracts.Integrations.Abstractions;
using Deal.Contracts.Integrations.Models;
namespace Deal.Infrastructure.Integrations.Services;
///
/// Локальная заглушка без telegram-service.
///
public sealed class LocalTelegramGateway : ITelegramGateway
{
// Фаза idle-формы (аккаунт не подключён — сервиса нет).
private const string IdlePhase = "idle";
///
public Task StatusAsync(CancellationToken ct)
{
return Task.FromResult(new TelegramAccountStatusDto(IdlePhase, false, false, string.Empty, null, null));
}
///
public Task StartPhoneAsync(
string phone,
int apiId,
string apiHash,
CancellationToken ct)
=> Task.FromResult(new TelegramAuthResultDto(IdlePhase, null));
///
public Task StartQrAsync(
int apiId,
string apiHash,
CancellationToken ct)
=> Task.FromResult(new TelegramAuthResultDto(IdlePhase, null));
///
public Task SendCodeAsync(string code, CancellationToken ct) => Task.FromResult(IdlePhase);
///
public Task SendPasswordAsync(string password, CancellationToken ct) => Task.FromResult(IdlePhase);
///
public Task LogoutAsync(CancellationToken ct) => Task.CompletedTask;
///
public Task> RefreshDialogsAsync(CancellationToken ct)
=> Task.FromResult>([]);
///
public Task SetMonitorAsync(
string dialogId,
bool enabled,
CancellationToken ct) => Task.CompletedTask;
///
public Task SetMonitorAllAsync(bool enabled, CancellationToken ct) => Task.CompletedTask;
///
public Task BackfillAsync(
string dialogId,
bool force,
CancellationToken ct) => Task.FromResult(0);
///
public Task> ReadRecentAsync(
string dialogId,
int limit,
CancellationToken ct)
=> Task.FromResult>([]);
///
public Task ReadSourceAsync(
string dialogId,
long msgId,
CancellationToken ct)
=> Task.FromResult(new TelegramSourceContentDto(false, null, null));
///
public Task> SearchAsync(
string query,
int limit,
CancellationToken ct)
=> Task.FromResult>([]);
///
public Task InfoAsync(string dialogId, CancellationToken ct)
=> Task.FromResult(new TelegramChannelInfoDto(dialogId, string.Empty, string.Empty, string.Empty, SourceDefaults.DefaultHue, null, false));
///
public Task ReadForEvalAsync(
string dialogId,
int limit,
CancellationToken ct)
=> Task.FromResult(new TelegramEvalReadDto(false, "no_history", []));
///
public Task JoinAsync(string username, CancellationToken ct) => Task.CompletedTask;
///
public Task LeaveAsync(string dialogId, CancellationToken ct) => Task.CompletedTask;
}