code: public function onInsert(ResourceEventInterface $event)
      {
          $stockUnit = $this->getStockUnitFromEvent($event);
  
          if ($this->stateResolver->resolve($stockUnit)) {
              $this->persistenceHelper->persistAndRecompute($stockUnit, false);
          }
  
          $this->scheduleSubjectStockUnitChangeEvent($stockUnit);
      }
docs: Insert event handler.
  
  @param ResourceEventInterface $event