firefly-iii/app/lib/FireflyIII/Report/ReportQueryInterface.php

155 lines
4.3 KiB
PHP
Raw Normal View History

2014-12-27 10:21:15 -06:00
<?php
namespace FireflyIII\Report;
use Carbon\Carbon;
use Illuminate\Support\Collection;
/**
* Interface ReportQueryInterface
*
* @package FireflyIII\Report
*/
interface ReportQueryInterface
{
/**
* This query retrieves a list of accounts that are active and not shared.
*
* @return Collection
*/
public function accountList();
/**
2014-12-28 01:54:53 -06:00
* Get a users accounts combined with various meta-data related to the start and end date.
2014-12-27 10:21:15 -06:00
*
* @param Carbon $start
* @param Carbon $end
*
* @return Collection
*/
2014-12-28 01:54:53 -06:00
public function getAllAccounts(Carbon $start, Carbon $end);
/**
* Grabs a summary of all expenses grouped by budget, related to the account.
*
* @param \Account $account
* @param Carbon $start
* @param Carbon $end
*
* @return mixed
*/
public function getBudgetSummary(\Account $account, Carbon $start, Carbon $end);
/**
* This method will sum up all expenses in a certain time period that have no budget
* and are balanced by a transfer to make up for it.
*
* @param \Account $account
2014-12-30 11:44:58 -06:00
* @param Carbon $start
* @param Carbon $end
2014-12-28 01:54:53 -06:00
*
* @return float
*/
public function balancedTransactionsSum(\Account $account, Carbon $start, Carbon $end);
/**
* This method will get a list of all expenses in a certain time period that have no budget
* and are balanced by a transfer to make up for it.
*
* @param \Account $account
2014-12-30 11:44:58 -06:00
* @param Carbon $start
* @param Carbon $end
2014-12-28 01:54:53 -06:00
*
* @return Collection
*/
public function balancedTransactionsList(\Account $account, Carbon $start, Carbon $end);
2014-12-27 10:21:15 -06:00
/**
* Gets a list of all budgets and if present, the amount of the current BudgetLimit
* as well
*
* @param Carbon $date
*
* @return Collection
*/
public function getAllBudgets(Carbon $date);
2014-12-28 01:54:53 -06:00
/**
* Gets a list of expenses grouped by the budget they were filed under.
*
* @param Carbon $start
* @param Carbon $end
*
* @return Collection
*/
public function journalsByBudget(Carbon $start, Carbon $end);
2014-12-27 10:21:15 -06:00
/**
* Gets a list of categories and the expenses therein, grouped by the relevant category.
* This result excludes transfers to shared accounts which are expenses, technically.
*
* @param Carbon $start
* @param Carbon $end
*
* @return Collection
*/
public function journalsByCategory(Carbon $start, Carbon $end);
/**
* Gets a list of expense accounts and the expenses therein, grouped by that expense account.
* This result excludes transfers to shared accounts which are expenses, technically.
*
* @param Carbon $start
* @param Carbon $end
*
* @return Collection
*/
public function journalsByExpenseAccount(Carbon $start, Carbon $end);
/**
* This method returns all deposits into asset accounts, grouped by the revenue account,
* @param Carbon $start
* @param Carbon $end
*
* @return Collection
*/
public function journalsByRevenueAccount(Carbon $start, Carbon $end);
2015-01-18 14:40:00 -06:00
/**
* This method returns all "income" journals in a certain period, which are both transfers from a shared account
* and "ordinary" deposits. The query used is almost equal to ReportQueryInterface::journalsByRevenueAccount but it does
* not group and returns different fields.
*
* @param Carbon $start
* @param Carbon $end
*
* @return Collection
*/
public function incomeByPeriod(Carbon $start, Carbon $end);
2014-12-27 10:21:15 -06:00
/**
2014-12-28 01:54:53 -06:00
* With an equally misleading name, this query returns are transfers to shared accounts. These are considered
* expenses.
2014-12-27 10:21:15 -06:00
*
* @param Carbon $start
* @param Carbon $end
*
* @return Collection
*/
2014-12-28 01:54:53 -06:00
public function sharedExpenses(Carbon $start, Carbon $end);
2014-12-27 10:21:15 -06:00
/**
2014-12-28 01:54:53 -06:00
* With a slightly misleading name, this query returns all transfers to shared accounts
* grouped by category (which are technically expenses, since it won't be just your money that gets spend).
2014-12-27 10:21:15 -06:00
*
* @param Carbon $start
* @param Carbon $end
*
* @return Collection
*/
2014-12-28 01:54:53 -06:00
public function sharedExpensesByCategory(Carbon $start, Carbon $end);
2014-12-27 10:21:15 -06:00
2015-01-01 23:16:49 -06:00
}