using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using PolyTraderSharp.Models;

namespace PolyTrader.Core.Persistence
{
    /// <summary>
    /// Generischer, modulübergreifender Trade-Log (Collection "trade_log").
    /// Speist das Core-Dashboard mit den Trades aller Module.
    /// </summary>
    public interface ITradeLogRepository
    {
        void EnsureIndexes();
        void Insert(TradeRecord record);

        /// <summary>Die neuesten Einträge über alle Module (nach ClosedAt absteigend).</summary>
        List<TradeRecord> GetRecent(int limit);

        List<TradeRecord> Find(Expression<Func<TradeRecord, bool>> predicate);
    }
}
