<?php

declare( strict_types=1 );

namespace Brightfern\Validation;

/**
 * Outcome of an SMP recipient lookup.
 *
 *  - reachable === true  : participant is registered and an SMP answered.
 *  - reachable === false : we got a definitive "not registered" (404).
 *  - reachable === null  : indeterminate (DNS/transport/SMP error) — do not
 *                          hard-block on this; warn instead.
 */
final class RecipientResult {
	/**
	 * @param string[] $supportedDocumentTypes
	 */
	public function __construct(
		public ?bool $reachable,
		public string $participantId,
		public string $smpUrl = '',
		public array $supportedDocumentTypes = array(),
		public string $error = '',
	) {}

	public function isDefinitelyUnreachable(): bool {
		return false === $this->reachable;
	}
}
