mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-17 01:42:19 +00:00
Expand types.
This commit is contained in:
@@ -38,6 +38,8 @@ class AccountType extends Model
|
||||
const INITIAL_BALANCE = 'Initial balance account';
|
||||
const BENEFICIARY = 'Beneficiary account';
|
||||
const IMPORT = 'Import account';
|
||||
const RECONCILIATION = 'Reconciliation account';
|
||||
const LOAN = 'Loan';
|
||||
|
||||
/**
|
||||
* The attributes that should be casted to native types.
|
||||
|
@@ -37,6 +37,7 @@ class TransactionType extends Model
|
||||
const DEPOSIT = 'Deposit';
|
||||
const TRANSFER = 'Transfer';
|
||||
const OPENING_BALANCE = 'Opening balance';
|
||||
const RECONCILIATION = 'Reconciliation';
|
||||
|
||||
/**
|
||||
* The attributes that should be casted to native types.
|
||||
@@ -58,13 +59,13 @@ class TransactionType extends Model
|
||||
public static function routeBinder(string $type)
|
||||
{
|
||||
if (!auth()->check()) {
|
||||
throw new NotFoundHttpException;
|
||||
throw new NotFoundHttpException();
|
||||
}
|
||||
$transactionType = self::where('type', ucfirst($type))->first();
|
||||
if (null !== $transactionType) {
|
||||
return $transactionType;
|
||||
}
|
||||
throw new NotFoundHttpException;
|
||||
throw new NotFoundHttpException();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -21,14 +21,15 @@ class AccountTypeSeeder extends Seeder
|
||||
{
|
||||
public function run()
|
||||
{
|
||||
AccountType::create(['type' => 'Default account']);
|
||||
AccountType::create(['type' => 'Cash account']);
|
||||
AccountType::create(['type' => 'Asset account']);
|
||||
AccountType::create(['type' => 'Expense account']);
|
||||
AccountType::create(['type' => 'Revenue account']);
|
||||
AccountType::create(['type' => 'Initial balance account']);
|
||||
AccountType::create(['type' => 'Beneficiary account']);
|
||||
AccountType::create(['type' => 'Import account']);
|
||||
AccountType::create(['type' => 'Loan']);
|
||||
AccountType::create(['type' => AccountType::DEFAULT]);
|
||||
AccountType::create(['type' => AccountType::CASH]);
|
||||
AccountType::create(['type' => AccountType::ASSET]);
|
||||
AccountType::create(['type' => AccountType::EXPENSE]);
|
||||
AccountType::create(['type' => AccountType::REVENUE]);
|
||||
AccountType::create(['type' => AccountType::INITIAL_BALANCE]);
|
||||
AccountType::create(['type' => AccountType::BENEFICIARY]);
|
||||
AccountType::create(['type' => AccountType::IMPORT]);
|
||||
AccountType::create(['type' => AccountType::LOAN]);
|
||||
AccountType::create(['type' => AccountType::RECONCILIATION]);
|
||||
}
|
||||
}
|
||||
|
@@ -25,5 +25,6 @@ class TransactionTypeSeeder extends Seeder
|
||||
TransactionType::create(['type' => TransactionType::DEPOSIT]);
|
||||
TransactionType::create(['type' => TransactionType::TRANSFER]);
|
||||
TransactionType::create(['type' => TransactionType::OPENING_BALANCE]);
|
||||
TransactionType::create(['type' => TransactionType::RECONCILIATION]);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user