Files
myoffice_public/MyOffice.Data.Repositories/Currency/ICurrencyRateRepository.cs
T

19 lines
978 B
C#

namespace MyOffice.Data.Repositories.Currency;
using Models.Currencies;
public interface ICurrencyRateRepository
{
List<CurrencyRate> GetLastRates(Guid currencyId, DateTime? before = null, int count = 1);
Task<List<CurrencyRate>> GetLastRatesAsync(Guid currencyId, DateTime? before = null, int count = 1, CancellationToken cancellationToken = default);
Dictionary<string, CurrencyRate> GetLastRates(Guid userId, List<string> currencyIds, DateTime? before = null);
Task<Dictionary<string, CurrencyRate>> GetLastRatesAsync(
Guid userId,
List<string> currencyIds,
DateTime? before = null,
CancellationToken cancellationToken = default);
bool AddRate(CurrencyRate currencyRate);
Task<bool> AddRateAsync(CurrencyRate currencyRate, CancellationToken cancellationToken = default);
List<CurrencyRate> GetAtDate(Guid currencyId, DateTime date);
Task<List<CurrencyRate>> GetAtDateAsync(Guid currencyId, DateTime date, CancellationToken cancellationToken = default);
}