name), $data->billingAddress, $data->eInvoiceAddress === null ? null : new EInvoiceAddress($data->eInvoiceAddress), $data->eInvoiceOperator, $data->reference, ); return $this->transactions->run(function () use ($customerId, $billingUnit): int { if ($this->customers->findById($customerId) === null) { throw new CustomerNotFound($customerId); } return (int) $this->billingUnits->save($billingUnit)->id(); }); } }