public function whenBookSaleCompleted(BookSaleCompleted $event) { $book = $this->books->find((string) $event->bookId()); $book = new BookTransaction($book->bookId(), $book->title(), $book->sellersId(), $book->sellersName(), $buyer->memberId(), $buyer->fullName(), $book->price(), true, false); $this->books->save($book); }
public function whenBookSaleCompleted(BookSaleCompleted $event) { $this->books->remove($event->bookId()); }