Add fare type for pax/cargo/mixed flights #621 (#623)

This commit is contained in:
Nabeel S
2020-03-06 15:10:03 -05:00
committed by GitHub
parent 9f3ddd5dbd
commit 632c5782de
12 changed files with 150 additions and 46 deletions

View File

@@ -0,0 +1,16 @@
<?php
namespace App\Models\Enums;
use App\Contracts\Enum;
class FareType extends Enum
{
public const PASSENGER = 0;
public const CARGO = 1;
public static $labels = [
self::PASSENGER => 'Passenger',
self::CARGO => 'Cargo',
];
}

View File

@@ -78,4 +78,9 @@ class Expense extends Model
{
return $this->belongsTo(Airline::class, 'airline_id');
}
public function ref_model()
{
return $this->morphTo();
}
}

View File

@@ -11,6 +11,7 @@ use App\Contracts\Model;
* @property int code
* @property int capacity
* @property int count Only when merged with pivot
* @property int type
* @property string notes
* @property bool active
*/
@@ -32,12 +33,14 @@ class Fare extends Model
'price' => 'float',
'cost' => 'float',
'capacity' => 'integer',
'type' => 'integer',
'active' => 'boolean',
];
public static $rules = [
'code' => 'required',
'name' => 'required',
'type' => 'required',
];
/**