Files
firefly-iii/app/Repositories/Account/AccountRepositoryInterface.php

155 lines
3.4 KiB
PHP
Raw Normal View History

2015-02-09 07:23:39 +01:00
<?php
namespace FireflyIII\Repositories\Account;
2015-03-29 21:27:51 +02:00
use Carbon\Carbon;
use FireflyIII\Models\Account;
2015-03-13 08:44:07 +01:00
use FireflyIII\Models\Preference;
use FireflyIII\Models\Transaction;
2015-03-29 21:27:51 +02:00
use FireflyIII\Models\TransactionJournal;
2015-04-07 18:48:34 +02:00
use Illuminate\Pagination\LengthAwarePaginator;
2015-03-13 08:44:07 +01:00
use Illuminate\Support\Collection;
2015-03-29 21:27:51 +02:00
2015-02-11 07:35:10 +01:00
/**
* Interface AccountRepositoryInterface
*
* @package FireflyIII\Repositories\Account
*/
2015-02-09 07:23:39 +01:00
interface AccountRepositoryInterface
{
/**
* @param array $types
*
* @return int
*/
public function countAccounts(array $types);
/**
* @param Account $account
2015-07-10 20:48:45 +02:00
* @param Account $moveTo
*
* @return boolean
*/
2015-07-10 20:48:45 +02:00
public function destroy(Account $account, Account $moveTo = null);
2015-03-13 08:44:07 +01:00
/**
2016-01-19 13:59:54 +01:00
* @param $accountId
*
2016-01-19 13:59:54 +01:00
* @deprecated
*
* @return Account
*/
2016-01-19 13:59:54 +01:00
public function find($accountId);
/**
* Gets all the accounts by ID, for a given set.
*
* @param array $ids
*
* @return Collection
*/
public function get(array $ids);
/**
2016-01-19 13:59:54 +01:00
* @param array $types
*
2016-01-19 13:59:54 +01:00
* @return Collection
2015-03-13 08:44:07 +01:00
*/
2016-01-19 13:59:54 +01:00
public function getAccounts(array $types);
2015-03-13 08:44:07 +01:00
2015-04-07 10:14:10 +02:00
/**
2015-12-27 07:59:00 +01:00
* 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
*
2015-04-07 10:14:10 +02:00
* @return Collection
*/
2015-12-27 07:59:00 +01:00
public function getCreditCards(Carbon $date);
2015-04-07 10:14:10 +02:00
/**
2016-01-19 13:59:54 +01:00
* @param TransactionJournal $journal
* @param Account $account
*
2016-01-19 13:59:54 +01:00
* @return Transaction
*/
2016-01-19 13:59:54 +01:00
public function getFirstTransaction(TransactionJournal $journal, Account $account);
2015-03-13 08:44:07 +01:00
/**
* @param Preference $preference
*
* @return Collection
*/
public function getFrontpageAccounts(Preference $preference);
/**
* @param Account $account
* @param Carbon $start
* @param Carbon $end
*
* @return mixed
*/
public function getFrontpageTransactions(Account $account, Carbon $start, Carbon $end);
/**
* @param Account $account
2015-05-05 10:23:01 +02:00
* @param $page
*
2015-04-07 18:48:34 +02:00
* @return LengthAwarePaginator
*/
2015-03-02 20:05:28 +01:00
public function getJournals(Account $account, $page);
2015-04-07 20:54:43 +02:00
/**
2016-01-19 13:59:54 +01:00
* Get the accounts of a user that have piggy banks connected to them.
*
* @return Collection
2015-04-07 20:54:43 +02:00
*/
2016-01-19 13:59:54 +01:00
public function getPiggyBankAccounts();
2015-04-07 20:54:43 +02:00
2015-02-21 12:16:41 +01:00
/**
* Get savings accounts and the balance difference in the period.
2015-02-21 12:16:41 +01:00
*
* @return Collection
2015-02-21 12:16:41 +01:00
*/
public function getSavingsAccounts();
2015-02-21 12:16:41 +01:00
/**
* @param Account $account
2015-05-20 19:55:53 +02:00
* @param Carbon $date
2015-02-21 12:16:41 +01:00
*
* @return float
2015-02-21 12:16:41 +01:00
*/
2015-05-17 09:35:49 +02:00
public function leftOnAccount(Account $account, Carbon $date);
2015-02-24 21:10:25 +01:00
/**
* @param Account $account
*
* @return TransactionJournal|null
2015-02-24 21:10:25 +01:00
*/
public function openingBalanceTransaction(Account $account);
2015-03-21 08:51:34 +01:00
/**
* @param array $data
2015-03-21 08:51:34 +01:00
*
* @return Account
2015-03-21 08:51:34 +01:00
*/
public function store(array $data);
2016-01-19 13:59:54 +01:00
/**
* @return string
*/
public function sumOfEverything();
/**
* @param Account $account
* @param array $data
*
* @return Account
*/
public function update(Account $account, array $data);
2015-03-29 08:14:32 +02:00
}