chapterRepository->findVisibleById($command->chapterId); if (!$chapter) { throw new ChapterNotFoundException($command->chapterId); } // Soft delete by setting isVisible to false $updatedChapter = new \App\Domain\Manga\Domain\Model\Chapter( new \App\Domain\Manga\Domain\Model\ValueObject\ChapterId($chapter->getId()), $chapter->getMangaId(), $chapter->getNumber(), $chapter->getTitle(), $chapter->getVolume(), false, // isVisible = false (soft delete) $chapter->isAvailable(), $chapter->getCreatedAt() ); $this->chapterRepository->save($updatedChapter); } }