@@ -22,20 +22,22 @@ $factory->define(App\Models\Flight::class, function (Faker $faker) {
|
||||
'alt_airport_id' => function () {
|
||||
return factory(App\Models\Airport::class)->create()->id;
|
||||
},
|
||||
'distance' => $faker->numberBetween(1, 1000),
|
||||
'route' => null,
|
||||
'level' => 0,
|
||||
'dpt_time' => $faker->time(),
|
||||
'arr_time' => $faker->time(),
|
||||
'flight_time' => $faker->numberBetween(60, 360),
|
||||
'has_bid' => false,
|
||||
'active' => true,
|
||||
'visible' => true,
|
||||
'days' => 0,
|
||||
'start_date' => null,
|
||||
'end_date' => null,
|
||||
'created_at' => $faker->dateTimeBetween('-1 week', 'now'),
|
||||
'updated_at' => static function (array $flight) {
|
||||
'distance' => $faker->numberBetween(1, 1000),
|
||||
'route' => null,
|
||||
'level' => 0,
|
||||
'dpt_time' => $faker->time(),
|
||||
'arr_time' => $faker->time(),
|
||||
'flight_time' => $faker->numberBetween(60, 360),
|
||||
'load_factor' => $faker->randomElement([15, 20, 50, 90, 100]),
|
||||
'load_factor_variance' => $faker->randomElement([15, 20, 50, 90, 100]),
|
||||
'has_bid' => false,
|
||||
'active' => true,
|
||||
'visible' => true,
|
||||
'days' => 0,
|
||||
'start_date' => null,
|
||||
'end_date' => null,
|
||||
'created_at' => $faker->dateTimeBetween('-1 week', 'now'),
|
||||
'updated_at' => static function (array $flight) {
|
||||
return $flight['created_at'];
|
||||
},
|
||||
];
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class FlightsAddLoadFactor extends Migration
|
||||
{
|
||||
/**
|
||||
* Add a `load_factor` and `load_factor_variance` columns to the expenses table
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('flights', function (Blueprint $table) {
|
||||
$table->decimal('load_factor', 5, 2)
|
||||
->nullable()
|
||||
->after('flight_type');
|
||||
|
||||
$table->decimal('load_factor_variance', 5, 2)
|
||||
->nullable()
|
||||
->after('load_factor');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('flights', function (Blueprint $table) {
|
||||
$table->dropColumn('load_factor');
|
||||
$table->dropColumn('load_factor_variance');
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -124,7 +124,16 @@ airports:
|
||||
lat: 25.2528
|
||||
lon: 55.3644
|
||||
ground_handling_cost: 50
|
||||
|
||||
- id: OMAA
|
||||
iata: AUH
|
||||
icao: OMAA
|
||||
name: Abu Dhabi International Airport
|
||||
location: Abu Dhabi
|
||||
country:
|
||||
timezone: Asia/Dubai
|
||||
lat: 24.433
|
||||
lon: 54.6511
|
||||
ground_handling_cost: 50
|
||||
#
|
||||
aircraft:
|
||||
- id: 1
|
||||
@@ -283,6 +292,7 @@ flights:
|
||||
arr_time: 11PM EST
|
||||
flight_time: 240
|
||||
flight_type: J
|
||||
load_factor: 100
|
||||
created_at: NOW
|
||||
updated_at: NOW
|
||||
- id: flightid_3
|
||||
@@ -294,6 +304,7 @@ flights:
|
||||
arr_airport_id: KJFK
|
||||
flight_time: 480
|
||||
flight_type: J
|
||||
load_factor: 63
|
||||
dpt_time: 9AM CST
|
||||
arr_time: 1030AM CST
|
||||
route: PITZZ4 MNURE WLEEE4
|
||||
@@ -308,6 +319,37 @@ flights:
|
||||
arr_airport_id: MWCR
|
||||
flight_time: 70
|
||||
flight_type: 'J'
|
||||
load_factor: 80
|
||||
dpt_time: '0800'
|
||||
arr_time: '0900'
|
||||
route: 'MLY5 KEMBO UG442 SIA UG633 OTEKO UR640 NALRO GUBEL3'
|
||||
created_at: NOW
|
||||
updated_at: NOW
|
||||
- id: flightid_5
|
||||
airline_id: 1
|
||||
flight_number: 112
|
||||
route_code:
|
||||
route_leg:
|
||||
dpt_airport_id: OMAA
|
||||
arr_airport_id: OMDB
|
||||
flight_time: 30
|
||||
flight_type: 'J'
|
||||
load_factor:
|
||||
dpt_time: '0800'
|
||||
arr_time: '0900'
|
||||
route: 'MLY5 KEMBO UG442 SIA UG633 OTEKO UR640 NALRO GUBEL3'
|
||||
created_at: NOW
|
||||
updated_at: NOW
|
||||
- id: flightid_6
|
||||
airline_id: 1
|
||||
flight_number: 113
|
||||
route_code:
|
||||
route_leg:
|
||||
dpt_airport_id: OMDB
|
||||
arr_airport_id: OMAA
|
||||
flight_time: 30
|
||||
flight_type: 'J'
|
||||
load_factor: 100
|
||||
dpt_time: '0800'
|
||||
arr_time: '0900'
|
||||
route: 'MLY5 KEMBO UG442 SIA UG633 OTEKO UR640 NALRO GUBEL3'
|
||||
@@ -467,12 +509,8 @@ pirep_fares:
|
||||
|
||||
pirep_fields:
|
||||
- id: 1
|
||||
name: departure terminal
|
||||
slug: departure-terminal
|
||||
required: 1
|
||||
- id: 2
|
||||
name: arrival terminal
|
||||
slug: arrival-terminal
|
||||
name: Cost Index
|
||||
slug: cost-index
|
||||
required: 0
|
||||
|
||||
pirep_field_values:
|
||||
|
||||
@@ -138,6 +138,20 @@
|
||||
options: ''
|
||||
type: int
|
||||
description: 'Number of hours to expire bids after'
|
||||
- key: flights.default_load_factor
|
||||
name: 'Load Factor'
|
||||
group: flights
|
||||
value: 82
|
||||
options: ''
|
||||
type: number
|
||||
description: 'The default load factor for a flight, as a percent'
|
||||
- key: flights.load_factor_variance
|
||||
name: 'Load Factor Variance'
|
||||
group: flights
|
||||
value: 5
|
||||
options: ''
|
||||
type: number
|
||||
description: 'How much the load factor can vary per-flight'
|
||||
- key: pireps.duplicate_check_time
|
||||
name: 'PIREP duplicate time check'
|
||||
group: pireps
|
||||
|
||||
@@ -5,12 +5,13 @@ namespace App\Http\Resources;
|
||||
use App\Support\Units\Distance;
|
||||
use stdClass;
|
||||
|
||||
/**
|
||||
* @mixin \App\Models\Flight
|
||||
*/
|
||||
class Flight extends Response
|
||||
{
|
||||
/**
|
||||
* Set the fields on the flight object
|
||||
*
|
||||
* @mixin \App\Models\Flight
|
||||
*/
|
||||
private function setFields()
|
||||
{
|
||||
@@ -42,6 +43,14 @@ class Flight extends Response
|
||||
|
||||
$res['ident'] = $this->ident;
|
||||
|
||||
if (empty($res['load_factor'])) {
|
||||
$res['load_factor'] = setting('flights.default_load_factor');
|
||||
}
|
||||
|
||||
if (empty($res['load_factor_variance'])) {
|
||||
$res['load_factor_variance'] = setting('flights.load_factor_variance');
|
||||
}
|
||||
|
||||
$distance = new Distance($res['distance'], config('phpvms.internal_units.distance'));
|
||||
$res['distance'] = $distance->getResponseUnits();
|
||||
|
||||
|
||||
@@ -26,6 +26,8 @@ use Illuminate\Support\Collection;
|
||||
* @property int flight_time
|
||||
* @property string route
|
||||
* @property int level
|
||||
* @property float load_factor
|
||||
* @property float load_factor_variance
|
||||
* @property Airport dpt_airport
|
||||
* @property Airport arr_airport
|
||||
* @property Airport alt_airport
|
||||
@@ -65,6 +67,8 @@ class Flight extends Model
|
||||
'distance',
|
||||
'flight_time',
|
||||
'flight_type',
|
||||
'load_factor',
|
||||
'load_factor_variance',
|
||||
'route',
|
||||
'notes',
|
||||
'start_date',
|
||||
@@ -75,27 +79,31 @@ class Flight extends Model
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'flight_number' => 'integer',
|
||||
'days' => 'integer',
|
||||
'level' => 'integer',
|
||||
'distance' => 'float',
|
||||
'flight_time' => 'integer',
|
||||
'start_date' => 'date',
|
||||
'end_date' => 'date',
|
||||
'has_bid' => 'boolean',
|
||||
'route_leg' => 'integer',
|
||||
'active' => 'boolean',
|
||||
'visible' => 'boolean',
|
||||
'flight_number' => 'integer',
|
||||
'days' => 'integer',
|
||||
'level' => 'integer',
|
||||
'distance' => 'float',
|
||||
'flight_time' => 'integer',
|
||||
'start_date' => 'date',
|
||||
'end_date' => 'date',
|
||||
'load_factor' => 'double',
|
||||
'load_factor_variance' => 'double',
|
||||
'has_bid' => 'boolean',
|
||||
'route_leg' => 'integer',
|
||||
'active' => 'boolean',
|
||||
'visible' => 'boolean',
|
||||
];
|
||||
|
||||
public static $rules = [
|
||||
'airline_id' => 'required|exists:airlines,id',
|
||||
'flight_number' => 'required',
|
||||
'route_code' => 'nullable',
|
||||
'route_leg' => 'nullable',
|
||||
'dpt_airport_id' => 'required|exists:airports,id',
|
||||
'arr_airport_id' => 'required|exists:airports,id',
|
||||
'level' => 'nullable',
|
||||
'airline_id' => 'required|exists:airlines,id',
|
||||
'flight_number' => 'required',
|
||||
'route_code' => 'nullable',
|
||||
'route_leg' => 'nullable',
|
||||
'dpt_airport_id' => 'required|exists:airports,id',
|
||||
'arr_airport_id' => 'required|exists:airports,id',
|
||||
'load_factor' => 'nullable|numeric',
|
||||
'load_factor_variance' => 'nullable|numeric',
|
||||
'level' => 'nullable',
|
||||
];
|
||||
|
||||
/**
|
||||
|
||||
@@ -25,6 +25,7 @@ class ExpenseImporter extends ImportExport
|
||||
'name' => 'required',
|
||||
'amount' => 'required|numeric',
|
||||
'type' => 'required',
|
||||
'flight_type' => 'nullable',
|
||||
'charge_to_user' => 'nullable|boolean',
|
||||
'multiplier' => 'nullable|numeric',
|
||||
'active' => 'nullable|boolean',
|
||||
|
||||
@@ -25,26 +25,28 @@ class FlightImporter extends ImportExport
|
||||
* Should match the database fields, for the most part
|
||||
*/
|
||||
public static $columns = [
|
||||
'airline' => 'required',
|
||||
'flight_number' => 'required',
|
||||
'route_code' => 'nullable',
|
||||
'route_leg' => 'nullable',
|
||||
'dpt_airport' => 'required',
|
||||
'arr_airport' => 'required',
|
||||
'alt_airport' => 'nullable',
|
||||
'days' => 'nullable',
|
||||
'dpt_time' => 'nullable',
|
||||
'arr_time' => 'nullable',
|
||||
'level' => 'nullable|integer',
|
||||
'distance' => 'nullable|numeric',
|
||||
'flight_time' => 'required|integer',
|
||||
'flight_type' => 'required|alpha',
|
||||
'route' => 'nullable',
|
||||
'notes' => 'nullable',
|
||||
'active' => 'nullable|boolean',
|
||||
'subfleets' => 'nullable',
|
||||
'fares' => 'nullable',
|
||||
'fields' => 'nullable',
|
||||
'airline' => 'required',
|
||||
'flight_number' => 'required',
|
||||
'route_code' => 'nullable',
|
||||
'route_leg' => 'nullable',
|
||||
'dpt_airport' => 'required',
|
||||
'arr_airport' => 'required',
|
||||
'alt_airport' => 'nullable',
|
||||
'days' => 'nullable',
|
||||
'dpt_time' => 'nullable',
|
||||
'arr_time' => 'nullable',
|
||||
'level' => 'nullable|integer',
|
||||
'distance' => 'nullable|numeric',
|
||||
'flight_time' => 'required|integer',
|
||||
'flight_type' => 'required|alpha',
|
||||
'load_factor' => 'nullable',
|
||||
'load_factor_variance' => 'nullable',
|
||||
'route' => 'nullable',
|
||||
'notes' => 'nullable',
|
||||
'active' => 'nullable|boolean',
|
||||
'subfleets' => 'nullable',
|
||||
'fares' => 'nullable',
|
||||
'fields' => 'nullable',
|
||||
];
|
||||
|
||||
private $airportSvc;
|
||||
|
||||
@@ -307,3 +307,17 @@ if (!function_exists('_fmt')) {
|
||||
return $line;
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('docs_link')) {
|
||||
/**
|
||||
* Return a link to the docs
|
||||
*
|
||||
* @param string $key Key from phpvms.config.docs
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function docs_link($key)
|
||||
{
|
||||
return config('phpvms.docs.root').config('phpvms.docs.'.$key);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -109,6 +109,11 @@ return [
|
||||
* The links to various docs on the documentation site
|
||||
*/
|
||||
'docs' => [
|
||||
'cron' => 'http://docs.phpvms.net/configuration/cron',
|
||||
'root' => 'http://docs.phpvms.net',
|
||||
'cron' => '/configuration/cron',
|
||||
'finances' => '/concepts/finances',
|
||||
'importing_legacy' => '/setup/importing-from-v2-v5',
|
||||
'load_factor' => '/operations/flights#load-factor',
|
||||
'subfleets' => '/concepts/basics#subfleets-and-aircraft',
|
||||
],
|
||||
];
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<li>The first user's password (admin) will be "admin". Please change it after logging in</li>
|
||||
<li>User passwords will be reset and they will need to use "Forgot Password" to reset it</li>
|
||||
<li>If you have more than 1000 PIREPs or flights, it's best to use the command-line importer!
|
||||
<a href="http://docs.phpvms.net/setup/importing-from-v2-v5" target="_blank">Click here</a> to
|
||||
<a href="{{ docs_link('importing_legacy') }}" target="_blank">Click here</a> to
|
||||
see the documentation of how to use it.
|
||||
</li>
|
||||
<li><strong>THIS WILL WIPE OUT YOUR EXISTING DATA</strong> - this is required to make sure that things like
|
||||
|
||||
@@ -28,7 +28,8 @@ class AppServiceProvider extends ServiceProvider
|
||||
], 'config');
|
||||
|
||||
$this->mergeConfigFrom(
|
||||
__DIR__.'/../Config/config.php', 'vacentral'
|
||||
__DIR__.'/../Config/config.php',
|
||||
'vacentral'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<div class="alert alert-danger" role="alert">
|
||||
There was a problem running the cron; make sure it's setup and check logs at
|
||||
<span class="text-monospace bg-gradient-dark">storage/logs/cron.log</span>.
|
||||
<a href="{{ config('phpvms.docs.cron') }}" target="_blank">See the docs</a>
|
||||
<a href="{{ docs_link('cron') }}" target="_blank">See the docs</a>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
|
||||
@@ -6,8 +6,7 @@
|
||||
the values used come from the subfleet of the aircraft that the flight is
|
||||
filed with. Only assign the fares you want to override. They can be set as
|
||||
a monetary amount, or a percentage.
|
||||
<a href="http://docs.phpvms.net/concepts/finances"
|
||||
target="_blank">Read documentation about finances</a>.
|
||||
<a href="{{ docs_link('finances') }}" target="_blank">Read documentation about finances</a>.
|
||||
@endcomponent
|
||||
|
||||
<p class="text-danger">{{ $errors->first('value') }}</p>
|
||||
|
||||
@@ -99,25 +99,28 @@
|
||||
{{-- NEXT ROW --}}
|
||||
|
||||
<div class="row">
|
||||
<div class="form-group col-sm-3">
|
||||
{{ Form::label('dpt_time', 'Departure Time:') }}
|
||||
{{ Form::text('dpt_time', null, ['class' => 'form-control']) }}
|
||||
<p class="text-danger">{{ $errors->first('dpt_time') }}</p>
|
||||
<div class="form-group col-sm-4">
|
||||
{{ Form::label('load_factor', 'Load Factor:') }}
|
||||
{{ Form::text('load_factor', null, ['class' => 'form-control']) }}
|
||||
<p class="text-danger">{{ $errors->first('load_factor') }}</p>
|
||||
@component('admin.components.info')
|
||||
Value between 1 and 100. See
|
||||
<a href="{{ docs_link('load_factor') }}" target="_blank">docs</a>.
|
||||
Leave blank to use the default value.
|
||||
@endcomponent
|
||||
</div>
|
||||
|
||||
<div class="form-group col-sm-3">
|
||||
{{ Form::label('arr_time', 'Arrival Time:') }}
|
||||
{{ Form::text('arr_time', null, ['class' => 'form-control']) }}
|
||||
<p class="text-danger">{{ $errors->first('arr_time') }}</p>
|
||||
<div class="form-group col-sm-4">
|
||||
{{ Form::label('load_factor_variance', 'Load Factor Variance:') }}
|
||||
{{ Form::text('load_factor_variance', null, ['class' => 'form-control']) }}
|
||||
<p class="text-danger">{{ $errors->first('load_factor_variance') }}</p>
|
||||
@component('admin.components.info')
|
||||
How much the load factor can vary per flight (+ or -). Leave blank to
|
||||
use the default value.
|
||||
@endcomponent
|
||||
</div>
|
||||
|
||||
<div class="form-group col-sm-3">
|
||||
{{ Form::label('level', 'Flight Level:') }}
|
||||
{{ Form::text('level', null, ['class' => 'form-control']) }}
|
||||
<p class="text-danger">{{ $errors->first('level') }}</p>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-sm-3">
|
||||
<div class="form-group col-sm-4">
|
||||
{{ Form::label('distance', 'Distance:') }} <span class="description small">in nautical miles</span>
|
||||
<a href="#" class="airport_distance_lookup">Calculate</a>
|
||||
{{ Form::text('distance', null, ['id' => 'distance', 'class' => 'form-control']) }}
|
||||
@@ -185,6 +188,20 @@
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="form-group col-sm-4">
|
||||
{{ Form::label('dpt_time', 'Departure Time:') }}
|
||||
{{ Form::text('dpt_time', null, ['class' => 'form-control']) }}
|
||||
<p class="text-danger">{{ $errors->first('dpt_time') }}</p>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-sm-4">
|
||||
{{ Form::label('arr_time', 'Arrival Time:') }}
|
||||
{{ Form::text('arr_time', null, ['class' => 'form-control']) }}
|
||||
<p class="text-danger">{{ $errors->first('arr_time') }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -206,6 +223,14 @@
|
||||
<p class="text-danger">{{ $errors->first('route') }}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-container-body row">
|
||||
<div class="form-group col-sm-4">
|
||||
{{ Form::label('level', 'Flight Level:') }}
|
||||
{{ Form::text('level', null, ['class' => 'form-control']) }}
|
||||
<p class="text-danger">{{ $errors->first('level') }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<div class="alert alert-danger" role="alert">
|
||||
There was a problem running the cron; make sure it's setup and check logs at
|
||||
<span class="text-monospace bg-gradient-dark">storage/logs/cron.log</span>.
|
||||
<a href="{{ config('phpvms.docs.cron') }}" target="_blank">See the docs</a>
|
||||
<a href="{{ docs_link('cron') }}" target="_blank">See the docs</a>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
@@ -5,10 +5,7 @@
|
||||
group aircraft together by feature, so 737s with winglets might have a type of
|
||||
"B.738-WL". You can create as many as you want, you need at least one, though.
|
||||
|
||||
Read more about subfleets <a
|
||||
href="http://docs.phpvms.net/concepts/basics#subfleets-and-aircraft"
|
||||
target="_new">here</a>.
|
||||
|
||||
Read more about subfleets <a href="{{ docs_link('finances') }}" target="_new">here</a>.
|
||||
@endcomponent
|
||||
</div>
|
||||
|
||||
|
||||
@@ -435,7 +435,9 @@ class FinanceTest extends TestCase
|
||||
// Change to a percentage
|
||||
$manual_pay_rate = '50%';
|
||||
$manual_pay_adjusted = Math::addPercent(
|
||||
$rank->manual_base_pay_rate, $manual_pay_rate);
|
||||
$rank->manual_base_pay_rate,
|
||||
$manual_pay_rate
|
||||
);
|
||||
|
||||
$this->fleetSvc->addSubfleetToRank($subfleet['subfleet'], $rank, [
|
||||
'manual_pay' => $manual_pay_rate,
|
||||
|
||||
@@ -27,15 +27,18 @@ class FlightTest extends TestCase
|
||||
/**
|
||||
* Add a single flight
|
||||
*
|
||||
* @param $user
|
||||
* @param $user
|
||||
* @param array $flight_properties
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function addFlight($user)
|
||||
public function addFlight($user, $flight_properties = [])
|
||||
{
|
||||
$flight = factory(App\Models\Flight::class)->create([
|
||||
$opts = array_merge([
|
||||
'airline_id' => $user->airline_id,
|
||||
]);
|
||||
], $flight_properties);
|
||||
|
||||
$flight = factory(App\Models\Flight::class)->create($opts);
|
||||
|
||||
$flight->subfleets()->syncWithoutDetaching([
|
||||
factory(App\Models\Subfleet::class)->create([
|
||||
@@ -119,7 +122,10 @@ class FlightTest extends TestCase
|
||||
public function testGetFlight()
|
||||
{
|
||||
$this->user = factory(App\Models\User::class)->create();
|
||||
$flight = $this->addFlight($this->user);
|
||||
$flight = $this->addFlight($this->user, [
|
||||
'load_factor' => '',
|
||||
'load_factor_variance' => '',
|
||||
]);
|
||||
|
||||
$req = $this->get('/api/flights/'.$flight->id);
|
||||
$req->assertStatus(200);
|
||||
@@ -128,6 +134,7 @@ class FlightTest extends TestCase
|
||||
$this->assertEquals($flight->id, $body['id']);
|
||||
$this->assertEquals($flight->dpt_airport_id, $body['dpt_airport_id']);
|
||||
$this->assertEquals($flight->arr_airport_id, $body['arr_airport_id']);
|
||||
$this->assertEquals(setting('flights.default_load_factor'), $body['load_factor']);
|
||||
|
||||
// Distance conversion
|
||||
$this->assertHasKeys($body['distance'], ['mi', 'nmi', 'km']);
|
||||
@@ -167,6 +174,12 @@ class FlightTest extends TestCase
|
||||
$flight->route = $route_text;
|
||||
$flight->save();
|
||||
|
||||
$req = $this->get('/api/flights/'.$flight->id);
|
||||
$req->assertStatus(200);
|
||||
|
||||
$body = $req->json()['data'];
|
||||
$this->assertEquals($flight->load_factor, $body['load_factor']);
|
||||
|
||||
$res = $this->get('/api/flights/'.$flight->id.'/route');
|
||||
$res->assertStatus(200);
|
||||
$body = $res->json();
|
||||
|
||||
@@ -27,7 +27,8 @@ class MetarTest extends TestCase
|
||||
private function mockXmlResponse($filename)
|
||||
{
|
||||
$mock = new MockHandler([
|
||||
new Response(200,
|
||||
new Response(
|
||||
200,
|
||||
[
|
||||
'Content-Type' => 'text/xml',
|
||||
],
|
||||
@@ -85,7 +86,8 @@ class MetarTest extends TestCase
|
||||
$this->assertCount(4, $parsed['clouds']);
|
||||
$this->assertEquals(
|
||||
'A few at 1676 meters; scattered at 2896 meters; broken sky at 3353 meters; broken sky at 7010 meters',
|
||||
$parsed['clouds_report']);
|
||||
$parsed['clouds_report']
|
||||
);
|
||||
$this->assertEquals(1676.4, $parsed['cloud_height']['m']);
|
||||
$this->assertEquals(false, $parsed['cavok']);
|
||||
|
||||
|
||||
@@ -135,7 +135,8 @@ class TestCase extends Illuminate\Foundation\Testing\TestCase
|
||||
public function mockGuzzleClient($mockFile): void
|
||||
{
|
||||
$mock = new MockHandler([
|
||||
new Response(200,
|
||||
new Response(
|
||||
200,
|
||||
[
|
||||
'Content-Type' => 'application/json; charset=utf-8',
|
||||
],
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
airline,name,amount,type,charge_to_user,multiplier,active,ref_model,ref_model_id
|
||||
,"Per-Flight (no muliplier)",100,F,0,0,1,,
|
||||
,"Per-Flight (multiplier)",100,F,0,1,1,,
|
||||
VMS,"Per-Flight (multiplier, on airline)",200,F,0,1,1,,
|
||||
,"A daily fee",800,D,0,0,1,,
|
||||
,"A monthly fee",5000,M,0,0,1,,
|
||||
,Catering,1000,F,0,0,1,Subfleet,744-3X-RB211
|
||||
,"Catering Staff",1000,D,0,0,1,Subfleet,744-3X-RB211
|
||||
,Maintenance,1000,D,0,0,1,App\Models\Aircraft,001Z
|
||||
airline,name,amount,type,flight_type,charge_to_user,multiplier,active,ref_model,ref_model_id
|
||||
,"Per-Flight (no muliplier)",100,F,,0,0,1,,
|
||||
,"Per-Flight (multiplier)",100,F,,0,1,1,,
|
||||
VMS,"Per-Flight (multiplier, on airline)",200,F,,0,1,1,,
|
||||
,"A daily fee",800,D,,0,0,1,,
|
||||
,"A monthly fee",5000,M,,0,0,1,,
|
||||
,Catering,1000,F,J,0,0,1,Subfleet,744-3X-RB211
|
||||
,"Catering Staff",1000,D,J,0,0,1,Subfleet,744-3X-RB211
|
||||
,Maintenance,1000,D,F,0,0,1,App\Models\Aircraft,001Z
|
||||
|
||||
|
@@ -1,11 +1,11 @@
|
||||
airline,name,amount,type,charge_to_user,multiplier,active,ref_model,ref_model_id
|
||||
,"Per-Flight (no muliplier)",100,F,0,0,1,,
|
||||
,"Per-Flight (multiplier)",100,F,0,1,1,,
|
||||
VMS,"Per-Flight (multiplier, on airline)",200,F,0,1,1,,
|
||||
,"A daily fee",800,D,0,0,1,,
|
||||
,"A monthly fee",5000,M,0,0,1,,
|
||||
,Catering,1000,F,0,0,1,Subfleet,744-3X-RB211
|
||||
,"Catering Staff",1000,D,0,0,1,Subfleet,744-3X-RB211
|
||||
,Maintenance,1000,D,0,0,1,App\Models\Aircraft,001Z
|
||||
airline,name,amount,type,flight_type,charge_to_user,multiplier,active,ref_model,ref_model_id
|
||||
,"Per-Flight (no muliplier)",100,F,,0,0,1,,
|
||||
,"Per-Flight (multiplier)",100,F,,0,1,1,,
|
||||
VMS,"Per-Flight (multiplier, on airline)",200,F,,0,1,1,,
|
||||
,"A daily fee",800,D,,0,0,1,,
|
||||
,"A monthly fee",5000,M,,0,0,1,,
|
||||
,Catering,1000,F,,0,0,1,Subfleet,744-3X-RB211
|
||||
,"Catering Staff",1000,D,,0,0,1,Subfleet,744-3X-RB211
|
||||
,Maintenance,1000,D,,0,0,1,App\Models\Aircraft,001Z
|
||||
|
||||
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
airline,flight_number,route_code,route_leg,dpt_airport,arr_airport,alt_airport,days,dpt_time,arr_time,level,distance,flight_time,flight_type,route,notes,active,subfleets,fares,fields
|
||||
VMS,1972,,,KAUS,KJFK,KLGA,15,0810 CST,1235 EST,350,1477,207,J,ILEXY2 ZENZI LFK ELD J29 MEM Q29 JHW J70 STENT J70 MAGIO J70 LVZ LENDY6,"Just a flight",1,A32X,Y?price=300&cost=100&capacity=130;F?price=600&cost=400;B?,Departure Gate=4;Arrival Gate=C41
|
||||
" ",1972,,,KAUS,KJFK,KLGA,15,0810 CST,1235 EST,350,1477,207,J,ILEXY2 ZENZI LFK ELD J29 MEM Q29 JHW J70 STENT J70 MAGIO J70 LVZ LENDY6,"Just a flight",1,A32X,Y?price=300&cost=100&capacity=130;F?price=600&cost=400;B?,Departure Gate=4;Arrival Gate=C41
|
||||
VMS,113,,,KJFK,KAUS,KDFW,15,0810 EST,1035 CST,350,,207,J,,"Empty distance",1,A32X,Y?price=300&cost=100&capacity=130;F?price=600&cost=400;B?,Departure Gate=C41;Arrival Gate=2
|
||||
airline,flight_number,route_code,route_leg,dpt_airport,arr_airport,alt_airport,days,dpt_time,arr_time,level,distance,flight_time,flight_type,load_factor, load_factor_variance,route,notes,active,subfleets,fares,fields
|
||||
VMS,1972,,,KAUS,KJFK,KLGA,15,0810 CST,1235 EST,350,1477,207,J,85,0, ILEXY2 ZENZI LFK ELD J29 MEM Q29 JHW J70 STENT J70 MAGIO J70 LVZ LENDY6,"Just a flight",1,A32X,Y?price=300&cost=100&capacity=130;F?price=600&cost=400;B?,Departure Gate=4;Arrival Gate=C41
|
||||
" ",1972,,,KAUS,KJFK,KLGA,15,0810 CST,1235 EST,350,1477,207,J,100,10, ILEXY2 ZENZI LFK ELD J29 MEM Q29 JHW J70 STENT J70 MAGIO J70 LVZ LENDY6,"Just a flight",1,A32X,Y?price=300&cost=100&capacity=130;F?price=600&cost=400;B?,Departure Gate=4;Arrival Gate=C41
|
||||
VMS,113,,,KJFK,KAUS,KDFW,15,0810 EST,1035 CST,350,,207,J,70,2,,"Empty distance",1,A32X,Y?price=300&cost=100&capacity=130;F?price=600&cost=400;B?,Departure Gate=C41;Arrival Gate=2
|
||||
|
||||
|
@@ -1,2 +1,2 @@
|
||||
airline,flight_number,route_code,route_leg,dpt_airport,arr_airport,alt_airport,days,dpt_time,arr_time,level,distance,flight_time,flight_type,route,notes,active,subfleets,fares,fields
|
||||
VMS,1972,,,KAUS,KJFK,KLGA,15,0810 CST,1235 EST,350,1477,207,J,ILEXY2 ZENZI LFK ELD J29 MEM Q29 JHW J70 STENT J70 MAGIO J70 LVZ LENDY6,"Just a flight",1,A32X,Y?price=300&cost=100&capacity=130;F?price=600&cost=400;B?,
|
||||
airline,flight_number,route_code,route_leg,dpt_airport,arr_airport,alt_airport,days,dpt_time,arr_time,level,distance,flight_time,flight_type,load_factor, load_factor_variance,route,notes,active,subfleets,fares,fields
|
||||
VMS,1972,,,KAUS,KJFK,KLGA,15,0810 CST,1235 EST,350,1477,207,J,,,ILEXY2 ZENZI LFK ELD J29 MEM Q29 JHW J70 STENT J70 MAGIO J70 LVZ LENDY6,"Just a flight",1,A32X,Y?price=300&cost=100&capacity=130;F?price=600&cost=400;B?,
|
||||
|
||||
|
Reference in New Issue
Block a user