Files
firefly-iii/app/Repositories/Budget/OperationsRepositoryInterface.php

111 lines
3.3 KiB
PHP
Raw Normal View History

2019-08-29 21:33:12 +02:00
<?php
/**
* OperationsRepositoryInterface.php
2020-02-16 14:00:57 +01:00
* Copyright (c) 2019 james@firefly-iii.org
2019-08-29 21:33:12 +02:00
*
* This file is part of Firefly III (https://github.com/firefly-iii).
2019-08-29 21:33:12 +02:00
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
2019-08-29 21:33:12 +02:00
*
* This program is distributed in the hope that it will be useful,
2019-08-29 21:33:12 +02:00
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
2019-08-29 21:33:12 +02:00
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
2019-08-29 21:33:12 +02:00
*/
declare(strict_types=1);
namespace FireflyIII\Repositories\Budget;
use Carbon\Carbon;
2019-08-29 21:33:12 +02:00
use FireflyIII\Models\Budget;
use FireflyIII\Models\TransactionCurrency;
2019-08-29 21:33:12 +02:00
use FireflyIII\User;
2023-02-19 08:43:28 +01:00
use Illuminate\Contracts\Auth\Authenticatable;
use Illuminate\Support\Collection;
2019-08-29 21:33:12 +02:00
/**
* Interface OperationsRepositoryInterface
*/
interface OperationsRepositoryInterface
{
/**
* A method that returns the amount of money budgeted per day for this budget,
* on average.
*
2022-12-29 19:42:26 +01:00
* @param Budget $budget
2019-08-29 21:33:12 +02:00
*
* @return string
*/
public function budgetedPerDay(Budget $budget): string;
2021-08-20 20:49:42 +02:00
2019-08-30 08:12:15 +02:00
/**
2022-12-29 19:42:26 +01:00
* @param Collection $budgets
* @param Collection $accounts
* @param Carbon $start
* @param Carbon $end
2019-08-30 08:12:15 +02:00
*
* @return array
* @deprecated
*/
public function getBudgetPeriodReport(Collection $budgets, Collection $accounts, Carbon $start, Carbon $end): array;
2021-03-12 06:20:01 +01:00
/**
* This method returns a list of all the withdrawal transaction journals (as arrays) set in that period
* which have the specified budget set to them. It's grouped per currency, with as few details in the array
* as possible. Amounts are always negative.
*
2022-12-29 19:42:26 +01:00
* @param Carbon $start
* @param Carbon $end
* @param Collection|null $accounts
* @param Collection|null $budgets
2021-03-12 06:20:01 +01:00
*
* @return array
*/
public function listExpenses(Carbon $start, Carbon $end, ?Collection $accounts = null, ?Collection $budgets = null): array;
2019-08-30 08:00:52 +02:00
/**
2023-02-19 08:43:28 +01:00
* @param User|Authenticatable|null $user
2019-08-30 08:00:52 +02:00
*/
2023-02-19 08:43:28 +01:00
public function setUser(User|Authenticatable|null $user): void;
2019-08-30 08:00:52 +02:00
2021-03-12 06:20:01 +01:00
2019-08-30 08:19:55 +02:00
/**
* Return multi-currency spent information.
*
2022-12-29 19:42:26 +01:00
* @param Collection $budgets
* @param Collection $accounts
* @param Carbon $start
* @param Carbon $end
2019-08-30 08:19:55 +02:00
*
* @return array
* @deprecated
*/
public function spentInPeriodMc(Collection $budgets, Collection $accounts, Carbon $start, Carbon $end): array;
/**
2022-12-30 09:28:03 +01:00
* TODO this method was marked as deprecated but I'm not sure why.
2022-12-29 19:42:26 +01:00
* @param Carbon $start
* @param Carbon $end
* @param Collection|null $accounts
* @param Collection|null $budgets
* @param TransactionCurrency|null $currency
*
* @return array
2022-12-30 09:28:03 +01:00
*
*/
2022-10-30 14:24:28 +01:00
public function sumExpenses(
Carbon $start,
Carbon $end,
?Collection $accounts = null,
?Collection $budgets = null,
?TransactionCurrency $currency = null
): array;
}