mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2026-01-07 06:31:22 +00:00
Basic code for tracking liabilities.
This commit is contained in:
@@ -168,6 +168,18 @@ class AccountRepository implements AccountRepositoryInterface
|
||||
return $this->user->accounts()->find($accountId);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return account type or null if not found.
|
||||
*
|
||||
* @param string $type
|
||||
*
|
||||
* @return AccountType|null
|
||||
*/
|
||||
public function getAccountTypeByType(string $type): ?AccountType
|
||||
{
|
||||
return AccountType::whereType($type)->first();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $accountIds
|
||||
*
|
||||
@@ -373,6 +385,7 @@ class AccountRepository implements AccountRepositoryInterface
|
||||
* Returns the date of the very first transaction in this account.
|
||||
*
|
||||
* @param Account $account
|
||||
*
|
||||
* @return TransactionJournal|null
|
||||
*/
|
||||
public function oldestJournal(Account $account): ?TransactionJournal
|
||||
|
||||
@@ -24,17 +24,18 @@ namespace FireflyIII\Repositories\Account;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Models\Account;
|
||||
|
||||
|
||||
use FireflyIII\Models\AccountType;
|
||||
use FireflyIII\Models\TransactionJournal;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Support\Collection;
|
||||
|
||||
|
||||
/**
|
||||
* Interface AccountRepositoryInterface.
|
||||
*/
|
||||
interface AccountRepositoryInterface
|
||||
{
|
||||
|
||||
/**
|
||||
* Moved here from account CRUD.
|
||||
*
|
||||
@@ -87,6 +88,15 @@ interface AccountRepositoryInterface
|
||||
*/
|
||||
public function findNull(int $accountId): ?Account;
|
||||
|
||||
/**
|
||||
* Return account type or null if not found.
|
||||
*
|
||||
* @param string $type
|
||||
*
|
||||
* @return AccountType|null
|
||||
*/
|
||||
public function getAccountTypeByType(string $type): ?AccountType;
|
||||
|
||||
/**
|
||||
* @param array $accountIds
|
||||
*
|
||||
@@ -164,6 +174,7 @@ interface AccountRepositoryInterface
|
||||
* Returns the date of the very first transaction in this account.
|
||||
*
|
||||
* @param Account $account
|
||||
*
|
||||
* @return TransactionJournal|null
|
||||
*/
|
||||
public function oldestJournal(Account $account): ?TransactionJournal;
|
||||
|
||||
Reference in New Issue
Block a user