firefly-iii/app/Repositories/Budget/BudgetRepositoryInterface.php

166 lines
3.5 KiB
PHP
Raw Normal View History

2015-02-22 02:46:21 -06:00
<?php
namespace FireflyIII\Repositories\Budget;
2015-02-23 14:19:16 -06:00
use Carbon\Carbon;
2015-02-22 02:46:21 -06:00
use FireflyIII\Models\Budget;
2015-02-22 08:40:13 -06:00
use FireflyIII\Models\LimitRepetition;
2015-05-26 13:28:18 -05:00
use Illuminate\Pagination\LengthAwarePaginator;
2015-04-05 03:36:28 -05:00
use Illuminate\Support\Collection;
2015-02-23 14:19:16 -06:00
2015-02-22 02:46:21 -06:00
/**
* Interface BudgetRepositoryInterface
*
* @package FireflyIII\Repositories\Budget
*/
interface BudgetRepositoryInterface
{
/**
* @return void
*/
public function cleanupBudgets();
2015-02-22 08:40:13 -06:00
/**
* @param Budget $budget
*
* @return boolean
*/
public function destroy(Budget $budget);
2015-02-22 02:46:21 -06:00
/**
* Takes tags into account.
*
* @param Budget $budget
* @param Carbon $date
*
* @return float
*/
public function expensesOnDayCorrected(Budget $budget, Carbon $date);
2015-04-05 03:36:28 -05:00
/**
* @return Collection
*/
public function getActiveBudgets();
/**
* @param Budget $budget
* @param Carbon $start
* @param Carbon $end
*
2015-04-05 03:36:28 -05:00
* @return Collection
*/
public function getBudgetLimitRepetitions(Budget $budget, Carbon $start, Carbon $end);
2015-04-05 03:36:28 -05:00
2015-04-03 12:39:36 -05:00
/**
* @param Budget $budget
*
* @return Collection
2015-04-03 12:39:36 -05:00
*/
public function getBudgetLimits(Budget $budget);
/**
* @return Collection
*/
public function getBudgets();
2015-04-03 12:39:36 -05:00
2015-02-22 02:46:21 -06:00
/**
* @param Budget $budget
* @param Carbon $date
*
* @return LimitRepetition|null
2015-02-22 02:46:21 -06:00
*/
public function getCurrentRepetition(Budget $budget, Carbon $date);
2015-02-22 02:46:21 -06:00
2015-04-07 10:51:22 -05:00
/**
* @param Budget $budget
*
* @return Carbon
*/
public function getFirstBudgetLimitDate(Budget $budget);
2015-04-05 03:36:28 -05:00
/**
* @return Collection
*/
public function getInactiveBudgets();
2015-04-05 03:36:28 -05:00
/**
* Returns all the transaction journals for a limit, possibly limited by a limit repetition.
*
* @param Budget $budget
* @param LimitRepetition $repetition
* @param int $take
*
2015-05-26 13:28:18 -05:00
* @return LengthAwarePaginator
*/
public function getJournals(Budget $budget, LimitRepetition $repetition = null, $take = 50);
2015-04-07 10:51:22 -05:00
/**
* @param Budget $budget
*
* @return Carbon
*/
public function getLastBudgetLimitDate(Budget $budget);
/**
* @param Budget $budget
* @param Carbon $date
*
* @return float
*/
public function getLimitAmountOnDate(Budget $budget, Carbon $date);
/**
* @param Carbon $start
* @param Carbon $end
2015-04-05 03:36:28 -05:00
*
* @return Collection
*/
public function getWithoutBudget(Carbon $start, Carbon $end);
2015-04-05 03:36:28 -05:00
/**
* @param Carbon $start
* @param Carbon $end
2015-04-05 03:36:28 -05:00
*
* @return mixed
2015-04-05 03:36:28 -05:00
*/
public function getWithoutBudgetSum(Carbon $start, Carbon $end);
2015-04-05 03:36:28 -05:00
/**
*
* Same as ::spentInPeriod but corrects journals for their amount (tags).
*
* @param Budget $budget
* @param Carbon $start
* @param Carbon $end
* @param boolean $shared
*
2015-06-05 03:02:40 -05:00
* @return string
*/
public function spentInPeriodCorrected(Budget $budget, Carbon $start, Carbon $end, $shared = true);
2015-02-22 08:40:13 -06:00
/**
* @param array $data
*
* @return Budget
*/
public function store(array $data);
/**
* @param Budget $budget
2015-02-23 14:19:16 -06:00
* @param array $data
2015-02-22 08:40:13 -06:00
*
* @return Budget
*/
public function update(Budget $budget, array $data);
/**
* @param Budget $budget
* @param Carbon $date
* @param $amount
2015-02-22 08:40:13 -06:00
*
* @return mixed
2015-02-22 08:40:13 -06:00
*/
public function updateLimitAmount(Budget $budget, Carbon $date, $amount);
2015-02-22 08:40:13 -06:00
2015-03-29 01:14:32 -05:00
}