'mysql_presseecho', 'businessportal24' => 'mysql_businessportal', ]; public function handle(LegacyBillingAddressImporter $importer): int { $dryRun = (bool) $this->option('dry-run'); if ($dryRun) { $this->warn('[DRY-RUN] Kein tatsächlicher Schreibvorgang.'); } $countryNamesByPortal = []; foreach (self::CONNECTIONS as $portal => $connection) { $countryNamesByPortal[$portal] = DB::connection($connection) ->table('country') ->pluck('name', 'id') ->map(fn ($name): string => (string) $name) ->all(); } $report = $importer->import($countryNamesByPortal, $dryRun); $this->table( ['Importiert', 'Adresse vorhanden', 'Nicht parsebar', 'Land unbekannt', 'Quell-Rechnung fehlt'], [[ $report['imported'], $report['skipped_existing'], count($report['unparseable']), count($report['unknown_country']), count($report['missing_invoice']), ]], ); foreach ($report['unparseable'] as $line) { $this->warn("Manuell nachpflegen (Adresse nicht parsebar): {$line}"); } foreach ($report['unknown_country'] as $line) { $this->warn("Manuell nachpflegen (Land nicht zuordenbar): {$line}"); } foreach ($report['missing_invoice'] as $email) { $this->warn("Manuell prüfen (Quell-Rechnung nicht im Archiv): {$email}"); } return self::SUCCESS; } }