using Managing.Application.Abstractions.Services;
using Managing.Application.Workers;
using Managing.Application.Workers.Abstractions;
using static Managing.Common.Enums;

namespace Managing.Api.Workers.Workers;

public class TopVolumeTickerWorker : BaseWorker<TopVolumeTickerWorker>
{
    private readonly IStatisticService _statisticService;
    private static readonly WorkerType _workerType = WorkerType.TopVolumeTicker;

    public TopVolumeTickerWorker(
        ILogger<TopVolumeTickerWorker> logger,
        IWorkerService workerService,
        IStatisticService statisticService) : base(
        _workerType,
        logger,
        TimeSpan.FromHours(12),
        workerService
    )
    {
        _statisticService = statisticService;
    }

    protected override async Task Run(CancellationToken cancellationToken)
    {
        await _statisticService.UpdateTopVolumeTicker(TradingExchanges.Evm, 10);
    }
}