restoreRunId); $tenant = Tenant::find($this->tenantId); if (! $restoreRun || ! $tenant) { Log::warning('RestoreAssignmentsJob missing context', [ 'restore_run_id' => $this->restoreRunId, 'tenant_id' => $this->tenantId, ]); return [ 'outcomes' => [], 'summary' => ['success' => 0, 'failed' => 0, 'skipped' => 0], ]; } try { return $assignmentRestoreService->restore( tenant: $tenant, policyType: $this->policyType, policyId: $this->policyId, assignments: $this->assignments, groupMapping: $this->groupMapping, restoreRun: $restoreRun, actorEmail: $this->actorEmail, actorName: $this->actorName, ); } catch (\Throwable $e) { Log::error('RestoreAssignmentsJob failed', [ 'restore_run_id' => $this->restoreRunId, 'policy_id' => $this->policyId, 'error' => $e->getMessage(), ]); return [ 'outcomes' => [[ 'status' => 'failed', 'reason' => $e->getMessage(), ]], 'summary' => ['success' => 0, 'failed' => 1, 'skipped' => 0], ]; } } }