mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Remove TODO's.
This commit is contained in:
parent
0d7d3f45f0
commit
8832387b84
@ -38,7 +38,7 @@ use Illuminate\Http\JsonResponse;
|
||||
*
|
||||
* Shows income information grouped or limited by date.
|
||||
* Ie. all income grouped by account + currency.
|
||||
* TODO same code as Expense/AccountController.
|
||||
* See reference nr. 75
|
||||
*/
|
||||
class AccountController extends Controller
|
||||
{
|
||||
@ -74,8 +74,8 @@ class AccountController extends Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO same code as Expense/AccountController.
|
||||
* TODO does not actually include the name of the expense account.
|
||||
* See reference nr. 76
|
||||
* See reference nr. 77
|
||||
* @param GenericRequest $request
|
||||
*
|
||||
* @return JsonResponse
|
||||
@ -103,7 +103,7 @@ class AccountController extends Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO does not actually include the name of the expense account.
|
||||
* See reference nr. 78
|
||||
*
|
||||
* @param GenericRequest $request
|
||||
*
|
||||
|
@ -35,7 +35,7 @@ use Illuminate\Support\Collection;
|
||||
|
||||
/**
|
||||
* Class CategoryController
|
||||
* TODO same as opposing category controller
|
||||
* See reference nr. 79
|
||||
*/
|
||||
class CategoryController extends Controller
|
||||
{
|
||||
|
@ -58,8 +58,8 @@ class AccountController extends Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO same code as Expense/AccountController.
|
||||
* TODO does not actually include the name of the expense account.
|
||||
* See reference nr. 80
|
||||
* See reference nr. 81
|
||||
*
|
||||
* @param GenericRequest $request
|
||||
*
|
||||
|
@ -39,7 +39,7 @@ class TagController extends Controller
|
||||
|
||||
/**
|
||||
* TagController constructor.
|
||||
* TODO lots of copying and pasting here.
|
||||
* See reference nr. 82
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
|
@ -72,7 +72,7 @@ class UpdateController extends Controller
|
||||
*
|
||||
* @return JsonResponse
|
||||
*
|
||||
* TODO generates query exception when link exists.
|
||||
* See reference nr. 84
|
||||
*/
|
||||
public function update(UpdateRequest $request, TransactionJournalLink $journalLink): JsonResponse
|
||||
{
|
||||
|
@ -52,7 +52,7 @@ class PreferencesController extends Controller
|
||||
*/
|
||||
public function index(): JsonResponse
|
||||
{
|
||||
// TODO via repository.
|
||||
// See reference nr. 83
|
||||
$collection = auth()->user()->preferences()->get();
|
||||
$manager = $this->getManager();
|
||||
$count = $collection->count();
|
||||
|
@ -42,7 +42,7 @@ class MoveTransactionsRequest extends FormRequest
|
||||
* Configure the validator instance with special rules for after the basic validation rules.
|
||||
*
|
||||
* @param Validator $validator
|
||||
* TODO duplicate code.
|
||||
* See reference nr. 74
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
|
@ -76,7 +76,7 @@ class UpdateRequest extends FormRequest
|
||||
* Configure the validator instance with special rules for after the basic validation rules.
|
||||
*
|
||||
* @param Validator $validator
|
||||
* TODO duplicate code.
|
||||
* See reference nr. 72
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
|
@ -65,7 +65,7 @@ class UpdateRequest extends FormRequest
|
||||
public function rules(): array
|
||||
{
|
||||
$tag = $this->route()->parameter('tagOrId');
|
||||
// TODO is uniqueObjectForUser not obsolete?
|
||||
// See reference nr. 73
|
||||
$rules = [
|
||||
'tag' => 'min:1|uniqueObjectForUser:tags,tag,' . $tag->id,
|
||||
'description' => 'min:1|nullable',
|
||||
|
@ -60,7 +60,7 @@ class StoreRequest extends FormRequest
|
||||
'fire_webhooks' => $this->boolean('fire_webhooks', true),
|
||||
'transactions' => $this->getTransactionData(),
|
||||
];
|
||||
// TODO location
|
||||
// See reference nr. 71
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -27,7 +27,7 @@ use Illuminate\Queue\SerializesModels;
|
||||
|
||||
/**
|
||||
* Class StoredTransactionLink
|
||||
* TODO not used.
|
||||
* See reference nr. 85
|
||||
*/
|
||||
class StoredTransactionLink extends Event
|
||||
{
|
||||
|
@ -27,7 +27,7 @@ use Illuminate\Queue\SerializesModels;
|
||||
|
||||
/**
|
||||
* Class UpdatedTransactionLink
|
||||
* TODO unused
|
||||
* See reference nr. 86
|
||||
*/
|
||||
class UpdatedTransactionLink extends Event
|
||||
{
|
||||
|
@ -34,7 +34,7 @@ use Throwable;
|
||||
|
||||
/**
|
||||
* Class MonthReportGenerator.
|
||||
* TODO include info about tags.
|
||||
* See reference nr. 19
|
||||
*
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
|
@ -35,7 +35,7 @@ use Throwable;
|
||||
|
||||
/**
|
||||
* Class MonthReportGenerator.
|
||||
* TODO include info about tags.
|
||||
* See reference nr. 18
|
||||
*
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
|
@ -41,7 +41,7 @@ class Sha3SignatureGenerator implements SignatureGeneratorInterface
|
||||
try {
|
||||
$json = json_encode($message->message, JSON_THROW_ON_ERROR);
|
||||
} catch (JsonException $e) {
|
||||
// TODO needs FireflyException.
|
||||
// See reference nr. 87
|
||||
return sprintf('t=1,v%d=err-invalid-signature', $this->getVersion());
|
||||
}
|
||||
|
||||
|
@ -159,7 +159,7 @@ class IndexController extends Controller
|
||||
|
||||
$accounts->each(
|
||||
function (Account $account) use ($activities, $startBalances, $endBalances) {
|
||||
// TODO lots of queries executed in this block.
|
||||
// See reference nr. 68
|
||||
$account->lastActivityDate = $this->isInArray($activities, $account->id);
|
||||
$account->startBalance = $this->isInArray($startBalances, $account->id);
|
||||
$account->endBalance = $this->isInArray($endBalances, $account->id);
|
||||
|
@ -509,7 +509,7 @@ class AccountController extends Controller
|
||||
/**
|
||||
* Shows the balances for a given set of dates and accounts.
|
||||
*
|
||||
* TODO this chart is not multi-currency aware.
|
||||
* See reference nr. 55
|
||||
*
|
||||
* @param Carbon $start
|
||||
* @param Carbon $end
|
||||
|
@ -63,7 +63,7 @@ class CategoryController extends Controller
|
||||
|
||||
/**
|
||||
* Show an overview for a category for all time, per month/week/year.
|
||||
* TODO test method, for category refactor.
|
||||
* See reference nr. 59
|
||||
*
|
||||
* @param Category $category
|
||||
*
|
||||
@ -111,7 +111,7 @@ class CategoryController extends Controller
|
||||
|
||||
/**
|
||||
* Shows the category chart on the front page.
|
||||
* TODO test method, for category refactor.
|
||||
* See reference nr. 60
|
||||
*
|
||||
* @return JsonResponse
|
||||
*/
|
||||
@ -138,7 +138,7 @@ class CategoryController extends Controller
|
||||
|
||||
/**
|
||||
* Chart report.
|
||||
* TODO test method, for category refactor.
|
||||
* See reference nr. 61
|
||||
*
|
||||
* @param Category $category
|
||||
* @param Collection $accounts
|
||||
@ -254,7 +254,7 @@ class CategoryController extends Controller
|
||||
|
||||
/**
|
||||
* Chart for period for transactions without a category.
|
||||
* TODO test me.
|
||||
* See reference nr. 62
|
||||
*
|
||||
* @param Collection $accounts
|
||||
* @param Carbon $start
|
||||
@ -281,7 +281,7 @@ class CategoryController extends Controller
|
||||
|
||||
/**
|
||||
* Chart for a specific period.
|
||||
* TODO test method, for category refactor.
|
||||
* See reference nr. 63
|
||||
*
|
||||
* @param Category $category
|
||||
* @param Carbon $date
|
||||
|
@ -318,7 +318,7 @@ class CategoryReportController extends Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO duplicate function
|
||||
* See reference nr. 57
|
||||
*
|
||||
* @param Carbon $start
|
||||
* @param Carbon $end
|
||||
|
@ -249,7 +249,7 @@ class DoubleReportController extends Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO this method is double.
|
||||
* See reference nr. 51
|
||||
*
|
||||
* @param Collection $accounts
|
||||
* @param int $id
|
||||
@ -274,7 +274,7 @@ class DoubleReportController extends Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO duplicate function
|
||||
* See reference nr. 52
|
||||
*
|
||||
* @param Carbon $start
|
||||
* @param Carbon $end
|
||||
|
@ -69,7 +69,7 @@ class ExpenseReportController extends Controller
|
||||
/**
|
||||
* Main chart that shows income and expense for a combination of expense/revenue accounts.
|
||||
*
|
||||
* TODO this chart is not multi-currency aware.
|
||||
* See reference nr. 58
|
||||
*
|
||||
* @param Collection $accounts
|
||||
* @param Collection $expense
|
||||
|
@ -58,7 +58,7 @@ class PiggyBankController extends Controller
|
||||
/**
|
||||
* Shows the piggy bank history.
|
||||
*
|
||||
* TODO this chart is not multi-currency aware.
|
||||
* See reference nr. 53
|
||||
*
|
||||
* @param PiggyBankRepositoryInterface $repository
|
||||
* @param PiggyBank $piggyBank
|
||||
|
@ -102,7 +102,7 @@ class ReportController extends Controller
|
||||
}
|
||||
);
|
||||
|
||||
// TODO get liabilities and include those as well?
|
||||
// See reference nr. 56
|
||||
|
||||
while ($current < $end) {
|
||||
// get balances by date, grouped by currency.
|
||||
|
@ -323,7 +323,7 @@ class TagReportController extends Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO duplicate function
|
||||
* See reference nr. 54
|
||||
*
|
||||
* @param Carbon $start
|
||||
* @param Carbon $end
|
||||
|
@ -69,7 +69,7 @@ class IndexController extends Controller
|
||||
|
||||
/**
|
||||
* Show overview of all piggy banks.
|
||||
* TODO complicated
|
||||
* See reference nr. 66
|
||||
*
|
||||
* @param Request $request
|
||||
*
|
||||
|
@ -653,7 +653,7 @@ class ProfileController extends Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO duplicate code.
|
||||
* See reference nr. 64
|
||||
*
|
||||
* @param string $mfaCode
|
||||
*/
|
||||
|
@ -86,7 +86,7 @@ class EditController extends Controller
|
||||
*/
|
||||
public function edit(Request $request, Recurrence $recurrence)
|
||||
{
|
||||
// TODO should be in repos
|
||||
// See reference nr. 69
|
||||
$count = $recurrence->recurrenceTransactions()->count();
|
||||
if (0 === $count) {
|
||||
throw new FireflyException('This recurring transaction has no meta-data. You will have to delete it and recreate it. Sorry!');
|
||||
|
@ -68,7 +68,7 @@ class IndexController extends Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO the notes of a recurrence are pretty pointless at this moment.
|
||||
* See reference nr. 70
|
||||
* Show all recurring transactions.
|
||||
*
|
||||
* @param Request $request
|
||||
|
@ -292,7 +292,7 @@ class DoubleController extends Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO this method is double.
|
||||
* See reference nr. 67
|
||||
*
|
||||
* @param Collection $accounts
|
||||
* @param int $id
|
||||
|
@ -143,7 +143,7 @@ class EditController extends Controller
|
||||
*/
|
||||
private function parseFromOperators(array $submittedOperators): array
|
||||
{
|
||||
// TODO duplicated code.
|
||||
// See reference nr. 65
|
||||
$operators = config('firefly.search.operators');
|
||||
$renderedEntries = [];
|
||||
$triggers = [];
|
||||
|
@ -63,7 +63,7 @@ class BulkController extends Controller
|
||||
/**
|
||||
* Edit a set of journals in bulk.
|
||||
*
|
||||
* TODO user wont be able to tell if journal is part of split.
|
||||
* See reference nr. 47
|
||||
*
|
||||
* @param array $journals
|
||||
*
|
||||
|
@ -47,7 +47,7 @@ use Log;
|
||||
/**
|
||||
* Class ConvertController.
|
||||
*
|
||||
* TODO when converting to a split transfer, all sources and destinations must be the same.
|
||||
* See reference nr. 49
|
||||
*/
|
||||
class ConvertController extends Controller
|
||||
{
|
||||
@ -346,7 +346,7 @@ class ConvertController extends Controller
|
||||
throw new FireflyException(sprintf(trans('firefly.convert_invalid_destination'), $journal->id));
|
||||
}
|
||||
|
||||
// TODO typeOverrule: the account validator may have another opinion on the transaction type.
|
||||
// See reference nr. 50
|
||||
|
||||
$update = [
|
||||
'source_id' => $sourceId,
|
||||
|
@ -167,7 +167,7 @@ class MassController extends Controller
|
||||
{
|
||||
$journalIds = $request->get('journals');
|
||||
if (!is_array($journalIds)) {
|
||||
// TODO something error.
|
||||
// See reference nr. 48
|
||||
throw new FireflyException('This is not an array.');
|
||||
}
|
||||
$count = 0;
|
||||
|
@ -304,7 +304,7 @@ class RecurrenceFormRequest extends FormRequest
|
||||
$sourceId = null;
|
||||
$destinationId = null;
|
||||
|
||||
// TODO typeOverrule: the account validator may have another opinion on the transaction type.
|
||||
// See reference nr. 45
|
||||
|
||||
switch ($this->string('transaction_type')) {
|
||||
default:
|
||||
|
@ -37,7 +37,7 @@ class TestRuleFormRequest extends FormRequest
|
||||
|
||||
/**
|
||||
* Rules for this request.
|
||||
* TODO these rules are not valid anymore.
|
||||
* See reference nr. 46
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
|
@ -70,7 +70,7 @@ class Configuration extends Model
|
||||
protected $table = 'configuration';
|
||||
|
||||
/**
|
||||
* TODO can be replaced by native laravel code
|
||||
* See reference nr. 17
|
||||
* @codeCoverageIgnore
|
||||
*
|
||||
* @param mixed $value
|
||||
|
@ -130,7 +130,7 @@ class AccountRepository implements AccountRepositoryInterface
|
||||
$query->whereIn('account_types.type', $types);
|
||||
}
|
||||
|
||||
// TODO a loop like this is no longer necessary
|
||||
// See reference nr. 9
|
||||
|
||||
$accounts = $query->get(['accounts.*']);
|
||||
/** @var Account $account */
|
||||
@ -161,7 +161,7 @@ class AccountRepository implements AccountRepositoryInterface
|
||||
|
||||
$accounts = $query->get(['accounts.*']);
|
||||
|
||||
// TODO no longer need to loop like this
|
||||
// See reference nr. 10
|
||||
|
||||
/** @var Account $account */
|
||||
foreach ($accounts as $account) {
|
||||
|
@ -148,7 +148,7 @@ class BillRepository implements BillRepositoryInterface
|
||||
{
|
||||
$bills = $this->user->bills()->get(['bills.*']);
|
||||
|
||||
// TODO no longer need to loop like this
|
||||
// See reference nr. 6
|
||||
|
||||
/** @var Bill $bill */
|
||||
foreach ($bills as $bill) {
|
||||
|
@ -72,7 +72,7 @@ interface BudgetLimitRepositoryInterface
|
||||
public function find(Budget $budget, TransactionCurrency $currency, Carbon $start, Carbon $end): ?BudgetLimit;
|
||||
|
||||
/**
|
||||
* TODO this method is not multi-currency aware.
|
||||
* See reference nr. 11
|
||||
*
|
||||
* @param Carbon|null $start
|
||||
* @param Carbon|null $end
|
||||
|
@ -74,7 +74,7 @@ interface BudgetRepositoryInterface
|
||||
public function findByName(?string $name): ?Budget;
|
||||
|
||||
/**
|
||||
* TODO refactor to "find"
|
||||
* See reference nr. 12
|
||||
*
|
||||
* @param int|null $budgetId
|
||||
*
|
||||
|
@ -146,8 +146,8 @@ class NoBudgetRepository implements NoBudgetRepositoryInterface
|
||||
|
||||
/** @noinspection MoreThanThreeArgumentsInspection */
|
||||
/**
|
||||
* TODO this method does not include foreign amount transactions. It only sums up "amount".
|
||||
* TODO this probably also applies to the other "sumExpenses" methods.
|
||||
* See reference nr. 15
|
||||
* See reference nr. 16
|
||||
*
|
||||
* @param Carbon $start
|
||||
* @param Carbon $end
|
||||
|
@ -227,7 +227,7 @@ class OperationsRepository implements OperationsRepositoryInterface
|
||||
if ($accounts->count() > 0) {
|
||||
$collector->setAccounts($accounts);
|
||||
}
|
||||
// TODO possible candidate for getExtractedGroups
|
||||
// See reference nr. 13
|
||||
$set = $collector->getGroups();
|
||||
$return = [];
|
||||
$total = [];
|
||||
@ -359,7 +359,7 @@ class OperationsRepository implements OperationsRepositoryInterface
|
||||
|
||||
/**
|
||||
* For now, simply refer to whichever repository holds this function.
|
||||
* TODO might be done better in the future.
|
||||
* See reference nr. 14
|
||||
*
|
||||
* @param Budget $budget
|
||||
* @param Carbon|null $start
|
||||
|
@ -89,7 +89,7 @@ class CategoryRepository implements CategoryRepositoryInterface
|
||||
{
|
||||
$categories = $this->user->categories()->get(['categories.*']);
|
||||
|
||||
// TODO no longer need to loop like this
|
||||
// See reference nr. 7
|
||||
|
||||
foreach ($categories as $category) {
|
||||
if ($category->name === $name) {
|
||||
|
@ -58,7 +58,7 @@ interface JournalRepositoryInterface
|
||||
public function findByType(array $types): Collection;
|
||||
|
||||
/**
|
||||
* TODO Refactor to "find".
|
||||
* See reference nr. 1
|
||||
* Find a specific journal.
|
||||
*
|
||||
* @param int $journalId
|
||||
@ -85,7 +85,7 @@ interface JournalRepositoryInterface
|
||||
public function getDestinationAccount(TransactionJournal $journal): Account;
|
||||
|
||||
/**
|
||||
* TODO this method is no longer well-fitted in 4.8,0. Should be refactored and/or removed.
|
||||
* See reference nr. 2
|
||||
* Return a list of all destination accounts related to journal.
|
||||
*
|
||||
* @param TransactionJournal $journal
|
||||
@ -96,7 +96,7 @@ interface JournalRepositoryInterface
|
||||
public function getJournalDestinationAccounts(TransactionJournal $journal): Collection;
|
||||
|
||||
/**
|
||||
* TODO this method is no longer well-fitted in 4.8,0. Should be refactored and/or removed.
|
||||
* See reference nr. 3
|
||||
* Return a list of all source accounts related to journal.
|
||||
*
|
||||
* @param TransactionJournal $journal
|
||||
@ -121,7 +121,7 @@ interface JournalRepositoryInterface
|
||||
public function getLast(): ?TransactionJournal;
|
||||
|
||||
/**
|
||||
* TODO used only in transformer, so only for API use.
|
||||
* See reference nr. 4
|
||||
*
|
||||
* @param TransactionJournalLink $link
|
||||
*
|
||||
@ -150,7 +150,7 @@ interface JournalRepositoryInterface
|
||||
public function getSourceAccount(TransactionJournal $journal): Account;
|
||||
|
||||
/**
|
||||
* TODO maybe move to account repository?
|
||||
* See reference nr. 5
|
||||
*
|
||||
* @param int $journalId
|
||||
*/
|
||||
|
@ -269,7 +269,7 @@ class UserRepository implements UserRepositoryInterface
|
||||
*/
|
||||
public function hasRole(User $user, string $role): bool
|
||||
{
|
||||
// TODO no longer need to loop like this
|
||||
// See reference nr. 8
|
||||
|
||||
/** @var Role $userRole */
|
||||
foreach ($user->roles as $userRole) {
|
||||
|
@ -102,7 +102,7 @@ trait AccountServiceTrait
|
||||
/**
|
||||
* Update meta data for account. Depends on type which fields are valid.
|
||||
*
|
||||
* TODO this method treats expense accounts and liabilities the same way (tries to save interest)
|
||||
* See reference nr. 97
|
||||
*
|
||||
* @param Account $account
|
||||
* @param array $data
|
||||
@ -410,7 +410,7 @@ trait AccountServiceTrait
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO rename to "getOpposingTransaction"
|
||||
* See reference nr. 98
|
||||
*
|
||||
* @param TransactionJournal $journal
|
||||
* @param Account $account
|
||||
@ -705,7 +705,7 @@ trait AccountServiceTrait
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO Refactor to "getFirstJournal"
|
||||
* See reference nr. 99
|
||||
*
|
||||
* @param TransactionGroup $group
|
||||
*
|
||||
|
@ -145,7 +145,7 @@ trait RecurringTransactionTrait
|
||||
if (array_key_exists('foreign_amount', $array) && '' === (string)$array['foreign_amount']) {
|
||||
unset($array['foreign_amount']);
|
||||
}
|
||||
// TODO typeOverrule: the account validator may have another opinion on the transaction type.
|
||||
// See reference nr. 100
|
||||
$transaction = new RecurrenceTransaction(
|
||||
[
|
||||
'recurrence_id' => $recurrence->id,
|
||||
|
@ -35,7 +35,7 @@ use Log;
|
||||
|
||||
/**
|
||||
* Class AccountUpdateService
|
||||
* TODO this is a mess.
|
||||
* See reference nr. 90
|
||||
*/
|
||||
class AccountUpdateService
|
||||
{
|
||||
|
@ -35,7 +35,7 @@ use FireflyIII\Models\TransactionJournalMeta;
|
||||
|
||||
/**
|
||||
* Class GroupCloneService
|
||||
* TODO test.
|
||||
* See reference nr. 92
|
||||
*/
|
||||
class GroupCloneService
|
||||
{
|
||||
|
@ -32,7 +32,7 @@ use Log;
|
||||
|
||||
/**
|
||||
* Class GroupUpdateService
|
||||
* TODO test.
|
||||
* See reference nr. 91
|
||||
*/
|
||||
class GroupUpdateService
|
||||
{
|
||||
|
@ -48,7 +48,7 @@ use Log;
|
||||
* Class to centralise code that updates a journal given the input by system.
|
||||
*
|
||||
* Class JournalUpdateService
|
||||
* TODO test me
|
||||
* See reference nr. 93
|
||||
*/
|
||||
class JournalUpdateService
|
||||
{
|
||||
@ -158,7 +158,7 @@ class JournalUpdateService
|
||||
$this->updateAmount();
|
||||
$this->updateForeignAmount();
|
||||
|
||||
// TODO update hash
|
||||
// See reference nr. 94
|
||||
|
||||
app('preferences')->mark();
|
||||
|
||||
@ -201,7 +201,7 @@ class JournalUpdateService
|
||||
$result = $validator->validateSource($sourceId, $sourceName, null);
|
||||
Log::debug(sprintf('hasValidSourceAccount(%d, "%s") will return %s', $sourceId, $sourceName, var_export($result, true)));
|
||||
|
||||
// TODO typeOverrule: the account validator may have another opinion on the transaction type.
|
||||
// See reference nr. 95
|
||||
|
||||
// validate submitted info:
|
||||
return $result;
|
||||
@ -295,7 +295,7 @@ class JournalUpdateService
|
||||
$result = $validator->validateDestination($destId, $destName, null);
|
||||
Log::debug(sprintf('hasValidDestinationAccount(%d, "%s") will return %s', $destId, $destName, var_export($result, true)));
|
||||
|
||||
// TODO typeOverrule: the account validator may have another opinion on the transaction type.
|
||||
// See reference nr. 96
|
||||
|
||||
// validate submitted info:
|
||||
return $result;
|
||||
|
@ -49,7 +49,7 @@ class RecurrenceUpdateService
|
||||
/**
|
||||
* Updates a recurrence.
|
||||
*
|
||||
* TODO if the user updates the type, accounts must be validated (again).
|
||||
* See reference nr. 88
|
||||
*
|
||||
* @param Recurrence $recurrence
|
||||
* @param array $data
|
||||
@ -217,7 +217,7 @@ class RecurrenceUpdateService
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO this method is way too complex.
|
||||
* See reference nr. 89
|
||||
*
|
||||
* @param Recurrence $recurrence
|
||||
* @param array $transactions
|
||||
|
@ -115,7 +115,7 @@ class WholePeriodChartGenerator
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO is a duplicate function.
|
||||
* See reference nr. 32
|
||||
*
|
||||
* @param Carbon $start
|
||||
* @param Carbon $end
|
||||
|
@ -644,7 +644,7 @@ class ExportDataGenerator
|
||||
*/
|
||||
private function exportTransactions(): string
|
||||
{
|
||||
// TODO better place for keys?
|
||||
// See reference nr. 41
|
||||
$header = ['user_id', 'group_id', 'journal_id', 'created_at', 'updated_at', 'group_title', 'type', 'amount', 'foreign_amount', 'currency_code',
|
||||
'foreign_currency_code', 'description', 'date', 'source_name', 'source_iban', 'source_type', 'destination_name', 'destination_iban',
|
||||
'destination_type', 'reconciled', 'category', 'budget', 'bill', 'tags', 'notes',
|
||||
|
@ -33,8 +33,8 @@ use Throwable;
|
||||
*
|
||||
* All form methods that are account related.
|
||||
*
|
||||
* TODO describe all methods.
|
||||
* TODO optimize repositories and methods.
|
||||
* See reference nr. 29
|
||||
* See reference nr. 30
|
||||
*/
|
||||
class AccountForm
|
||||
{
|
||||
|
@ -35,7 +35,7 @@ use Throwable;
|
||||
*
|
||||
* All currency related form methods.
|
||||
*
|
||||
* TODO cleanup and describe.
|
||||
* See reference nr. 22
|
||||
*/
|
||||
class CurrencyForm
|
||||
{
|
||||
@ -107,7 +107,7 @@ class CurrencyForm
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO describe and cleanup.
|
||||
* See reference nr. 23
|
||||
*
|
||||
* @param string $name
|
||||
* @param mixed $value
|
||||
@ -121,7 +121,7 @@ class CurrencyForm
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO cleanup and describe better.
|
||||
* See reference nr. 24
|
||||
*
|
||||
* @param string $name
|
||||
* @param string $view
|
||||
@ -176,7 +176,7 @@ class CurrencyForm
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO cleanup and describe.
|
||||
* See reference nr. 25
|
||||
*
|
||||
* @param string $name
|
||||
* @param mixed $value
|
||||
@ -201,7 +201,7 @@ class CurrencyForm
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO cleanup and describe.
|
||||
* See reference nr. 26
|
||||
*
|
||||
* @param string $name
|
||||
* @param mixed $value
|
||||
|
@ -28,14 +28,14 @@ use FireflyIII\Repositories\PiggyBank\PiggyBankRepositoryInterface;
|
||||
/**
|
||||
* Class PiggyBankForm
|
||||
*
|
||||
* TODO cleanup and describe.
|
||||
* See reference nr. 27
|
||||
*/
|
||||
class PiggyBankForm
|
||||
{
|
||||
use FormSupport;
|
||||
|
||||
/**
|
||||
* TODO cleanup and describe.
|
||||
* See reference nr. 28
|
||||
*
|
||||
* @param string $name
|
||||
* @param mixed $value
|
||||
|
@ -29,7 +29,7 @@ use Illuminate\Support\HtmlString;
|
||||
|
||||
/**
|
||||
* Class RuleForm
|
||||
* TODO cleanup and describe.
|
||||
* See reference nr. 31
|
||||
*/
|
||||
class RuleForm
|
||||
{
|
||||
|
@ -73,7 +73,7 @@ trait ChartGeneration
|
||||
$chartData = [];
|
||||
/** @var Account $account */
|
||||
foreach ($accounts as $account) {
|
||||
// TODO we can use getAccountCurrency() instead
|
||||
// See reference nr. 33
|
||||
$currency = $repository->findNull((int)$accountRepos->getMetaValue($account, 'currency_id'));
|
||||
if (null === $currency) {
|
||||
$currency = $default;
|
||||
|
@ -115,7 +115,7 @@ trait ModelInformation
|
||||
*/
|
||||
protected function getTriggersForBill(Bill $bill): array // get info and augument
|
||||
{
|
||||
// TODO duplicated code.
|
||||
// See reference nr. 39
|
||||
$operators = config('firefly.search.operators');
|
||||
$triggers = [];
|
||||
foreach ($operators as $key => $operator) {
|
||||
@ -167,7 +167,7 @@ trait ModelInformation
|
||||
*/
|
||||
private function getTriggersForJournal(TransactionJournal $journal): array
|
||||
{
|
||||
// TODO duplicated code.
|
||||
// See reference nr. 40
|
||||
$operators = config('firefly.search.operators');
|
||||
$triggers = [];
|
||||
foreach ($operators as $key => $operator) {
|
||||
|
@ -38,7 +38,7 @@ use Log;
|
||||
/**
|
||||
* Trait PeriodOverview.
|
||||
*
|
||||
* TODO verify this all works as expected.
|
||||
* See reference nr. 36
|
||||
*
|
||||
* - Always request start date and end date.
|
||||
* - Group expenses, income, etc. under this period.
|
||||
@ -392,7 +392,7 @@ trait PeriodOverview
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO fix date.
|
||||
* See reference nr. 37
|
||||
*
|
||||
* Show period overview for no category view.
|
||||
*
|
||||
|
@ -292,7 +292,7 @@ trait RenderPartialViews
|
||||
*/
|
||||
protected function getCurrentTriggers(Rule $rule): array // get info from object and present.
|
||||
{
|
||||
// TODO duplicated code.
|
||||
// See reference nr. 38
|
||||
$operators = config('firefly.search.operators');
|
||||
$triggers = [];
|
||||
foreach ($operators as $key => $operator) {
|
||||
|
@ -79,7 +79,7 @@ trait RuleManagement
|
||||
*/
|
||||
protected function getPreviousTriggers(Request $request): array
|
||||
{
|
||||
// TODO duplicated code.
|
||||
// See reference nr. 34
|
||||
$operators = config('firefly.search.operators');
|
||||
$triggers = [];
|
||||
foreach ($operators as $key => $operator) {
|
||||
@ -124,7 +124,7 @@ trait RuleManagement
|
||||
*/
|
||||
protected function parseFromOperators(array $submittedOperators): array
|
||||
{
|
||||
// TODO duplicated code.
|
||||
// See reference nr. 35
|
||||
$operators = config('firefly.search.operators');
|
||||
$renderedEntries = [];
|
||||
$triggers = [];
|
||||
|
@ -183,7 +183,7 @@ class Preferences
|
||||
* @param null $default
|
||||
*
|
||||
* @return Preference|null
|
||||
* TODO remove me
|
||||
* See reference nr. 44
|
||||
* @throws FireflyException
|
||||
*/
|
||||
public function getFreshForUser(User $user, string $name, $default = null): ?Preference
|
||||
|
@ -93,7 +93,7 @@ class AmountFormat extends AbstractExtension
|
||||
* Will format the amount by the currency related to the given account.
|
||||
*
|
||||
* @return TwigFunction
|
||||
* TODO remove me when layout v1 is deprecated.
|
||||
* See reference nr. 42
|
||||
*/
|
||||
protected function formatAmountByAccount(): TwigFunction
|
||||
{
|
||||
|
@ -355,7 +355,7 @@ class General extends AbstractExtension
|
||||
|
||||
/**
|
||||
* @return TwigFunction
|
||||
* TODO remove me once layout v1 is deprecated.
|
||||
* See reference nr. 43
|
||||
*/
|
||||
protected function getMetaField(): TwigFunction
|
||||
{
|
||||
|
@ -212,7 +212,7 @@ class AccountTransformer extends AbstractTransformer
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* TODO refactor call to getOpeningBalanceAmount / Date because its extra queries.
|
||||
* See reference nr. 20
|
||||
*/
|
||||
private function getOpeningBalance(Account $account, string $accountType): array
|
||||
{
|
||||
|
@ -34,7 +34,7 @@ class TagTransformer extends AbstractTransformer
|
||||
/**
|
||||
* Transform a tag.
|
||||
*
|
||||
* TODO add spent, earned, transferred, etc.
|
||||
* See reference nr. 21
|
||||
*
|
||||
* @param Tag $tag
|
||||
*
|
||||
|
@ -265,7 +265,7 @@ class FireflyValidator extends Validator
|
||||
$repository = app(BudgetRepositoryInterface::class);
|
||||
$budgets = $repository->getBudgets();
|
||||
// count budgets, should have at least one
|
||||
// TODO no longer need to loop like this
|
||||
// See reference nr. 102
|
||||
$count = $budgets->filter(
|
||||
function (Budget $budget) use ($value) {
|
||||
return $budget->name === $value;
|
||||
@ -448,7 +448,7 @@ class FireflyValidator extends Validator
|
||||
$value = $this->data['name'];
|
||||
|
||||
$set = $user->accounts()->where('account_type_id', $type->id)->get();
|
||||
// TODO no longer need to loop like this
|
||||
// See reference nr. 103
|
||||
/** @var Account $entry */
|
||||
foreach ($set as $entry) {
|
||||
if ($entry->name === $value) {
|
||||
@ -480,7 +480,7 @@ class FireflyValidator extends Validator
|
||||
$accountTypeIds = $accountTypes->pluck('id')->toArray();
|
||||
/** @var Collection $set */
|
||||
$set = auth()->user()->accounts()->whereIn('account_type_id', $accountTypeIds)->where('id', '!=', $ignore)->get();
|
||||
// TODO no longer need to loop like this
|
||||
// See reference nr. 104
|
||||
/** @var Account $entry */
|
||||
foreach ($set as $entry) {
|
||||
if ($entry->name === $value) {
|
||||
@ -504,10 +504,10 @@ class FireflyValidator extends Validator
|
||||
|
||||
/** @var Collection $set */
|
||||
$set = auth()->user()->accounts()->where('account_type_id', $type->id)->where('id', '!=', $ignore)->get();
|
||||
// TODO no longer need to loop like this
|
||||
// See reference nr. 105
|
||||
/** @var Account $entry */
|
||||
foreach ($set as $entry) {
|
||||
// TODO no longer need to loop like this.
|
||||
// See reference nr. 106
|
||||
if ($entry->name === $value) {
|
||||
return false;
|
||||
}
|
||||
@ -718,7 +718,7 @@ class FireflyValidator extends Validator
|
||||
* @param mixed $value
|
||||
* @param mixed $parameters
|
||||
*
|
||||
* TODO this method does not need a for loop
|
||||
* See reference nr. 107
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
|
@ -41,7 +41,7 @@ trait RecurrenceValidation
|
||||
/**
|
||||
* Validate account information input for recurrences which are being updated.
|
||||
*
|
||||
* TODO must always trigger when the type of the recurrence changes.
|
||||
* See reference nr. 101
|
||||
*
|
||||
* @param Validator $validator
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user