using Predictalytics.Domain.Entities; using Predictalytics.Domain.Enums; namespace Predictalytics.Domain.Interfaces; public interface ITradeRepository { Task GetByPlatformTradeIdAsync(PlatformType platform, string platformTradeId, CancellationToken ct = default); Task> GetByTraderIdAsync(int traderId, int skip = 0, int take = 50, CancellationToken ct = default); /// Fast INT-based market lookup (preferred after DbMarketId backfill). Task> GetByDbMarketIdAsync(int dbMarketId, int skip = 0, int take = 50, CancellationToken ct = default); /// String-based fallback for trades not yet linked to a DB market. Task> GetByMarketIdAsync(string platformMarketId, int skip = 0, int take = 50, CancellationToken ct = default); Task> GetRecentAsync(int count = 50, PlatformType? platform = null, CancellationToken ct = default); Task> GetLargestAsync(int count = 5, DateTime? since = null, CancellationToken ct = default); Task GetCountAsync(int? traderId = null, CancellationToken ct = default); Task AddRangeAsync(IEnumerable trades, CancellationToken ct = default); Task GetTotalVolumeAsync(DateTime? since = null, CancellationToken ct = default); Task> GetOrphanedTradesAsync(int limit, CancellationToken ct = default); Task> GetKnownPlatformTradeIdsAsync(PlatformType platform, int traderId, IEnumerable platformTradeIds, CancellationToken ct = default); Task UpdateAsync(Trade trade, CancellationToken ct = default); Task> GetTradesForContextEnrichmentAsync(int limit, CancellationToken ct = default); }