code: public function onContentChange(ResourceEventInterface $event)
      {
          $invoice = $this->getInvoiceFromEvent($event);
  
          if (!$this->persistenceHelper->isScheduledForRemove($invoice)) {
              if ($this->updateTotals($invoice)) {
                  $this->persistenceHelper->persistAndRecompute($invoice, false);
              }
  
              $this->updateCustomerBalance($invoice);
          }
  
          $sale = $this->getSaleFromInvoice($invoice);
  
          $this->scheduleSaleContentChangeEvent($sale);
      }
docs: Content change event handler.
  
  @param ResourceEventInterface $event