Remove unused enums

This commit is contained in:
James Cole
2026-02-20 20:33:13 +01:00
parent c4392f89d1
commit cab298708c
10 changed files with 8 additions and 172 deletions
@@ -61,7 +61,7 @@ class TransactionRequest extends FormRequest
public function rules(): array
{
return ['query' => ['required', 'min:1', 'max:255', 'json', new IsValidBulkClause(ClauseType::TRANSACTION)]];
return ['query' => ['required', 'min:1', 'max:255', 'json', new IsValidBulkClause(ClauseType::TRANSACTION->value)]];
}
public function withValidator(Validator $validator): void
-50
View File
@@ -1,50 +0,0 @@
<?php
/*
* AccountBalance.php
* Copyright (c) 2024 james@firefly-iii.org.
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* 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.
*
* This program is distributed in the hope that it will be useful,
* 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.
*
* 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/.
*/
declare(strict_types=1);
namespace FireflyIII\Entities;
use FireflyIII\Models\Account;
class AccountBalance
{
public string $amount;
public string $currencyId;
public string $id;
public static function fromArray(): self
{
$balance = new self();
$balance->id = (string) random_int(1, 1000);
// $balance->name = (string) random_int(1, 1000);
$balance->amount = (string) random_int(1, 1000);
$balance->currencyId = '1';
return $balance;
}
public function getAccount(): Account
{
return Account::inRandomOrder()->first();
}
}
+4 -4
View File
@@ -27,9 +27,9 @@ namespace FireflyIII\Enums;
/**
* Class ClauseType
*/
class ClauseType
enum ClauseType: string
{
public const string TRANSACTION = 'transaction';
public const string UPDATE = 'update';
public const string WHERE = 'where';
case TRANSACTION = 'transaction';
case UPDATE = 'update';
case WHERE = 'where';
}
-56
View File
@@ -32,62 +32,6 @@ class AccountType extends Model
{
use ReturnsIntegerIdTrait;
/** @deprecated */
#[Deprecated]
public const string ASSET = 'Asset account';
/** @deprecated */
#[Deprecated]
public const string BENEFICIARY = 'Beneficiary account';
/** @deprecated */
#[Deprecated]
public const string CASH = 'Cash account';
/** @deprecated */
#[Deprecated]
public const string CREDITCARD = 'Credit card';
/** @deprecated */
#[Deprecated]
public const string DEBT = 'Debt';
/** @deprecated */
#[Deprecated]
public const string DEFAULT = 'Default account';
/** @deprecated */
#[Deprecated]
public const string EXPENSE = 'Expense account';
/** @deprecated */
#[Deprecated]
public const string IMPORT = 'Import account';
/** @deprecated */
#[Deprecated]
public const string INITIAL_BALANCE = 'Initial balance account';
/** @deprecated */
#[Deprecated]
public const string LIABILITY_CREDIT = 'Liability credit account';
/** @deprecated */
#[Deprecated]
public const string LOAN = 'Loan';
/** @deprecated */
#[Deprecated]
public const string MORTGAGE = 'Mortgage';
/** @deprecated */
#[Deprecated]
public const string RECONCILIATION = 'Reconciliation account';
/** @deprecated */
#[Deprecated]
public const string REVENUE = 'Revenue account';
protected $casts = ['created_at' => 'datetime', 'updated_at' => 'datetime'];
protected $fillable = ['type'];
-12
View File
@@ -39,18 +39,6 @@ class AutoBudget extends Model
use ReturnsIntegerIdTrait;
use SoftDeletes;
/** @deprecated */
#[Deprecated]
public const int AUTO_BUDGET_ADJUSTED = 3;
/** @deprecated */
#[Deprecated]
public const int AUTO_BUDGET_RESET = 1;
/** @deprecated */
#[Deprecated]
public const int AUTO_BUDGET_ROLLOVER = 2;
protected $casts = ['amount' => 'string', 'native_amount' => 'string'];
protected $fillable = ['budget_id', 'amount', 'period', 'native_amount'];
-16
View File
@@ -36,22 +36,6 @@ class RecurrenceRepetition extends Model
use ReturnsIntegerIdTrait;
use SoftDeletes;
/** @deprecated */
#[Deprecated]
public const int WEEKEND_DO_NOTHING = 1;
/** @deprecated */
#[Deprecated]
public const int WEEKEND_SKIP_CREATION = 2;
/** @deprecated */
#[Deprecated]
public const int WEEKEND_TO_FRIDAY = 3;
/** @deprecated */
#[Deprecated]
public const int WEEKEND_TO_MONDAY = 4;
protected $casts = [
'created_at' => 'datetime',
'updated_at' => 'datetime',
-1
View File
@@ -39,7 +39,6 @@ use Illuminate\Database\Eloquent\SoftDeletes;
#[ObservedBy([TransactionObserver::class])]
class Transaction extends Model
{
use HasFactory;
use ReturnsIntegerIdTrait;
use SoftDeletes;
-1
View File
@@ -53,7 +53,6 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
#[ObservedBy([DeletedTransactionJournalObserver::class])]
class TransactionJournal extends Model
{
use HasFactory;
use ReturnsIntegerIdTrait;
use ReturnsIntegerUserIdTrait;
use SoftDeletes;
-28
View File
@@ -36,34 +36,6 @@ class TransactionType extends Model
use ReturnsIntegerIdTrait;
use SoftDeletes;
/** @deprecated */
#[Deprecated]
public const string DEPOSIT = 'Deposit';
/** @deprecated */
#[Deprecated]
public const string INVALID = 'Invalid';
/** @deprecated */
#[Deprecated]
public const string LIABILITY_CREDIT = 'Liability credit';
/** @deprecated */
#[Deprecated]
public const string OPENING_BALANCE = 'Opening balance';
/** @deprecated */
#[Deprecated]
public const string RECONCILIATION = 'Reconciliation';
/** @deprecated */
#[Deprecated]
public const string TRANSFER = 'Transfer';
/** @deprecated */
#[Deprecated]
public const string WITHDRAWAL = 'Withdrawal';
protected $casts = ['created_at' => 'datetime', 'updated_at' => 'datetime', 'deleted_at' => 'datetime'];
protected $fillable = ['type'];
+3 -3
View File
@@ -25,11 +25,11 @@ declare(strict_types=1);
use FireflyIII\Enums\ClauseType;
return [
ClauseType::TRANSACTION => [
ClauseType::WHERE => [
ClauseType::TRANSACTION->value => [
ClauseType::WHERE->value => [
'account_id' => 'required|numeric|belongsToUser:accounts,id',
],
ClauseType::UPDATE => [
ClauseType::UPDATE->value => [
'account_id' => 'required|numeric|belongsToUser:accounts,id',
],
],