mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-31 18:54:58 +00:00
Refactoring.
This commit is contained in:
@@ -6,7 +6,6 @@ namespace FireflyIII\Repositories\Account;
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Models\Account;
|
||||
use FireflyIII\Models\AccountMeta;
|
||||
use FireflyIII\Models\Preference;
|
||||
use FireflyIII\Models\Transaction;
|
||||
use FireflyIII\Models\TransactionJournal;
|
||||
use Illuminate\Pagination\LengthAwarePaginator;
|
||||
@@ -35,6 +34,15 @@ interface AccountRepositoryInterface
|
||||
*/
|
||||
public function destroy(Account $account, Account $moveTo): bool;
|
||||
|
||||
/**
|
||||
* @param Collection $accounts
|
||||
* @param Carbon $start
|
||||
* @param Carbon $end
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function earnedInPeriod(Collection $accounts, Carbon $start, Carbon $end): string;
|
||||
|
||||
/**
|
||||
* @param int $accountId
|
||||
*
|
||||
@@ -42,6 +50,13 @@ interface AccountRepositoryInterface
|
||||
*/
|
||||
public function find(int $accountId): Account;
|
||||
|
||||
/**
|
||||
* @param Account $account
|
||||
*
|
||||
* @return Carbon
|
||||
*/
|
||||
public function firstUseDate(Account $account): Carbon;
|
||||
|
||||
/**
|
||||
* Gets all the accounts by ID, for a given set.
|
||||
*
|
||||
@@ -51,38 +66,19 @@ interface AccountRepositoryInterface
|
||||
*/
|
||||
public function get(array $ids): Collection;
|
||||
|
||||
/**
|
||||
* @param array $accountIds
|
||||
*
|
||||
* @return Collection
|
||||
*/
|
||||
public function getAccountsById(array $accountIds): Collection;
|
||||
|
||||
/**
|
||||
* @param array $types
|
||||
*
|
||||
* @return Collection
|
||||
*/
|
||||
public function getAccounts(array $types): Collection;
|
||||
|
||||
/**
|
||||
* This method returns the users credit cards, along with some basic information about the
|
||||
* balance they have on their CC. To be used in the JSON boxes on the front page that say
|
||||
* how many bills there are still left to pay. The balance will be saved in field "balance".
|
||||
*
|
||||
* To get the balance, the field "date" is necessary.
|
||||
*
|
||||
* @param Carbon $date
|
||||
*
|
||||
* @return Collection
|
||||
*/
|
||||
public function getCreditCards(Carbon $date): Collection;
|
||||
|
||||
/**
|
||||
* Returns a list of transactions TO the given (expense) $account, all from the
|
||||
* given list of accounts
|
||||
*
|
||||
* @param Account $account
|
||||
* @param Collection $accounts
|
||||
* @param Carbon $start
|
||||
* @param Carbon $end
|
||||
*
|
||||
* @return Collection
|
||||
*/
|
||||
public function getExpensesByDestination(Account $account, Collection $accounts, Carbon $start, Carbon $end): Collection;
|
||||
public function getAccountsByType(array $types): Collection;
|
||||
|
||||
/**
|
||||
* @param TransactionJournal $journal
|
||||
@@ -93,35 +89,10 @@ interface AccountRepositoryInterface
|
||||
public function getFirstTransaction(TransactionJournal $journal, Account $account): Transaction;
|
||||
|
||||
/**
|
||||
* @param Preference $preference
|
||||
* @deprecated
|
||||
*
|
||||
* @return Collection
|
||||
*/
|
||||
public function getFrontpageAccounts(Preference $preference): Collection;
|
||||
|
||||
/**
|
||||
* @param Account $account
|
||||
* @param Carbon $start
|
||||
* @param Carbon $end
|
||||
* SEE OTHER GETJOURNALS METHODS.
|
||||
*
|
||||
* @return Collection
|
||||
*/
|
||||
public function getFrontpageTransactions(Account $account, Carbon $start, Carbon $end): Collection;
|
||||
|
||||
/**
|
||||
* Returns a list of transactions TO the given (asset) $account, but none from the
|
||||
* given list of accounts
|
||||
*
|
||||
* @param Account $account
|
||||
* @param Collection $accounts
|
||||
* @param Carbon $start
|
||||
* @param Carbon $end
|
||||
*
|
||||
* @return Collection
|
||||
*/
|
||||
public function getIncomeByDestination(Account $account, Collection $accounts, Carbon $start, Carbon $end): Collection;
|
||||
|
||||
/**
|
||||
* @param Account $account
|
||||
* @param int $page
|
||||
* @param int $pageSize
|
||||
@@ -131,6 +102,10 @@ interface AccountRepositoryInterface
|
||||
public function getJournals(Account $account, int $page, int $pageSize = 50): LengthAwarePaginator;
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
*
|
||||
* SEE OTHER GETJOURNALS METHODS.
|
||||
*
|
||||
* @param Account $account
|
||||
* @param Carbon $start
|
||||
* @param Carbon $end
|
||||
@@ -140,6 +115,8 @@ interface AccountRepositoryInterface
|
||||
public function getJournalsInRange(Account $account, Carbon $start, Carbon $end): Collection;
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
*
|
||||
* Get the accounts of a user that have piggy banks connected to them.
|
||||
*
|
||||
* @return Collection
|
||||
@@ -147,6 +124,8 @@ interface AccountRepositoryInterface
|
||||
public function getPiggyBankAccounts(): Collection;
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
*
|
||||
* Get savings accounts and the balance difference in the period.
|
||||
*
|
||||
* @return Collection
|
||||
@@ -154,6 +133,18 @@ interface AccountRepositoryInterface
|
||||
public function getSavingsAccounts() : Collection;
|
||||
|
||||
/**
|
||||
* @param Collection $accounts
|
||||
* @param array $types
|
||||
* @param Carbon $start
|
||||
* @param Carbon $end
|
||||
*
|
||||
* @return Collection
|
||||
*/
|
||||
public function journalsInPeriod(Collection $accounts, array $types, Carbon $start, Carbon $end): Collection;
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
*
|
||||
* @param Account $account
|
||||
* @param Carbon $date
|
||||
*
|
||||
@@ -180,12 +171,23 @@ interface AccountRepositoryInterface
|
||||
public function oldestJournalDate(Account $account): Carbon;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @param Account $account
|
||||
*
|
||||
* @return TransactionJournal
|
||||
*/
|
||||
public function openingBalanceTransaction(Account $account) : TransactionJournal;
|
||||
|
||||
/**
|
||||
* @param Collection $accounts
|
||||
* @param Carbon $start
|
||||
* @param Carbon $end
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function spentInPeriod(Collection $accounts, Carbon $start, Carbon $end): string;
|
||||
|
||||
/**
|
||||
* @param array $data
|
||||
*
|
||||
@@ -203,6 +205,8 @@ interface AccountRepositoryInterface
|
||||
public function storeMeta(Account $account, string $name, $value): AccountMeta;
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function sumOfEverything() : string;
|
||||
|
||||
Reference in New Issue
Block a user