2014-10-27 23:58:48 -05:00
|
|
|
<?php
|
|
|
|
|
2014-10-30 13:26:28 -05:00
|
|
|
namespace FireflyIII\Database\Ifaces;
|
2014-10-27 23:58:48 -05:00
|
|
|
|
|
|
|
use Illuminate\Support\Collection;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Interface AccountInterface
|
|
|
|
*
|
|
|
|
* @package FireflyIII\Database
|
|
|
|
*/
|
|
|
|
interface AccountInterface
|
|
|
|
{
|
|
|
|
|
|
|
|
/**
|
2014-11-12 15:37:09 -06:00
|
|
|
* Counts the number of accounts found with the included types.
|
2014-10-27 23:58:48 -05:00
|
|
|
*
|
2014-11-12 15:37:09 -06:00
|
|
|
* @param array $types
|
2014-10-27 23:58:48 -05:00
|
|
|
*
|
2014-11-12 15:37:09 -06:00
|
|
|
* @return int
|
2014-10-27 23:58:48 -05:00
|
|
|
*/
|
2014-11-12 15:37:09 -06:00
|
|
|
public function countAccountsByType(array $types);
|
2014-10-27 23:58:48 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Counts the number of total asset accounts. Useful for DataTables.
|
|
|
|
*
|
|
|
|
* @return int
|
|
|
|
*/
|
|
|
|
public function countAssetAccounts();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Counts the number of total expense accounts. Useful for DataTables.
|
|
|
|
*
|
|
|
|
* @return int
|
|
|
|
*/
|
|
|
|
public function countExpenseAccounts();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Counts the number of total revenue accounts. Useful for DataTables.
|
|
|
|
*
|
|
|
|
* @return int
|
|
|
|
*/
|
|
|
|
public function countRevenueAccounts();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param array $parameters
|
|
|
|
*
|
|
|
|
* @return Collection
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param \Account $account
|
|
|
|
*
|
|
|
|
* @return \Account|null
|
|
|
|
*/
|
|
|
|
public function findInitialBalanceAccount(\Account $account);
|
|
|
|
|
|
|
|
/**
|
2014-11-12 15:37:09 -06:00
|
|
|
* Get all accounts of the selected types. Is also capable of handling DataTables' parameters.
|
2014-10-27 23:58:48 -05:00
|
|
|
*
|
2014-11-12 15:37:09 -06:00
|
|
|
* @param array $types
|
2014-10-27 23:58:48 -05:00
|
|
|
* @param array $parameters
|
|
|
|
*
|
|
|
|
* @return Collection
|
|
|
|
*/
|
2014-11-12 15:37:09 -06:00
|
|
|
public function getAccountsByType(array $types, array $parameters = []);
|
2014-10-27 23:58:48 -05:00
|
|
|
|
|
|
|
/**
|
2014-11-12 15:37:09 -06:00
|
|
|
* Get all asset accounts. The parameters are optional and are provided by the DataTables plugin.
|
2014-10-27 23:58:48 -05:00
|
|
|
*
|
|
|
|
* @param array $parameters
|
|
|
|
*
|
|
|
|
* @return Collection
|
|
|
|
*/
|
2014-11-12 15:37:09 -06:00
|
|
|
public function getAssetAccounts(array $parameters = []);
|
2014-10-27 23:58:48 -05:00
|
|
|
|
|
|
|
/**
|
2014-11-12 15:37:09 -06:00
|
|
|
* Get all default accounts.
|
2014-10-27 23:58:48 -05:00
|
|
|
*
|
2014-11-12 15:37:09 -06:00
|
|
|
* @return Collection
|
2014-10-27 23:58:48 -05:00
|
|
|
*/
|
2014-11-12 15:37:09 -06:00
|
|
|
public function getDefaultAccounts();
|
|
|
|
|
|
|
|
public function getExpenseAccounts(array $parameters = []);
|
2014-10-27 23:58:48 -05:00
|
|
|
|
|
|
|
/**
|
2014-11-12 15:37:09 -06:00
|
|
|
* Get all revenue accounts.
|
|
|
|
*
|
|
|
|
* @param array $parameters
|
2014-10-27 23:58:48 -05:00
|
|
|
*
|
|
|
|
* @return Collection
|
|
|
|
*/
|
2014-11-12 15:37:09 -06:00
|
|
|
public function getRevenueAccounts(array $parameters = []);
|
2014-10-27 23:58:48 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @param \Account $account
|
|
|
|
*
|
|
|
|
* @return \TransactionJournal|null
|
|
|
|
*/
|
|
|
|
public function openingBalanceTransaction(\Account $account);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param \Account $account
|
2014-11-12 15:37:09 -06:00
|
|
|
* @param array $data
|
2014-10-27 23:58:48 -05:00
|
|
|
*
|
|
|
|
* @return bool
|
|
|
|
*/
|
|
|
|
public function storeInitialBalance(\Account $account, array $data);
|
|
|
|
}
|