code: public function onUpdate(ResourceEventInterface $event)
      {
          $customer = $this->getCustomerFromEvent($event);
  
          $changed = $this->generateNumber($customer);
  
          if ($this->persistenceHelper->isChanged($customer, 'parent')) {
              $changed |= $this->updateFromParent($customer);
          }
  
          $changed |= $this->pricingUpdater->updateVatNumberSubject($customer);
  
          if ($changed) {
              $this->persistenceHelper->persistAndRecompute($customer);
          }
  
          $hierarchyFields = ['company', 'customerGroup', 'vatNumber', 'vatDetails', 'vatValid'];
          if ($this->persistenceHelper->isChanged($customer, $hierarchyFields)) {
              $this->scheduleParentChangeEvents($customer);
          }
      }
docs: Update event handler.
  
  @param ResourceEventInterface $event