using KArtSell.Modules.ModelOperations.ShadowRun;
using Microsoft.Extensions.Logging;

namespace KArtSell.Modules.ModelOperations.ShadowRun.Services;

/// <summary>
/// Stub implementation of KRX data service for local development and testing.
/// Returns empty data sets. Replace with real implementation for production.
/// </summary>
public sealed class StubKrxDataService : IKrxDataService
{
    private readonly ILogger<StubKrxDataService> _logger;

    public StubKrxDataService(ILogger<StubKrxDataService> logger)
    {
        _logger = logger;
    }

    public async Task<IReadOnlyList<DataBackfiller.OhlcvBar>> GetDailyOhlcvAsync(
        string ticker,
        DateOnly startDate,
        DateOnly endDate,
        CancellationToken cancellationToken)
    {
        _logger.LogWarning("Using stub KRX data service - no real market data available. Ticker: {Ticker}, Period: {Start}..{End}",
            ticker, startDate, endDate);
        await Task.Delay(10, cancellationToken);
        return Array.Empty<DataBackfiller.OhlcvBar>().AsReadOnly();
    }

    public async Task<IReadOnlyList<DataBackfiller.FeeScheduleEntry>> GetFeeScheduleAsync(
        DateOnly startDate,
        DateOnly endDate,
        CancellationToken cancellationToken)
    {
        _logger.LogWarning("Using stub KRX data service - no real fee schedule available. Period: {Start}..{End}",
            startDate, endDate);
        await Task.Delay(10, cancellationToken);
        return Array.Empty<DataBackfiller.FeeScheduleEntry>().AsReadOnly();
    }
}
