From dfbaa1afd35a2d479faaed64b5495589952cefa6 Mon Sep 17 00:00:00 2001 From: Nabeel S Date: Sun, 23 Feb 2020 19:48:28 -0500 Subject: [PATCH] Fix rowmapper generator, check for fields, map users #443 (#583) * Fix rowmapper generator, check for fields, map users #443 * Formatting * Remove value store at the end of the import * Update the notes for the importer about users * Uncomment importers disabled during testing --- app/Services/UserService.php | 7 ++ .../Resources/views/step1-configure.blade.php | 2 + modules/Importer/Services/BaseImporter.php | 12 +- modules/Importer/Services/ImporterService.php | 8 +- .../Services/Importers/AircraftImporter.php | 5 +- .../Services/Importers/AirlineImporter.php | 3 +- .../Services/Importers/AirportImporter.php | 3 +- .../Services/Importers/ClearDatabase.php | 18 ++- .../Services/Importers/FinalizeImporter.php | 10 ++ .../Services/Importers/FlightImporter.php | 5 +- .../Services/Importers/GroupImporter.php | 11 +- .../Services/Importers/PirepImporter.php | 11 +- .../Services/Importers/RankImport.php | 4 +- .../Services/Importers/UserImport.php | 35 +++++- modules/Importer/Utils/IdMapper.php | 8 ++ modules/Importer/Utils/ImporterDB.php | 117 ++++++++++++++---- resources/views/system/acars/config.blade.php | 4 +- 17 files changed, 214 insertions(+), 49 deletions(-) diff --git a/app/Services/UserService.php b/app/Services/UserService.php index 9be4e8a4..42b955e2 100644 --- a/app/Services/UserService.php +++ b/app/Services/UserService.php @@ -135,6 +135,13 @@ class UserService extends Service return $user; } + /** + * Return true or false if a pilot ID already exists + * + * @param int $pilot_id + * + * @return bool + */ public function isPilotIdAlreadyUsed(int $pilot_id): bool { return User::where('pilot_id', '=', $pilot_id)->exists(); diff --git a/modules/Importer/Resources/views/step1-configure.blade.php b/modules/Importer/Resources/views/step1-configure.blade.php index 138df6f8..41f01ce3 100644 --- a/modules/Importer/Resources/views/step1-configure.blade.php +++ b/modules/Importer/Resources/views/step1-configure.blade.php @@ -10,6 +10,8 @@

IMPORTANT NOTES