code: public function onInsert(ResourceEventInterface $event)
      {
          $customer = $this->getCustomerFromEvent($event);
  
          $changed = $this->generateNumber($customer);
  
          $changed |= $this->updateFromParent($customer);
  
          $changed |= $this->pricingUpdater->updateVatNumberSubject($customer);
  
          if ($changed) {
              $this->persistenceHelper->persistAndRecompute($customer);
          }
      }
docs: Insert event handler.
  
  @param ResourceEventInterface $event