$context */ public function __construct( private readonly int $order_id, private readonly ?int $document_id, private readonly ?string $document_uuid, private readonly string $email_id, private readonly string $attempt_id, private readonly int $attempt_number, private readonly string $outcome, private readonly string $occurred_at, private readonly ?string $failure_reason = null, private readonly array $context = array() ) { if ( $order_id <= 0 || '' === trim( $email_id ) || '' === trim( $attempt_id ) || $attempt_number <= 0 ) { throw new \InvalidArgumentException( 'Mail evidence identity is invalid.' ); } if ( ! in_array( $outcome, array( self::ACCEPTED, self::FAILED ), true ) ) { throw new \InvalidArgumentException( 'Mail evidence outcome is invalid.' ); } if ( null !== $document_id && $document_id <= 0 ) { throw new \InvalidArgumentException( 'Mail evidence document ID is invalid.' ); } if ( null !== $document_uuid && '' === trim( $document_uuid ) ) { throw new \InvalidArgumentException( 'Mail evidence document UUID is invalid.' ); } } public function order_id(): int { return $this->order_id; } public function document_id(): ?int { return $this->document_id; } public function document_uuid(): ?string { return $this->document_uuid; } public function email_id(): string { return $this->email_id; } public function attempt_id(): string { return $this->attempt_id; } public function attempt_number(): int { return $this->attempt_number; } public function outcome(): string { return $this->outcome; } public function occurred_at(): string { return $this->occurred_at; } public function failure_reason(): ?string { return $this->failure_reason; } public function context(): array { return $this->context; } }