$itemIds */ public function __construct( private readonly array $itemIds, private readonly string $descriptionMode, private readonly bool $separateDocuments, private readonly int $userId, ) {} public function handle(ExportTechnicalDescriptionsService $service): void { try { $file = $service->handle( $this->itemIds, $this->descriptionMode, $this->separateDocuments, $this->userId, ); event(new SendWebSocketMessageEvent( 'Экспорт технических описаний завершён!', $this->userId, ['link' => $file->link], )); } catch (Throwable $exception) { Log::error('Technical descriptions export failed.', [ 'user_id' => $this->userId, 'item_ids' => $this->itemIds, 'error' => $exception->getMessage(), ]); event(new SendWebSocketMessageEvent( 'Ошибка экспорта технических описаний: '.$exception->getMessage(), $this->userId, ['error' => $exception->getMessage()], )); throw $exception; } } }