<?php

declare( strict_types=1 );

namespace Brightfern\Transmission;

/**
 * A normalized inbound document received from the network via the provider.
 * Provider-specific webhook/poll payloads are reduced to this shape so the rest
 * of the inbound pipeline (store, parse, match) is provider-agnostic.
 */
final class InboundInvoice {
	public function __construct(
		public string $providerMessageId, // Provider's id/guid for the received doc.
		public string $senderId,          // Sender electronic address ("scheme:value").
		public string $recipientId,       // Our electronic address it was sent to.
		public string $documentType,      // "invoice" | "creditnote".
		public string $xml,               // Raw UBL/CII payload.
		public string $receivedAt = '',   // ISO 8601, as reported by the provider.
		public string $format = '',       // e.g. "peppol-bis-billing-3.0".
		public array $raw = array(),      // Original payload for audit.
	) {}
}
