protected function record(PayloadInterface $payload, array $metaData = null): void
    {
        $domainEventMessage = new DomainEventMessage(
            $payload,
            new PayloadType($payload),
            new DateTime(),
            $this->getIdentifier(),
            $this->getNextVersion(),
            array_replace_recursive(
                $this
                    ->getCommandMessage()
                    ->getMetaData(),
                $metaData
            )
        );

        $this
            ->apply($domainEventMessage)
            ->addDomainEventMessage($domainEventMessage);
    }