using Managing.Domain.Backtests;
using Managing.Domain.Users;

namespace Managing.Application.Abstractions.Repositories;

/// <summary>
/// Repository interface for genetic algorithm requests
/// </summary>
public interface IGeneticRepository
{
    /// <summary>
    /// Inserts a genetic request for a user
    /// </summary>
    /// <param name="user">The user</param>
    /// <param name="geneticRequest">The genetic request to insert</param>
    void InsertGeneticRequestForUser(User user, GeneticRequest geneticRequest);

    /// <summary>
    /// Gets all genetic requests for a user
    /// </summary>
    /// <param name="user">The user to get requests for</param>
    /// <returns>Collection of genetic requests</returns>
    IEnumerable<GeneticRequest> GetGeneticRequestsByUser(User user);

    /// <summary>
    /// Gets a specific genetic request by ID for a user
    /// </summary>
    /// <param name="user">The user</param>
    /// <param name="id">The request ID</param>
    /// <returns>The genetic request or null if not found</returns>
    GeneticRequest GetGeneticRequestByIdForUser(User user, string id);

    /// <summary>
    /// Updates a genetic request
    /// </summary>
    /// <param name="geneticRequest">The genetic request to update</param>
    Task UpdateGeneticRequestAsync(GeneticRequest geneticRequest);

    /// <summary>
    /// Deletes a genetic request by ID for a user
    /// </summary>
    /// <param name="user">The user</param>
    /// <param name="id">The request ID</param>
    void DeleteGeneticRequestByIdForUser(User user, string id);

    /// <summary>
    /// Deletes all genetic requests for a user
    /// </summary>
    /// <param name="user">The user</param>
    void DeleteAllGeneticRequestsForUser(User user);

    /// <summary>
    /// Gets all genetic requests by status across all users
    /// </summary>
    /// <param name="status">The status to filter by</param>
    /// <returns>Collection of genetic requests</returns>
    Task<List<GeneticRequest>> GetGeneticRequestsAsync(GeneticRequestStatus status);
} 