code: public function onInsert(ResourceEventInterface $event)
      {
          $shipment = $this->getShipmentFromEvent($event);
  
          // Generate number and key
          $changed = $this->generateNumber($shipment);
  
          // Completed state
          $changed |= $this->handleCompletedState($shipment);
  
          if ($changed) {
              $this->persistenceHelper->persistAndRecompute($shipment);
          }
  
          $sale = $this->getSaleFromShipment($shipment);
          $sale->addShipment($shipment); // TODO wtf ?
  
          $this->invoiceSynchronizer->synchronize($shipment);
  
          $this->scheduleSaleContentChangeEvent($sale);
      }
docs: Insert event handler.
  
  @param ResourceEventInterface $event