/**
  * @param Event $event
  * @return string
  * @throws EventSourcingException when failed to serialize
  */
 public function serialize(Event $event)
 {
     $serialization = json_encode($event->toContractualData(), JSON_UNESCAPED_UNICODE);
     if ($serialization === false) {
         throw EventSourcingException::failedToSerializeEvent($this->getLastErrorMessage());
     }
     return $serialization;
 }