using Managing.Domain.Candles;
using Orleans;

namespace Managing.Application.Abstractions.Grains;

/// <summary>
/// Orleans grain interface for candle storage and retrieval.
/// This grain manages in-memory historical candle data with state persistence
/// and subscribes to price streams for real-time updates.
/// </summary>
public interface ICandleStoreGrain : IGrainWithStringKey
{
    /// <summary>
    /// Gets the current list of historical candles (up to 500 most recent)
    /// </summary>
    /// <returns>List of candles ordered by date</returns>
    Task<HashSet<Candle>> GetCandlesAsync();
    /// <summary>
    /// Gets the X latest candles from the store
    /// </summary>
    /// <param name="count">Number of latest candles to retrieve (default: 1)</param>
    /// <returns>List of the X latest candles ordered by date</returns>
    Task<List<Candle>> GetLastCandle(int count = 1);
}

