Skip to content

Firefly III: a personal finances manager

Move account types to enum class.

James Cole641683d4310d
diff --git a/app/Enums/AccountTypeEnum.php b/app/Enums/AccountTypeEnum.php
new file mode 100644
index 0000000000..48ea7741fd
--- /dev/null
+++ b/app/Enums/AccountTypeEnum.php
@@ -0,0 +1,44 @@
+<?php
+/*
+ * AccountTypeEnum.php
+ * Copyright (c) 2022 [email protected]
+ *
+ * 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/>.
+ */
+
+namespace FireflyIII\Enums;
+
+/**
+ * enum AccountTypeEnum
+ */
+enum AccountTypeEnum: string
+{
+ case ASSET = 'Asset account';
+ case BENEFICIARY = 'Beneficiary account';
+ case CASH = 'Cash account';
+ case CREDITCARD = 'Credit card';
+ case DEBT = 'Debt';
+ case DEFAULT = 'Default account';
+ case EXPENSE = 'Expense account';
+ case IMPORT = 'Import account';
+ case INITIAL_BALANCE = 'Initial balance account';
+ case LIABILITY_CREDIT = 'Liability credit account';
+ case LOAN = 'Loan';
+ case MORTGAGE = 'Mortgage';
+ case RECONCILIATION = 'Reconciliation account';
+ case REVENUE = 'Revenue account';
+
+}
\ No newline at end of file
diff --git a/app/Models/AccountType.php b/app/Models/AccountType.php
index 859ff0b710..1f3abaf1b9 100644
--- a/app/Models/AccountType.php
+++ b/app/Models/AccountType.php
@@ -49,34 +49,6 @@ use Illuminate\Support\Carbon;
*/
class AccountType extends Model
{
- /** @var string */
- public const ASSET = 'Asset account';
- /** @var string */
- public const BENEFICIARY = 'Beneficiary account';
- /** @var string */
- public const CASH = 'Cash account';
- /** @var string */
- public const CREDITCARD = 'Credit card';
- /** @var string */
- public const DEBT = 'Debt';
- /** @var string */
- public const DEFAULT = 'Default account';
- /** @var string */
- public const EXPENSE = 'Expense account';
- /** @var string */
- public const IMPORT = 'Import account';
- /** @var string */
- public const INITIAL_BALANCE = 'Initial balance account';
- /** @var string */
- public const LIABILITY_CREDIT = 'Liability credit account';
- /** @var string */
- public const LOAN = 'Loan';
- /** @var string */
- public const MORTGAGE = 'Mortgage';
- /** @var string */
- public const RECONCILIATION = 'Reconciliation account';
- /** @var string */
- public const REVENUE = 'Revenue account';
/**
* The attributes that should be casted to native types.
*