From 2ecf366670d378bb5b364fff122c48122537dd99 Mon Sep 17 00:00:00 2001 From: Nabeel S Date: Thu, 26 Nov 2020 13:34:04 -0500 Subject: [PATCH] Add missing columns from subfleet export #926 (#941) --- app/Models/Subfleet.php | 1 - app/Services/ImportExport/SubfleetImporter.php | 15 +++++++++++---- tests/data/subfleets.csv | 6 +++--- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/app/Models/Subfleet.php b/app/Models/Subfleet.php index 94eea348..58116b5a 100644 --- a/app/Models/Subfleet.php +++ b/app/Models/Subfleet.php @@ -31,7 +31,6 @@ class Subfleet extends Model 'airline_id', 'type', 'name', - 'turn_time', 'fuel_type', 'cost_block_hour', 'cost_delay_minute', diff --git a/app/Services/ImportExport/SubfleetImporter.php b/app/Services/ImportExport/SubfleetImporter.php index 77d53f3d..10b8fe02 100644 --- a/app/Services/ImportExport/SubfleetImporter.php +++ b/app/Services/ImportExport/SubfleetImporter.php @@ -19,10 +19,17 @@ class SubfleetImporter extends ImportExport * Should match the database fields, for the most part */ public static $columns = [ - 'airline' => 'required', - 'type' => 'required', - 'name' => 'required', - 'fares' => 'nullable', + 'airline' => 'required', + 'type' => 'required', + 'name' => 'required', + 'fuel_type' => 'nullable', + 'cost_block_hour' => 'nullable', + 'cost_delay_minute' => 'nullable', + 'ground_handling_multiplier' => 'nullable', + 'cargo_capacity' => 'nullable', + 'fuel_capacity' => 'nullable', + 'gross_weight' => 'nullable', + 'fares' => 'nullable', ]; private $fareSvc; diff --git a/tests/data/subfleets.csv b/tests/data/subfleets.csv index 0711662a..1002c269 100644 --- a/tests/data/subfleets.csv +++ b/tests/data/subfleets.csv @@ -1,3 +1,3 @@ -airline,type,name,fares -VMS,A32X,Airbus A320,Y;B?capacity=100&price=500% -VMS, ,Boeing 747-400,Y;B?capacity=100&price=500% +airline,type,name,fuel_type,cost_block_hour,cost_delay_minute,ground_handling_multiplier,cargo_capacity,fuel_capacity,gross_weight,fares +VMS,A32X,"Airbus A320",,1000,0,200,,,,Y;B?capacity=100&price=500% +VMS, ,"Boeing 747-400",,1000,0,200,,,,Y;B?capacity=100&price=500%