using Books.Api.EventFlow.ReadModels;

namespace Books.Api.EventFlow.Repositories;

public interface IBankConnectionRepository
{
    Task<BankConnectionReadModelDto?> GetByIdAsync(string id, CancellationToken cancellationToken = default);
    Task<IReadOnlyList<BankConnectionReadModelDto>> GetByCompanyIdAsync(string companyId, CancellationToken cancellationToken = default);
    Task<IReadOnlyList<BankConnectionReadModelDto>> GetActiveByCompanyIdAsync(string companyId, CancellationToken cancellationToken = default);

    /// <summary>
    /// Get all active connections across all companies.
    /// Used by the sync job to process all connections.
    /// </summary>
    Task<IReadOnlyList<BankConnectionReadModelDto>> GetAllActiveAsync(CancellationToken cancellationToken = default);
}
