From aec70cf6a05ed5114d6419542a1d9f3a7cf3db18 Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 12 Mar 2021 06:11:50 +0100 Subject: [PATCH] Add invalid transaction type. --- app/Models/TransactionType.php | 25 +++------------------- database/seeders/TransactionTypeSeeder.php | 1 + 2 files changed, 4 insertions(+), 22 deletions(-) diff --git a/app/Models/TransactionType.php b/app/Models/TransactionType.php index 1d159ca24a..7f3f9f5c23 100644 --- a/app/Models/TransactionType.php +++ b/app/Models/TransactionType.php @@ -57,39 +57,20 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; class TransactionType extends Model { use SoftDeletes; - - /** - * - */ public const WITHDRAWAL = 'Withdrawal'; - /** - * - */ public const DEPOSIT = 'Deposit'; - /** - * - */ public const TRANSFER = 'Transfer'; - /** - * - */ public const OPENING_BALANCE = 'Opening balance'; - /** - * - */ public const RECONCILIATION = 'Reconciliation'; - /** - * The attributes that should be casted to native types. - * - * @var array - */ + public const INVALID = 'Invalid'; + /** @var string[] */ protected $casts = [ 'created_at' => 'datetime', 'updated_at' => 'datetime', 'deleted_at' => 'datetime', ]; - /** @var array Fields that can be filled */ + /** @var string[] */ protected $fillable = ['type']; /** diff --git a/database/seeders/TransactionTypeSeeder.php b/database/seeders/TransactionTypeSeeder.php index 412246a673..97eb6c19d0 100644 --- a/database/seeders/TransactionTypeSeeder.php +++ b/database/seeders/TransactionTypeSeeder.php @@ -39,6 +39,7 @@ class TransactionTypeSeeder extends Seeder TransactionType::TRANSFER, TransactionType::OPENING_BALANCE, TransactionType::RECONCILIATION, + TransactionType::INVALID ]; foreach ($types as $type) {