using System.Collections.Generic;
using System.Threading.Tasks;
using QuantEngine.Core.Interfaces;

namespace QuantEngine.Application.Services
{
    public class PostgresqlHistorySnapshotReader : IPostgresqlHistorySnapshotReader
    {
        private readonly IPostgresqlHistoryStore _store;

        public PostgresqlHistorySnapshotReader(IPostgresqlHistoryStore store)
        {
            _store = store;
        }

        public Task<IReadOnlyList<IDictionary<string, object?>>> ReadAsync(string domain, int limit = 500)
            => _store.SnapshotAsync(domain, limit);
    }
}
