code: public function onStateChange(ResourceEventInterface $event)
      {
          $sale = $this->getSaleFromEvent($event);
  
          if ($this->persistenceHelper->isScheduledForRemove($sale)) {
              $event->stopPropagation();
  
              return;
          }
  
          $this->handleStateChange($sale);
      }
docs: State change event handler.
  
  @param ResourceEventInterface $event