$customer->id]); $this->deleteBackups($customer); $customerId = $customer->id; $vmid = $customer->vmid; if ($actor) { VmActivityLog::query()->create([ 'customer_id' => $customerId, 'user_id' => $actor->id, 'action' => 'terminate.permanent', 'status' => 'success', ]); } $this->provisioning->deprovision($customer); if ($vmid) { $this->vmidReservation->scheduleRelease((int) $vmid, $customer); } $customer->devices()->delete(); $customer->delete(); } /** * VM entfernen, Kundeneintrag bleibt (Support-Fall). */ public function removeVmOnly(Customer $customer, ?User $actor = null): void { $this->provisioning->deprovision($customer); if ($customer->vmid) { $this->vmidReservation->scheduleRelease((int) $customer->vmid, $customer); } $customer->update([ 'status' => 'failed', 'provisioning_step' => 'deprovisioned', 'vmid' => null, ]); } private function deleteBackups(Customer $customer): void { if (! $customer->vmid) { return; } if (! config('hosting.backups.enabled', false)) { Log::info('Backup deletion skipped (PBS not enabled)', ['vmid' => $customer->vmid]); return; } // PBS-Integration folgt in Phase 2, wenn API-Rechte auf inett-PBS vorhanden Log::warning('PBS backup purge pending implementation', [ 'vmid' => $customer->vmid, 'storage' => config('hosting.backups.pbs_storage'), ]); } }