. */ declare(strict_types=1); namespace FireflyIII\Repositories\Budget; use Carbon\Carbon; use FireflyIII\Models\Budget; use FireflyIII\Models\BudgetLimit; use FireflyIII\Models\TransactionCurrency; use FireflyIII\User; use Illuminate\Contracts\Auth\Authenticatable; use Illuminate\Support\Collection; /** * Interface BudgetLimitRepositoryInterface */ interface BudgetLimitRepositoryInterface { /** * Tells you which amount has been budgeted (for the given budgets) * in the selected query. Returns a positive amount as a string. */ public function budgeted(Carbon $start, Carbon $end, TransactionCurrency $currency, ?Collection $budgets = null): string; /** * Destroy all budget limits. */ public function destroyAll(): void; /** * Destroy a budget limit. */ public function destroyBudgetLimit(BudgetLimit $budgetLimit): void; public function find(Budget $budget, TransactionCurrency $currency, Carbon $start, Carbon $end): ?BudgetLimit; /** * TODO this method is not multi currency aware. */ public function getAllBudgetLimits(Carbon $start = null, Carbon $end = null): Collection; public function getAllBudgetLimitsByCurrency(TransactionCurrency $currency, Carbon $start = null, Carbon $end = null): Collection; public function getBudgetLimits(Budget $budget, Carbon $start = null, Carbon $end = null): Collection; public function setUser(null|Authenticatable|User $user): void; public function store(array $data): BudgetLimit; public function update(BudgetLimit $budgetLimit, array $data): BudgetLimit; public function updateLimitAmount(Budget $budget, Carbon $start, Carbon $end, string $amount): ?BudgetLimit; }