mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Small extension on import account, for testing mostly.
This commit is contained in:
@@ -87,6 +87,18 @@ class AccountRepository implements AccountRepositoryInterface
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return account type by string.
|
||||
*
|
||||
* @param string $type
|
||||
*
|
||||
* @return AccountType|null
|
||||
*/
|
||||
public function getAccountType(string $type): ?AccountType
|
||||
{
|
||||
return AccountType::whereType($type)->first();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Account $account
|
||||
*
|
||||
|
@@ -24,6 +24,7 @@ namespace FireflyIII\Repositories\Account;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Models\Account;
|
||||
use FireflyIII\Models\AccountType;
|
||||
use FireflyIII\Models\Note;
|
||||
use FireflyIII\Models\TransactionJournal;
|
||||
use FireflyIII\User;
|
||||
@@ -34,12 +35,6 @@ use Illuminate\Support\Collection;
|
||||
*/
|
||||
interface AccountRepositoryInterface
|
||||
{
|
||||
/**
|
||||
* @param Account $account
|
||||
*
|
||||
* @return Note|null
|
||||
*/
|
||||
public function getNote(Account $account): ?Note;
|
||||
/**
|
||||
* Moved here from account CRUD.
|
||||
*
|
||||
@@ -90,6 +85,15 @@ interface AccountRepositoryInterface
|
||||
*/
|
||||
public function findByName(string $name, array $types): Account;
|
||||
|
||||
/**
|
||||
* Return account type by string.
|
||||
*
|
||||
* @param string $type
|
||||
*
|
||||
* @return AccountType|null
|
||||
*/
|
||||
public function getAccountType(string $type): ?AccountType;
|
||||
|
||||
/**
|
||||
* @param array $accountIds
|
||||
*
|
||||
@@ -116,6 +120,13 @@ interface AccountRepositoryInterface
|
||||
*/
|
||||
public function getCashAccount(): Account;
|
||||
|
||||
/**
|
||||
* @param Account $account
|
||||
*
|
||||
* @return Note|null
|
||||
*/
|
||||
public function getNote(Account $account): ?Note;
|
||||
|
||||
/**
|
||||
* Find or create the opposing reconciliation account.
|
||||
*
|
||||
|
Reference in New Issue
Block a user