First attempt at optimised query for multi-year budget chart.

This commit is contained in:
James Cole
2015-12-28 19:56:28 +01:00
parent 83de3482ce
commit 6ab6dd6ac3
3 changed files with 194 additions and 49 deletions

View File

@@ -31,12 +31,26 @@ interface BudgetRepositoryInterface
* Returns an array with every budget in it and the expenses for each budget
* per month.
*
* @param Carbon $start
* @param Carbon $end
* @param Collection $accounts
* @param Carbon $start
* @param Carbon $end
*
* @return array
*/
public function getBudgetsAndExpenses(Carbon $start, Carbon $end);
public function getBudgetsAndExpensesPerMonth(Collection $accounts, Carbon $start, Carbon $end);
/**
* Returns an array with every budget in it and the expenses for each budget
* per year for.
*
* @param Collection $budgets
* @param Collection $accounts
* @param Carbon $start
* @param Carbon $end
*
* @return array
*/
public function getBudgetsAndExpensesPerYear(Collection $budgets, Collection $accounts, Carbon $start, Carbon $end);
/**
* Takes tags into account.
@@ -53,6 +67,17 @@ interface BudgetRepositoryInterface
*/
public function getActiveBudgets();
/**
* Get the budgeted amounts for each budgets in each year.
*
* @param Collection $budgets
* @param Carbon $start
* @param Carbon $end
*
* @return Collection
*/
public function getBudgetedPerYear(Collection $budgets, Carbon $start, Carbon $end);
/**
* @param Budget $budget
* @param Carbon $start