// EN: Repository interface for Session aggregate.
// VI: Interface repository cho aggregate Session.

using FnbEngine.Domain.SeedWork;

namespace FnbEngine.Domain.AggregatesModel.SessionAggregate;

/// <summary>
/// EN: Repository interface for Session aggregate root.
/// VI: Interface repository cho aggregate root Session.
/// </summary>
public interface ISessionRepository : IRepository<Session>
{
    /// <summary>
    /// EN: Add a new session.
    /// VI: Thêm phiên mới.
    /// </summary>
    Task<Session> AddAsync(Session session, CancellationToken cancellationToken = default);

    /// <summary>
    /// EN: Update an existing session.
    /// VI: Cập nhật phiên hiện tại.
    /// </summary>
    void Update(Session session);

    /// <summary>
    /// EN: Get session by ID.
    /// VI: Lấy phiên theo ID.
    /// </summary>
    Task<Session?> GetByIdAsync(Guid id, CancellationToken cancellationToken = default);

    /// <summary>
    /// EN: Get active session by table ID.
    /// VI: Lấy phiên đang hoạt động theo table ID.
    /// </summary>
    Task<Session?> GetActiveByTableAsync(Guid tableId, CancellationToken cancellationToken = default);

    /// <summary>
    /// EN: Get sessions by shop ID.
    /// VI: Lấy danh sách phiên theo shop ID.
    /// </summary>
    Task<IEnumerable<Session>> GetByShopAsync(Guid shopId, CancellationToken cancellationToken = default);
}
