code: public function onPreCopy(SaleTransformEvent $event)
      {
          $source = $event->getSource();
  
          if ($source instanceof OrderInterface) {
              // Prevent if order is not 'new'
              if ($source->getState() !== OrderStates::STATE_NEW) {
                  $event->addMessage(new ResourceMessage(
                      'ekyna_commerce.sale.message.transform_prevented',
                      ResourceMessage::TYPE_ERROR
                  ));
              }
          }
      }
docs: Pre copy event handler.
  
  @param SaleTransformEvent $event