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

146 lines
3.0 KiB
PHP
Raw Normal View History

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