<?php
/**
 * Recording finalization acknowledgement exception.
 *
 * @package ScheduledChanges
 */

namespace ScheduledChanges\Recording;

/**
 * Raised when finalization would exclude unsupported metadata without consent.
 */
final class RecordingFinalizationRequiresAcknowledgement extends \RuntimeException {
	/**
	 * @var array<int,array<string,mixed>>
	 */
	private array $warnings;
	/**
	 * @var string[]
	 */
	private array $selected_change_ids;

	/**
	 * @param array<int,array<string,mixed>> $warnings Unsupported metadata warnings.
	 * @param string[]                       $selected_change_ids Supported selected changes.
	 */
	public function __construct( array $warnings, array $selected_change_ids ) {
		parent::__construct(
			'Recording includes unsupported metadata changes that will not be scheduled. Review and acknowledge them before scheduling supported changes.'
		);

		$this->warnings            = array_values( $warnings );
		$this->selected_change_ids = array_values( $selected_change_ids );
	}

	/**
	 * @return array<int,array<string,mixed>>
	 */
	public function warnings(): array {
		return $this->warnings;
	}

	/**
	 * @return string[]
	 */
	public function selectedChangeIds(): array {
		return $this->selected_change_ids;
	}
}
