transactions->run(function () use ($userId, $entryId): void { $entry = $this->entries->findForUser($userId, $entryId) ?? throw new TimeEntryNotFound($entryId); $entry->ensureNotApproved(); $this->booking->openTask($entry->taskId()); $this->entries->delete($entry); }); } }