public function mapTarget(PersistenceTarget $target): Target
    {
        try {
            $targetType = $this->targetTypeRegistry->getTargetType(
                $target->type
            );
        } catch (TargetTypeException $e) {
            $targetType = new NullTargetType();
        }

        $targetData = [
            'id' => $target->id,
            'status' => $target->status,
            'ruleId' => $target->ruleId,
            'targetType' => $targetType,
            'value' => $target->value,
        ];

        return Target::fromArray($targetData);
    }