using Books.Api.EventFlow.ReadModels;
namespace Books.Api.AiBookkeeper;
///
/// Matches documents to pending bank transactions based on amount.
///
public interface IBankTransactionMatcher
{
///
/// Find the oldest pending bank transaction matching the given amount.
/// For expenses (negative amounts), matches transactions where the bank amount is negative.
/// For income (positive amounts), matches transactions where the bank amount is positive.
///
/// Company ID
/// Document amount (positive for income, negative for expense)
/// Amount tolerance (default ±0.01)
/// Cancellation token
/// Matching bank transaction, or null if not found
Task FindMatchingTransactionAsync(
string companyId,
decimal amount,
decimal tolerance = 0.01m,
CancellationToken cancellationToken = default);
}