diff --git a/app/Console/Services/Importer.php b/app/Console/Services/Importer.php index d1f75fbc..a69242aa 100644 --- a/app/Console/Services/Importer.php +++ b/app/Console/Services/Importer.php @@ -525,7 +525,7 @@ class Importer 'flight_number' => $row->flightnum ?: '', 'dpt_airport_id' => $row->depicao, 'arr_airport_id' => $row->arricao, - 'fuel_used' => $row->fuelused, + 'block_fuel' => $row->fuelused, 'route' => $row->route ?: '', 'source_name' => $row->source, 'created_at' => $this->parseDate($row->submitdate), diff --git a/app/Database/migrations/2017_06_28_195426_create_pirep_tables.php b/app/Database/migrations/2017_06_28_195426_create_pirep_tables.php index bcf5f1eb..e7182171 100644 --- a/app/Database/migrations/2017_06_28_195426_create_pirep_tables.php +++ b/app/Database/migrations/2017_06_28_195426_create_pirep_tables.php @@ -30,12 +30,11 @@ class CreatePirepTables extends Migration $table->string('arr_airport_id', 5); $table->unsignedInteger('distance')->nullable(); $table->unsignedInteger('planned_distance')->nullable(); - $table->unsignedInteger('altitude')->nullable(); $table->unsignedInteger('level')->nullable(); $table->unsignedDecimal('flight_time', 19)->nullable(); $table->unsignedDecimal('planned_flight_time', 19)->nullable(); - $table->unsignedDecimal('gross_weight', 19)->nullable(); - $table->unsignedDecimal('fuel_used', 19)->nullable(); + $table->unsignedDecimal('zfw', 19)->nullable(); + $table->unsignedDecimal('block_fuel', 19)->nullable(); $table->decimal('landing_rate', 19)->nullable(); $table->text('route')->nullable(); $table->text('notes')->nullable(); diff --git a/app/Http/Requests/Acars/FileRequest.php b/app/Http/Requests/Acars/FileRequest.php index 2cbf7a91..44b6687c 100644 --- a/app/Http/Requests/Acars/FileRequest.php +++ b/app/Http/Requests/Acars/FileRequest.php @@ -21,26 +21,28 @@ class FileRequest extends FormRequest public function rules() { $rules = [ - 'flight_time' => 'required|integer', - 'distance' => 'required|numeric', + 'flight_time' => 'required|integer', - 'airline_id' => 'nullable|exists:airlines,id', - 'aircraft_id' => 'nullable|exists:aircraft,id', - 'flight_id' => 'nullable|exists:flights,id', - 'flight_number' => 'nullable', - 'dpt_airport_id' => 'nullable', - 'arr_airport_id' => 'nullable', - 'route_code' => 'nullable', - 'route_leg' => 'nullable', - 'planned_distance' => 'nullable|numeric', - 'planned_flight_time' => 'nullable|integer', - 'level' => 'nullable|numeric', - 'route' => 'nullable', - 'notes' => 'nullable', - 'source_name' => 'nullable|max:20', - 'landing_rate' => 'nullable|numeric', - 'flight_type' => 'nullable|integer', - 'created_at' => 'nullable|date', + 'airline_id' => 'nullable|exists:airlines,id', + 'aircraft_id' => 'nullable|exists:aircraft,id', + 'flight_id' => 'nullable|exists:flights,id', + 'flight_number' => 'nullable', + 'dpt_airport_id' => 'nullable', + 'arr_airport_id' => 'nullable', + 'route_code' => 'nullable', + 'route_leg' => 'nullable', + 'distance' => 'nullable|numeric', + 'planned_distance' => 'nullable|numeric', + 'planned_flight_time' => 'nullable|integer', + 'level' => 'nullable|numeric', + 'zfw' => 'nullable|numeric', + 'block_fuel' => 'nullable|numeric', + 'route' => 'nullable', + 'notes' => 'nullable', + 'source_name' => 'nullable|max:25', + 'landing_rate' => 'nullable|numeric', + 'flight_type' => 'nullable|integer', + 'created_at' => 'nullable|date', ]; return $rules; diff --git a/app/Http/Requests/Acars/PrefileRequest.php b/app/Http/Requests/Acars/PrefileRequest.php index 97b2a11d..523767f7 100644 --- a/app/Http/Requests/Acars/PrefileRequest.php +++ b/app/Http/Requests/Acars/PrefileRequest.php @@ -18,25 +18,26 @@ class PrefileRequest extends FormRequest public function rules() { $rules = [ - 'airline_id' => 'required|exists:airlines,id', - 'aircraft_id' => 'required|exists:aircraft,id', - 'flight_number' => 'required', - 'level' => 'required|numeric', - 'dpt_airport_id' => 'required', - 'arr_airport_id' => 'required', - 'planned_distance' => 'required|numeric', - 'source_name' => 'required', + 'airline_id' => 'required|exists:airlines,id', + 'aircraft_id' => 'required|exists:aircraft,id', + 'flight_number' => 'required', + 'level' => 'required|numeric', + 'dpt_airport_id' => 'required', + 'arr_airport_id' => 'required', + 'planned_distance' => 'required|numeric', + 'source_name' => 'required|max:25', - 'flight_id' => 'nullable', - 'route_code' => 'nullable', - 'route_leg' => 'nullable', - 'distance' => 'nullable|numeric', - 'flight_time' => 'nullable|integer', - 'planned_flight_time' => 'nullable|integer', - 'route' => 'nullable', - 'notes' => 'nullable', - 'flight_type' => 'nullable|integer', - 'created_at' => 'nullable|date', + 'route_code' => 'nullable', + 'route_leg' => 'nullable', + 'distance' => 'nullable|numeric', + 'flight_time' => 'nullable|integer', + 'planned_flight_time' => 'nullable|integer', + 'zfw' => 'nullable|numeric', + 'block_fuel' => 'nullable|numeric', + 'route' => 'nullable', + 'notes' => 'nullable', + 'flight_type' => 'nullable|integer', + 'created_at' => 'nullable|date', ]; return $rules; diff --git a/app/Models/Pirep.php b/app/Models/Pirep.php index 4be4cb62..924f698c 100644 --- a/app/Models/Pirep.php +++ b/app/Models/Pirep.php @@ -31,22 +31,21 @@ class Pirep extends BaseModel 'route_leg', 'airline_id', 'aircraft_id', - 'altitude', 'distance', 'planned_distance', 'flight_time', 'planned_flight_time', 'dpt_airport_id', 'arr_airport_id', - 'fuel_used', + 'block_fuel', 'landing_rate', - 'source', 'level', 'route', 'notes', 'flight_type', 'state', 'status', + 'source', 'source_name', 'raw_data', 'created_at', @@ -61,7 +60,7 @@ class Pirep extends BaseModel 'planned_flight_time' => 'integer', 'level' => 'integer', 'altitude' => 'integer', - 'fuel_used' => 'float', + 'block_fuel' => 'float', 'gross_weight' => 'float', 'landing_rate' => 'float', 'flight_type' => 'integer',