. */ declare(strict_types=1); namespace FireflyIII\Repositories\Currency; use Carbon\Carbon; use FireflyIII\Models\CurrencyExchangeRate; use FireflyIII\Models\TransactionCurrency; use FireflyIII\Models\UserGroup; use FireflyIII\User; use Illuminate\Contracts\Auth\Authenticatable; use Illuminate\Support\Collection; /** * Interface CurrencyRepositoryInterface. */ interface CurrencyRepositoryInterface { public function find(int $currencyId): ?TransactionCurrency; /** * Find by currency code, return NULL if unfound. * * Used in the download exchange rates cron job. Does not require user object. */ public function findByCode(string $currencyCode): ?TransactionCurrency; /** * Returns the complete set of transactions but needs * no user object. * * Used by the download exchange rate cron job. */ public function getCompleteSet(): Collection; /** * Get currency exchange rate. * * Used in the download exchange rate cron job. Needs the user object! */ public function getExchangeRate(TransactionCurrency $fromCurrency, TransactionCurrency $toCurrency, Carbon $date): ?CurrencyExchangeRate; /** * Set currency exchange rate. * * Used in download exchange rate cron job. Needs the user object! */ public function setExchangeRate(TransactionCurrency $fromCurrency, TransactionCurrency $toCurrency, Carbon $date, float $rate): CurrencyExchangeRate; public function setUser(null|Authenticatable|User $user): void; public function setUserGroup(UserGroup $userGroup): void; }