argument('id'); $isCustomer = (bool) $this->option('customer'); if ($isCustomer) { $model = ShoppingUser::withTrashed()->find($id); $label = $model ? 'Endkunde #'.$model->id.' ('.$model->billing_email.')' : null; } else { $model = User::withTrashed()->find($id); $label = $model ? 'Berater #'.$model->id.' ('.$model->email.')' : null; } if (! $model) { $this->error('ERROR: Datensatz nicht gefunden, id: '.$id); return 1; } if (! $this->option('force') && ! $this->confirm('DSGVO-Löschung für '.$label.' UNWIDERRUFLICH ausführen?')) { $this->info('Abgebrochen.'); return 0; } try { $summary = $isCustomer ? $gdprDeletionService->deleteShoppingUser($model) : $gdprDeletionService->deleteUser($model); $this->info('SUCCESS: DSGVO-Löschung ausgeführt: '.json_encode($summary)); return 0; } catch (GdprDeletionException $e) { $this->error('ERROR: '.$e->getMessage()); return 1; } } }