2023-03-25 11:32:33 +01:00
|
|
|
<?php
|
2023-04-01 07:50:53 +02:00
|
|
|
|
2023-03-25 11:32:33 +01:00
|
|
|
/*
|
|
|
|
* AccountRepositoryInterface.php
|
|
|
|
* Copyright (c) 2023 james@firefly-iii.org
|
|
|
|
*
|
|
|
|
* This file is part of Firefly III (https://github.com/firefly-iii).
|
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Affero General Public License as
|
|
|
|
* published by the Free Software Foundation, either version 3 of the
|
|
|
|
* License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Affero General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Affero General Public License
|
|
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2023-07-15 16:02:42 +02:00
|
|
|
declare(strict_types=1);
|
|
|
|
|
2023-09-21 15:50:49 +02:00
|
|
|
namespace FireflyIII\Repositories\UserGroups\Account;
|
2023-03-25 11:32:33 +01:00
|
|
|
|
2023-07-25 09:01:44 +02:00
|
|
|
use FireflyIII\Models\Account;
|
|
|
|
use FireflyIII\Models\TransactionCurrency;
|
2023-10-30 19:49:40 +01:00
|
|
|
use FireflyIII\Models\UserGroup;
|
2023-10-29 17:41:14 +01:00
|
|
|
use FireflyIII\User;
|
2023-03-25 11:32:33 +01:00
|
|
|
use Illuminate\Support\Collection;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Interface AccountRepositoryInterface
|
|
|
|
*/
|
|
|
|
interface AccountRepositoryInterface
|
|
|
|
{
|
2024-03-06 07:16:01 +01:00
|
|
|
public function countAccounts(array $types): int;
|
|
|
|
|
2023-12-10 06:51:59 +01:00
|
|
|
public function find(int $accountId): ?Account;
|
2023-11-28 17:18:31 +01:00
|
|
|
|
|
|
|
public function findByAccountNumber(string $number, array $types): ?Account;
|
|
|
|
|
2023-12-10 06:51:59 +01:00
|
|
|
public function findByIbanNull(string $iban, array $types): ?Account;
|
2023-07-25 09:01:44 +02:00
|
|
|
|
2023-09-23 07:15:41 +02:00
|
|
|
public function findByName(string $name, array $types): ?Account;
|
|
|
|
|
2023-08-01 09:27:39 +02:00
|
|
|
public function getAccountCurrency(Account $account): ?TransactionCurrency;
|
2023-07-25 09:01:44 +02:00
|
|
|
|
|
|
|
public function getAccountsById(array $accountIds): Collection;
|
|
|
|
|
2023-08-01 09:27:39 +02:00
|
|
|
public function getAccountsByType(array $types, ?array $sort = []): Collection;
|
2023-07-25 09:01:44 +02:00
|
|
|
|
2024-03-04 20:41:34 +01:00
|
|
|
/**
|
|
|
|
* Used in the infinite accounts list.
|
|
|
|
*/
|
2024-03-05 19:38:45 +01:00
|
|
|
public function getAccountsInOrder(array $types, array $sort, int $startRow, int $endRow): Collection;
|
2024-03-04 20:41:34 +01:00
|
|
|
|
2023-08-06 11:22:36 +02:00
|
|
|
public function getActiveAccountsByType(array $types): Collection;
|
|
|
|
|
2023-07-25 09:01:44 +02:00
|
|
|
/**
|
|
|
|
* Return meta value for account. Null if not found.
|
|
|
|
*/
|
|
|
|
public function getMetaValue(Account $account, string $field): ?string;
|
2023-08-01 09:27:39 +02:00
|
|
|
|
2024-03-06 07:16:01 +01:00
|
|
|
/**
|
|
|
|
* Reset order types of the mentioned accounts.
|
|
|
|
*/
|
|
|
|
public function resetAccountOrder(): void;
|
|
|
|
|
2023-08-01 09:27:39 +02:00
|
|
|
public function searchAccount(string $query, array $types, int $limit): Collection;
|
|
|
|
|
2023-12-10 06:51:59 +01:00
|
|
|
public function setUser(User $user): void;
|
|
|
|
|
|
|
|
public function setUserGroup(UserGroup $userGroup): void;
|
2023-03-25 11:32:33 +01:00
|
|
|
}
|