using Managing.Domain.Scenarios;
using Managing.Domain.Strategies;
using Managing.Domain.Trades;
using Managing.Domain.Users;
using static Managing.Common.Enums;

namespace Managing.Application.Abstractions.Repositories;

public interface ITradingRepository
{
    Task<Scenario> GetScenarioByNameAsync(string scenario);
    Task<IEnumerable<Signal>> GetSignalsByUserAsync(User user);
    Task<Signal> GetSignalByIdentifierAsync(string identifier, User user = null);
    Task InsertPositionAsync(Position position);
    Task UpdatePositionAsync(Position position);
    Task<IndicatorBase> GetStrategyByNameAsync(string strategy);
    Task InsertScenarioAsync(Scenario scenario);
    Task InsertIndicatorAsync(IndicatorBase indicator);
    Task<IEnumerable<Scenario>> GetScenariosAsync();
    Task<IEnumerable<Scenario>> GetScenariosByUserAsync(User user);
    Task<IEnumerable<IndicatorBase>> GetStrategiesAsync();
    Task<IEnumerable<IndicatorBase>> GetIndicatorsAsync();
    Task DeleteScenarioAsync(string name);
    Task DeleteIndicatorAsync(string name);
    Task<Position> GetPositionByIdentifierAsync(Guid identifier);
    Task<IEnumerable<Position>> GetPositionsAsync(PositionInitiator positionInitiator);
    Task<IEnumerable<Position>> GetPositionsByStatusAsync(PositionStatus positionStatus);
    Task<IEnumerable<Position>> GetPositionsByInitiatorIdentifierAsync(Guid initiatorIdentifier);
    Task<IEnumerable<Position>> GetPositionsByInitiatorIdentifiersAsync(IEnumerable<Guid> initiatorIdentifiers);
    Task<IEnumerable<Position>> GetAllPositionsAsync();

    Task UpdateScenarioAsync(Scenario scenario);
    Task UpdateStrategyAsync(IndicatorBase indicatorBase);
    Task<IndicatorBase> GetStrategyByNameUserAsync(string name, User user);
    Task<Scenario> GetScenarioByNameUserAsync(string scenarioName, User user);
}