using Predictalytics.Application.DTOs;
using Predictalytics.Domain.ValueObjects;

namespace Predictalytics.Application.Interfaces;

public interface IAnalyticsService
{
    /// <summary>Get the main dashboard summary.</summary>
    Task<DashboardDto> GetDashboardAsync(CancellationToken ct = default);

    /// <summary>Perform deep-dive analysis on a specific trader.</summary>
    Task<TraderDeepDiveDto?> GetTraderDeepDiveAsync(int traderId, CancellationToken ct = default);
    Task<IReadOnlyList<TraderDto>> GetTradersAsync(int skip = 0, int take = 50, string? platform = null, bool highlyCopyable = false, string? traitFilter = null, CancellationToken ct = default);

    /// <summary>Get list of all discovered traits.</summary>
    Task<IReadOnlyList<string>> GetTraitsAsync(CancellationToken ct = default);

    /// <summary>Get a trader's details.</summary>
    Task<TraderDetailDto?> GetTraderDetailAsync(int traderId, CancellationToken ct = default);

    /// <summary>Get a trader's positions.</summary>
    Task<IReadOnlyList<TraderPositionDto>> GetTraderPositionsAsync(int traderId, CancellationToken ct = default);

    /// <summary>Get list of markets.</summary>
    Task<IReadOnlyList<MarketDto>> GetMarketsAsync(int skip = 0, int take = 50, string? platform = null, string? category = null, string? query = null, CancellationToken ct = default);

    /// <summary>Get market details.</summary>
    Task<MarketDetailDto?> GetMarketDetailAsync(int marketId, CancellationToken ct = default);

    /// <summary>Search for traders and markets.</summary>
    Task<SearchResultsDto> SearchAsync(string query, CancellationToken ct = default);

    /// <summary>Manually trigger a trade history sync for a specific trader.</summary>
    Task TriggerTradeSyncAsync(int traderId, CancellationToken ct = default);

    /// <summary>Manually trigger a deep-dive analysis (PnL recalculation) for a specific trader.</summary>
    Task ForceAnalyzeTraderAsync(int traderId, CancellationToken ct = default);

    /// <summary>Manually add a trader by platform and wallet address.</summary>
    Task<int> AddTraderAsync(string platform, string walletAddress, CancellationToken ct = default);
}
