* @param RouterOsReactivationAdapterInterface|null $adapter RouterOS interface adapter * @return array Structured evaluation result with state machine status and action plan */ public function evaluateReactivationEligibility( int $customerId, ?int $invoiceId = null, ?RouterOsReactivationAdapterInterface $adapter = null ): array { $customer = $this->getCustomerById($customerId); if (!$customer) { return [ 'status' => 'NOT_ELIGIBLE', 'state' => 'Not Eligible', 'reason_code' => 'CUSTOMER_NOT_FOUND', 'reason' => 'Data pelanggan (ID #' . $customerId . ') tidak ditemukan di database.', 'customer_id' => $customerId, 'checks' => [ 'customer_exists' => false, 'package_valid' => false, 'invoice_settled' => false, 'router_online' => false, 'secret_exists' => false, 'is_isolated' => false, 'no_scheduler_conflict' => false ], 'risks' => ['Pelanggan tidak terdaftar'] ]; } $username = trim($customer['pppoe_username'] ?? $customer['service_number'] ?? ''); if ($username === '') { return [ 'status' => 'NOT_ELIGIBLE', 'state' => 'Not Eligible', 'reason_code' => 'NO