<?php
 namespace App\Modules\Software\Procp; use App\Core\Software\AbstractSoftware; use App\Models\ClientSoftwareLicense; use Illuminate\Support\Str; class Procp extends AbstractSoftware { public function requiresHostBinding(): bool { return false; } public function hostBindingSchema(): array { return []; } public function adminFields(): array { return []; } public function paramSchema(): array { return []; } public function testConnection(array $params): array { return $this->ok('PROCP lisans modülü — key lokal üretilir; doğrulama /api/license/validate endpoint\'inden yapılır (PRC-868).'); } public function issueLicense( ClientSoftwareLicense $license, array $bindingInput, array $moduleConfig, ): array { if ($license->issued && ! empty($license->license_key)) { $license->update(['last_attempt_at' => now()]); return $this->ok('PROCP lisans anahtarı zaten üretilmiş — renewal\'da rotate edilmez (idempotent).', [ 'license_id' => $license->id, ]); } $license->update([ 'license_key' => self::uniqueLicenseKey('PROCP-', 3, 4), 'host_binding' => [], 'binding_input' => $bindingInput, 'issued' => true, 'issued_at' => now(), 'last_error' => null, 'last_attempt_at' => now(), ]); return $this->ok('PROCP lisans anahtarı üretildi. Müşteri kurulumunda girecek; ilk doğrulamada domain\'e bağlanır.', [ 'license_id' => $license->id, ]); } } 