transactions->run(function () use ($userId, $entryId, $parsed, $note): void { $entry = $this->entries->findForUser($userId, $entryId) ?? throw new TimeEntryNotFound($entryId); $entry->ensureNotApproved(); $this->booking->openTask($entry->taskId()); $this->booking->ensureDayFits($userId, $entry->workedOn(), $parsed, $entry->id()); $entry->changeHours($parsed, $note); $this->entries->save($entry); }); } }